Beispiel #1
0
void update_kiowa_lamp_avionics (void)
{
	entity
		*en;

	en = get_gunship_entity ();

	update_master_caution ();

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

	kiowa_lamps.engine_ignition = !get_dynamics_damage_type (DYNAMICS_DAMAGE_LEFT_ENGINE) && current_flight_dynamics->left_engine_rpm.value > 0.01;

	kiowa_lamps.apu_ignition = current_flight_dynamics->apu_rpm.value > 0.01;

	kiowa_lamps.engine_fire = get_dynamics_damage_type (DYNAMICS_DAMAGE_LEFT_ENGINE_FIRE);

	kiowa_lamps.apu_fire = 0;

	kiowa_lamps.engine_fire_extinguiser = fire_extinguisher_used;

	kiowa_lamps.hydraulic_pressure = get_dynamics_damage_type (DYNAMICS_DAMAGE_LOW_HYDRAULICS);

	kiowa_lamps.oil_pressure = get_dynamics_damage_type (DYNAMICS_DAMAGE_LOW_OIL_PRESSURE) || get_dynamics_damage_type (DYNAMICS_DAMAGE_HIGH_OIL_PRESSURE);

	kiowa_lamps.oil_temperature = 0;

	kiowa_lamps.overtorque = get_current_flight_dynamics_overtorque ();

	kiowa_lamps.rotor_rpm = get_current_flight_dynamics_low_rotor_rpm ();

	kiowa_lamps.fuel_low = current_flight_dynamics->fuel_weight.value < (current_flight_dynamics->fuel_weight.max * 0.25);

	kiowa_lamps.rotor_brake = get_current_flight_dynamics_rotor_brake ();

	kiowa_lamps.navigation_lights = get_local_entity_int_value (en, INT_TYPE_LIGHTS_ON);

	kiowa_lamps.hover_hold = get_current_flight_dynamics_auto_hover ();

	kiowa_lamps.altitude_hold = get_current_flight_dynamics_altitude_lock ();

	kiowa_lamps.auto_pilot = get_current_flight_dynamics_auto_pilot ();

	kiowa_lamps.laser = get_local_entity_int_value (en, INT_TYPE_LASER_ON);

	kiowa_lamps.ir_jammer = get_local_entity_int_value (en, INT_TYPE_INFRA_RED_JAMMER_ON);

	kiowa_lamps.auto_counter_measures = get_global_auto_counter_measures ();

	kiowa_lamps.ase_auto_page = get_global_ase_auto_page ();

	kiowa_lamps.co_pilot_main_mfd_focus = get_kiowa_main_mfd_has_focus (KIOWA_MAIN_MFD_LOCATION_CO_PILOT);

	kiowa_lamps.pilot_main_mfd_focus = get_kiowa_main_mfd_has_focus (KIOWA_MAIN_MFD_LOCATION_PILOT);
}
Beispiel #2
0
void update_hokum_lamp_avionics (void)
{
	entity
		*en;

	int
		gear_state;

	en = get_gunship_entity ();

	update_master_caution ();

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

	gear_state = get_local_entity_undercarriage_state (en);

	gear_transition_timer -= get_delta_time ();

	if (gear_transition_timer <= 0.0)
	{
		gear_transition_state ^= 1;

		gear_transition_timer = GEAR_TRANSITION_FLASH_RATE;
	}

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

	hokum_lamps.left_engine_fire = get_dynamics_damage_type (DYNAMICS_DAMAGE_LEFT_ENGINE_FIRE);

	hokum_lamps.apu_fire = 0;

	hokum_lamps.right_engine_fire = get_dynamics_damage_type (DYNAMICS_DAMAGE_RIGHT_ENGINE_FIRE);

	hokum_lamps.fire_extinguiser = fire_extinguisher_used;

	hokum_lamps.hydraulic_pressure = get_dynamics_damage_type (DYNAMICS_DAMAGE_LOW_HYDRAULICS);

	hokum_lamps.oil_pressure = get_dynamics_damage_type (DYNAMICS_DAMAGE_LOW_OIL_PRESSURE) || get_dynamics_damage_type (DYNAMICS_DAMAGE_HIGH_OIL_PRESSURE);

	hokum_lamps.oil_temperature = 0;

	hokum_lamps.overtorque = get_current_flight_dynamics_overtorque ();

	hokum_lamps.rotor_rpm = get_current_flight_dynamics_low_rotor_rpm ();

	hokum_lamps.fuel_low = current_flight_dynamics->fuel_weight.value < (current_flight_dynamics->fuel_weight.max * 0.25);

	hokum_lamps.rotor_brake = get_current_flight_dynamics_rotor_brake ();

	hokum_lamps.wheel_brake = get_current_flight_dynamics_wheel_brake ();

	hokum_lamps.navigation_lights = get_local_entity_int_value (en, INT_TYPE_LIGHTS_ON);

	hokum_lamps.hover_hold = get_current_flight_dynamics_auto_hover ();

	hokum_lamps.altitude_hold = get_current_flight_dynamics_altitude_lock ();

	hokum_lamps.auto_pilot = get_current_flight_dynamics_auto_pilot ();

	hokum_lamps.radar = get_local_entity_int_value (en, INT_TYPE_RADAR_ON);

	hokum_lamps.laser = get_local_entity_int_value (en, INT_TYPE_LASER_ON);

	hokum_lamps.radar_jammer = get_local_entity_int_value (en, INT_TYPE_RADAR_JAMMER_ON);

	hokum_lamps.ir_jammer = get_local_entity_int_value (en, INT_TYPE_INFRA_RED_JAMMER_ON);

	hokum_lamps.auto_counter_measures = get_global_auto_counter_measures ();

	hokum_lamps.ase_auto_page = get_global_ase_auto_page ();

	hokum_lamps.gear_damaged = get_dynamics_damage_type (DYNAMICS_DAMAGE_UNDERCARRIAGE);

	switch (gear_state)
	{
		////////////////////////////////////////
		case AIRCRAFT_UNDERCARRIAGE_UP:
		////////////////////////////////////////
		{
			hokum_lamps.gear_status = 1;

			hokum_lamps.gear_red = 1;

			break;
		}
		////////////////////////////////////////
		case AIRCRAFT_UNDERCARRIAGE_LOWERING:
		////////////////////////////////////////
		{
			hokum_lamps.gear_status = gear_transition_state;

			hokum_lamps.gear_red = 0;

			break;
		}
		////////////////////////////////////////
		case AIRCRAFT_UNDERCARRIAGE_DOWN:
		////////////////////////////////////////
		{
			hokum_lamps.gear_status = 1;

			hokum_lamps.gear_red = 0;

			break;
		}
		////////////////////////////////////////
		case AIRCRAFT_UNDERCARRIAGE_RAISING:
		////////////////////////////////////////
		{
			hokum_lamps.gear_status = gear_transition_state;

			hokum_lamps.gear_red = 1;

			break;
		}
	}

	hokum_lamps.pilot_lh_mfd_focus = get_hokum_mfd_has_focus (HOKUM_MFD_LOCATION_PILOT_LHS);

	hokum_lamps.pilot_rh_mfd_focus = get_hokum_mfd_has_focus (HOKUM_MFD_LOCATION_PILOT_RHS);

	hokum_lamps.co_pilot_lh_mfd_focus = get_hokum_mfd_has_focus (HOKUM_MFD_LOCATION_CO_PILOT_LHS);

	hokum_lamps.co_pilot_rh_mfd_focus = get_hokum_mfd_has_focus (HOKUM_MFD_LOCATION_CO_PILOT_RHS);
}