Exemple #1
0
void do_weapon_n_item_stuff()
{
	int i;

	if (Controls.fire_flare_count > 0)
	{
		Controls.fire_flare_count = 0;
		if (allowed_to_fire_flare())
			Flare_create(ConsoleObject);
	}

	if (allowed_to_fire_missile() && Controls.fire_secondary_state)
		Global_missile_firing_count += Weapon_info[Secondary_weapon_to_weapon_info[Secondary_weapon]].fire_count;

	if (Global_missile_firing_count) {
		do_missile_firing(0);
		Global_missile_firing_count--;
	}

	if (Controls.cycle_primary_count > 0)
	{
		for (i=0;i<Controls.cycle_primary_count;i++)
			CyclePrimary ();
		Controls.cycle_primary_count = 0;
	}
	if (Controls.cycle_secondary_count > 0)
	{
		for (i=0;i<Controls.cycle_secondary_count;i++)
			CycleSecondary ();
		Controls.cycle_secondary_count = 0;
	}
	if (Controls.select_weapon_count > 0)
	{
		Controls.select_weapon_count--;
		do_weapon_select(Controls.select_weapon_count>4?Controls.select_weapon_count-5:Controls.select_weapon_count,Controls.select_weapon_count>4?1:0);
		Controls.select_weapon_count = 0;
	}
	if (Global_missile_firing_count < 0)
		Global_missile_firing_count = 0;

	//	Drop proximity bombs.
	while (Controls.drop_bomb_count > 0)
	{
		do_missile_firing(1);
		Controls.drop_bomb_count--;
	}
}
Exemple #2
0
void do_weapon_n_item_stuff()
{
	int i;

	if (Controls.fire_flare_count > 0)
	{
		Controls.fire_flare_count = 0;
		if (allowed_to_fire_flare())
			Flare_create(ConsoleObject);
	}
//Turkey Begin
if (!((Game_mode & GM_MULTI) && (Game_mode & GM_TURKEY) && get_team(Player_num)))
{
//Turkey End
	if (allowed_to_fire_missile() && Controls.fire_secondary_state)
		Global_missile_firing_count += Weapon_info[Secondary_weapon_to_weapon_info[Secondary_weapon]].fire_count;

	if (Global_missile_firing_count) {
		do_missile_firing(0);
		Global_missile_firing_count--;
	}

	if (Controls.cycle_primary_count > 0)
	{
		for (i=0;i<Controls.cycle_primary_count;i++)
			CyclePrimary ();
		Controls.cycle_primary_count = 0;
	}
	if (Controls.cycle_secondary_count > 0)
	{
		for (i=0;i<Controls.cycle_secondary_count;i++)
			CycleSecondary ();
		Controls.cycle_secondary_count = 0;
	}
	if (Controls.select_weapon_count > 0)
	{
		Controls.select_weapon_count--;
		do_weapon_select(Controls.select_weapon_count>4?Controls.select_weapon_count-5:Controls.select_weapon_count,Controls.select_weapon_count>4?1:0);
		Controls.select_weapon_count = 0;
	}
	if (Controls.headlight_count > 0)
	{
		for (i=0;i<Controls.headlight_count;i++)
			toggle_headlight_active ();
		Controls.headlight_count = 0;
	}

	if (Global_missile_firing_count < 0)
		Global_missile_firing_count = 0;
//Turkey Begin
//should we allow turkey to poop?
}
//Turkey End
	//	Drop proximity bombs.
	while (Controls.drop_bomb_count > 0)
	{
		do_missile_firing(1);
		Controls.drop_bomb_count--;
	}

	if (Controls.toggle_bomb_count > 0)
	{
		int bomb = Secondary_last_was_super[PROXIMITY_INDEX]?PROXIMITY_INDEX:SMART_MINE_INDEX;
	
		if (!Players[Player_num].secondary_ammo[PROXIMITY_INDEX] && !Players[Player_num].secondary_ammo[SMART_MINE_INDEX])
		{
			digi_play_sample_once( SOUND_BAD_SELECTION, F1_0 );
			HUD_init_message_literal(HM_DEFAULT, "No bombs available!");
		}
		else
		{	
			if (Players[Player_num].secondary_ammo[bomb]==0)
			{
				digi_play_sample_once( SOUND_BAD_SELECTION, F1_0 );
				HUD_init_message(HM_DEFAULT, "No %s available!",(bomb==SMART_MINE_INDEX)?"Smart mines":"Proximity bombs");
			}
			else
			{
				Secondary_last_was_super[PROXIMITY_INDEX]=!Secondary_last_was_super[PROXIMITY_INDEX];
				digi_play_sample_once( SOUND_GOOD_SELECTION_SECONDARY, F1_0 );
			}
		}
		Controls.toggle_bomb_count = 0;
	}
//Turkey Begin
//or maybe we shouldnt allow turkey to poop
//}
//Turkey End

	if (Controls.energy_to_shield_state && (Players[Player_num].flags & PLAYER_FLAGS_CONVERTER))
		transfer_energy_to_shield();
	
}
Exemple #3
0
int HandleGameKey(int key)
{
	switch (key) {

		case KEY_1 + KEY_SHIFTED:
		case KEY_2 + KEY_SHIFTED:
		case KEY_3 + KEY_SHIFTED:
		case KEY_4 + KEY_SHIFTED:
		case KEY_5 + KEY_SHIFTED:
		case KEY_6 + KEY_SHIFTED:
		case KEY_7 + KEY_SHIFTED:
		case KEY_8 + KEY_SHIFTED:
		case KEY_9 + KEY_SHIFTED:
		case KEY_0 + KEY_SHIFTED:
			if (PlayerCfg.EscortHotKeys)
			{
				if (!(Game_mode & GM_MULTI))
					set_escort_special_goal(key);
				else
					HUD_init_message_literal(HM_DEFAULT, "No Guide-Bot in Multiplayer!");
				game_flush_inputs();
				return 1;
			}
			else
				return 0;

		case KEY_ALTED+KEY_F7:
		KEY_MAC(case KEY_COMMAND+KEY_ALTED+KEY_7:)
			PlayerCfg.HudMode=(PlayerCfg.HudMode+1)%GAUGE_HUD_NUMMODES;
			write_player_file();
			switch (PlayerCfg.HudMode)
			{
				case 0: HUD_init_message_literal(HM_DEFAULT, "Standard HUD"); break;
				case 1: HUD_init_message_literal(HM_DEFAULT, "Alternative HUD #1"); break;
				case 2: HUD_init_message_literal(HM_DEFAULT, "Alternative HUD #2"); break;
				case 3: HUD_init_message_literal(HM_DEFAULT, "No HUD"); break;
			}
			return 1;

#ifdef NETWORK
		KEY_MAC(case KEY_COMMAND+KEY_6:)
		case KEY_F6:
			if (Netgame.RefusePlayers && WaitForRefuseAnswer && !(Game_mode & GM_TEAM))
			{
				RefuseThisPlayer=1;
				HUD_init_message_literal(HM_MULTI, "Player accepted!");
			} else {
				Show_network_stats = ! Show_network_stats; 
			}
			return 1;
		case KEY_ALTED + KEY_1:
			if (Netgame.RefusePlayers && WaitForRefuseAnswer && (Game_mode & GM_TEAM))
				{
					RefuseThisPlayer=1;
					HUD_init_message_literal(HM_MULTI, "Player accepted!");
					RefuseTeam=1;
					game_flush_inputs();
				}
			return 1;
		case KEY_ALTED + KEY_2:
			if (Netgame.RefusePlayers && WaitForRefuseAnswer && (Game_mode & GM_TEAM))
				{
					RefuseThisPlayer=1;
					HUD_init_message_literal(HM_MULTI, "Player accepted!");
					RefuseTeam=2;
					game_flush_inputs();
				}
			return 1;
#endif

		default:
			break;

	}	 //switch (key)

	if (!Player_is_dead)
		switch (key)
		{
#if 0 
// weapon selection handled in kconfig_read_controls, d1x-style
				// MWA changed the weapon select cases to have each case call
				// do_weapon_select the macintosh keycodes aren't consecutive from 1
				// -- 0 on the keyboard -- boy is that STUPID!!!!
				//	Select primary or secondary weapon.
			case KEY_1:
				do_weapon_select(0 , 0);
				break;
			case KEY_2:
				do_weapon_select(1 , 0);
				break;
			case KEY_3:
				do_weapon_select(2 , 0);
				break;
			case KEY_4:
				do_weapon_select(3 , 0);
				break;
			case KEY_5:
				do_weapon_select(4 , 0);
				break;

			case KEY_6:
				do_weapon_select(0 , 1);
				break;
			case KEY_7:
				do_weapon_select(1 , 1);
				break;
			case KEY_8:
				do_weapon_select(2 , 1);
				break;
			case KEY_9:
				do_weapon_select(3 , 1);
				break;
			case KEY_0:
				do_weapon_select(4 , 1);
				break;
#endif

				KEY_MAC(case KEY_COMMAND+KEY_SHIFTED+KEY_5:)
			case KEY_F5 + KEY_SHIFTED:
				DropCurrentWeapon();
				break;

			KEY_MAC(case KEY_COMMAND+KEY_SHIFTED+KEY_6:)
			case KEY_F6 + KEY_SHIFTED:
				DropSecondaryWeapon();
				break;

#ifdef NETWORK
			case KEY_0 + KEY_ALTED:
				DropFlag ();
				game_flush_inputs();
				break;
#endif

			KEY_MAC(case KEY_COMMAND+KEY_4:)
			case KEY_F4:
				if (!DefiningMarkerMessage)
					InitMarkerInput();
				break;

			default:
				return 0;
		}
	else
		return 0;