コード例 #1
0
ファイル: OUNITIF.cpp プロジェクト: AMDmi3/7kaa
//--------- Begin of function Unit::detect_main_menu ---------//
//
void Unit::detect_main_menu()
{
	if( detect_basic_info() )
		return;

	if( detect_unit_profile() )
		return;

	if( is_own_spy() )
		detect_spy_menu(INFO_Y1+187);

	if( is_own() )
		detect_button();
}
コード例 #2
0
ファイル: ou_carai.cpp プロジェクト: mecirt/7k2
//--------- Begin of function UnitCaravan::detect_info ---------//
//
void UnitCaravan::detect_info()
{
	if( detect_unit_profile() )
		return;

//	if(!is_visible())
//		return;

	if( detect_basic_info() )
		return;

	if( !is_own() && !config.show_ai_info )
		return;
	
	detect_stop();

	if( is_own() )
	{
		int i;
		int rc =  button_auto_trade_group.detect();
		if( rc >= 0 )
		{
			if( remote.is_enable() )
			{
				// ##### begin Gilbert 7/10 ######//
				// packet structure : <unit recno> <0=manual, 1=auto>
				short *shortPtr = (short *)remote.new_send_queue_msg(MSG_U_CARA_SET_AUTO, 2*sizeof(short));
				*shortPtr = sprite_recno;
				shortPtr[1] = rc;
				return;
				// ##### end Gilbert 7/10 ######//
			}
			else
			{
				default_market_trade_mode = (char) rc;
				for( i = 0; i < MAX_STOP_FOR_CARAVAN; ++i )
					if( stop_array[i].firm_recno && stop_array[i].firm_id == FIRM_MARKET )
						set_stop_pick_up(i+1, rc ? AUTO_PICK_UP : MANUAL_PICK_UP, COMMAND_AUTO);
			}
		}

		if( button_duplicate_caravan.detect() )
		{
			se_ctrl.immediate_sound("CV-M3-5");
			duplicate_caravan(COMMAND_PLAYER);			
		}
	}
}
コード例 #3
0
ファイル: OU_GOD.cpp プロジェクト: AMDmi3/7kaa
//--------- Begin of function UnitGod::detect_info ---------//
//
void UnitGod::detect_info()
{
	if( detect_basic_info() )
		return;

	if( detect_unit_profile() )
		return;

	if( !is_own() )
		return;

	if( game.game_mode == GAME_TEST )
		return;

	if( god_res[god_id]->can_cast_power )
	{
		// ###### begin Gilbert 14/10 ######//
		int rc=0;
		char castPowerType = 0;

		if( button_cast.detect() )
		{
			// cast_power_type = 1;
			castPowerType = 1;
			rc = 1;
		}

		if( button_cast2.detect() )
		{
			castPowerType = 2;
			//cast_power_type = 2;
			//cast_origin_x = cur_x_loc();
			//cast_origin_y = cur_y_loc();
			rc = 1;
		}

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

		if( rc && castPowerType)
		{
			if( god_id == GOD_VIKING && castPowerType == 1 )	// summon rain, summon immediately, no need to select target
				go_cast_power(next_x_loc(), next_y_loc(), castPowerType, COMMAND_PLAYER);
			else
				power.issue_command(COMMAND_GOD_CAST_POWER, sprite_recno, castPowerType);
		}
		// ###### end Gilbert 14/10 ######//
	}
}