Exemple #1
0
//--------- Begin of function FirmCamp::next_day ---------//
//
void FirmCamp::next_day()
{
	//----- call next_day() of the base class -----//

	Firm::next_day();

	//----- update the patrol_unit_array -----//

	validate_patrol_unit();
	validate_soldier();

	//------- update loyalty --------//

	if( info.game_date%30 == firm_recno%30 )
		update_loyalty();

	//-------- consume food --------//

	if( soldier_count>0 )
		consume_food();

	// ------- process train ---------//

	if( config.fast_build && is_own() )
	{
		for( int i=0 ; i<100 ; i++ )
			basic_train();
	}
	else
		basic_train();

	//--------------------------------------//

	if( info.game_date%30 == firm_recno%30 )			// once a week
	{
		advanced_train();
	}

	if( info.game_date%8 == firm_recno%8 )
	{
		recover_hit_point();
	}

	// ------ process item --------//

	Soldier* soldierPtr = soldier_array;

	for( int i=0 ; i<soldier_count ; i++, soldierPtr++ )
	{
		soldierPtr->item.next_day();
	}

	//----------- debugging code -----------//

	err_when( overseer_recno && unit_array[overseer_recno]->skill_level()==0 );

	err_when( overseer_recno && unit_array[overseer_recno]->nation_recno != nation_recno );
}
Exemple #2
0
//--------- Begin of function FirmBase::next_day ---------//
//
void FirmBase::next_day()
{
	//----- call next_day() of the base class -----//

	Firm::next_day();

	//--------------------------------------//

	calc_productivity();

	//--------------------------------------//

	if( info.game_date%15 == firm_recno%15 )			// once a week
	{
		train_unit();
		recover_hit_point();
	}

	//------- increase pray points --------//

	if( overseer_recno && pray_points < MAX_PRAY_POINTS )
	{
		// ###### patch begin Gilbert 21/1 #######//
		if( config.fast_build )
			pray_points += productivity/10;
		else
			pray_points += productivity/100;
		// ###### patch end Gilbert 21/1 #######//

		if( pray_points > MAX_PRAY_POINTS )
			pray_points = (float) MAX_PRAY_POINTS;
	}

	//------ validate god_unit_recno ------//

	if( god_unit_recno )
	{
		if( unit_array.is_deleted(god_unit_recno) )
			god_unit_recno = 0;

	#ifdef DEBUG
		if( god_unit_recno )
		{
			err_when( !unit_array[god_unit_recno]->is_visible() );
			err_when( unit_array[god_unit_recno]->nation_recno != nation_recno );
		}
	#endif
	}
}
Exemple #3
0
//--------- Begin of function FirmCamp::next_day ---------//
//
void FirmCamp::next_day()
{
	//----- call next_day() of the base class -----//

	Firm::next_day();

	//----- update the patrol_unit_array -----//

	validate_patrol_unit();

	//--------------------------------------//

	if( info.game_date%15 == firm_recno%15 )			// once a week
	{
		train_unit();
		recover_hit_point();
	}

	//--- if there are weapons in the firm, pay for their expenses ---//

	pay_weapon_expense();
}
Exemple #4
0
//--------- Begin of function FirmInn::next_day ---------//
//
void FirmInn::next_day()
{
	//----------- run next_day() of the base class -------------//

	Firm::next_day();

	//-------- update the hire list ------------//

	int updateInterveal = 10 + info.year_passed*2;		// there will be less and less units to hire as the game passes

	if( info.game_date % updateInterveal == firm_recno % updateInterveal )
		update_add_hire_list();

	if( info.game_date % updateInterveal == firm_recno % updateInterveal )
		update_del_hire_list();

	//--------- recover hit points ----------//

	if( info.game_date%15 == firm_recno%15 )
	{
		recover_hit_point();
	}
}