Esempio n. 1
0
void debug_dynamics_damage_model (event *ev)
{

	dynamics_damage_types
		damage;

	damage = (dynamics_damage_types) (1 << ((ev->key)- (DIK_1)));

	dynamics_damage_model (damage, FALSE);
}
Esempio n. 2
0
void damage_helicopter_via_damage_level (entity *en, entity *aggressor)
{

	int
		damage;

	float
		en_damage_factor;

	ASSERT (get_local_entity_int_value (en, INT_TYPE_PLAYER) != ENTITY_PLAYER_AI);

	en_damage_factor = (float) get_local_entity_int_value (en, INT_TYPE_DAMAGE_LEVEL) / get_local_entity_int_value (en, INT_TYPE_INITIAL_DAMAGE_LEVEL);

	for (damage = 0; damage < sizeof (dynamics_damage_database) / sizeof (dynamics_damage_type); damage ++)
	{

		if (dynamics_damage_database [damage].kickin_value >= en_damage_factor)
		{

			if (get_gunship_entity () == en)
			{

				dynamics_damage_model (1 << damage, TRUE);
			}
			else
			{

				transmit_entity_comms_message (ENTITY_COMMS_DAMAGE_PLAYER, en, 1 << damage, TRUE);
			}
/*
			if (aggressor)
			{

				if (dynamics_damage_database [damage].store_aggressor_in_debrief)
				{
	
					debug_log ("CO_DMG: storing in debrief that %s %s caused damage to user",
									entity_type_names [get_local_entity_type (aggressor)],
									get_local_entity_string (aggressor, STRING_TYPE_FULL_NAME));
	
//					set_debrief_aggressor_entity (aggressor);
				}
			}
*/
		}
	}
}
Esempio n. 3
0
static void damage_systems (kiowa_damage_flags damage)
{
	entity
		*en;

	en = get_gunship_entity ();

	////////////////////////////////////////

	if (damage.flir)
	{
		if (!kiowa_damage.flir)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.flir = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_FLIR_FAILURE);

			if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_FLIR)
			{
				select_kiowa_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
			}
		}
	}

	////////////////////////////////////////

	if (damage.dtv)
	{
		if (!kiowa_damage.dtv)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.dtv = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_DTV_FAILURE);

			if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_DTV)
			{
				select_kiowa_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
			}
		}
	}

	////////////////////////////////////////

	if (damage.laser_designator)
	{
		if (!kiowa_damage.laser_designator)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.laser_designator = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_laser_is_active(FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_LASER_DESIGNATOR_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.infra_red_jammer)
	{
		if (!kiowa_damage.infra_red_jammer)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.infra_red_jammer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_IR_JAMMER_FAILURE);

			if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_INFRA_RED_JAMMER_ON))
			{
				set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_INFRA_RED_JAMMER_ON, FALSE);
			}
		}
	}

	////////////////////////////////////////

	if (damage.navigation_computer)
	{
		if (!kiowa_damage.navigation_computer)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.navigation_computer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_NAV_COMPUTER_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.communications)
	{
		if (!kiowa_damage.communications)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.communications = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_COMMS_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.radar_warning_system)
	{
		if (!kiowa_damage.radar_warning_system)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.radar_warning_system = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_RADAR_WARNING_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.co_pilot_main_mfd)
	{
		if (!kiowa_damage.co_pilot_main_mfd)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.co_pilot_main_mfd = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_MFD_FAILURE);

			select_kiowa_main_mfd_mode (KIOWA_MAIN_MFD_MODE_DAMAGED, KIOWA_MAIN_MFD_LOCATION_CO_PILOT);
		}
	}

	////////////////////////////////////////

	if (damage.pilot_main_mfd)
	{
		if (!kiowa_damage.pilot_main_mfd)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.pilot_main_mfd = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_MFD_FAILURE);

			select_kiowa_main_mfd_mode (KIOWA_MAIN_MFD_MODE_DAMAGED, KIOWA_MAIN_MFD_LOCATION_PILOT);
		}
	}

	////////////////////////////////////////

	if (damage.center_main_mfd)
	{
		if (!kiowa_damage.center_main_mfd)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.center_main_mfd = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_MFD_FAILURE);

			select_kiowa_main_mfd_mode (KIOWA_MAIN_MFD_MODE_DAMAGED, KIOWA_MAIN_MFD_LOCATION_CENTER);
		}
	}

	////////////////////////////////////////

	if (damage.pnvs)
	{
		if (!kiowa_damage.pnvs)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.pnvs = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_PNVS_FAILURE);

			night_vision_system_active = FALSE;
		}
	}

	////////////////////////////////////////

	if (damage.lh_pylon)
	{
		if (!kiowa_damage.lh_pylon)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.lh_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.rh_pylon)
	{
		if (!kiowa_damage.rh_pylon)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.rh_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.chaff_dispenser)
	{
		if (!kiowa_damage.chaff_dispenser)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.chaff_dispenser = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_CHAFF_DISPENSER_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.flare_dispenser)
	{
		if (!kiowa_damage.flare_dispenser)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.flare_dispenser = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_FLARE_DISPENSER_DAMAGED);
		}
	}
	////////////////////////////////////////

	if (damage.hud)
	{
		if (!kiowa_damage.hud)
		{
			activate_kiowa_master_caution ();

			kiowa_damage.hud = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HUD_FAILURE);
		}
	}

	////////////////////////////////////////

	set_kiowa_weapon_damage_status ();
}
Esempio n. 4
0
static void damage_systems (havoc_damage_flags damage)
{
	entity
		*en;

	en = get_gunship_entity ();

	////////////////////////////////////////

	if (damage.radar)
	{
		if (!havoc_damage.radar)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.radar = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("RADAR", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_RADAR_FAILURE);

			if
			(
				(target_acquisition_system == TARGET_ACQUISITION_SYSTEM_GROUND_RADAR) ||
				(target_acquisition_system == TARGET_ACQUISITION_SYSTEM_AIR_RADAR)
			)
			{
				select_havoc_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
			}
		}
	}

	////////////////////////////////////////

	if (damage.flir)
	{
		if (!havoc_damage.flir)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.flir = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("FLIR", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_FLIR_FAILURE);

			if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_FLIR)
			{
				select_havoc_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
			}
		}
	}

	////////////////////////////////////////

	if (damage.llltv)
	{
		if (!havoc_damage.llltv)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.llltv = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("LLLTV", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_LLLTV_FAILURE);

			if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_LLLTV)
			{
				select_havoc_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
			}
		}
	}

	////////////////////////////////////////

	if (damage.laser_range_finder)
	{
		if (!havoc_damage.laser_range_finder)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.laser_range_finder = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("LASER", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_LASER_RANGE_FINDER_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.radar_jammer)
	{
		if (!havoc_damage.radar_jammer)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.radar_jammer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("RD JAMMER", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_RADAR_JAMMER_FAILURE);

			if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_RADAR_JAMMER_ON))
			{
				set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_RADAR_JAMMER_ON, FALSE);
			}
		}
	}

	////////////////////////////////////////

	if (damage.infra_red_jammer)
	{
		if (!havoc_damage.infra_red_jammer)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.infra_red_jammer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("IR JAMMER", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_IR_JAMMER_FAILURE);

			if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_INFRA_RED_JAMMER_ON))
			{
				set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_INFRA_RED_JAMMER_ON, FALSE);
			}
		}
	}

	////////////////////////////////////////

	if (damage.navigation_computer)
	{
		if (!havoc_damage.navigation_computer)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.navigation_computer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("NAV COMP", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_NAV_COMPUTER_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.communications)
	{
		if (!havoc_damage.communications)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.communications = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("COMMS", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_COMMS_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.radar_warning_system)
	{
		if (!havoc_damage.radar_warning_system)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.radar_warning_system = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("RWS", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_RADAR_WARNING_FAILURE);
		}
	}

	////////////////////////////////////////

	if (!get_global_simple_avionics ())
	{
		if (damage.head_up_display)
		{
			if (!havoc_damage.head_up_display)
			{
				activate_havoc_master_caution_lamp ();

				havoc_damage.head_up_display = TRUE;

				dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

				set_havoc_ekran_display_text ("HUD", "FAILURE", NULL, NULL);

				play_client_server_warning_message (en, SPEECH_SYSTEM_HUD_FAILURE);
			}
		}
	}

	////////////////////////////////////////

	if (!get_global_simple_avionics ())
	{
		if (damage.helmet_mounted_sight)
		{
			if (!havoc_damage.helmet_mounted_sight)
			{
				activate_havoc_master_caution_lamp ();

				havoc_damage.helmet_mounted_sight = TRUE;

				dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

				set_havoc_ekran_display_text ("HMS", "FAILURE", NULL, NULL);

				play_client_server_warning_message (en, SPEECH_SYSTEM_HELMET_MOUNTED_SIGHT_FAILURE);

				if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_HMS)
				{
					select_havoc_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
				}
			}
		}
	}

	////////////////////////////////////////

	if (damage.tv_display)
	{
		if (!havoc_damage.tv_display)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.tv_display = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("TV", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_TV_DISPLAY_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.threat_warning_display)
	{
		if (!havoc_damage.threat_warning_display)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.threat_warning_display = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("TWD", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_THREAT_WARNING_DISPLAY_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.night_vision_goggles)
	{
		if (!havoc_damage.night_vision_goggles)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.night_vision_goggles = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("NVG", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_NIGHT_VISION_GOGGLES_FAILURE);

			night_vision_system_active = FALSE;
		}
	}

	////////////////////////////////////////

	if (damage.gun_jammed)
	{
		if (!havoc_damage.gun_jammed)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.gun_jammed = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("GUN", "JAMMED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_GUN_JAMMED);
		}
	}

	////////////////////////////////////////

	if (damage.lh_outer_pylon)
	{
		if (!havoc_damage.lh_outer_pylon)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.lh_outer_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("HARDPOINT", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.lh_inner_pylon)
	{
		if (!havoc_damage.lh_inner_pylon)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.lh_inner_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("HARDPOINT", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.rh_outer_pylon)
	{
		if (!havoc_damage.rh_outer_pylon)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.rh_outer_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("HARDPOINT", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.rh_inner_pylon)
	{
		if (!havoc_damage.rh_inner_pylon)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.rh_inner_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("HARDPOINT", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.chaff_dispenser)
	{
		if (!havoc_damage.chaff_dispenser)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.chaff_dispenser = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("CHAFF", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_CHAFF_DISPENSER_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.flare_dispenser)
	{
		if (!havoc_damage.flare_dispenser)
		{
			activate_havoc_master_caution_lamp ();

			havoc_damage.flare_dispenser = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_havoc_ekran_display_text ("FLARES", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_FLARE_DISPENSER_DAMAGED);
		}
	}

	////////////////////////////////////////

	set_havoc_weapon_damage_status ();
}
Esempio n. 5
0
void update_dynamics_damage (void)
{

	int
		damage;

	for (damage = 1; damage < NUM_DYNAMICS_DAMAGE_TYPES; damage = damage << 1)
	{

		if (current_flight_dynamics->dynamics_damage & damage)
		{

			switch (damage)
			{

				case DYNAMICS_DAMAGE_MAIN_ROTOR:
				case DYNAMICS_DAMAGE_TAIL_ROTOR:
				case DYNAMICS_DAMAGE_LEFT_ENGINE:
				case DYNAMICS_DAMAGE_RIGHT_ENGINE:
				case DYNAMICS_DAMAGE_LOW_HYDRAULICS:
				case DYNAMICS_DAMAGE_LOW_OIL_PRESSURE:
				case DYNAMICS_DAMAGE_HIGH_OIL_PRESSURE:
				case DYNAMICS_DAMAGE_AVIONICS:
				case DYNAMICS_DAMAGE_FIRE_EXTINGUISHER:
				case DYNAMICS_DAMAGE_UNDERCARRIAGE:
				{

					break;
				}
				case DYNAMICS_DAMAGE_LEFT_ENGINE_FIRE:
				{

					if (current_flight_dynamics->dynamics_damage & ~DYNAMICS_DAMAGE_LEFT_ENGINE)
					{

						current_flight_dynamics->left_engine_temp.value += 10.0 * get_delta_time ();

						if (current_flight_dynamics->left_engine_temp.value > current_flight_dynamics->left_engine_temp.max)
						{

							dynamics_damage_model (DYNAMICS_DAMAGE_LEFT_ENGINE, FALSE);
						}

						#if DEBUG_MODULE

						debug_log ("DYNAMICS: left engine fire temp %f", current_flight_dynamics->left_engine_temp.value);

						#endif
					}

					break;
				}
				case DYNAMICS_DAMAGE_RIGHT_ENGINE_FIRE:
				{

					if (current_flight_dynamics->dynamics_damage & ~DYNAMICS_DAMAGE_RIGHT_ENGINE)
					{

						current_flight_dynamics->right_engine_temp.value += 10.0 * get_delta_time ();

						if (current_flight_dynamics->right_engine_temp.value > current_flight_dynamics->right_engine_temp.max)
						{

							dynamics_damage_model (DYNAMICS_DAMAGE_RIGHT_ENGINE, FALSE);
						}

						#if DEBUG_MODULE

						debug_log ("DYNAMICS: right engine fire temp %f", current_flight_dynamics->right_engine_temp.value);

						#endif
					}

					break;
				}
				case DYNAMICS_DAMAGE_STABILISER:
				{

					//
					// move cog about ramdomly
					//

					if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_AIRBORNE_AIRCRAFT))
					{

						current_flight_dynamics->centre_of_gravity.x += current_flight_dynamics->roll.value * get_model_delta_time ();
						current_flight_dynamics->centre_of_gravity.z -= current_flight_dynamics->pitch.value * get_model_delta_time ();

						current_flight_dynamics->centre_of_gravity.x = bound (current_flight_dynamics->centre_of_gravity.x, -0.1, 0.1);
						current_flight_dynamics->centre_of_gravity.z = bound (current_flight_dynamics->centre_of_gravity.z, -0.1, 0.1);

						#if DEBUG_MODULE

						debug_log ("DYNAMICS: stabaliser damaged : cog %f, %f", current_flight_dynamics->centre_of_gravity.x, current_flight_dynamics->centre_of_gravity.z);

						#endif
					}

					break;
				}

				case DYNAMICS_DAMAGE_FUEL_LEAK:
				{

					current_flight_dynamics->fuel_weight.value -= FUEL_LEAK_RATE * get_delta_time ();

					current_flight_dynamics->fuel_weight.value = max (current_flight_dynamics->fuel_weight.value, 0.0);

					#if DEBUG_MODULE

					debug_log ("DYNAMICS: fuel leak, currently %f", current_flight_dynamics->fuel_weight.value);

					#endif

					break;
				}
			}
		}
	}
}
Esempio n. 6
0
static void damage_systems (apache_damage_flags damage)
{
	entity
		*en;

	en = get_gunship_entity ();

	////////////////////////////////////////

	if (damage.radar)
	{
		if (!apache_damage.radar)
		{
			apache_damage.radar = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("RADAR FAILURE", "", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_RADAR_FAILURE);

			if
			(
				(target_acquisition_system == TARGET_ACQUISITION_SYSTEM_GROUND_RADAR) ||
				(target_acquisition_system == TARGET_ACQUISITION_SYSTEM_AIR_RADAR)
			)
			{
				select_apache_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
			}
		}
	}

	////////////////////////////////////////

	if (damage.flir)
	{
		if (!apache_damage.flir)
		{
			apache_damage.flir = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("FLIR FAILURE", "", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_FLIR_FAILURE);

			if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_FLIR)
			{
				select_apache_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
			}
		}
	}

	////////////////////////////////////////

	if (damage.dtv)
	{
		if (!apache_damage.dtv)
		{
			apache_damage.dtv = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("DTV FAILURE", "", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_DTV_FAILURE);

			if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_DTV)
			{
				select_apache_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
			}
		}
	}

	////////////////////////////////////////

	if (damage.dvo)
	{
		if (!apache_damage.dvo)
		{
			apache_damage.dvo = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("DVO FAILURE", "", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_DVO_FAILURE);

			if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_DVO)
			{
				select_apache_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
			}
		}
	}

	////////////////////////////////////////

	if (damage.laser_designator)
	{
		if (!apache_damage.laser_designator)
		{
			apache_damage.laser_designator = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("LASER DESIG", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_LASER_DESIGNATOR_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.radar_jammer)
	{
		if (!apache_damage.radar_jammer)
		{
			apache_damage.radar_jammer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("RADAR JAMMER", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_RADAR_JAMMER_FAILURE);

			if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_RADAR_JAMMER_ON))
			{
				set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_RADAR_JAMMER_ON, FALSE);
			}
		}
	}

	////////////////////////////////////////

	if (damage.infra_red_jammer)
	{
		if (!apache_damage.infra_red_jammer)
		{
			apache_damage.infra_red_jammer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("IR JAMMER", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_IR_JAMMER_FAILURE);

			if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_INFRA_RED_JAMMER_ON))
			{
				set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_INFRA_RED_JAMMER_ON, FALSE);
			}
		}
	}

	////////////////////////////////////////

	if (damage.navigation_computer)
	{
		if (!apache_damage.navigation_computer)
		{
			apache_damage.navigation_computer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("NAV COMPUTER", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_NAV_COMPUTER_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.communications)
	{
		if (!apache_damage.communications)
		{
			apache_damage.communications = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("COMMS FAILURE", "", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_COMMS_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.radar_warning_system)
	{
		if (!apache_damage.radar_warning_system)
		{
			apache_damage.radar_warning_system = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("RADAR WARNING", "FAILURE", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_RADAR_WARNING_FAILURE);
		}
	}

	////////////////////////////////////////

	if (!get_global_simple_avionics ())
	{
		if (damage.ihadss)
		{
			if (!apache_damage.ihadss)
			{
				apache_damage.ihadss = TRUE;

				dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

				set_apache_upfront_display_text ("IHADSS FAILURE", "", NULL, NULL);

				play_client_server_warning_message (en, SPEECH_SYSTEM_IHADSS_FAILURE);

				if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_IHADSS)
				{
					select_apache_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
				}
			}
		}
	}

	////////////////////////////////////////

	if (damage.lh_mfd)
	{
		if (!apache_damage.lh_mfd)
		{
			apache_damage.lh_mfd = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("MFD FAILURE", "", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_MFD_FAILURE);

			select_apache_mfd_mode (MFD_MODE_DAMAGED, MFD_LOCATION_LHS);
		}
	}

	////////////////////////////////////////

	if (damage.rh_mfd)
	{
		if (!apache_damage.rh_mfd)
		{
			apache_damage.rh_mfd = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("MFD FAILURE", "", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_MFD_FAILURE);

			select_apache_mfd_mode (MFD_MODE_DAMAGED, MFD_LOCATION_RHS);
		}
	}

	////////////////////////////////////////

	if (damage.pnvs)
	{
		if (!apache_damage.pnvs)
		{
			apache_damage.pnvs = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("PNVS FAILURE", "", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_PNVS_FAILURE);

			night_vision_system_active = FALSE;
		}
	}

	////////////////////////////////////////

	if (damage.gun_jammed)
	{
		if (!apache_damage.gun_jammed)
		{
			apache_damage.gun_jammed = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("GUN JAMMED", "", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_GUN_JAMMED);
		}
	}

	////////////////////////////////////////

	if (damage.lh_wing_tip_mount)
	{
		if (!apache_damage.lh_wing_tip_mount)
		{
			apache_damage.lh_wing_tip_mount = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("HARDPOINT", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.lh_outer_pylon)
	{
		if (!apache_damage.lh_outer_pylon)
		{
			apache_damage.lh_outer_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("HARDPOINT", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.lh_inner_pylon)
	{
		if (!apache_damage.lh_inner_pylon)
		{
			apache_damage.lh_inner_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("HARDPOINT", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.rh_wing_tip_mount)
	{
		if (!apache_damage.rh_wing_tip_mount)
		{
			apache_damage.rh_wing_tip_mount = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("HARDPOINT", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.rh_outer_pylon)
	{
		if (!apache_damage.rh_outer_pylon)
		{
			apache_damage.rh_outer_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("HARDPOINT", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.rh_inner_pylon)
	{
		if (!apache_damage.rh_inner_pylon)
		{
			apache_damage.rh_inner_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("HARDPOINT", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.chaff_dispenser)
	{
		if (!apache_damage.chaff_dispenser)
		{
			apache_damage.chaff_dispenser = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("CHAFF DISPNSR", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_CHAFF_DISPENSER_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.flare_dispenser)
	{
		if (!apache_damage.flare_dispenser)
		{
			apache_damage.flare_dispenser = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_apache_upfront_display_text ("FLARE DISPNSR", "DAMAGED", NULL, NULL);

			play_client_server_warning_message (en, SPEECH_SYSTEM_FLARE_DISPENSER_DAMAGED);
		}
	}

	////////////////////////////////////////

	set_apache_weapon_damage_status ();
}
Esempio n. 7
0
static void damage_systems (ka50_damage_flags damage)
{
	entity
		*en;

	en = get_gunship_entity ();

	////////////////////////////////////////

	if (damage.flir)
	{
		if (!ka50_damage.flir)
		{
			activate_ka50_master_caution ();

			ka50_damage.flir = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("FLIR", "FAILURE", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_FLIR_FAILURE);

			if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_FLIR)
			{
				select_ka50_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
			}
		}
	}

	////////////////////////////////////////

	if (damage.laser_designator)
	{
		if (!ka50_damage.laser_designator)
		{
			activate_ka50_master_caution ();

			ka50_damage.laser_designator = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_laser_is_active(FALSE);

			set_ka50_text_display_text ("LASER", "DESIGNATOR", "FAILURE");

			play_client_server_warning_message (en, SPEECH_SYSTEM_LASER_DESIGNATOR_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.radar_jammer)
	{
		if (!ka50_damage.radar_jammer)
		{
			activate_ka50_master_caution ();

			ka50_damage.radar_jammer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("RADAR", "JAMMER", "FAILURE");

			play_client_server_warning_message (en, SPEECH_SYSTEM_RADAR_JAMMER_FAILURE);

			if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_RADAR_JAMMER_ON))
			{
				set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_RADAR_JAMMER_ON, FALSE);
			}
		}
	}

	////////////////////////////////////////

	if (damage.infra_red_jammer)
	{
		if (!ka50_damage.infra_red_jammer)
		{
			activate_ka50_master_caution ();

			ka50_damage.infra_red_jammer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("IR JAMMER", "FAILURE", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_IR_JAMMER_FAILURE);

			if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_INFRA_RED_JAMMER_ON))
			{
				set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_INFRA_RED_JAMMER_ON, FALSE);
			}
		}
	}

	////////////////////////////////////////

	if (damage.navigation_computer)
	{
		if (!ka50_damage.navigation_computer)
		{
			activate_ka50_master_caution ();

			ka50_damage.navigation_computer = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("NAVIGATION", "COMPUTER", "FAILURE");

			play_client_server_warning_message (en, SPEECH_SYSTEM_NAV_COMPUTER_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.communications)
	{
		if (!ka50_damage.communications)
		{
			activate_ka50_master_caution ();

			ka50_damage.communications = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("COMMS", "FAILURE", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_COMMS_FAILURE);
		}
	}

	////////////////////////////////////////

	if (damage.radar_warning_system)
	{
		if (!ka50_damage.radar_warning_system)
		{
			activate_ka50_master_caution ();

			ka50_damage.radar_warning_system = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("RADAR", "WARNING", "FAILURE");

			play_client_server_warning_message (en, SPEECH_SYSTEM_RADAR_WARNING_FAILURE);
		}
	}

	////////////////////////////////////////

	if (!get_global_simple_avionics ())
	{
		if (damage.head_up_display)
		{
			if (!ka50_damage.head_up_display)
			{
				activate_ka50_master_caution ();

				ka50_damage.head_up_display = TRUE;

				dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

				set_ka50_text_display_text ("HUD", "FAILURE", "");

				play_client_server_warning_message (en, SPEECH_SYSTEM_HUD_FAILURE);
			}
		}
	}

	////////////////////////////////////////

	if (!get_global_simple_avionics ())
	{
		if (damage.helmet_mounted_sight)
		{
			if (!ka50_damage.helmet_mounted_sight)
			{
				activate_ka50_master_caution ();

				ka50_damage.helmet_mounted_sight = TRUE;

				dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

				set_ka50_text_display_text ("HMS", "FAILURE", "");

				play_client_server_warning_message (en, SPEECH_SYSTEM_HELMET_MOUNTED_SIGHT_FAILURE);

				if (target_acquisition_system == TARGET_ACQUISITION_SYSTEM_HMS)
				{
					select_ka50_target_acquisition_system (TARGET_ACQUISITION_SYSTEM_OFF);
				}
			}
		}
	}

	////////////////////////////////////////

	if (damage.shkval_mfd)
	{
		if (!ka50_damage.shkval_mfd)
		{
			activate_ka50_master_caution ();

			ka50_damage.shkval_mfd = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("SHKVAL", "FAILURE", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_MFD_FAILURE);

			select_ka50_mfd_mode (KA50_MFD_MODE_DAMAGED, KA50_MFD_LOCATION_SHKVAL);
		}
	}

	////////////////////////////////////////

	if (damage.abris_mfd)
	{
		if (!ka50_damage.abris_mfd)
		{
			activate_ka50_master_caution ();

			ka50_damage.abris_mfd = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("ABRIS", "FAILURE", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_MFD_FAILURE);

			select_ka50_mfd_mode (KA50_MFD_MODE_DAMAGED, KA50_MFD_LOCATION_ABRIS);
		}
	}

	////////////////////////////////////////

	if (damage.night_vision_goggles)
	{
		if (!ka50_damage.night_vision_goggles)
		{
			activate_ka50_master_caution ();

			ka50_damage.night_vision_goggles = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("NVG", "DAMAGED", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_NIGHT_VISION_GOGGLES_FAILURE);

			night_vision_system_active = FALSE;
		}
	}

	////////////////////////////////////////

	if (damage.gun_jammed)
	{
		if (!ka50_damage.gun_jammed)
		{
			activate_ka50_master_caution ();

			ka50_damage.gun_jammed = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("GUN", "JAMMED", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_GUN_JAMMED);
		}
	}

	////////////////////////////////////////

	if (damage.lh_outer_pylon)
	{
		if (!ka50_damage.lh_outer_pylon)
		{
			activate_ka50_master_caution ();

			ka50_damage.lh_outer_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("HARDPOINT", "DAMAGED", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.lh_inner_pylon)
	{
		if (!ka50_damage.lh_inner_pylon)
		{
			activate_ka50_master_caution ();

			ka50_damage.lh_inner_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("HARDPOINT", "DAMAGED", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.rh_outer_pylon)
	{
		if (!ka50_damage.rh_outer_pylon)
		{
			activate_ka50_master_caution ();

			ka50_damage.rh_outer_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("HARDPOINT", "DAMAGED", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.rh_inner_pylon)
	{
		if (!ka50_damage.rh_inner_pylon)
		{
			activate_ka50_master_caution ();

			ka50_damage.rh_inner_pylon = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("HARDPOINT", "DAMAGED", "");

			play_client_server_warning_message (en, SPEECH_SYSTEM_HARDPOINT_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.lh_chaff_dispensers)
	{
		if (!ka50_damage.lh_chaff_dispensers)
		{
			activate_ka50_master_caution ();

			ka50_damage.lh_chaff_dispensers = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("CHAFF", "DISPENSER", "DAMAGED");

			play_client_server_warning_message (en, SPEECH_SYSTEM_CHAFF_DISPENSER_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.rh_chaff_dispensers)
	{
		if (!ka50_damage.rh_chaff_dispensers)
		{
			activate_ka50_master_caution ();

			ka50_damage.rh_chaff_dispensers = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("CHAFF", "DISPENSER", "DAMAGED");

			play_client_server_warning_message (en, SPEECH_SYSTEM_CHAFF_DISPENSER_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.lh_flare_dispensers)
	{
		if (!ka50_damage.lh_flare_dispensers)
		{
			activate_ka50_master_caution ();

			ka50_damage.lh_flare_dispensers = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("FLARE", "DISPENSER", "DAMAGED");

			play_client_server_warning_message (en, SPEECH_SYSTEM_FLARE_DISPENSER_DAMAGED);
		}
	}

	////////////////////////////////////////

	if (damage.rh_flare_dispensers)
	{
		if (!ka50_damage.rh_flare_dispensers)
		{
			activate_ka50_master_caution ();

			ka50_damage.rh_flare_dispensers = TRUE;

			dynamics_damage_model (DYNAMICS_DAMAGE_AVIONICS, FALSE);

			set_ka50_text_display_text ("FLARE", "DISPENSER", "DAMAGED");

			play_client_server_warning_message (en, SPEECH_SYSTEM_FLARE_DISPENSER_DAMAGED);
		}
	}

	////////////////////////////////////////

	set_ka50_weapon_damage_status ();
}