Beispiel #1
0
float adjust_radio_message_amplification (float amp, vec3d *pos)
{
	float
		d,
		range;

	if (!get_gunship_entity ())
	{
		return amp;
	}

	ASSERT (pos);

	range = get_approx_3d_range (get_local_entity_vec3d_ptr (get_gunship_entity (), VEC3D_TYPE_POSITION), pos);

	if (range > 120 * KILOMETRE)
	{
		return 0.0;
	}

	if (range < 1 * KILOMETRE)
	{
		return amp;
	}

	d = ((120 * KILOMETRE) - range) / ((120 * KILOMETRE) - (1 * KILOMETRE));

	return (d * amp);
}
Beispiel #2
0
void set_next_waypoint (void)
{
	entity
		*guide;

	//
	// Can only change your current waypoint if you have a gunship, and you are leader of your current task
	//

	if (!get_gunship_entity ())
	{
		return;
	}

	if (!get_local_entity_int_value (get_gunship_entity (), INT_TYPE_TASK_LEADER))
	{
		return;
	}

	guide = get_local_entity_parent (get_gunship_entity (), LIST_TYPE_FOLLOWER);

	if (!guide)
	{
		return;
	}

	set_guide_next_waypoint (guide);
}
Beispiel #3
0
void initialise_free_flight_screen_map_page_objects (void)
{
	vec3d
		*pos;
		
	set_active_map_object (NULL);

	if (get_gunship_entity ())
	{
		pos = get_local_entity_vec3d_ptr (get_gunship_entity (), VEC3D_TYPE_POSITION);

		page_map_dimensions.x = pos->x;
		page_map_dimensions.z = pos->z;

		page_map_dimensions.size = 32.0 * KILOMETRE;
	}
	else
	{
		page_map_dimensions.x = MID_MAP_X;
		page_map_dimensions.z = MID_MAP_Z;

		page_map_dimensions.size = min (MAX_MAP_X - MIN_MAP_X, MAX_MAP_Z - MIN_MAP_Z);
	}
	
	page_map_dimensions.selected_entity = NULL;

	clear_map_mouse_over_object (&page_map_dimensions);
}
Beispiel #4
0
void update_weapon_load_shared_mem ()
{
	weapon_package_status
		*package_status;

	unsigned next_free = 0;

	if (!gPtrSharedMemory || !get_gunship_entity())
		return;

	package_status = (weapon_package_status *) get_local_entity_ptr_value(get_gunship_entity(), PTR_TYPE_WEAPON_PACKAGE_STATUS_ARRAY);

	if (package_status)
	{
		int package;
		weapon_config_types config_type = (weapon_config_types) get_local_entity_int_value (get_gunship_entity(), INT_TYPE_WEAPON_CONFIG_TYPE);

		for (package = 0; package < MAX_WEAPON_LOAD_DATA; package++)
		{
			entity_sub_types weapon_type;
			int number;

			weapon_type = weapon_config_database[config_type][package].sub_type;
			number = package_status[package].number;

			gPtrSharedMemory->weapon_load[next_free].weapon_type = weapon_type;
			gPtrSharedMemory->weapon_load[next_free].weapon_count = number;
			next_free++;
		}
	}
	else
		memset(gPtrSharedMemory->weapon_load, 0, sizeof(gPtrSharedMemory->weapon_load));
}
Beispiel #5
0
static void update_master_caution (void)
{
	//
	// monitor engine damage
	//

	engine_damage_imminent_status = get_current_flight_dynamics_engine_damage_imminent ();

	if ((!previous_engine_damage_imminent_status) && engine_damage_imminent_status)
	{
		play_client_server_warning_message (get_gunship_entity (), SPEECH_SYSTEM_ENGINE_OVERTORQUE);

		activate_blackhawk_master_caution ();
	}

	previous_engine_damage_imminent_status = engine_damage_imminent_status;

	//
	// update master caution
	//

	master_caution_sound_timer -= get_delta_time ();

	if (master_caution_sound_timer <= 0.0)
	{
		master_caution_sound_timer = 0.0;

		pause_local_entity_sound_type (get_gunship_entity (), ENTITY_SUB_TYPE_EFFECT_SOUND_MCA, 0.5);
	}
}
Beispiel #6
0
void restore_kiowa_virtual_cockpit_main_rotors (void)
{
	float
		theta;

	object_3d_instance
		*inst3d;

	ASSERT (get_gunship_entity ());

	ASSERT (virtual_cockpit_inst3d_detail_level_normal_inst3d);
	ASSERT (virtual_cockpit_inst3d_detail_level_glass_inst3d);

	inst3d = (object_3d_instance *) get_local_entity_ptr_value (get_gunship_entity (), PTR_TYPE_INSTANCE_3D_OBJECT);

	ASSERT (inst3d);

	theta = get_rotation_angle_of_helicopter_main_rotors (inst3d);

	set_rotation_angle_of_helicopter_main_rotors (virtual_cockpit_inst3d_detail_level_normal_inst3d, theta);
	set_rotation_angle_of_helicopter_main_rotors (virtual_cockpit_inst3d_detail_level_glass_inst3d, theta);

	animate_helicopter_virtual_cockpit_main_rotors (get_gunship_entity (), virtual_cockpit_inst3d_detail_level_normal_inst3d);
	animate_helicopter_virtual_cockpit_main_rotors (get_gunship_entity (), virtual_cockpit_inst3d_detail_level_glass_inst3d);

	restore_helicopter_main_rotor_inst3d (virtual_cockpit_inst3d_detail_level_normal_inst3d);
	restore_helicopter_main_rotor_inst3d (virtual_cockpit_inst3d_detail_level_glass_inst3d);
}
Beispiel #7
0
static void deinitialise_master_caution (void)
{
	if (get_gunship_entity ())
	{
		pause_local_entity_sound_type (get_gunship_entity (), ENTITY_SUB_TYPE_EFFECT_SOUND_MCA, 0.5);
	}
}
Beispiel #8
0
static float get_canopy_doors_aiming_state (void)
{
	float
		aiming_state;

	ASSERT (get_gunship_entity ());

	ASSERT (current_flight_dynamics);

	if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_AIRBORNE_AIRCRAFT))
	{
		aiming_state = CANOPY_DOOR_STATE_CLOSED;
	}
	else
	{
		if (current_flight_dynamics->rotor_brake)
		{
			aiming_state = CANOPY_DOOR_STATE_OPEN;
		}
		else
		{
			aiming_state = CANOPY_DOOR_STATE_CLOSED;
		}
	}

	return (aiming_state);
}
Beispiel #9
0
void set_hud_bob_up_overlay (void)
{
	hud_bob_up_overlay = TRUE;

	hud_bob_up_heading = get_local_entity_float_value (get_gunship_entity (), FLOAT_TYPE_HEADING);

	get_local_entity_vec3d (get_gunship_entity (), VEC3D_TYPE_POSITION, &hud_bob_up_position);
}
Beispiel #10
0
void deinitialise_kiowa_threat_warning_system (void)
{
	if (get_gunship_entity ())
	{
		pause_local_entity_sound_type (get_gunship_entity (), ENTITY_SUB_TYPE_EFFECT_SOUND_INCOMING_MISSILE_WARNING, 0.5);

		pause_local_entity_sound_type (get_gunship_entity (), ENTITY_SUB_TYPE_EFFECT_SOUND_RADAR_LOCKED, 0.5);
	}
}
Beispiel #11
0
static void toggle_navigation_lights_event (event *ev)
{
	int
		status;

	status = get_local_entity_int_value (get_gunship_entity (), INT_TYPE_LIGHTS_ON);

	status ^= 1;

	set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_LIGHTS_ON, status);
}
Beispiel #12
0
static void select_cannon_event (event *ev)
{
	if (get_local_entity_weapon_available (get_gunship_entity (), ENTITY_SUB_TYPE_WEAPON_2A42_30MM_HE_ROUND))
	{
		set_gunship_weapon (ENTITY_SUB_TYPE_WEAPON_2A42_30MM_HE_ROUND);
	}
	else if (get_local_entity_weapon_available (get_gunship_entity (), ENTITY_SUB_TYPE_WEAPON_2A42_30MM_AP_ROUND))
	{
		set_gunship_weapon (ENTITY_SUB_TYPE_WEAPON_2A42_30MM_AP_ROUND);
	}
}
Beispiel #13
0
int award_purple_heart_medal (int side)
{
	player_log_type
		*player;

	int
		*medals,
		damage;

	ASSERT ((side >= 0) && (side <= NUM_ENTITY_SIDES));

	player = get_current_player_log ();

	medals = player->side_log[side].medals;

	// get helicopter damage

	damage = get_dynamics_damage_type (DYNAMICS_DAMAGE_MAIN_ROTOR |
													DYNAMICS_DAMAGE_TAIL_ROTOR |
													DYNAMICS_DAMAGE_LEFT_ENGINE |
													DYNAMICS_DAMAGE_RIGHT_ENGINE |
													DYNAMICS_DAMAGE_LEFT_ENGINE_FIRE |
													DYNAMICS_DAMAGE_RIGHT_ENGINE_FIRE |
													DYNAMICS_DAMAGE_LOW_HYDRAULICS |
													DYNAMICS_DAMAGE_LOW_OIL_PRESSURE |
													DYNAMICS_DAMAGE_HIGH_OIL_PRESSURE |
													DYNAMICS_DAMAGE_STABILISER);

	if ((get_gunship_entity ()) && (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_ALIVE)))
	{
		if (damage)
		{
			medals [MEDAL_PURPLE_HEART] += 1;

			#if DEBUG_MODULE

			debug_filtered_log ("Awarded Purple Heart Medal");

			#endif

			return MEDAL_PURPLE_HEART;
		}
	}

	#if DEBUG_MODULE

	debug_filtered_log ("Purple Heart Medal Not Awarded");

	#endif

	return MEDAL_TYPE_NONE;
}
Beispiel #14
0
void set_ka50_radar_jammer_manual (int state)
{
	if (!ka50_damage.radar_jammer)
	{
		if (!get_global_auto_counter_measures ())
		{
			if (state != 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, state);
			}
		}
	}
}
Beispiel #15
0
void set_ka50_infra_red_jammer_auto (int state)
{
	if (!ka50_damage.infra_red_jammer)
	{
		if (get_global_auto_counter_measures ())
		{
			if (state != 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, state);
			}
		}
	}
}
Beispiel #16
0
int overview_camera_valid (camera *raw)
{
	ASSERT (raw);

	if (get_gunship_entity ())
	{
		if (raw->external_view_entity == get_gunship_entity ())
		{
			return (TRUE);
		}
	}

	return (FALSE);
}
Beispiel #17
0
void update_vector_acceleration_dynamics (void)
{

	vec3d
		position;

	get_local_entity_vec3d (get_gunship_entity (), VEC3D_TYPE_POSITION, &position);

	current_flight_dynamics->position.x = position.x;
	current_flight_dynamics->position.y = position.y;
	current_flight_dynamics->position.z = position.z;

	// convert to world axis and
	// move the object

	current_flight_dynamics->world_velocity_x.value =
						(current_flight_dynamics->velocity_x.value * cos (current_flight_dynamics->heading.value)) +
						(current_flight_dynamics->velocity_z.value * sin (current_flight_dynamics->heading.value)) +
						(current_flight_dynamics->velocity_y.value * sin (current_flight_dynamics->pitch.value) * sin (current_flight_dynamics->heading.value));

	current_flight_dynamics->world_velocity_y.value =
						(current_flight_dynamics->velocity_y.value) +
						(current_flight_dynamics->velocity_z.value * sin (current_flight_dynamics->pitch.value)) +
						(current_flight_dynamics->velocity_x.value * sin (current_flight_dynamics->roll.value));

	current_flight_dynamics->world_velocity_z.value =
						(current_flight_dynamics->velocity_z.value * cos (current_flight_dynamics->heading.value)) +
						(current_flight_dynamics->velocity_x.value * sin (current_flight_dynamics->heading.value)) +
						(current_flight_dynamics->velocity_y.value * sin (current_flight_dynamics->pitch.value) * cos (current_flight_dynamics->heading.value));

	current_flight_dynamics->position.x += current_flight_dynamics->world_velocity_x.value * get_delta_time ();
	current_flight_dynamics->position.y += current_flight_dynamics->world_velocity_y.value * get_delta_time ();
	current_flight_dynamics->position.z += current_flight_dynamics->world_velocity_z.value * get_delta_time ();

	// maintain motion vector for outputed variables.

	current_flight_dynamics->model_motion_vector.x = current_flight_dynamics->velocity_x.value;
	current_flight_dynamics->model_motion_vector.y = current_flight_dynamics->velocity_y.value;
	current_flight_dynamics->model_motion_vector.z = current_flight_dynamics->velocity_z.value;

	current_flight_dynamics->world_motion_vector.x = current_flight_dynamics->world_velocity_x.value;
	current_flight_dynamics->world_motion_vector.y = current_flight_dynamics->world_velocity_y.value;
	current_flight_dynamics->world_motion_vector.z = current_flight_dynamics->world_velocity_z.value;

	position.x = current_flight_dynamics->position.x;
	position.y = current_flight_dynamics->position.y;
	position.z = current_flight_dynamics->position.z;

	set_local_entity_vec3d (get_gunship_entity (), VEC3D_TYPE_POSITION, &position);
}
Beispiel #18
0
void get_default_crew_viewpoint (int index, object_3d_instance   *virtual_cockpit_inst3d)
{
	viewpoint
		vp;

	float
		head_pitch_datum;

	head_pitch_datum = pilot_head_pitch_datum;

	//
	// rotate head
	//

	virtual_cockpit_inst3d->sub_objects[index].relative_heading = -pilot_head_heading;
	virtual_cockpit_inst3d->sub_objects[index].relative_pitch = head_pitch_datum - pilot_head_pitch;
	virtual_cockpit_inst3d->sub_objects[index].relative_roll = 0.0;

	//
	// get viewpoint (avoid jitter)
	//

	virtual_cockpit_inst3d->vp.x = 0.0;
	virtual_cockpit_inst3d->vp.y = 0.0;
	virtual_cockpit_inst3d->vp.z = 0.0;

	get_local_entity_attitude_matrix (get_gunship_entity (), virtual_cockpit_inst3d->vp.attitude);

	get_3d_sub_object_world_viewpoint (&virtual_cockpit_inst3d->sub_objects[index], &vp);

	get_local_entity_vec3d (get_gunship_entity (), VEC3D_TYPE_POSITION, &pilot_head_vp.position);

// x,y,z is here north south east west!
//inserting fixed values here does not work because of head movement

	pilot_head_vp.x += vp.x;
	pilot_head_vp.y += vp.y;
	pilot_head_vp.z += vp.z;

	memcpy (pilot_head_vp.attitude, vp.attitude, sizeof (matrix3x3));

	vp.x = -vp.x;
	vp.y = -vp.y;
	vp.z = -vp.z;

	multiply_transpose_matrix3x3_vec3d (&virtual_cockpit_inst3d->vp.position, pilot_head_vp.attitude, &vp.position);


}
Beispiel #19
0
void toggle_ground_stabilisation (void)
{
	if (command_line_ground_stabilisation_available)
	{
		if (eo_ground_stabilised)
		{
			eo_ground_stabilised = 0;
		}
		else
		{
			matrix3x3
				attitude;

			eo_ground_stabilised = 1;

			get_local_entity_attitude_matrix (get_gunship_entity (), attitude);

			eo_ground_stabilisation_value_heading = atan2 (attitude [2][0], attitude [2][2]);

			eo_ground_stabilisation_value_pitch = asin (attitude [2][1]);

//			eo_ground_stabilisation_value_roll = atan2 (-attitude [0][1], attitude [1][1]);
		}
	}
}
Beispiel #20
0
static void update_indicator_lamps (void)
{
	entity
		*en;

	en = get_gunship_entity ();

	blackhawk_lamps.indicator_lamp_1 = get_current_flight_dynamics_rotor_brake ();

	blackhawk_lamps.indicator_lamp_2 = get_current_flight_dynamics_overtorque ();

	blackhawk_lamps.indicator_lamp_3 = get_current_flight_dynamics_low_rotor_rpm ();

	blackhawk_lamps.indicator_lamp_4 = get_current_flight_dynamics_wheel_brake ();

	blackhawk_lamps.indicator_lamp_5 = get_current_flight_dynamics_auto_pilot ();

	blackhawk_lamps.indicator_lamp_6 = get_current_flight_dynamics_auto_hover ();

	blackhawk_lamps.indicator_lamp_7 = get_local_entity_int_value (en, INT_TYPE_RADAR_ON);

	blackhawk_lamps.indicator_lamp_8 = get_local_entity_int_value (en, INT_TYPE_RADAR_JAMMER_ON);

	blackhawk_lamps.indicator_lamp_9 = get_local_entity_int_value (en, INT_TYPE_INFRA_RED_JAMMER_ON);
}
Beispiel #21
0
void set_kiowa_weapon_damage_status (void)
{
	entity
		*en;

	entity_sub_types
		weapon_sub_type;

	en = get_gunship_entity ();

	set_client_server_entity_weapon_damage (en, KIOWA_LHS_PYLON, ENTITY_SUB_TYPE_WEAPON_NO_WEAPON, kiowa_damage.lh_pylon);
	set_client_server_entity_weapon_damage (en, KIOWA_RHS_PYLON, ENTITY_SUB_TYPE_WEAPON_NO_WEAPON, kiowa_damage.rh_pylon);
	set_client_server_entity_weapon_damage (en, KIOWA_CHAFF_DISPENSER, ENTITY_SUB_TYPE_WEAPON_CHAFF, kiowa_damage.chaff_dispenser);
	set_client_server_entity_weapon_damage (en, KIOWA_FLARE_DISPENSER, ENTITY_SUB_TYPE_WEAPON_FLARE, kiowa_damage.flare_dispenser);

	//
	// check if selected weapon is still available, if not, select next
	//

	weapon_sub_type = get_local_entity_int_value (en, INT_TYPE_SELECTED_WEAPON);

	if (weapon_sub_type != ENTITY_SUB_TYPE_WEAPON_NO_WEAPON)
	{
		if (!get_local_entity_weapon_available (en, weapon_sub_type))
		{
			weapon_sub_type = get_next_available_weapon_sub_type (en);

			set_gunship_weapon (weapon_sub_type);
		}
	}
}
Beispiel #22
0
object_3d_camera_index_numbers get_crew_camera_index (crew_roles role)
{
	object_3d_camera_index_numbers
		crew_camera_index;

	if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_EJECTED))
	{
		if (role == CREW_ROLE_PILOT)
		{
			crew_camera_index = OBJECT_3D_CAMERA_VIEW_STATIC_PILOT_EJECT;
		}
		else
		{
			crew_camera_index = OBJECT_3D_CAMERA_VIEW_STATIC_WSO_EJECT;
		}
	}
	else
	{
		if (role == CREW_ROLE_PILOT)
		{
			crew_camera_index = OBJECT_3D_CAMERA_VIEW_STATIC_PILOT;
		}
		else
		{
			crew_camera_index = OBJECT_3D_CAMERA_VIEW_STATIC_WSO;
		}
	}

	return (crew_camera_index);
}
Beispiel #23
0
int get_current_virtual_cockpit_camera (crew_roles role)
{
	int
		current_virtual_cockpit_camera;

	if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_EJECTED))
	{
		if (role == CREW_ROLE_PILOT)
		{
			ASSERT (get_number_of_3d_object_cameras (virtual_cockpit_inst3d, OBJECT_3D_CAMERA_VIEW_STATIC_PILOT_EJECT) > 0);

			current_virtual_cockpit_camera = 0;
		}
		else
		{
			ASSERT (get_number_of_3d_object_cameras (virtual_cockpit_inst3d, OBJECT_3D_CAMERA_VIEW_STATIC_WSO_EJECT) > 0);

			current_virtual_cockpit_camera = 0;
		}
	}
	else
	{
		if (role == CREW_ROLE_PILOT)
		{
			current_virtual_cockpit_camera = current_pilot_virtual_cockpit_camera;
		}
		else
		{
			current_virtual_cockpit_camera = current_co_pilot_virtual_cockpit_camera;
		}
	}

	return (current_virtual_cockpit_camera);
}
Beispiel #24
0
static void set_eo_view_params(target_acquisition_systems system, int x_min, int y_min, int x_max, int y_max, float xfov, float yfov)
{
	display_3d_light_levels
		light_level;

	display_3d_noise_levels
		noise_level;

	vec3d
		*position;

	weathermodes
		weather_mode;

	day_segment_types
		day_segment_type;

	display_3d_tints
		tint;

	position = get_local_entity_vec3d_ptr (get_gunship_entity (), VEC3D_TYPE_POSITION);

	weather_mode = get_simple_session_weather_at_point (position);
	ASSERT ((weather_mode > WEATHERMODE_INVALID) && (weather_mode < WEATHERMODE_LAST));

	day_segment_type = (day_segment_types) get_local_entity_int_value (get_session_entity (), INT_TYPE_DAY_SEGMENT_TYPE);
	ASSERT ((day_segment_type >= 0) && (day_segment_type < NUM_DAY_SEGMENT_TYPES));

	switch (system)
	{
		case TARGET_ACQUISITION_SYSTEM_FLIR:
		{
			light_level = flir_light_levels[weather_mode][day_segment_type];
			noise_level = flir_noise_levels[weather_mode][day_segment_type];
			tint = DISPLAY_3D_TINT_AMBER;

			break;
		}
		case TARGET_ACQUISITION_SYSTEM_LLLTV:
		{
			light_level = llltv_light_levels[weather_mode][day_segment_type];
			noise_level = llltv_noise_levels[weather_mode][day_segment_type];
			tint = DISPLAY_3D_TINT_AMBER_VISUAL;

			break;
		}
		default:
		{
			debug_fatal ("Invalid target acquisition system = %d", system);

			break;
		}
	}

	set_main_3d_params (tint, light_level, noise_level, x_min, y_min, x_max, y_max, xfov, yfov);
}
Beispiel #25
0
float get_ka50_missile_flight_time (void)
{
	entity
		*en,
		*weapon,
		*target;

	vec3d
		*weapon_position,
		*target_position;

	float
		flight_time,
		weapon_velocity,
		target_range;

	flight_time = 0.0;

	en = get_gunship_entity ();

	//
	// find most recently launched Vikhr with a target (first found on list)
	//

	weapon = get_local_entity_first_child (en, LIST_TYPE_LAUNCHED_WEAPON);

	while (weapon)
	{
		if (get_local_entity_int_value (weapon, INT_TYPE_ENTITY_SUB_TYPE) == ENTITY_SUB_TYPE_WEAPON_VIKHR)
		{
			target = get_local_entity_parent (weapon, LIST_TYPE_TARGET);

			if (target)
			{
				weapon_position = get_local_entity_vec3d_ptr (weapon, VEC3D_TYPE_POSITION);

				target_position = get_local_entity_vec3d_ptr (target, VEC3D_TYPE_POSITION);

				target_range = get_3d_range (weapon_position, target_position);

				weapon_velocity = get_local_entity_float_value (weapon, FLOAT_TYPE_VELOCITY);

				if (weapon_velocity > 0.0)
				{
					flight_time = target_range / weapon_velocity;

					break;
				}
			}
		}

		weapon = get_local_entity_child_succ (weapon, LIST_TYPE_LAUNCHED_WEAPON);
	}

	return (flight_time);
}
Beispiel #26
0
void inc_player_log_kills (int side, player_log_type *log, entity *victim)
{
	ASSERT (victim);

	if (victim == get_gunship_entity ())
	{
		inc_player_log_deaths (side, log);
	}
	else
	{
		if (get_local_entity_int_value (victim, INT_TYPE_SIDE) != get_global_gunship_side ())
		{
			switch (get_local_entity_type (victim))
			{
				case ENTITY_TYPE_FIXED_WING:
				case ENTITY_TYPE_HELICOPTER:
				{
					inc_player_log_air_kills (side, log);

					break;
				}
				case ENTITY_TYPE_ANTI_AIRCRAFT:
				case ENTITY_TYPE_ROUTED_VEHICLE:
				{
					inc_player_log_ground_kills (side, log);

					break;
				}
				case ENTITY_TYPE_SHIP_VEHICLE:
				{
					inc_player_log_sea_kills (side, log);

					break;
				}
				case ENTITY_TYPE_BRIDGE:
				case ENTITY_TYPE_CITY_BUILDING:
				case ENTITY_TYPE_SCENIC:
				case ENTITY_TYPE_SITE:
				case ENTITY_TYPE_SITE_UPDATABLE:
				{
					inc_player_log_fixed_kills (side, log);

					break;
				}
				default:
				{
					break;
				}
			}
		}
		else
		{
			inc_player_log_friendly_kills (side, log);
		}
	}
}
Beispiel #27
0
void toggle_viper_radar_jammer_manual (void)
{
	if (!viper_damage.radar_jammer)
	{
		if (!get_global_auto_counter_measures ())
		{
			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);
			}
			else
			{
				set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_RADAR_JAMMER_ON, TRUE);
			}
		}
	}

	play_common_cpg_radar_jammer_speech (viper_damage.radar_jammer);
}
Beispiel #28
0
void toggle_ka50_infra_red_jammer_manual (void)
{
	if (!ka50_damage.infra_red_jammer)
	{
		if (!get_global_auto_counter_measures ())
		{
			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);
			}
			else
			{
				set_client_server_entity_int_value (get_gunship_entity (), INT_TYPE_INFRA_RED_JAMMER_ON, TRUE);
			}
		}
	}

	play_common_cpg_infra_red_jammer_speech (ka50_damage.infra_red_jammer);
}
Beispiel #29
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 #30
0
static void update_master_caution (void)
{
	//
	// monitor engine damage
	//

	engine_damage_imminent_status = get_current_flight_dynamics_engine_damage_imminent ();

	if ((!previous_engine_damage_imminent_status) && engine_damage_imminent_status)
	{
		play_client_server_warning_message (get_gunship_entity (), SPEECH_SYSTEM_ENGINE_OVERTORQUE);

		activate_hokum_master_caution ();
	}

	previous_engine_damage_imminent_status = engine_damage_imminent_status;

	//
	// update master caution lamp
	//

	if (master_caution_alert)
	{
		master_caution_flash_timer -= get_delta_time ();

		if (master_caution_flash_timer <= 0.0)
		{
			master_caution_flash_timer = MASTER_CAUTION_FLASH_RATE;

			hokum_lamps.master_caution ^= 1;
		}

		master_caution_sound_timer -= get_delta_time ();

		if (master_caution_sound_timer <= 0.0)
		{
			master_caution_sound_timer = 0.0;

			pause_local_entity_sound_type (get_gunship_entity (), ENTITY_SUB_TYPE_EFFECT_SOUND_MCA, 0.5);
		}
	}
}