|
Wing Commander II
Reconstructed Win32 source (1996)
|
Flight maneuvers. More...
#include "game.h"Go to the source code of this file.
Macros | |
| #define | FL_C |
| #define | MANEUVER_REROLL_CHANCE(m) |
| #define | COLLISION_RADIUS_OF(obj) |
Functions | |
| void | HandleUnsupportedManeuver (short maneuver, short ship, short target) |
| void | BeginShipCloak (short ship) |
| void | ResetShipCloakState (short ship) |
| void | chase_speed (short obj, short range) |
| void | SetShipAiScratchWord (unsigned short v) |
| void | maneuver_complete (short ship) |
| void | Mline_up_drop (short ship, short target) |
| void | Mwabble (short ship) |
| void | advance (short ship) |
| void | ShipAiState35 (short ship, short target) |
| void | Mfull_ahead (short ship, short target) |
| void | Mchill (short ship, short target) |
| void | Mdrop_a_mine (short ship, short target) |
| void | Mthink (short ship, short target) |
| void | Mtight_loop (short ship) |
| void | Mhard_break (short ship) |
| void | Msit_n_spin (short ship, short target) |
| void | Mturn_n_spin (short ship, short target) |
| void | Mburnout (short ship, short target) |
| void | Mkickit (short ship) |
| void | Mturn_n_kick (short ship) |
| void | Mroll_over (short ship) |
| void | Mhard_turn (short ship) |
| void | Mfish_hook (short ship, short target) |
| void | Mtry2tail (short ship, short target) |
| void | Msplit_left (short ship) |
| void | Msplit_right (short ship) |
| void | Mgloat (short ship) |
| void | Mtail_fire (short ship, short target) |
| void | Mzip_past (short ship, short target) |
| void | ShipAiState47 (short ship, short target) |
| void | ShipAiState28 (short ship, short target) |
| void | ShipAiState46 (short ship) |
| void | Mram_missile (short ship, short target) |
| void | Mbuzz_debris (short ship) |
| void | Mstrafe_enemy (short ship, short target) |
| void | Mbest_strafe (short ship, short target) |
| void | Mtarget_missile (short ship, short target) |
| void | Msit_n_fire (short ship, short target) |
| void | Mstrafe_n_roll (short ship, short target) |
| void | Mkill_missile (short ship, short target) |
| void | Msuicide_run (short ship, short target) |
| void | Mget_distance (short ship, short target) |
| void | general_zig (short ship, unsigned int target, short pitch) |
| void | Mzig_zag (short ship, unsigned int target) |
| void | Mzig_zag_pitch (short ship, unsigned int target) |
| void | Mcorkscrew (short ship) |
| void | Mveer_away (short ship, short target) |
| void | ShipAiState44 (short ship) |
| void | Mtarget_laser (short ship, short target) |
| void | Mrout_me (short ship) |
| void | ShipAiState3 (short ship, short target) |
| void | ShipAiState45 (short ship, short target) |
| void | Mnone (void) |
| void | Mreset (short ship) |
| void | perform_maneuver (short obj) |
Variables | |
| unsigned char | g_abManeuverRerollChance [50] |
| void(* | g_apManeuverHandlers [50])(short, short) |
Flight maneuvers.
Definition in file fl.c.
| #define COLLISION_RADIUS_OF | ( | obj | ) |
Definition at line 81 of file fl.c.
Referenced by perform_maneuver().
| #define MANEUVER_REROLL_CHANCE | ( | m | ) |
| void advance | ( | short | ship | ) |
Definition at line 181 of file fl.c.
References advance(), g_acShipSequence, g_asShipManeuver, and MANEUVER_NONE.
Referenced by advance(), auto_pilot_sequence(), DrawWrappedCinematicText(), general_zig(), Mburnout(), Mbuzz_debris(), Mcorkscrew(), Mfish_hook(), Mgloat(), Mhard_break(), Mhard_turn(), Mkickit(), Mroll_over(), Msit_n_spin(), Msplit_left(), Msplit_right(), Mtarget_missile(), Mtight_loop(), Mturn_n_kick(), Mturn_n_spin(), Mveer_away(), and ShipAiState46().
| void BeginShipCloak | ( | short | ship | ) |
Definition at line 92 of file fl.c.
References BeginShipCloak(), g_anShipCloakState, g_asObjectScreenX, g_asShipCloakElapsedFrames, g_nCannedSceneMode, PlaySfxWaveFileByNumber(), and recalc_max_velocity().
Referenced by BeginShipCloak(), RestoreCannedSceneObjectState(), and ShipAiState47().
| void chase_speed | ( | short | obj, |
| short | range ) |
Definition at line 112 of file fl.c.
References approach_full_speed(), approach_speed(), approach_zero_speed(), chase_speed(), fire_afterburner(), g_acShipTarget, g_anShipSpeed, and g_nTargetRange.
Referenced by chase_speed(), intelligence_events(), and Mtail_fire().
| void general_zig | ( | short | ship, |
| unsigned int | target, | ||
| short | pitch ) |
Definition at line 849 of file fl.c.
References advance(), fire_afterburner(), g_acShipSequence, g_aeSpecialManeuver, g_anPitchGoal, g_anYawGoal, g_asShipCount, general_zig(), maneuver_complete(), no_goal(), SPECIAL_MANEUVER_NONE, and void().
Referenced by general_zig(), Mzig_zag(), and Mzig_zag_pitch().
| void HandleUnsupportedManeuver | ( | short | maneuver, |
| short | ship, | ||
| short | target ) |
Definition at line 84 of file fl.c.
References g_nOriginDevUnlock, HandleUnsupportedManeuver(), and Mzip_past().
Referenced by HandleUnsupportedManeuver(), Mchill(), Mdrop_a_mine(), Mfull_ahead(), Mtarget_laser(), Mthink(), ShipAiState28(), ShipAiState3(), and ShipAiState35().
| void maneuver_complete | ( | short | ship | ) |
Definition at line 134 of file fl.c.
References maneuver_complete(), MANEUVER_NONE, reset_maneuver(), set_special(), and SPECIAL_MANEUVER_NONE.
Referenced by general_zig(), maneuver_complete(), Mburnout(), Mbuzz_debris(), Mcorkscrew(), Mfish_hook(), Mget_distance(), Mgloat(), Mhard_break(), Mhard_turn(), Mkickit(), Mkill_missile(), Mline_up_drop(), Mram_missile(), Mreset(), Mroll_over(), Msplit_left(), Msplit_right(), Mstrafe_enemy(), Mtarget_missile(), Mtight_loop(), Mtry2tail(), Mturn_n_kick(), Mturn_n_spin(), Mveer_away(), Mwabble(), Mzip_past(), perform_maneuver(), ShipAiState44(), ShipAiState45(), ShipAiState46(), ShipAiState47(), and try2rout().
| void Mbest_strafe | ( | short | ship, |
| short | target ) |
Definition at line 743 of file fl.c.
References g_nTargetFacing, Mbest_strafe(), Mstrafe_enemy(), and Mzip_past().
Referenced by Mbest_strafe().
| void Mburnout | ( | short | ship, |
| short | target ) |
Definition at line 375 of file fl.c.
References advance(), fire_afterburner(), g_acShipSequence, g_anYawGoal, maneuver_complete(), Mburnout(), no_goal(), RandomBelowOrEqual(), and void().
Referenced by Mburnout(), and Mkill_missile().
| void Mbuzz_debris | ( | short | ship | ) |
Definition at line 699 of file fl.c.
References advance(), approach_full_speed(), CanSetNewShipTurnGoal(), fire_afterburner(), g_acShipSequence, g_aeSpecialManeuver, g_nFacingToTarget, maneuver_complete(), Mbuzz_debris(), SPECIAL_MANEUVER_NONE, and veer_random().
Referenced by Mbuzz_debris().
| void Mchill | ( | short | ship, |
| short | target ) |
Definition at line 202 of file fl.c.
References HandleUnsupportedManeuver(), and Mchill().
Referenced by Mchill().
| void Mcorkscrew | ( | short | ship | ) |
Definition at line 898 of file fl.c.
References advance(), approach_full_speed(), g_acShipSequence, g_anRollGoal, g_anYawGoal, g_asShipCount, maneuver_complete(), Mcorkscrew(), and no_goal().
Referenced by Mcorkscrew().
| void Mdrop_a_mine | ( | short | ship, |
| short | target ) |
Definition at line 209 of file fl.c.
References HandleUnsupportedManeuver(), and Mdrop_a_mine().
Referenced by Mdrop_a_mine().
| void Mfish_hook | ( | short | ship, |
| short | target ) |
Definition at line 477 of file fl.c.
References advance(), approach_full_speed(), ObjectTypeData::cruiseVelocity, fire_afterburner(), fire_super_brake(), g_acObjectType, g_acShipSequence, g_anYawGoal, g_aObjectTypeData, maneuver_complete(), Mfish_hook(), no_goal(), normal_speed(), RandomBelowOrEqual(), real_velocity(), and void().
Referenced by Mfish_hook(), and Mkill_missile().
| void Mfull_ahead | ( | short | ship, |
| short | target ) |
Definition at line 195 of file fl.c.
References HandleUnsupportedManeuver(), and Mfull_ahead().
Referenced by Mfull_ahead().
| void Mget_distance | ( | short | ship, |
| short | target ) |
Definition at line 833 of file fl.c.
References approach_full_speed(), CanSetNewShipTurnGoal(), fire_afterburner(), g_nFacingToTarget, g_nTargetRange, maneuver_complete(), Mget_distance(), MinShort(), normal_speed(), and steer_away_from_object().
Referenced by Mget_distance().
| void Mgloat | ( | short | ship | ) |
Definition at line 580 of file fl.c.
References advance(), g_acShipSequence, g_anPitchGoal, g_asShipCount, maneuver_complete(), Mgloat(), RandomBelow(), set_special(), and SPECIAL_MANEUVER_KILL_ENGINES.
Referenced by Mgloat(), and perform_maneuver().
| void Mhard_break | ( | short | ship | ) |
Definition at line 250 of file fl.c.
References advance(), fire_super_brake(), g_acShipSequence, g_asShipCount, maneuver_complete(), Mhard_break(), set_special(), and SPECIAL_MANEUVER_KILL_ENGINES.
Referenced by Mhard_break().
| void Mhard_turn | ( | short | ship | ) |
Definition at line 461 of file fl.c.
References advance(), approach_full_speed(), g_acShipSequence, g_anYawGoal, maneuver_complete(), Mhard_turn(), no_goal(), and RandomBelowOrEqual().
Referenced by Mhard_turn().
| void Mkickit | ( | short | ship | ) |
Definition at line 397 of file fl.c.
References advance(), fire_afterburner(), g_acShipSequence, g_aeSpecialManeuver, maneuver_complete(), Mkickit(), and SPECIAL_MANEUVER_NONE.
Referenced by Mkickit().
| void Mkill_missile | ( | short | ship, |
| short | target ) |
Definition at line 803 of file fl.c.
References FindMissileTargetingObject(), fire(), g_acShipTarget, g_nFacingToTarget, g_nTargetRange, g_nTargetShip, get_facing_range_from_object(), MANEUVER_BURNOUT, maneuver_complete(), MANEUVER_FISH_HOOK, Mburnout(), Mfish_hook(), Mkill_missile(), point_ship_at_object(), and reset_maneuver().
Referenced by Mkill_missile().
| void Mline_up_drop | ( | short | ship, |
| short | target ) |
Definition at line 141 of file fl.c.
References CanSetNewShipTurnGoal(), g_aeSpecialManeuver, g_anRollGoal, g_aShipPosition, maneuver_complete(), Mline_up_drop(), point_ship_at_point(), and SPECIAL_MANEUVER_NORMAL.
Referenced by Mline_up_drop(), and perform_maneuver().
| void Mram_missile | ( | short | ship, |
| short | target ) |
Definition at line 686 of file fl.c.
References approach_full_speed(), CanSetNewShipTurnGoal(), fire_missile(), g_nFacingToTarget, g_nTargetRange, maneuver_complete(), Mram_missile(), and point_ship_at_object().
Referenced by Mram_missile().
| void Mreset | ( | short | ship | ) |
Definition at line 1008 of file fl.c.
References maneuver_complete(), and Mreset().
Referenced by Mreset().
| void Mroll_over | ( | short | ship | ) |
Definition at line 447 of file fl.c.
References advance(), approach_full_speed(), g_acShipSequence, g_anRollGoal, maneuver_complete(), Mroll_over(), and RandomBelowOrEqual().
Referenced by Mroll_over().
| void Mrout_me | ( | short | ship | ) |
Definition at line 973 of file fl.c.
References Mrout_me(), and try2rout().
Referenced by Mrout_me().
| void Msit_n_fire | ( | short | ship, |
| short | target ) |
Definition at line 781 of file fl.c.
References approach_cruise_speed(), approach_zero_speed(), CanSetNewShipTurnGoal(), fire(), g_nTargetRange, Msit_n_fire(), and point_ship_at_object().
Referenced by Msit_n_fire().
| void Msit_n_spin | ( | short | ship, |
| short | target ) |
Definition at line 279 of file fl.c.
References AddFixedVectors(), advance(), approach_speed(), fire(), g_acShipSequence, g_anShipSpeed, g_aShipForwardVector, g_aShipPosition, g_asShipCount, g_nFacingToTarget, g_nTargetRange, MANEUVER_ROLL_OVER, Msit_n_spin(), no_goal(), point_ship_at_object(), point_ship_at_point(), reset_maneuver(), ScaleFixedVector(), set_special(), SPECIAL_MANEUVER_KILL_ENGINES, SPECIAL_MANEUVER_NONE, steady_object(), and veer_random().
Referenced by Msit_n_spin().
| void Msplit_left | ( | short | ship | ) |
Definition at line 538 of file fl.c.
References advance(), approach_full_speed(), fire_afterburner(), g_acShipSequence, g_aeSpecialManeuver, g_anYawGoal, maneuver_complete(), Msplit_left(), no_goal(), and SPECIAL_MANEUVER_NONE.
Referenced by Msplit_left().
| void Msplit_right | ( | short | ship | ) |
Definition at line 559 of file fl.c.
References advance(), approach_full_speed(), fire_afterburner(), g_acShipSequence, g_aeSpecialManeuver, g_anYawGoal, maneuver_complete(), Msplit_right(), no_goal(), and SPECIAL_MANEUVER_NONE.
Referenced by Msplit_right().
| void Mstrafe_enemy | ( | short | ship, |
| short | target ) |
Definition at line 725 of file fl.c.
References approach_cruise_speed(), approach_zero_speed(), fire(), fire_afterburner(), g_aeObjectClass, g_asObjectType, g_asShipMissionType, g_nTargetRange, maneuver_complete(), Mstrafe_enemy(), and point_ship_at_object().
Referenced by Mbest_strafe(), Mstrafe_enemy(), Mstrafe_n_roll(), and Mtarget_missile().
| void Mstrafe_n_roll | ( | short | ship, |
| short | target ) |
Definition at line 793 of file fl.c.
References g_anRollGoal, g_asObjectCounter, Mstrafe_enemy(), and Mstrafe_n_roll().
Referenced by Mstrafe_n_roll().
| void Msuicide_run | ( | short | ship, |
| short | target ) |
Definition at line 826 of file fl.c.
References fire_afterburner(), Msuicide_run(), and point_ship_at_object().
Referenced by Msuicide_run().
| void Mtail_fire | ( | short | ship, |
| short | target ) |
Definition at line 605 of file fl.c.
References CanSetNewShipTurnGoal(), chase_speed(), fire(), g_asObjectCollisionRadius, Mtail_fire(), and point_ship_at_object().
Referenced by Mtail_fire(), and Mzip_past().
| void Mtarget_laser | ( | short | ship, |
| short | target ) |
Definition at line 967 of file fl.c.
References HandleUnsupportedManeuver(), and Mtarget_laser().
Referenced by Mtarget_laser().
| void Mtarget_missile | ( | short | ship, |
| short | target ) |
Definition at line 753 of file fl.c.
References advance(), CanSetNewShipTurnGoal(), fire_afterburner(), g_acShipSequence, g_aeSpecialManeuver, maneuver_complete(), Mstrafe_enemy(), Mtarget_missile(), no_goal(), and point_ship_at_object().
Referenced by Mtarget_missile().
| void Mthink | ( | short | ship, |
| short | target ) |
Definition at line 216 of file fl.c.
References HandleUnsupportedManeuver(), and Mthink().
Referenced by Mthink().
| void Mtight_loop | ( | short | ship | ) |
Definition at line 223 of file fl.c.
References advance(), approach_cruise_speed(), g_acShipSequence, g_anPitchGoal, maneuver_complete(), Mtight_loop(), and no_goal().
Referenced by Mtight_loop().
| void Mtry2tail | ( | short | ship, |
| short | target ) |
Definition at line 518 of file fl.c.
References fire_afterburner(), g_aeSpecialManeuver, g_aShipPosition, g_aShipRightVector, g_asObjectCollisionRadius, g_nTargetRange, maneuver_complete(), Mtry2tail(), point_ship_at_point(), position_relative(), SPECIAL_MANEUVER_NONE, and unactive().
Referenced by Mtry2tail().
| void Mturn_n_kick | ( | short | ship | ) |
Definition at line 412 of file fl.c.
References advance(), approach_full_speed(), fire_afterburner(), g_acShipSequence, g_acShipTarget, g_aeObjectClass, g_aeSpecialManeuver, maneuver_complete(), Mturn_n_kick(), no_goal(), OBJECT_CLASS_MISSILE, point_perpendicular(), SPECIAL_MANEUVER_NONE, and veer_random().
Referenced by Mturn_n_kick().
| void Mturn_n_spin | ( | short | ship, |
| short | target ) |
Definition at line 343 of file fl.c.
References advance(), g_acShipSequence, g_asShipCount, g_nTargetFacing, maneuver_complete(), Mturn_n_spin(), no_goal(), point_ship_at_object(), set_special(), SPECIAL_MANEUVER_KILL_ENGINES, and veer_random().
Referenced by Mturn_n_spin().
| void Mveer_away | ( | short | ship, |
| short | target ) |
Definition at line 924 of file fl.c.
References advance(), approach_full_speed(), fire_afterburner(), g_acShipSequence, g_asObjectCollisionRadius, g_nFacingToTarget, g_nShipAiScratchValue, g_nTargetRange, maneuver_complete(), Mveer_away(), no_goal(), normal_speed(), RandomBelowOrEqual(), steer_away_from_object(), and veer_random().
Referenced by Mveer_away(), and perform_maneuver().
| void Mwabble | ( | short | ship | ) |
Definition at line 157 of file fl.c.
References CanSetNewShipTurnGoal(), fire_afterburner(), g_anPitchGoal, g_anRollGoal, g_anYawGoal, g_asShipCount, maneuver_complete(), Mwabble(), RandomBelowOrEqual(), and signed_random().
Referenced by Mwabble().
| void Mzig_zag | ( | short | ship, |
| unsigned int | target ) |
Definition at line 886 of file fl.c.
References general_zig(), and Mzig_zag().
Referenced by Mzig_zag().
| void Mzig_zag_pitch | ( | short | ship, |
| unsigned int | target ) |
Definition at line 892 of file fl.c.
References general_zig(), and Mzig_zag_pitch().
Referenced by Mzig_zag_pitch().
| void Mzip_past | ( | short | ship, |
| short | target ) |
Definition at line 616 of file fl.c.
References approach_full_speed(), CanSetNewShipTurnGoal(), close_behind(), fire_afterburner(), g_asObjectCollisionRadius, g_nFacingToTarget, g_nTargetFacing, g_nTargetRange, maneuver_complete(), Mtail_fire(), Mzip_past(), point_ship_behind_object(), point_ship_below_object(), and unactive().
Referenced by HandleUnsupportedManeuver(), Mbest_strafe(), Mzip_past(), and ShipAiState47().
| void perform_maneuver | ( | short | obj | ) |
Definition at line 1014 of file fl.c.
References COLLISION_RADIUS_OF, find_weapon(), fire_weapon(), g_acShipTarget, g_apManeuverHandlers, g_asIntelligenceEvent, g_asObjectCollisionRadius, g_asShipIntelSlot, g_asShipManeuver, g_bAiMissileFiringEnabled, g_bCurrentManeuverReroll, g_nOriginDevUnlock, g_nTargetFacing, g_nTargetRange, maneuver_complete(), MANEUVER_GLOAT, MANEUVER_HANDLER_COUNT, MANEUVER_LINE_UP_DROP, MANEUVER_REROLL_CHANCE, MANEUVER_VEER_AWAY, Mgloat(), Mline_up_drop(), Mveer_away(), OBJECT_DATA_CHAFF_POD, perform_maneuver(), RandomBelowOrEqual(), SetShipAiScratchWord(), unactive(), and void().
Referenced by maneuvering(), and perform_maneuver().
| void ResetShipCloakState | ( | short | ship | ) |
Definition at line 105 of file fl.c.
References g_anShipCloakState, g_asShipCloakCooldown, and ResetShipCloakState().
Referenced by fire(), ResetShipCloakState(), and RestoreCannedSceneObjectState().
| void SetShipAiScratchWord | ( | unsigned short | v | ) |
Definition at line 128 of file fl.c.
References g_nShipAiScratchValue, and SetShipAiScratchWord().
Referenced by perform_maneuver(), and SetShipAiScratchWord().
| void ShipAiState28 | ( | short | ship, |
| short | target ) |
Definition at line 655 of file fl.c.
References HandleUnsupportedManeuver(), and ShipAiState28().
Referenced by ShipAiState28().
| void ShipAiState3 | ( | short | ship, |
| short | target ) |
Definition at line 980 of file fl.c.
References HandleUnsupportedManeuver(), and ShipAiState3().
Referenced by ShipAiState3().
| void ShipAiState35 | ( | short | ship, |
| short | target ) |
Definition at line 188 of file fl.c.
References HandleUnsupportedManeuver(), and ShipAiState35().
Referenced by ShipAiState35().
| void ShipAiState44 | ( | short | ship | ) |
Definition at line 959 of file fl.c.
References g_acShipStress, maneuver_complete(), and ShipAiState44().
Referenced by ShipAiState44().
| void ShipAiState45 | ( | short | ship, |
| short | target ) |
Definition at line 989 of file fl.c.
References approach_full_speed(), fire_afterburner(), g_nFacingToTarget, maneuver_complete(), point_ship_at_object(), ShipAiState45(), and unactive().
Referenced by ShipAiState45().
| void ShipAiState46 | ( | short | ship | ) |
Definition at line 664 of file fl.c.
References advance(), approach_full_speed(), fire_afterburner(), g_acShipSequence, g_anRollGoal, g_anYawGoal, g_asProjectileEvasionTicks, maneuver_complete(), no_goal(), RandomBelowOrEqual(), and ShipAiState46().
Referenced by ShipAiState46().
| void ShipAiState47 | ( | short | ship, |
| short | target ) |
Definition at line 642 of file fl.c.
References BeginShipCloak(), g_anShipCloakState, g_asShipCloakCooldown, maneuver_complete(), Mzip_past(), and ShipAiState47().
Referenced by ShipAiState47().
| unsigned char g_abManeuverRerollChance[50] |
| void(* g_apManeuverHandlers[50])(short, short) | ( | short | , |
| short | ) |
Definition at line 18 of file fl.c.
Referenced by perform_maneuver().