|
Wing Commander II
Reconstructed Win32 source (1996)
|
Ship AI bookkeeping: alerts, collisions, goals and squads. More...
#include "game.h"Go to the source code of this file.
Macros | |
| #define | LOGIC_C |
Functions | |
| void | SendKilrathiAceGreetingOnce (short obj) |
| short | signed_random (short range) |
| short | alert_flag (short ship, unsigned int bits) |
| void | set_alert (short i, unsigned int bits) |
| void | clear_alert (short i) |
| void | start_collision_alert (short obj, short other) |
| void | try2end_collision_alert (short obj) |
| short | normal_speed (short obj) |
| short | real_crash_time (short obj, short other) |
| short | crash_time (short obj, short other) |
| short | detect_collisions (short obj) |
| short | unactive (short ship) |
| short | are_alive (short obj) |
| void | trim_goals (short obj, short amount) |
| short | report_kilrathi_rout (int mode) |
| short | find_ship_index (short missionShip) |
| short | try2rout (short obj) |
| signed char | CanSetNewShipTurnGoal (short ship) |
| signed char | no_goal (short ship) |
| short | being_tailed (short obj, short other) |
| short | detect_enemy_tail (short obj) |
| short | is_ship_tailing_player_target (short obj) |
| short | FindMissileTargetingObject (short obj) |
| void | build_squad_list (short leader) |
| unsigned int | find_squad_center (FixedVector *center) |
| void | init_formation_burst (short obj) |
| void | reset_mission_type (short obj, short missionType) |
| unsigned int | change_mission_type (short obj, short missionType) |
| unsigned int | reset_objective (short ship, short objective) |
| unsigned int | alter_objective (short ship, short objective) |
| unsigned int | reset_tactic (short ship, short tactic) |
| unsigned int | alter_tactic (short ship, short tactic) |
| void | reset_maneuver (short ship, short maneuver) |
| void | try2reset_maneuver (short obj, short maneuver) |
| void | set_special (short ship, short special) |
| unsigned int | approach_zero_speed (short ship) |
| unsigned int | approach_min_speed (short obj) |
| void | approach_half_speed (short obj) |
| unsigned int | approach_cruise_speed (short ship) |
| unsigned int | approach_full_speed (short ship) |
| unsigned int | approach_ship_speed (short obj, short other) |
| void | ComputePointAheadOfObject (short obj, unsigned short distance, FixedVector *point) |
| void | ComputePointBehindObject (short obj, unsigned short distance, FixedVector *point) |
| short | close_behind (short range) |
| short | scan_for_enemy (short obj, unsigned short range) |
| short | distance_from_object (short obj, short other) |
| short | any_enemy (short obj, short range) |
| short | ships_within_range (short obj, short other, short range) |
| short | enemy_within_range (short obj, short range) |
| short | attacker_in_range (short obj, unsigned short range) |
| short | in_danger (short obj) |
| short | target_within_range (short obj) |
| short | target_valid (short obj, short target) |
| short | build_target_list (short obj, short range) |
| void | inherit_leader_mission (short obj) |
| void | inherit_leader (short obj) |
| short | dead_ship (short i) |
| short | gone_ship (short missionShip) |
| short | skill_check (short obj, short margin) |
| short | find_ships_sphere (short missionShip) |
| short | locate_ship (short missionShip, FixedVector *point) |
| void | get_follow_point (short obj, FixedVector *point) |
| unsigned int | get_first_follow_point (short obj, FixedVector *point) |
| short | hostile_sphere (short obj, short navPoint) |
| short | abandoned (short obj, short other) |
| void | engage (short obj, short target, short objective) |
| short | ShipHasTorpedo (short ship) |
| short | CanShipWeaponDamageTarget (short ship, short target) |
| short | triumph (short obj) |
| short | find_ratio (short inputMinimum, short inputMaximum, short input, short outputMinimum, short outputMaximum) |
| short | evaluate_damage (short obj) |
Variables | |
| short | g_bKilrathiAceGreetingSent = 0 |
| short | g_5_nCollisionCountdownNumber |
| signed char | g_acMissionShipStatusFlagsBytes [8] |
| short | g_bWingmanKilledThisMission |
| signed char | g_4_acInitialShipKillNumber [8] |
| short | g_nLastFoundShip |
Ship AI bookkeeping: alerts, collisions, goals and squads.
Definition in file logic.c.
| short abandoned | ( | short | obj, |
| short | other ) |
Definition at line 933 of file logic.c.
References abandoned(), distance_from_object(), explode(), FindNearestNavPoint(), g_abShipTurn, g_asShipSide, g_nCurrentNavPoint, hostile_sphere(), RandomBelowOrEqual(), and SIDE_KILRATHI.
Referenced by abandoned(), close_behind(), cruise_home(), and cruise_to_destination().
| short alert_flag | ( | short | ship, |
| unsigned int | bits ) |
Definition at line 25 of file logic.c.
References alert_flag(), and g_anShipAlertFlags.
Referenced by accelerate_and_move_object(), alert_flag(), approach_speed(), DrawTextAt(), handle_collisions(), rotate_object_to_goal(), and set_special().
| unsigned int alter_objective | ( | short | ship, |
| short | objective ) |
Definition at line 453 of file logic.c.
References alter_objective(), alter_tactic(), g_aeShipObjective, steady_object(), and TACTIC_NONE.
Referenced by alter_objective(), DrawTextAt(), and request().
| unsigned int alter_tactic | ( | short | ship, |
| short | tactic ) |
Definition at line 469 of file logic.c.
References alter_tactic(), g_asShipTactic, MANEUVER_NONE, and reset_maneuver().
Referenced by alter_objective(), alter_tactic(), DrawTextAt(), and patrol_area().
| short any_enemy | ( | short | obj, |
| short | range ) |
Definition at line 610 of file logic.c.
References any_enemy(), distance_from_object(), g_aeObjectClass, g_aeSpecialManeuver, g_asShipSide, g_nTargetRange, g_nTargetShip, OBJECT_CLASS_SHIP, and SPECIAL_MANEUVER_UNKNOWN_9.
Referenced by any_enemy(), BuildCommunicationCommandMenu(), BuildCommunicationRecipientMenu(), check_stranded(), close_behind(), disobey_formation(), HandleSpaceFlightControls(), imperial_formation(), intelligence_events(), internal_damage(), run_away(), ShouldWingmanAcceptRoutCommand(), and try2rout().
| unsigned int approach_cruise_speed | ( | short | ship | ) |
Definition at line 529 of file logic.c.
References approach_cruise_speed(), approach_speed(), g_acObjectType, and g_aObjectTypeData.
Referenced by approach_cruise_speed(), capital_ship_intelligence(), coming_home(), cruise_home(), cruise_to_destination(), destroyer_intelligence(), DrawTextAt(), goto_location(), Msit_n_fire(), Mstrafe_enemy(), Mtight_loop(), patrol_area(), rendezvous_mission(), return_to_buddy(), ship_intelligence(), and tanker_intelligence().
| unsigned int approach_full_speed | ( | short | ship | ) |
Definition at line 537 of file logic.c.
References approach_full_speed(), approach_speed(), and g_asShipMaximumVelocity.
Referenced by accelerate_and_jump(), approach_full_speed(), capital_ship_intelligence(), chase_speed(), cruise_to_destination(), DrawTextAt(), formation_burst(), goto_formation(), goto_location(), Mbuzz_debris(), Mcorkscrew(), Mfish_hook(), Mget_distance(), Mhard_turn(), Mram_missile(), Mroll_over(), Msplit_left(), Msplit_right(), Mturn_n_kick(), Mveer_away(), Mzip_past(), patrol_area(), prevent_collision(), rendezvous_mission(), run_away(), ShipAiState45(), ShipAiState46(), streak_toward(), and tanker_intelligence().
| void approach_half_speed | ( | short | obj | ) |
Definition at line 520 of file logic.c.
References approach_half_speed(), approach_speed(), g_acObjectType, and g_aObjectTypeData.
Referenced by approach_half_speed(), cruise_to_destination(), defend_mission(), destroyer_intelligence(), DrawTextAt(), and goto_location().
| unsigned int approach_min_speed | ( | short | obj | ) |
Definition at line 514 of file logic.c.
References approach_min_speed(), and approach_speed().
Referenced by approach_min_speed(), DrawTextAt(), and goto_formation().
| unsigned int approach_ship_speed | ( | short | obj, |
| short | other ) |
Definition at line 544 of file logic.c.
References approach_ship_speed(), approach_speed(), and g_anShipSpeed.
Referenced by approach_ship_speed(), coming_home(), DrawTextAt(), escort_buddy(), goto_formation(), and imperial_formation().
| unsigned int approach_zero_speed | ( | short | ship | ) |
Definition at line 508 of file logic.c.
References approach_speed(), and approach_zero_speed().
Referenced by accelerate_and_move_object(), approach_zero_speed(), capital_ship_strike_mission(), chase_speed(), DrawTextAt(), Msit_n_fire(), Mstrafe_enemy(), prevent_collision(), and UpdateSavedTorpedoTargetLock().
| short are_alive | ( | short | obj | ) |
Definition at line 194 of file logic.c.
References are_alive(), g_aeShipObjective, SHIP_OBJECTIVE_NOT_ALIVE, and unactive().
Referenced by are_alive(), and DrawTextAt().
| short attacker_in_range | ( | short | obj, |
| unsigned short | range ) |
Definition at line 664 of file logic.c.
References attacker_in_range(), distance_from_object(), g_acShipTarget, g_aeObjectClass, g_aeSpecialManeuver, g_asShipSide, g_nTargetRange, g_nTargetShip, OBJECT_CLASS_SHIP, and SPECIAL_MANEUVER_UNKNOWN_9.
Referenced by attacker_in_range(), close_behind(), imperial_formation(), rendezvous_mission(), select_target(), and tanker_intelligence().
| short being_tailed | ( | short | obj, |
| short | other ) |
Definition at line 321 of file logic.c.
References being_tailed(), g_nFacingToTarget, g_nTargetFacing, g_nTargetRange, and get_facing_range_from_object().
Referenced by being_tailed(), detect_enemy_tail(), DrawTextAt(), and is_ship_tailing_player_target().
| void build_squad_list | ( | short | leader | ) |
Definition at line 370 of file logic.c.
References build_squad_list(), g_acShipList, and g_asShipWingLeader.
Referenced by build_squad_list(), DrawTextAt(), and init_formation_burst().
| short build_target_list | ( | short | obj, |
| short | range ) |
Definition at line 728 of file logic.c.
References build_target_list(), distance_from_object(), g_acShipList, g_acShipTarget, g_aeObjectClass, g_aeSpecialManeuver, g_asObjectType, g_asShipListRange, g_asShipSide, OBJECT_CLASS_MISSILE, OBJECT_CLASS_SHIP, and SPECIAL_MANEUVER_UNKNOWN_9.
Referenced by build_target_list(), close_behind(), and fire_turrets().
| signed char CanSetNewShipTurnGoal | ( | short | ship | ) |
Definition at line 303 of file logic.c.
References CanSetNewShipTurnGoal(), g_anPitchGoal, g_anRollGoal, g_anYawGoal, and GetAdaptiveTurnRate().
Referenced by CanSetNewShipTurnGoal(), chase_location(), cruise_home(), cruise_to_destination(), defend_mission(), DrawTextAt(), escort_buddy(), formation_break(), formation_burst(), goto_formation(), goto_location(), Mbuzz_debris(), Mget_distance(), Mline_up_drop(), Mram_missile(), Msit_n_fire(), Mtail_fire(), Mtarget_missile(), Mwabble(), Mzip_past(), orbit_sphere(), patrol_area(), prepare_for_jump(), prevent_collision(), rendezvous_mission(), return_to_buddy(), streak_toward(), and tanker_intelligence().
| unsigned int change_mission_type | ( | short | obj, |
| short | missionType ) |
Definition at line 436 of file logic.c.
References change_mission_type(), g_aeShipObjective, g_asShipMissionType, OBJECTIVE_ENGAGE_ENEMY, and reset_mission_type().
Referenced by change_mission_type(), defend_mission(), DrawTextAt(), escort_mission(), kilrathi_wingman(), rendezvous_mission(), and strike_mission().
| void clear_alert | ( | short | i | ) |
Definition at line 37 of file logic.c.
References clear_alert(), g_acShipAlertSource, g_anShipAlertFlags, and g_asShipAlertCountdown.
Referenced by clear_alert(), DrawTextAt(), init_intelligence_data(), prevent_collision(), remove_object(), and try2end_collision_alert().
| short close_behind | ( | short | range | ) |
Definition at line 568 of file logic.c.
References close_behind(), g_nTargetFacing, and g_nTargetRange.
| void ComputePointAheadOfObject | ( | short | obj, |
| unsigned short | distance, | ||
| FixedVector * | point ) |
Definition at line 550 of file logic.c.
References AddFixedVectors(), ComputePointAheadOfObject(), g_aShipForwardVector, g_aShipPosition, and ScaleFixedVector().
Referenced by ComputePointAheadOfObject(), and DrawTextAt().
| void ComputePointBehindObject | ( | short | obj, |
| unsigned short | distance, | ||
| FixedVector * | point ) |
Definition at line 559 of file logic.c.
References AddFixedVectors(), ComputePointBehindObject(), g_aShipForwardVector, g_aShipPosition, and ScaleFixedVector().
Referenced by ComputePointBehindObject(), and DrawTextAt().
| short crash_time | ( | short | obj, |
| short | other ) |
Definition at line 132 of file logic.c.
References crash_time(), g_aeObjectClass, g_asObjectScreenX, OBJECT_CLASS_ASTEROID, and real_crash_time().
Referenced by crash_time(), detect_collisions(), and DrawTextAt().
| short dead_ship | ( | short | i | ) |
Definition at line 792 of file logic.c.
References dead_ship(), g_aMissionShips, and MissionShipRecord::state.
Referenced by close_behind(), dead_ship(), locate_ship(), and triumph().
| short detect_collisions | ( | short | obj | ) |
Definition at line 143 of file logic.c.
References crash_time(), detect_collisions(), g_5_nCollisionCountdownNumber, g_aeObjectClass, g_pActiveHazardField, OBJECT_CLASS_ASTEROID, OBJECT_CLASS_MISSILE, and OBJECT_CLASS_NULL.
Referenced by detect_collisions(), DrawTextAt(), and handle_collisions().
| short detect_enemy_tail | ( | short | obj | ) |
Definition at line 330 of file logic.c.
References being_tailed(), detect_enemy_tail(), g_acShipTarget, g_aeObjectClass, g_aeSpecialManeuver, g_asShipSide, OBJECT_CLASS_SHIP, and SPECIAL_MANEUVER_UNKNOWN_9.
Referenced by check_engage_target(), detect_enemy_tail(), disobey_formation(), DrawTextAt(), and gametrack().
| short enemy_within_range | ( | short | obj, |
| short | range ) |
Definition at line 635 of file logic.c.
References distance_from_object(), enemy_within_range(), g_aeObjectClass, g_aeSpecialManeuver, g_asShipSide, OBJECT_CLASS_SHIP, and SPECIAL_MANEUVER_UNKNOWN_9.
Referenced by enemy_within_range().
| void engage | ( | short | obj, |
| short | target, | ||
| short | objective ) |
Definition at line 952 of file logic.c.
References engage(), g_acShipTarget, g_aeShipObjective, g_asPilotLevel, g_asShipSide, reset_objective(), SendKilrathiAceGreetingOnce(), and SIDE_KILRATHI.
Referenced by approach_and_engage(), close_behind(), defend_mission(), engage(), escort_mission(), formation_break(), formation_burst(), imperial_formation(), kilrathi_wingman(), rendezvous_mission(), and request().
| short evaluate_damage | ( | short | obj | ) |
Definition at line 1027 of file logic.c.
References ObjectTypeData::armorFront, ObjectTypeData::armorLeft, ObjectTypeData::armorRear, ObjectTypeData::armorRight, ObjectTypeData::damageCapacity, evaluate_damage(), g_aasShipArmor, g_acObjectType, g_acShipDamage, g_aeObjectClass, g_aObjectTypeData, and OBJECT_CLASS_SHIP.
Referenced by approach_and_engage(), check_destroy_target(), close_behind(), evaluate_damage(), handle_stress(), intelligence_events(), and reset_stress().
| short find_ratio | ( | short | inputMinimum, |
| short | inputMaximum, | ||
| short | input, | ||
| short | outputMinimum, | ||
| short | outputMaximum ) |
Definition at line 1013 of file logic.c.
References find_ratio().
Referenced by close_behind(), explosion_shock_wave(), find_ratio(), rear_sphere(), reset_stress(), and try_far_spot().
| short find_ship_index | ( | short | missionShip | ) |
Definition at line 251 of file logic.c.
References find_ship_index(), g_aeObjectClass, g_aeSpecialManeuver, g_asShipMissionIndex, g_nLastFoundShip, OBJECT_CLASS_FUTURION, OBJECT_CLASS_SHIP, and SPECIAL_MANEUVER_UNKNOWN_9.
Referenced by capital_ship_strike_mission(), check_destroy_target(), cleanup_objectives(), coming_home(), defend_mission(), DrawTextAt(), escort_mission(), Explosion(), find_ship_index(), flag_reached(), get_follow_point(), hidden_objective(), init_ship(), locate_ship(), rendezvous_mission(), set_formation_position(), Set_up_ship_info(), SetScale(), and strike_mission().
| short find_ships_sphere | ( | short | missionShip | ) |
Definition at line 816 of file logic.c.
References find_ships_sphere(), g_aMissionNavPoints, MISSION_NAV_POINT_COUNT, MissionNavPoint::missionShips, and MissionNavPoint::type.
Referenced by close_behind(), find_ships_sphere(), FollowSelectedObjectiveSystem(), IsMissionObjectiveOutOfSystem(), IsObjectiveInDisplayedSystem(), locate_ship(), prepare_mission(), and RefreshObjectiveShipNavPoints().
| unsigned int find_squad_center | ( | FixedVector * | center | ) |
Definition at line 387 of file logic.c.
References AddFixedVectors(), divide_vector(), find_squad_center(), g_acShipList, g_aShipPosition, and zero_vector().
Referenced by DrawTextAt(), find_squad_center(), and init_formation_burst().
| short FindMissileTargetingObject | ( | short | obj | ) |
Definition at line 357 of file logic.c.
References FindMissileTargetingObject(), g_acShipTarget, g_aeObjectClass, and OBJECT_CLASS_MISSILE.
Referenced by DrawTextAt(), FindMissileTargetingObject(), gametrack(), intelligence_events(), Mkill_missile(), and update_missile_warning().
| unsigned int get_first_follow_point | ( | short | obj, |
| FixedVector * | point ) |
Definition at line 907 of file logic.c.
References g_abShipNavPointIndex, g_asShipSide, g_cCurrentNavPointIndex, get_first_follow_point(), get_follow_point(), and SIDE_IMPERIAL.
Referenced by close_behind(), coming_home(), get_first_follow_point(), reach_warp(), and strike_mission().
| void get_follow_point | ( | short | obj, |
| FixedVector * | point ) |
Definition at line 872 of file logic.c.
References find_ship_index(), g_abFlightPath, g_abShipNavPointIndex, g_aMissionNavPoints, g_aMissionObjectives, g_aShipPosition, g_asShipMissionParameter, g_asShipSide, get_follow_point(), MISSION_OBJECTIVE_COUNT, MissionNavPoint::position, MissionObjective::position, and SIDE_KILRATHI.
Referenced by close_behind(), cruise_home(), cruise_to_destination(), get_first_follow_point(), and get_follow_point().
| short gone_ship | ( | short | missionShip | ) |
Definition at line 798 of file logic.c.
References g_aMissionShips, gone_ship(), and MissionShipRecord::state.
Referenced by check_destroy_target(), check_goal(), close_behind(), and gone_ship().
| short hostile_sphere | ( | short | obj, |
| short | navPoint ) |
Definition at line 916 of file logic.c.
References g_aMissionNavPoints, g_aMissionShips, g_asShipSide, hostile_sphere(), and MissionNavPoint::missionShips.
Referenced by abandoned(), close_behind(), and hostile_sphere().
| short in_danger | ( | short | obj | ) |
Definition at line 688 of file logic.c.
References distance_from_object(), g_acShipTarget, g_aeObjectClass, g_aeSpecialManeuver, g_asShipSide, g_nTargetRange, g_nTargetShip, in_danger(), OBJECT_CLASS_SHIP, and SPECIAL_MANEUVER_UNKNOWN_9.
Referenced by close_behind(), defend_mission(), escort_mission(), and in_danger().
| void inherit_leader | ( | short | obj | ) |
Definition at line 775 of file logic.c.
References g_aeObjectClass, g_asShipWingLeader, inherit_leader(), inherit_leader_mission(), and OBJECT_CLASS_SHIP.
Referenced by close_behind(), inherit_leader(), and kilrathi_wingman().
| void inherit_leader_mission | ( | short | obj | ) |
Definition at line 758 of file logic.c.
References g_aeObjectClass, g_aShipMissionSpot, g_asShipMissionParameter, g_asShipMissionType, g_asShipWingLeader, inherit_leader_mission(), and OBJECT_CLASS_SHIP.
Referenced by close_behind(), inherit_leader(), inherit_leader_mission(), and ship_intelligence().
| void init_formation_burst | ( | short | obj | ) |
Definition at line 403 of file logic.c.
References AddFixedVectors(), build_squad_list(), ComputeVectorDelta(), find_squad_center(), g_acShipList, g_aShipDestination, g_aShipPosition, init_formation_burst(), OBJECTIVE_BREAK_FORMATION, reset_objective(), ScaleFixedVector(), and steady_object().
Referenced by approach_and_engage(), DrawTextAt(), init_formation_burst(), and patrol_area().
| short is_ship_tailing_player_target | ( | short | obj | ) |
Definition at line 347 of file logic.c.
References being_tailed(), g_acShipTarget, is_ship_tailing_player_target(), and unactive().
Referenced by DrawTextAt(), gametrack(), and is_ship_tailing_player_target().
| short locate_ship | ( | short | missionShip, |
| FixedVector * | point ) |
Definition at line 848 of file logic.c.
References AddFixedVectors(), dead_ship(), find_ship_index(), find_ships_sphere(), g_aMissionNavPoints, g_aMissionShips, g_aShipPosition, locate_ship(), and zero_vector().
Referenced by close_behind(), init_intelligence_data(), locate_ship(), LocateMobileObjective(), and strike_mission().
| signed char no_goal | ( | short | ship | ) |
Definition at line 313 of file logic.c.
References g_anPitchGoal, g_anRollGoal, g_anYawGoal, and no_goal().
Referenced by DrawTextAt(), general_zig(), Mburnout(), Mcorkscrew(), Mfish_hook(), Mhard_turn(), Msit_n_spin(), Msplit_left(), Msplit_right(), Mtarget_missile(), Mtight_loop(), Mturn_n_kick(), Mturn_n_spin(), Mveer_away(), no_goal(), and ShipAiState46().
| short normal_speed | ( | short | obj | ) |
Definition at line 68 of file logic.c.
References g_aeSpecialManeuver, g_asShipMaximumVelocity, normal_speed(), real_velocity(), and SPECIAL_MANEUVER_AFTERBURNER.
Referenced by cruise_home(), DrawTextAt(), goto_formation(), house_keep_objects(), Mfish_hook(), Mget_distance(), Mveer_away(), normal_speed(), prevent_collision(), run_away(), and streak_toward().
| short real_crash_time | ( | short | obj, |
| short | other ) |
Definition at line 76 of file logic.c.
References AddFixedVectors(), ComputeVectorDelta(), DivideFixed(), FixedToShortSaturating(), g_aShipPosition, g_aShipVelocity, g_asObjectCollisionRadius, MaxShort(), real_crash_time(), ScaleFixedVector(), and Vector_magnitude().
Referenced by crash_time(), DrawTextAt(), and real_crash_time().
| short report_kilrathi_rout | ( | int | mode | ) |
Definition at line 214 of file logic.c.
References distance_from_object(), g_aeObjectClass, g_aeShipObjective, g_aeSpecialManeuver, g_asShipMissionType, g_asShipSide, g_nCurrentWave, MISSION_TYPE_ROUT, OBJECT_CLASS_SHIP, OBJECTIVE_DESTROY_SHIP, OBJECTIVE_ENGAGE_ENEMY, ProcessEnemyWaveCompletion(), report_kilrathi_rout(), SIDE_KILRATHI, and SPECIAL_MANEUVER_UNKNOWN_9.
Referenced by auto_pilot_sequence(), disobey_formation(), DrawTextAt(), gametrack(), new_space_music_changes(), report_kilrathi_rout(), and reset_mission_type().
| void reset_maneuver | ( | short | ship, |
| short | maneuver ) |
Definition at line 476 of file logic.c.
References g_acShipSequence, g_asShipCount, g_asShipManeuver, and reset_maneuver().
Referenced by alter_tactic(), DrawTextAt(), house_keep_objects(), maneuver_complete(), Mkill_missile(), Msit_n_spin(), process_maneuver_node(), reset_maneuver(), reset_tactic(), ResolveObjectDestruction(), and try2reset_maneuver().
| void reset_mission_type | ( | short | obj, |
| short | missionType ) |
Definition at line 426 of file logic.c.
References g_asShipMissionType, g_asShipSide, MISSION_TYPE_ROUT, OBJECTIVE_NONE, report_kilrathi_rout(), reset_mission_type(), reset_objective(), and SIDE_KILRATHI.
Referenced by arrive_from_warp(), change_mission_type(), check_goal(), DrawTextAt(), rendezvous_mission(), reset_mission_type(), Set_up_ship_info(), and try2rout().
| unsigned int reset_objective | ( | short | ship, |
| short | objective ) |
Definition at line 445 of file logic.c.
References g_aeShipObjective, reset_objective(), reset_tactic(), steady_object(), and TACTIC_NONE.
Referenced by clean_up_cockpit(), defend_mission(), DrawTextAt(), engage(), escort_mission(), fail(), imperial_wingman(), init_formation_burst(), intelligence_events(), kilrathi_wingman(), rendezvous_mission(), request(), reset_mission_type(), reset_objective(), return_to_buddy(), return_to_master(), and strike_mission().
| unsigned int reset_tactic | ( | short | ship, |
| short | tactic ) |
Definition at line 461 of file logic.c.
References g_acShipTarget, g_asShipTactic, MANEUVER_NONE, reset_maneuver(), and reset_tactic().
Referenced by capital_ship_intelligence(), coming_home(), cruise_home(), cruise_to_destination(), DrawTextAt(), patrol_area(), prepare_for_jump(), reach_warp(), reset_objective(), reset_tactic(), strike_mission(), and warp_arrival().
| short scan_for_enemy | ( | short | obj, |
| unsigned short | range ) |
Definition at line 576 of file logic.c.
References distance_from_object(), distance_from_point(), g_aeObjectClass, g_aeSpecialManeuver, g_aShipPosition, g_asShipSide, g_nTargetRange, g_nTargetShip, get_facing_range_from_object(), OBJECT_CLASS_SHIP, scan_for_enemy(), SPECIAL_MANEUVER_UNKNOWN_9, and target_valid().
Referenced by approach_and_engage(), capital_ship_intelligence(), close_behind(), cruise_to_destination(), defend_mission(), scan_and_lock(), scan_for_enemy(), and select_target().
| void SendKilrathiAceGreetingOnce | ( | short | obj | ) |
Definition at line 10 of file logic.c.
References g_bKilrathiAceGreetingSent, send_message(), and SendKilrathiAceGreetingOnce().
Referenced by DrawTextAt(), engage(), and SendKilrathiAceGreetingOnce().
| void set_alert | ( | short | i, |
| unsigned int | bits ) |
Definition at line 31 of file logic.c.
References g_anShipAlertFlags, and set_alert().
Referenced by DrawTextAt(), set_alert(), start_collision_alert(), and try2end_collision_alert().
| void set_special | ( | short | ship, |
| short | special ) |
Definition at line 493 of file logic.c.
References alert_flag(), g_aeSpecialManeuver, set_special(), SPECIAL_MANEUVER_BLOWING_UP, SPECIAL_MANEUVER_LOST_CONTROL, and SPECIAL_MANEUVER_NONE.
Referenced by accelerate_and_move_object(), BeginShipDestructionSequence(), check_for_lost_control(), cruise_home(), cruise_to_destination(), DrawTextAt(), Explosion(), fire_afterburner(), fire_super_brake(), maneuver_complete(), Mgloat(), Mhard_break(), Msit_n_spin(), Mturn_n_spin(), pilot_hit(), prepare_for_jump(), rotate_object_to_goal(), set_special(), and start_collision_alert().
| short ships_within_range | ( | short | obj, |
| short | other, | ||
| short | range ) |
Definition at line 654 of file logic.c.
References ComputeVectorDelta(), g_aShipPosition, IsVectorWithinRange(), and ships_within_range().
Referenced by close_behind(), ships_within_range(), and target_within_range().
| short signed_random | ( | short | range | ) |
Definition at line 19 of file logic.c.
References RandomBelowOrEqual(), and signed_random().
Referenced by DrawTextAt(), generate_stars(), make_shard(), Mwabble(), prepare_for_jump(), signed_random(), tanker_intelligence(), try_far_spot(), and update_star_field().
| short skill_check | ( | short | obj, |
| short | margin ) |
Definition at line 807 of file logic.c.
References g_asPilotLevel, RandomBelowOrEqual(), and skill_check().
Referenced by check_for_lost_control(), close_behind(), pilot_hit(), rotate_object_to_goal(), and skill_check().
| void start_collision_alert | ( | short | obj, |
| short | other ) |
Definition at line 45 of file logic.c.
References g_acShipAlertSource, g_asShipAfterburnerTimer, g_asShipAlertCountdown, set_alert(), set_special(), SPECIAL_MANEUVER_NONE, start_collision_alert(), and steady_object().
Referenced by DrawTextAt(), handle_collisions(), and start_collision_alert().
| short target_valid | ( | short | obj, |
| short | target ) |
Definition at line 968 of file logic.c.
References CanShipWeaponDamageTarget(), g_anShipCloakState, g_asShipCloakElapsedFrames, g_asShipSide, ShipHasTorpedo(), target_valid(), and unactive().
Referenced by check_destroy_target(), check_engage_target(), close_behind(), scan_for_enemy(), target_valid(), and target_within_range().
| short target_within_range | ( | short | obj | ) |
Definition at line 712 of file logic.c.
References g_acShipTarget, ships_within_range(), target_valid(), target_within_range(), and unactive().
Referenced by close_behind(), and target_within_range().
| void trim_goals | ( | short | obj, |
| short | amount ) |
Definition at line 201 of file logic.c.
References g_anPitchGoal, g_anYawGoal, and trim_goals().
Referenced by chase_location(), DrawTextAt(), goto_formation(), orbit_sphere(), patrol_area(), trim_goals(), and UpdateTargetCameraObject().
| short triumph | ( | short | obj | ) |
Definition at line 983 of file logic.c.
References dead_ship(), g_abFlightPath, g_asShipMissionParameter, g_asShipMissionType, MISSION_TYPE_DEFEND, MISSION_TYPE_ESCORT, MISSION_TYPE_PATROL, MISSION_TYPE_STRIKE, MISSION_TYPE_WINGMAN, triumph(), and visited().
Referenced by changetrack(), close_behind(), ShouldWingmanAcceptRoutCommand(), and triumph().
| void try2end_collision_alert | ( | short | obj | ) |
Definition at line 58 of file logic.c.
References clear_alert(), g_asShipAlertCountdown, set_alert(), and try2end_collision_alert().
Referenced by DrawTextAt(), prevent_collision(), and try2end_collision_alert().
| void try2reset_maneuver | ( | short | obj, |
| short | maneuver ) |
Definition at line 484 of file logic.c.
References g_asShipManeuver, reset_maneuver(), steady_object(), and try2reset_maneuver().
Referenced by DrawTextAt(), and try2reset_maneuver().
| short try2rout | ( | short | obj | ) |
Definition at line 272 of file logic.c.
References any_enemy(), g_acMissionShipStatusFlagsBytes, g_acShipStress, g_aeObjectClass, g_aeSpecialManeuver, g_asShipSide, g_nYourWingman, maneuver_complete(), MISSION_TYPE_ROUT, OBJECT_CLASS_CAPITAL_SHIP, reset_mission_type(), send_message(), SPECIAL_MANEUVER_UNKNOWN_9, and try2rout().
Referenced by DrawTextAt(), Mrout_me(), request(), and try2rout().
| short unactive | ( | short | ship | ) |
Definition at line 186 of file logic.c.
References g_aeObjectClass, g_asShipManeuver, MANEUVER_HARD_BRAKE, OBJECT_CLASS_SHIP, and unactive().
Referenced by are_alive(), capital_ship_intelligence(), capital_ship_strike_mission(), DrawTextAt(), escort_mission(), have_target(), intelligence_events(), is_ship_tailing_player_target(), kilrathi_wingman(), Mtry2tail(), Mzip_past(), patrol_area(), perform_maneuver(), rendezvous_mission(), run_away(), SaveTorpedoTargetLockForViewChange(), ShipAiState45(), target_valid(), target_within_range(), unactive(), and UpdateSavedTorpedoTargetLock().
| signed char g_4_acInitialShipKillNumber[8] |
Definition at line 1056 of file logic.c.
Referenced by analyze_kill(), prepare_mission(), process_maneuver_node(), and StoreMissionResultsInCampaignGlobals().
| short g_5_nCollisionCountdownNumber |
Definition at line 1053 of file logic.c.
Referenced by detect_collisions(), and prevent_collision().
| signed char g_acMissionShipStatusFlagsBytes[8] |
Definition at line 1054 of file logic.c.
Referenced by Explosion(), RunSpaceFlight(), SpawnMissionEjectionPod(), StoreMissionResultsInCampaignGlobals(), and try2rout().
| short g_bKilrathiAceGreetingSent = 0 |
Definition at line 1049 of file logic.c.
Referenced by SendKilrathiAceGreetingOnce(), and Set_up_ship_info().
| short g_bWingmanKilledThisMission |
Definition at line 1055 of file logic.c.
Referenced by prepare_mission().
| short g_nLastFoundShip |
Definition at line 1057 of file logic.c.
Referenced by find_ship_index().