Exemplo n.º 1
0
//--------- Begin of function FirmMonster::put_info ---------//
//
void FirmMonster::put_info(int refreshFlag)
{
	disp_basic_info(INFO_Y1, refreshFlag);

	if( !config.show_ai_info && nation_recno!=nation_array.player_recno )
		return;

	disp_monster_info(INFO_Y1+54, refreshFlag);
}
Exemplo n.º 2
0
//--------- Begin of function FirmHarbor::disp_main_menu ---------//
//
void FirmHarbor::disp_main_menu(int refreshFlag)
{
	firm_harbor_ptr = this;

	disp_basic_info(INFO_Y1, refreshFlag);

	if( !should_show_harbor_info() )
		return;

	//-------- display browser -----------//

	if( refreshFlag == INFO_REPAINT )
	{
		browse_ship.init( SHIP_BROWSE_X1, SHIP_BROWSE_Y1, SHIP_BROWSE_X2, SHIP_BROWSE_Y2,
								0, 25, ship_count, put_ship_rec );

		browse_ship.open(1);

		put_det(INFO_REPAINT);
	}
	else
	{
		if( last_ship_count != ship_count )
		{
			last_ship_count = ship_count;
			info.disp();
		}
		else
			browse_ship.update();          // update only
	}

	last_ship_count = ship_count;

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

	if( !own_firm() )
		return;

	//-------- display buttons ---------//

	if( refreshFlag == INFO_REPAINT )
	{
		button_build.paint( SHIP_DET_X1, SHIP_DET_Y2+4, 'A', "MAKESHIP" );
		button_sail.paint ( SHIP_DET_X1+BUTTON_ACTION_WIDTH, SHIP_DET_Y2+4, 'A', "SAILOUT" );
	}

	if( ship_count > 0 )
		button_sail.enable();
	else
		button_sail.disable();

	//------ display the info of the ship under construction ------//

	disp_build_info(refreshFlag);
}
Exemplo n.º 3
0
//--------- Begin of function FirmBase::put_info ---------//
//
void FirmBase::put_info(int refreshFlag)
{
	disp_basic_info(INFO_Y1, refreshFlag);

	if( !should_show_info() )
		return;

	disp_base_info(INFO_Y1+54, refreshFlag);
	disp_worker_list(INFO_Y1+104, refreshFlag);
	disp_worker_info(INFO_Y1+168, refreshFlag);
	disp_god_info(INFO_Y1+226, refreshFlag);

	//------ display button -------//

	int x, y=INFO_Y1+279;

	if( own_firm() )
	{
		if( refreshFlag==INFO_REPAINT )
		{
			button_invoke.paint( INFO_X1, y, 'A', "INVOKE" );
			button_reward.paint( INFO_X1 + BUTTON_ACTION_WIDTH, y, 'A', "REWARDSP" );
			button_vacate_firm.paint(INFO_X1 + BUTTON_ACTION_WIDTH * 2, y, 'A', "RECRUIT");
			button_vacate_firm.set_help_code("MOBILIZE");
		}

		if( can_invoke() )
			button_invoke.enable();
		else
			button_invoke.disable();

		if( nation_array[nation_recno]->cash >= REWARD_COST &&
			 ( (overseer_recno && unit_array[overseer_recno]->rank_id != RANK_KING)
			  || selected_worker_id ) )
		{
			button_reward.enable();
		}
		else
		{
			button_reward.disable();
		}

		if( have_own_workers() )
			button_vacate_firm.enable();
		else
			button_vacate_firm.disable();

		x=INFO_X1+BUTTON_ACTION_WIDTH * 3;
	}
	else
		x=INFO_X1;

	disp_spy_button(x, y, refreshFlag);
}
Exemplo n.º 4
0
//--------- Begin of function FirmCamp::put_info ---------//
//
void FirmCamp::put_info(int refreshFlag)
{
	disp_basic_info(INFO_Y1, refreshFlag);

	if( !should_show_info() )
		return;

	disp_camp_info(INFO_Y1+54, refreshFlag);
	disp_worker_list(INFO_Y1+104, refreshFlag);
	disp_worker_info(INFO_Y1+168, refreshFlag);

	//------ display button -------//

	int x;

	if( own_firm() )
	{
		if( refreshFlag==INFO_REPAINT )
		{
			button_patrol.paint( INFO_X1, INFO_Y1+242, 'A', "PATROL" );
			button_reward.paint( INFO_X1+BUTTON_ACTION_WIDTH, INFO_Y1+242, 'A', "REWARDCB" );
			button_defense.paint( INFO_X2-BUTTON_ACTION_WIDTH, INFO_Y1+242, 'A', defense_flag ? (char*)"DEFENSE1" : (char*)"DEFENSE0" );
		}

		if( overseer_recno || worker_count )
			button_patrol.enable();
		else
			button_patrol.disable();

		if( nation_array[nation_recno]->cash >= REWARD_COST &&
			 ( (overseer_recno && unit_array[overseer_recno]->rank_id != RANK_KING)
			  || selected_worker_id ) )
		{
			button_reward.enable();
		}
		else
		{
			button_reward.disable();
		}

		x=INFO_X1+BUTTON_ACTION_WIDTH*2;
	}
	else
		x=INFO_X1;

	disp_spy_button(x, INFO_Y1+242, refreshFlag);

	#ifdef DEBUG
		if( sys.testing_session || sys.debug_session )
			disp_debug_info(this, refreshFlag);
	#endif
}
Exemplo n.º 5
0
//--------- Begin of function FirmMine::put_info ---------//
//
void FirmMine::put_info(int refreshFlag)
{
	disp_basic_info(INFO_Y1, refreshFlag);

	if( !should_show_info() )
		return;

	disp_mine_info(INFO_Y1+52, refreshFlag);
	disp_worker_list(INFO_Y1+127, refreshFlag);
	disp_worker_info(INFO_Y1+191, refreshFlag);

	//---------- display spy button ----------//

	disp_spy_button(INFO_X1, INFO_Y1+249, refreshFlag);
}
Exemplo n.º 6
0
//--------- Begin of function FirmInn::put_info ---------//
//
void FirmInn::put_info(int refreshFlag)
{
	firm_inn_ptr = this;

	disp_basic_info(INFO_Y1, refreshFlag);

	if( !should_show_info() )
		return;

	//----------- display browser -----------//

	if( refreshFlag == INFO_REPAINT )
	{
		browse_hire.init( HIRE_BROWSE_X1, HIRE_BROWSE_Y1, HIRE_BROWSE_X2, HIRE_BROWSE_Y2,
								0, 25, inn_unit_count, put_hire_rec );

		browse_hire.open(1);
	}
	else
	{
		if( last_hire_count != inn_unit_count )
		{
			if( last_hire_count==0 || inn_unit_count==0 )		// repaint the whole area as the detail area needs to disappear
			{
				last_hire_count = inn_unit_count;
				info.disp();
				return;
			}

			last_hire_count = inn_unit_count;

			browse_hire.refresh(-1, inn_unit_count);

			if( last_hire_count==0 || inn_unit_count==0 )
				refreshFlag = INFO_REPAINT;
		}
		else
			browse_hire.update();          // update only
	}

	last_hire_count = inn_unit_count;

	put_det(refreshFlag);

	//---------- display spy button ----------//

	disp_spy_button(INFO_X1+BUTTON_ACTION_WIDTH, HIRE_DET_Y2+4, refreshFlag);
}
Exemplo n.º 7
0
//--------- Begin of function FirmResearch::disp_main_menu ---------//
//
void FirmResearch::disp_main_menu(int refreshFlag)
{
	disp_basic_info(INFO_Y1, refreshFlag);

	if( !should_show_info() )
		return;

	disp_research_info(INFO_Y1+54, refreshFlag);

	disp_worker_list(INFO_Y1+107, refreshFlag);

	disp_worker_info(INFO_Y1+171, refreshFlag);

	if( own_firm() )
	{
		if( refreshFlag==INFO_REPAINT )
			button_select_research.paint( INFO_X1, INFO_Y1+235, 'A', "RESEARCH" );
	}

	disp_spy_button( INFO_X1+BUTTON_ACTION_WIDTH, INFO_Y1+235, refreshFlag );
}
Exemplo n.º 8
0
//--------- Begin of function Unit::disp_main_menu ---------//
//
void Unit::disp_main_menu(int refreshFlag)
{
	disp_basic_info(INFO_Y1, refreshFlag);
	disp_unit_profile( INFO_Y1+52, refreshFlag );

	if( !should_show_info() )
		return;

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

	int y=INFO_Y1+98;

	if( race_id )
	{
		disp_unit_info( y, refreshFlag );
		y += 89;
	}

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

	if( is_own_spy() )
	{
		disp_spy_menu(y, refreshFlag);
		y+=spy_menu_height()+3;
	}

	if( is_own() )
	{
		if( refreshFlag == INFO_REPAINT )
			disp_button(y);

		y+=BUTTON_ACTION_HEIGHT;
	}

	#ifdef DEBUG
		if( sys.debug_session || sys.testing_session )
			disp_debug_info(this, INFO_Y2-68, refreshFlag);
	#endif
}
Exemplo n.º 9
0
//--------- Begin of function FirmFactory::put_info ---------//
//
void FirmFactory::put_info(int refreshFlag)
{
	//---------- display info ------------//

	disp_basic_info(INFO_Y1, refreshFlag);

	if( !should_show_info() )
		return;

	disp_factory_info(INFO_Y1+54, refreshFlag);
	disp_worker_list(INFO_Y1+126, refreshFlag);
	disp_worker_info(INFO_Y1+190, refreshFlag);

	//------ display mobilize button -------//

	int x = INFO_X1;

	if(own_firm())
	{
		if (refreshFlag == INFO_REPAINT)
		{
			button_change_production.paint(INFO_X1, INFO_Y1 + 248, 'A', "CHGPROD");
			button_vacate_firm.paint(INFO_X1 + BUTTON_ACTION_WIDTH, INFO_Y1 + 248, 'A', "RECRUIT");
			button_vacate_firm.set_help_code("MOBILIZE");
		}

		if (worker_count)
			button_vacate_firm.enable();
		else
			button_vacate_firm.disable();

		x += (BUTTON_ACTION_WIDTH * 2);
	}

	//---------- display spy button ----------//

	disp_spy_button(x, INFO_Y1+248, refreshFlag);
}
Exemplo n.º 10
0
//--------- Begin of function Firm::disp_spy_menu ---------//
//
void Firm::disp_spy_menu(int refreshFlag)
{
	static int lastSpyCount;

	firm_ptr = this;

	disp_basic_info(INFO_Y1, refreshFlag);

	//---------- paint controls -----------//

	if( refreshFlag == INFO_REPAINT )
	{
		//------ display browser field description -------//

		int x=SPY_BROWSE_X1+2;
		int y=SPY_BROWSE_Y1-23;

		vga.d3_panel_up( SPY_BROWSE_X1, y, SPY_BROWSE_X2, SPY_BROWSE_Y1-3 );

		font_san.put( x+4  , y+4, "Spy Skill" );
		font_san.put( x+70 , y+4, "Loyalty" );
		font_san.put( x+130, y+4, "Action" );

		//------------ create browser ------------//

		browse_spy.init( SPY_BROWSE_X1, SPY_BROWSE_Y1, SPY_BROWSE_X2, SPY_BROWSE_Y2,
							  0, 25, player_spy_count, put_spy_rec );

		browse_spy.open(1);

		lastSpyCount = player_spy_count;

		err_when( player_spy_count != spy_filter() );
	}
	else
	{
		//---------- update controls -----------//

		if( player_spy_count != lastSpyCount )
		{
			lastSpyCount = player_spy_count;
			info.disp();
			return;
		}
		else
			browse_spy.update();
	}

	if( spy_filter()==0 )
		return;

	//----------- create the paint button ----------//

	if( refreshFlag == INFO_REPAINT )
	{
		int x=BUTTON_X1;
		int y=SPY_BROWSE_Y2+5;

		//--------- spy menu mode -----------//

		if( firm_menu_mode == FIRM_MENU_SPY )
		{
			//--------- mobilize spy button --------//

			button_spy_mobilize.paint( x, y, 'A', "MOBILSPY" );
			x+=BUTTON_ACTION_WIDTH;

			//--------- reward spy button --------//

			button_spy_reward.paint( x, y, 'A', "REWARD" );
			x+=BUTTON_ACTION_WIDTH;

			//------ change spy action button ------//

			if( firm_id != FIRM_INN && nation_recno != nation_array.player_recno )		// cannot change action in inns
			{
				button_spy_action.paint( x, y, 'A', "SPYCHACT" );
				x+=BUTTON_ACTION_WIDTH;
			}
			else
				button_spy_action.reset();

			//---------- capture button -----------//

			if( can_player_spy_capture() )
			{
				button_capture.paint( x, y, 'A', "SPYCAPT" );
				x+=BUTTON_ACTION_WIDTH;

				if( x+BUTTON_ACTION_WIDTH-5 > INFO_X2 )
				{
					x  = BUTTON_X1;
					y += BUTTON_ACTION_HEIGHT;
				}
			}
			else
				button_capture.reset();

			//---------- view secret button -----------//

			if( nation_recno && nation_recno != nation_array.player_recno )
			{
				button_view_secret.paint( x, y, 'A', "VSECRET" );
				x+=BUTTON_ACTION_WIDTH;

				if( x+BUTTON_ACTION_WIDTH-5 > INFO_X2 )
				{
					x  = BUTTON_X1;
					y += BUTTON_ACTION_HEIGHT;
				}
			}
			else
				button_view_secret.reset();

			//---------- assassination button -----------//

			if( nation_recno && nation_recno != nation_array.player_recno &&
				 firm_res[firm_id]->need_overseer )
			{
				button_assassinate.paint( x, y, 'A', "ASSASSIN" );
				x+=BUTTON_ACTION_WIDTH;

				if( x+BUTTON_ACTION_WIDTH-5 > INFO_X2 )
				{
					x  = BUTTON_X1;
					y += BUTTON_ACTION_HEIGHT;
				}
			}
			else
				button_assassinate.reset();
		}

		//--------- select briber mode --------//

		else if( firm_menu_mode == FIRM_MENU_SELECT_BRIBER )
		{
			button_bribe.paint( x, y, 'A', "BRIBE" );
			x+=BUTTON_ACTION_WIDTH;
		}
		else
			err_here();

		//----------- cancel button -----------//

		button_cancel.paint( x, y, 'A', "PREVMENU" );
	}

	//---- enable/disable view secret button ----//

	//### begin alex 20/3 ###//
	if( button_view_secret.init_flag && firm_menu_mode==FIRM_MENU_SPY)
	//#### end alex 20/3 ####//
	{
		Spy* spyPtr = spy_array[ spy_filter( browse_spy.recno() ) ];

		if( spyPtr->spy_skill >= MIN_VIEW_SECRET_SPYING_SKILL )
			button_view_secret.enable();
		else
			button_view_secret.disable();
	}

	//---- enable/disable assassinate button ----//

	if( button_assassinate.init_flag )
	{
		if( overseer_recno &&
			 unit_array[overseer_recno]->true_nation_recno() != nation_array.player_recno )		// don't assassinate your own spy
		{
			button_assassinate.enable();
		}
		else
		{
			button_assassinate.disable();
		}
	}
}
Exemplo n.º 11
0
//--------- Begin of function Firm::disp_info_both ---------//
//
void Firm::disp_info_both(int refreshFlag)
{
	static char  lastUnderConstruction;
	static short lastFirmRecno;
	static char  lastShouldShowInfo;
	static short lastPlayerSpyCount;

	//------ check if under_construction has been changed -----//

	if( lastUnderConstruction != under_construction )
	{
		lastUnderConstruction = under_construction;

		if( refreshFlag == INFO_UPDATE )
			info.disp();							// refresh the display
	}

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

	if( under_construction )
	{
		disp_basic_info(INFO_Y1, refreshFlag);

		if( refreshFlag == INFO_REPAINT )
			font_san.d3_put( INFO_X1, INFO_Y1+54, INFO_X2, INFO_Y1+74, _("Under Construction") );
	}
	else
	{
		//------ check if should_show_info() has been changed -----//

		int shouldShowInfo = should_show_info();

		if( shouldShowInfo   != lastShouldShowInfo ||
			 player_spy_count != lastPlayerSpyCount )
		{
			lastShouldShowInfo = shouldShowInfo;
			lastPlayerSpyCount = player_spy_count;

			if( refreshFlag == INFO_UPDATE )
			{
				info.disp();
				return;
			}
		}

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

		if( lastFirmRecno != firm_recno ||
			 (firm_menu_mode != FIRM_MENU_ASSASSINATE_RESULT &&
			  player_spy_count==0 && bribe_result==BRIBE_NONE) )		// don't refresh mode if the player spy in the firm has just failed the bribing and executed, and we now need to display the failure message
		{
			firm_menu_mode = FIRM_MENU_MAIN;
			lastFirmRecno = firm_recno;
			bribe_result  = BRIBE_NONE;
		}

		switch( firm_menu_mode )
		{
			case FIRM_MENU_MAIN:
				put_info(refreshFlag);
				break;

			case FIRM_MENU_SPY:
			case FIRM_MENU_SELECT_BRIBER:
				disp_spy_menu(refreshFlag);
				break;

			case FIRM_MENU_SET_BRIBE_AMOUNT:
				disp_bribe_menu(refreshFlag);
				break;

			case FIRM_MENU_VIEW_SECRET:
				spy_array.disp_view_secret_menu(action_spy_recno, refreshFlag);
				break;

			case FIRM_MENU_ASSASSINATE_RESULT:
				disp_assassinate_result(refreshFlag);
				break;
		}

		#ifdef DEBUG
		if(debug2_enable_flag)
		{
			font_san.d3_put( INFO_X1, INFO_Y2-30, INFO_X2, INFO_Y2, "" );
			font_san.field( INFO_X1+10, INFO_Y2-20, " ", INFO_X1+20, firm_recno, 1, INFO_X2-10, refreshFlag);
			font_san.field( INFO_X1+40, INFO_Y2-20, " ", INFO_X1+50, loc_x1, 1, INFO_X2-10, refreshFlag);
			font_san.field( INFO_X1+70, INFO_Y2-20, " ", INFO_X1+80, loc_y1, 1, INFO_X2-10, refreshFlag);
			font_san.field( INFO_X1+100, INFO_Y2-20, " ", INFO_X1+110, ai_link_checked, 1, INFO_X2-10, refreshFlag);
		}
		#endif
	}
}
Exemplo n.º 12
0
//--------- Begin of function UnitGod::disp_info ---------//
//
void UnitGod::disp_info(int refreshFlag)
{
	disp_basic_info(INFO_Y1, refreshFlag);
	disp_unit_profile( INFO_Y1+54, refreshFlag );

	if( !is_own() )
		return;

	if( game.game_mode == GAME_TEST )
		return;

	if( god_res[god_id]->can_cast_power )
	{
		//-------- get the button name --------//

		const char* buttonName;

		switch(god_id)
		{
			case GOD_PERSIAN:
				buttonName = "GODHEAL";
				break;

			case GOD_JAPANESE:
				buttonName = "GODMIND";
				break;

			case GOD_MAYA:
				buttonName = "GODINCCL";
				break;

			case GOD_VIKING:
				buttonName = "GODRAIN";
				break;

			case GOD_EGYPTIAN:
				buttonName = "GODEGYPT";
				break;

			case GOD_INDIAN:
				buttonName = "GODMUGL";
				break;

			case GOD_ZULU:
				buttonName = "GODZULU";
				break;

			default:
				err_here();
		}

		//----------- create the cast button -----------//

		button_cast.paint(INFO_X1, INFO_Y1+101, 'A', buttonName );

		if( hit_points >= god_res[god_id]->power_pray_points )
			button_cast.enable();
		else
			button_cast.disable();

		//------ The viking gods have two types of power ------//

		if( god_id == GOD_VIKING )
		{
			button_cast2.paint(INFO_X1+BUTTON_ACTION_WIDTH, INFO_Y1+101, 'A', "GODTORNA" );

			if( hit_points >= god_res[god_id]->power_pray_points )
				button_cast2.enable();
			else
				button_cast2.disable();
		}
	}
}