|
Wing Commander
Reconstructed Win32 source (1996)
|
NPC pilot intelligence (the original BRAINS.C). More...
Go to the source code of this file.
Variables | |
| short | nEnemySighting = 0x7fff |
| struct Shape * | pScrambleDetailShape |
| short | nScrambleCockpitAngle |
| ShortPoint | stScrambleCockpitDetail |
| short | nFuneralCasketPositionX |
| short | nFuneralCasketPosY |
NPC pilot intelligence (the original BRAINS.C).
Address range 409760-40b66f. The surviving WINGLEADER module and the Mac brain symbol run both cover cruise_home through FF_missile_intelligence.
Definition in file brains.c.
| void accelerate_and_jump | ( | short | obj | ) |
Definition at line 528 of file brains.c.
References accelerate_and_jump(), approach_full_speed(), asShipTotal, and warp().
Referenced by accelerate_and_jump(), and reach_warp().
Definition at line 203 of file brains.c.
References allow_engage(), bEngageAllowed, and nAutoEngageTimer.
Referenced by allow_engage(), request(), and try2allow_engage().
| void approach_and_engage | ( | short | obj, |
| short | goal ) |
Definition at line 649 of file brains.c.
References acShipTargetTable, aeObjectClass, aiPilotLevel, approach_and_engage(), distance_from_object(), engage(), evaluate_damage(), init_formation_burst(), MaxShort(), MinShort(), nTgtRange, OBJECT_CLASS_FUTURION, OBJECTIVE_DESTROY_SHIP, scan_for_enemy(), and streak_toward().
Referenced by approach_and_engage(), and strike_mission().
| void capital_ship_intelligence | ( | short | obj | ) |
Definition at line 916 of file brains.c.
References acShipTargetTable, aeObjectTypeList, aeShipMissionType, aeShipTacticArray, approach_cruise_speed(), approach_full_speed(), capital_ship_intelligence(), coming_home(), destroyer_intelligence(), fire_turrets(), MISSION_TYPE_COME_HOME, MISSION_TYPE_GOTO_WARP, MISSION_TYPE_NONE, MISSION_TYPE_ROUT, MISSION_TYPE_WARP_ARRIVE, nTargetShip, OBJECT_TYPE_DORKIR, OBJECT_TYPE_FRALTHI, OBJECT_TYPE_KILRATHI_BASE, OBJECT_TYPE_LUMBARI, OBJECT_TYPE_RALARI, OBJECT_TYPE_SIVAR, OBJECT_TYPE_SNAKEIR, OBJECT_TYPE_SPIKERI, reach_warp(), regulate_turn(), reset_tactic(), run_away(), scan_for_enemy(), select_target(), stationary_intelligence(), TACTIC_NONE, TACTIC_SELF_DEFENSE, tanker_intelligence(), unactive(), and warp_arrival().
Referenced by capital_ship_intelligence(), and object_intelligence().
| unsigned int change_mission_type | ( | short | obj, |
| enum ShipMissionType | missionType ) |
| short check_destroy_target | ( | short | obj | ) |
Definition at line 147 of file brains.c.
References acShipTargetTable, aeObjectClass, aeShipSide, aiPilotLevel, anShipMissionShips, check_destroy_target(), check_engage_target(), evaluate_damage(), find_ship_index(), gone_ship(), MaxShort(), MinShort(), OBJECT_CLASS_FUTURION, RandomBelow(), and target_valid().
Referenced by check_destroy_target(), imperial_wingman(), and strike_mission().
| short check_engage_target | ( | short | obj | ) |
Definition at line 135 of file brains.c.
References acShipTargetTable, check_engage_target(), detect_enemy_tail(), select_target(), and target_valid().
Referenced by check_destroy_target(), check_engage_target(), defend_mission(), escort_mission(), imperial_wingman(), kilrathi_patrol(), kilrathi_wingman(), and rendezvous_mission().
| void check_goal | ( | short | obj | ) |
Definition at line 625 of file brains.c.
References anShipMissionShips, check_goal(), gone_ship(), MISSION_TYPE_PATROL, MISSION_TYPE_ROUT, and reset_mission_type().
Referenced by check_goal(), and strike_mission().
| void coming_home | ( | short | obj | ) |
Definition at line 75 of file brains.c.
References aeShipMissionType, aeShipSide, aeShipTacticArray, aMissionObjectivesArray, aShipDestinationsArray, coming_home(), cruise_home(), fail(), find_objective(), find_ship_index(), get_first_follow_point(), MissionHeaderDisk::homeMissionShip, MISSION_TYPE_ROUT, no_goal(), point_parallel(), MissionObjective::position, reset_tactic(), SIDE_IMPERIAL, stCurrentMissionHeader, TACTIC_CRUISE, TACTIC_HEAD_HOME, and TACTIC_NONE.
Referenced by capital_ship_intelligence(), coming_home(), run_away(), and ship_intelligence().
| void cruise_home | ( | short | obj | ) |
Definition at line 30 of file brains.c.
References abandoned(), abFlightPathList, abShipNavPtIdx, abShipTurnList, aeObjectClass, aMissionObjectivesArray, approach_cruise_speed(), aShipDestinationsArray, aShipMissionSpotArray, aShipVelocity, cruise_home(), distance_from_object(), distance_from_point(), equ_vector(), fire_afterburner(), flag_objective(), get_follow_point(), no_goal(), normal_speed(), nYourWingman, OBJECT_CLASS_CAPITAL_SHIP, point_ship_at_point(), remove_object(), reset_tactic(), set_special(), SPECIAL_MANEUVER_KILL_ENGINES, TACTIC_HEAD_HOME, and zero_vector().
Referenced by coming_home(), and cruise_home().
| void cruise_to_destination | ( | short | obj | ) |
Definition at line 470 of file brains.c.
References abandoned(), abFlightPathList, abShipNavPtIdx, abShipTurnList, acShipTargetTable, aeShipSide, approach_cruise_speed(), approach_full_speed(), approach_half_speed(), aShipDestinationsArray, aShipMissionSpotArray, cruise_to_destination(), distance_from_point(), equ_vector(), flag_reached(), get_facing_range_from_object(), get_follow_point(), nFacingToTargetValue, no_goal(), point_ship_at_point(), reset_tactic(), scan_for_enemy(), set_special(), SIDE_IMPERIAL, SPECIAL_MANEUVER_KILL_ENGINES, and TACTIC_SIT_STILL.
Referenced by cruise_to_destination(), and reach_warp().
| void defend_mission | ( | short | obj | ) |
Definition at line 720 of file brains.c.
References abShipTurnList, acShipTargetTable, aeShipObjectiveList, anShipMissionShips, approach_half_speed(), change_mission_type(), check_engage_target(), defend_mission(), distance_from_object(), engage(), fail(), find_ship_index(), in_danger(), maneuvering(), MISSION_TYPE_PATROL, no_goal(), nTargetShip, nTgtRange, OBJECTIVE_ENGAGE_ENEMY, OBJECTIVE_HOME_BASE, OBJECTIVE_NONE, OBJECTIVE_WANDER, point_perpendicular(), reset_objective(), return_to_master(), and scan_for_enemy().
Referenced by defend_mission(), and ship_intelligence().
| void destroyer_intelligence | ( | short | obj | ) |
Definition at line 895 of file brains.c.
References acShipTargetTable, approach_cruise_speed(), approach_half_speed(), destroyer_intelligence(), fire_turrets(), and orbit_sphere().
Referenced by capital_ship_intelligence(), and destroyer_intelligence().
Definition at line 197 of file brains.c.
References bEngageAllowed, and disallow_engage().
Referenced by disallow_engage(), and request().
| short dist_from_home | ( | short | obj | ) |
Definition at line 374 of file brains.c.
References aShipMissionSpotArray, dist_from_home(), and distance_from_point().
Referenced by dist_from_home(), and patrol_area().
| void escort_buddy | ( | short | obj, |
| short | buddy ) |
Definition at line 580 of file brains.c.
References approach_ship_speed(), escort_buddy(), no_goal(), and point_parallel().
Referenced by escort_buddy(), and escort_mission().
| void escort_mission | ( | short | obj | ) |
Definition at line 588 of file brains.c.
References abShipTurnList, aeShipObjectiveList, anShipMissionShips, change_mission_type(), check_engage_target(), distance_from_object(), engage(), escort_buddy(), escort_mission(), fail(), find_ship_index(), in_danger(), maneuvering(), MISSION_TYPE_PATROL, nTargetShip, nTgtRange, OBJECTIVE_ENGAGE_ENEMY, OBJECTIVE_HOME_BASE, OBJECTIVE_NONE, OBJECTIVE_WANDER, reset_objective(), return_to_buddy(), and unactive().
Referenced by escort_mission(), and ship_intelligence().
| void fail | ( | short | obj | ) |
Definition at line 69 of file brains.c.
References fail(), OBJECTIVE_NONE, and reset_objective().
Referenced by coming_home(), defend_mission(), escort_mission(), fail(), imperial_wingman(), kilrathi_patrol(), kilrathi_wingman(), patrol_area(), reach_warp(), ship_intelligence(), and strike_mission().
| void FF_missile_intelligence | ( | short | obj | ) |
Definition at line 1064 of file brains.c.
References acObjOwnersTable, acShipCommunicatorArray, acShipTargetTable, acViableTargetList, aeObjectClass, aeShipSide, aeShipTacticArray, anShipSpeed, asViableTgtDistList, cViableTargetCount, distance_from_object(), FF_missile_intelligence(), get_ship_max_velocity(), nTgtRange, OBJECT_CLASS_SHIP, point_ship(), sort_viable_target_list(), TACTIC_RAM, and vToTgt.
Referenced by FF_missile_intelligence(), and object_intelligence().
| void formation_break | ( | short | obj | ) |
Definition at line 277 of file brains.c.
References acShipSequence, acShipTargetTable, anPitchGoal, anRollGoal, anYawTarget, engage(), formation_break(), no_goal(), OBJECTIVE_ENGAGE_ENEMY, and steady_object().
Referenced by formation_break(), and imperial_wingman().
| void formation_burst | ( | short | obj | ) |
Definition at line 180 of file brains.c.
References acShipTargetTable, aeShipMissionType, approach_full_speed(), aShipDestinationsArray, asShipTotal, engage(), formation_burst(), MISSION_TYPE_STRIKE, no_goal(), OBJECTIVE_DESTROY_SHIP, OBJECTIVE_ENGAGE_ENEMY, and point_ship().
Referenced by formation_burst(), kilrathi_patrol(), kilrathi_wingman(), and strike_mission().
| void futurion_intelligence | ( | short | obj | ) |
Definition at line 979 of file brains.c.
References aeObjectClass, asActionCounts, asObjectCounterArray, futurion_intelligence(), nFacingToTargetValue, nTgtRange, and ship_vs_ship().
Referenced by futurion_intelligence(), object_intelligence(), and update_objects_in_space().
| void heat_seeking_missile_intelligence | ( | short | obj | ) |
Definition at line 1018 of file brains.c.
References abShipExhaustHeatList, acShipTargetTable, acViableTargetList, aeObjectClass, anShipSpeed, asViableTgtDistList, cViableTargetCount, explode(), get_facing_range_from_object(), get_ship_max_velocity(), heat_seeking_missile_intelligence(), nFacingToTargetValue, nTargetFacingValue, nTgtRange, OBJECT_CLASS_CAPITAL_SHIP, OBJECT_CLASS_SHIP, point_ship(), sort_viable_target_list(), and vToTgt.
Referenced by heat_seeking_missile_intelligence(), and object_intelligence().
| void imperial_formation | ( | short | obj | ) |
Definition at line 230 of file brains.c.
References aeSpecialManeuvers, aiPilotLevel, any_enemy(), approach_ship_speed(), aShipPositionsArray, asShipWingLeaderArray, attacker_in_range(), bEngageAllowed, distance_from_object(), engage(), facing_to_object(), fire_afterburner(), imperial_formation(), maintain_formation(), message_showing(), nAutoEngageTimer, nCameraViewMode, nCurrentWave, nEnemySighting, nTargetShip, nYourWingman, OBJECTIVE_ENGAGE_ENEMY, point_ship_at_object(), real_velocity(), send_message(), SPECIAL_MANEUVER_NONE, and try2allow_engage().
Referenced by imperial_formation(), and imperial_wingman().
| void imperial_wingleader | ( | short | obj | ) |
Definition at line 464 of file brains.c.
References imperial_wingleader(), and kilrathi_patrol().
Referenced by imperial_wingleader(), and ship_intelligence().
| void imperial_wingman | ( | short | obj | ) |
Definition at line 299 of file brains.c.
References aeShipObjectiveList, check_destroy_target(), check_engage_target(), fail(), formation_break(), imperial_formation(), imperial_wingman(), maneuvering(), OBJECTIVE_BREAK_FORMATION, OBJECTIVE_DESTROY_SHIP, OBJECTIVE_ENGAGE_ENEMY, OBJECTIVE_HOLD_FORMATION, OBJECTIVE_NONE, and reset_objective().
Referenced by imperial_wingman(), and wingman_mission().
| void kilrathi_patrol | ( | short | obj | ) |
Definition at line 440 of file brains.c.
References aeShipObjectiveList, aeShipTacticArray, check_engage_target(), fail(), formation_burst(), kilrathi_patrol(), maneuvering(), OBJECTIVE_BREAK_FORMATION, OBJECTIVE_ENGAGE_ENEMY, OBJECTIVE_HOLD_FORMATION, OBJECTIVE_NONE, OBJECTIVE_WANDER, patrol_area(), and TACTIC_APPROACH_TARGET.
Referenced by imperial_wingleader(), kilrathi_patrol(), and ship_intelligence().
| void kilrathi_wingman | ( | short | obj | ) |
Definition at line 324 of file brains.c.
References acShipTargetTable, aeShipObjectiveList, asShipWingLeaderArray, change_mission_type(), check_engage_target(), engage(), fail(), formation_burst(), inherit_leader(), kilrathi_wingman(), maintain_formation(), maneuvering(), MISSION_TYPE_PATROL, OBJECTIVE_BREAK_FORMATION, OBJECTIVE_DESTROY_SHIP, OBJECTIVE_ENGAGE_ENEMY, OBJECTIVE_HOLD_FORMATION, OBJECTIVE_NONE, reset_objective(), and unactive().
Referenced by kilrathi_wingman(), and wingman_mission().
| void maneuvering | ( | short | obj, |
| short | newTarget ) |
Definition at line 172 of file brains.c.
References acShipTargetTable, intelligence_events(), maneuvering(), and perform_maneuver().
Referenced by defend_mission(), escort_mission(), imperial_wingman(), kilrathi_patrol(), kilrathi_wingman(), maneuvering(), rendezvous_mission(), and strike_mission().
| void mine_intelligence | ( | short | obj | ) |
Definition at line 992 of file brains.c.
References aeObjectClass, aeObjectTypeList, aObjectTypeData, asObjectCounterArray, distance_from_object(), explode(), mine_intelligence(), OBJECT_CLASS_SHIP, and RandomBelowOrEqual().
Referenced by mine_intelligence(), and object_intelligence().
| void orbit_sphere | ( | short | obj | ) |
Definition at line 855 of file brains.c.
References aMissionNavPoints, distance_from_point(), nCurrentNavigationPoint, no_goal(), orbit_sphere(), point_perpendicular_to_point(), point_ship_at_point(), MissionNavPoint::position, MissionNavPoint::proximityRadius, and trim_goals().
Referenced by destroyer_intelligence(), orbit_sphere(), and tanker_intelligence().
| void patrol_area | ( | short | obj | ) |
Definition at line 391 of file brains.c.
References acShipTargetTable, aeShipTacticArray, alter_tactic(), approach_cruise_speed(), approach_full_speed(), aShipMissionSpotArray, dist_from_home(), fail(), init_formation_burst(), no_goal(), nTgtRange, patrol_area(), point_ship_at_object(), point_ship_at_point(), reset_tactic(), scan_and_lock(), ship_vs_point(), ship_vs_ship(), TACTIC_APPROACH_TARGET, TACTIC_HEAD_HOME, TACTIC_LOOK_OUT, TACTIC_NONE, trim_goals(), and unactive().
Referenced by kilrathi_patrol(), and patrol_area().
| void prepare_for_jump | ( | short | obj | ) |
Definition at line 509 of file brains.c.
References aeShipSide, anShipSpeed, anYawTarget, asShipTotal, fire_afterburner(), get_facing_range_from_object(), nFacingToTargetValue, no_goal(), nTargetFacingValue, nTgtRange, prepare_for_jump(), reset_tactic(), set_special(), SIDE_KILRATHI, signed_random(), SPECIAL_MANEUVER_STOP_DRIFT, and TACTIC_WARP_OUT.
Referenced by prepare_for_jump(), and reach_warp().
| void reach_warp | ( | short | obj | ) |
Definition at line 536 of file brains.c.
References accelerate_and_jump(), aeShipTacticArray, aShipDestinationsArray, cruise_to_destination(), fail(), get_first_follow_point(), prepare_for_jump(), reach_warp(), reset_tactic(), TACTIC_CRUISE, TACTIC_NONE, TACTIC_SIT_STILL, and TACTIC_WARP_OUT.
Referenced by capital_ship_intelligence(), reach_warp(), and ship_intelligence().
| void rendezvous_mission | ( | short | obj | ) |
Definition at line 767 of file brains.c.
References aeShipObjectiveList, anShipMissionShips, approach_cruise_speed(), approach_full_speed(), attacker_in_range(), change_mission_type(), check_engage_target(), distance_from_object(), engage(), find_ship_index(), maneuvering(), MISSION_TYPE_DEFEND, MISSION_TYPE_PATROL, no_goal(), nTargetShip, OBJECTIVE_ENGAGE_ENEMY, OBJECTIVE_REACH_SHIP, point_ship_at_object(), rendezvous_mission(), reset_mission_type(), reset_objective(), and unactive().
Referenced by rendezvous_mission(), and ship_intelligence().
| void return_to_buddy | ( | short | obj, |
| short | buddy ) |
Definition at line 568 of file brains.c.
References approach_cruise_speed(), distance_from_object(), no_goal(), OBJECTIVE_WANDER, point_parallel(), point_ship_at_object(), reset_objective(), and return_to_buddy().
Referenced by escort_mission(), and return_to_buddy().
| void return_to_master | ( | short | obj, |
| short | master ) |
Definition at line 708 of file brains.c.
References distance_from_object(), OBJECTIVE_WANDER, point_perpendicular(), reset_objective(), return_to_master(), and streak_toward().
Referenced by defend_mission(), and return_to_master().
| void run_away | ( | short | obj | ) |
Definition at line 105 of file brains.c.
References aeShipMissionType, aeShipSide, any_enemy(), approach_full_speed(), asShipWingLeaderArray, coming_home(), distance_from_object(), fire_afterburner(), maintain_formation(), MISSION_TYPE_ROUT, normal_speed(), point_ship(), RandomBelow(), remove_object(), run_away(), SIDE_IMPERIAL, unactive(), FixedVector::y, and zero_vector().
Referenced by capital_ship_intelligence(), run_away(), and ship_intelligence().
| short scan_and_lock | ( | short | obj, |
| int | scanRange, | ||
| enum ShipTactic | newTactic ) |
Definition at line 382 of file brains.c.
References acShipTargetTable, aeShipTacticArray, scan_and_lock(), and scan_for_enemy().
Referenced by patrol_area(), and scan_and_lock().
| void ship_intelligence | ( | short | obj | ) |
Definition at line 801 of file brains.c.
References acShipAiCooldowns, aeShipMissionType, aeShipSide, coming_home(), defend_mission(), escort_mission(), fail(), imperial_wingleader(), inherit_leader_mission(), kilrathi_patrol(), MISSION_TYPE_COME_HOME, MISSION_TYPE_DEFEND, MISSION_TYPE_ESCORT, MISSION_TYPE_GOTO_WARP, MISSION_TYPE_NONE, MISSION_TYPE_PATROL, MISSION_TYPE_RENDEZVOUS, MISSION_TYPE_ROUT, MISSION_TYPE_STRIKE, MISSION_TYPE_WARP_ARRIVE, MISSION_TYPE_WINGMAN, reach_warp(), regulate_turn(), rendezvous_mission(), run_away(), ship_intelligence(), strike_mission(), warp_arrival(), and wingman_mission().
Referenced by object_intelligence(), and ship_intelligence().
| void stationary_intelligence | ( | short | obj | ) |
Definition at line 907 of file brains.c.
References aeObjectTypeList, anObjectYawRotation, fire_turrets(), OBJECT_TYPE_KILRATHI_BASE, and stationary_intelligence().
Referenced by capital_ship_intelligence(), and stationary_intelligence().
| void streak_toward | ( | short | obj, |
| short | goal, | ||
| short | range ) |
Definition at line 634 of file brains.c.
References approach_full_speed(), fire_afterburner(), no_goal(), normal_speed(), point_ship_at_object(), RandomBelow(), streak_toward(), and veer_random().
Referenced by approach_and_engage(), return_to_master(), and streak_toward().
| void strike_mission | ( | short | obj | ) |
Definition at line 677 of file brains.c.
References aeObjectClass, aeShipObjectiveList, anShipMissionShips, approach_and_engage(), check_destroy_target(), check_goal(), fail(), find_ship_index(), formation_burst(), maneuvering(), OBJECT_CLASS_FUTURION, OBJECTIVE_BREAK_FORMATION, OBJECTIVE_DESTROY_SHIP, OBJECTIVE_ENGAGE_ENEMY, OBJECTIVE_HOLD_FORMATION, OBJECTIVE_HOME_BASE, OBJECTIVE_NONE, reset_objective(), and strike_mission().
Referenced by ship_intelligence(), and strike_mission().
| void tanker_intelligence | ( | short | obj | ) |
Definition at line 873 of file brains.c.
References acShipTargetTable, anRollGoal, anYawTarget, approach_cruise_speed(), approach_full_speed(), attacker_in_range(), fire(), no_goal(), nTargetShip, orbit_sphere(), point_capital_ship_at_object(), RandomBelowOrEqual(), signed_random(), and tanker_intelligence().
Referenced by capital_ship_intelligence(), and tanker_intelligence().
| void try2allow_engage | ( | int | pilotLevel | ) |
Definition at line 210 of file brains.c.
References allow_engage(), nAutoEngageTimer, RandomBelowOrEqual(), and try2allow_engage().
Referenced by imperial_formation(), and try2allow_engage().
| void warp_arrival | ( | short | obj | ) |
Definition at line 559 of file brains.c.
References aeShipTacticArray, arrive_from_warp(), reset_tactic(), TACTIC_WARP_IN, and warp_arrival().
Referenced by capital_ship_intelligence(), ship_intelligence(), and warp_arrival().
| void wingman_mission | ( | short | obj | ) |
Definition at line 364 of file brains.c.
References aeShipSide, imperial_wingman(), kilrathi_wingman(), SIDE_IMPERIAL, and wingman_mission().
Referenced by ship_intelligence(), and wingman_mission().
| short nEnemySighting = 0x7fff |
Definition at line 20 of file brains.c.
Referenced by imperial_formation(), and set_up_action_sphere().
| short nFuneralCasketPositionX |
Definition at line 26 of file brains.c.
Referenced by funeral_player(), and funeral_sequence().
| short nFuneralCasketPosY |
Definition at line 27 of file brains.c.
Referenced by funeral_player(), and funeral_sequence().
| short nScrambleCockpitAngle |
Definition at line 24 of file brains.c.
Referenced by DrawScrambleFrame(), landing(), and scramble().
| struct Shape* pScrambleDetailShape |
Definition at line 23 of file brains.c.
Referenced by DrawScrambleFrame(), and landing().
| ShortPoint stScrambleCockpitDetail |
Definition at line 25 of file brains.c.
Referenced by DrawScrambleFrame(), landing(), and scramble().