Wing Commander
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
fl.c File Reference

Flight manoeuvre handlers and their dispatch. More...

#include "wc1.h"
#include <malloc.h>
#include <float.h>
#include <assert.h>

Go to the source code of this file.

Typedefs

typedef void(*) ShipManeuverHandler(short, short)

Functions

void SetManeuverProximityRange (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)
void Mchill (short ship, short target)
void Mdrop_a_mine (short ship)
void Mthink (short ship)
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, short target)
void Mtail_fire (short ship, short target)
void Mzip_past (short ship, short target)
void Mtarget_missile (short ship, short target)
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 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, short target, short pitch)
void Mzig_zag (short ship, short target)
void Mzig_zag_pitch (short ship, short 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 Mnone (void)
void Mreset (short ship)
void perform_maneuver (short obj)

Variables

static unsigned char abManeuverRerollChance [47]
static ShipManeuverHandler apShipAiManeuverHandlers [47]
static short nManeuverProximityRange
static unsigned char bCurrentManeuverReroll
short nScrambleCanopyOffset
short nFuneralMainDist
signed char bScrambleCanopyClosed
short nCutsceneFuneralGuardFrame
ShortPoint stScrambleOverlay
struct Shape * pScrambleOverlayShape

Detailed Description

Flight manoeuvre handlers and their dispatch.

Address range 4060a0-40770f. The Mac fl symbol run corroborates this group; its dispatch tables precede the cutscene data.

Definition in file fl.c.

Typedef Documentation

◆ ShipManeuverHandler

typedef void(*) ShipManeuverHandler(short, short)

Definition at line 14 of file fl.c.

Function Documentation

◆ advance()

◆ general_zig()

void general_zig ( short ship,
short target,
short pitch )

◆ maneuver_complete()

◆ Mbest_strafe()

void Mbest_strafe ( short ship,
short target )

Definition at line 713 of file fl.c.

References Mbest_strafe(), Mstrafe_enemy(), Mzip_past(), and nTargetFacingValue.

Referenced by Mbest_strafe(), Msit_n_fire(), and Mtarget_laser().

◆ Mburnout()

void Mburnout ( short ship,
short target )

◆ Mbuzz_debris()

◆ Mchill()

void Mchill ( short ship,
short target )

Definition at line 199 of file fl.c.

References acShipSequence, chase_location(), close_behind(), get_front_spot(), Mchill(), and reset_maneuver().

Referenced by Mchill().

◆ Mcorkscrew()

void Mcorkscrew ( short ship)

◆ Mdrop_a_mine()

void Mdrop_a_mine ( short ship)

◆ Mfish_hook()

◆ Mfull_ahead()

void Mfull_ahead ( short ship)

Definition at line 185 of file fl.c.

References approach_full_speed(), asShipTotal, maneuver_complete(), and Mfull_ahead().

Referenced by Mfull_ahead().

◆ Mget_distance()

void Mget_distance ( short ship,
short target )

◆ Mgloat()

void Mgloat ( short ship,
short target )

◆ Mhard_break()

void Mhard_break ( short ship)

◆ Mhard_turn()

void Mhard_turn ( short ship)

◆ Mkickit()

void Mkickit ( short ship)

◆ Mkill_missile()

◆ Mline_up_drop()

void Mline_up_drop ( short ship,
short target )

◆ Mnone()

void Mnone ( void )

Definition at line 928 of file fl.c.

References Mnone().

Referenced by Mnone().

◆ Mram_missile()

void Mram_missile ( short ship,
short target )

◆ Mreset()

void Mreset ( short ship)

Definition at line 933 of file fl.c.

References maneuver_complete(), and Mreset().

Referenced by Mreset().

◆ Mroll_over()

void Mroll_over ( short ship)

◆ Mrout_me()

void Mrout_me ( short ship)

Definition at line 921 of file fl.c.

References Mrout_me(), and try2rout().

Referenced by Mrout_me().

◆ Msit_n_fire()

◆ Msit_n_spin()

◆ Msplit_left()

void Msplit_left ( short ship)

Definition at line 539 of file fl.c.

References acShipSequence, advance(), anYawTarget, maneuver_complete(), Msplit_left(), and no_goal().

Referenced by Msplit_left().

◆ Msplit_right()

void Msplit_right ( short ship)

Definition at line 554 of file fl.c.

References acShipSequence, advance(), anYawTarget, maneuver_complete(), Msplit_right(), and no_goal().

Referenced by Msplit_right().

◆ Mstrafe_enemy()

void Mstrafe_enemy ( short ship,
short target )

◆ Mstrafe_n_roll()

void Mstrafe_n_roll ( short ship,
short target )

Definition at line 739 of file fl.c.

References anRollGoal, asObjectCounterArray, Mstrafe_enemy(), and Mstrafe_n_roll().

Referenced by Mstrafe_n_roll().

◆ Msuicide_run()

void Msuicide_run ( short ship,
short target )

Definition at line 772 of file fl.c.

References approach_full_speed(), Msuicide_run(), no_goal(), and point_ship_at_object().

Referenced by Msuicide_run().

◆ Mtail_fire()

void Mtail_fire ( short ship,
short target )

◆ Mtarget_laser()

void Mtarget_laser ( short ship,
short target )

Definition at line 915 of file fl.c.

References Mbest_strafe(), and Mtarget_laser().

Referenced by Mtarget_laser().

◆ Mtarget_missile()

◆ Mthink()

void Mthink ( short ship)

Definition at line 224 of file fl.c.

References approach_cruise_speed(), asShipTotal, maneuver_complete(), and Mthink().

Referenced by Mthink().

◆ Mtight_loop()

void Mtight_loop ( short ship)

◆ Mtry2tail()

void Mtry2tail ( short ship,
short target )

◆ Mturn_n_kick()

◆ Mturn_n_spin()

◆ Mveer_away()

◆ Mwabble()

void Mwabble ( short ship)

◆ Mzig_zag()

void Mzig_zag ( short ship,
short target )

Definition at line 833 of file fl.c.

References general_zig(), and Mzig_zag().

Referenced by Mzig_zag().

◆ Mzig_zag_pitch()

void Mzig_zag_pitch ( short ship,
short target )

Definition at line 839 of file fl.c.

References general_zig(), and Mzig_zag_pitch().

Referenced by Mzig_zag_pitch().

◆ Mzip_past()

◆ perform_maneuver()

◆ SetManeuverProximityRange()

void SetManeuverProximityRange ( unsigned short v)

Definition at line 84 of file fl.c.

References nManeuverProximityRange, and SetManeuverProximityRange().

Referenced by perform_maneuver(), and SetManeuverProximityRange().

◆ ShipAiState35()

◆ ShipAiState44()

void ShipAiState44 ( short ship)

Definition at line 908 of file fl.c.

References acShipStressList, maneuver_complete(), and ShipAiState44().

Referenced by ShipAiState44().

Variable Documentation

◆ abManeuverRerollChance

unsigned char abManeuverRerollChance[47]
static
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0
}

Definition at line 17 of file fl.c.

Referenced by perform_maneuver().

◆ apShipAiManeuverHandlers

ShipManeuverHandler apShipAiManeuverHandlers[47]
static

Definition at line 22 of file fl.c.

Referenced by perform_maneuver().

◆ bCurrentManeuverReroll

unsigned char bCurrentManeuverReroll
static

Definition at line 73 of file fl.c.

Referenced by perform_maneuver().

◆ bScrambleCanopyClosed

signed char bScrambleCanopyClosed

Definition at line 78 of file fl.c.

Referenced by DrawScrambleFrame(), landing(), and scramble().

◆ nCutsceneFuneralGuardFrame

short nCutsceneFuneralGuardFrame

Definition at line 79 of file fl.c.

Referenced by funeral_player(), and funeral_sequence().

◆ nFuneralMainDist

short nFuneralMainDist

Definition at line 77 of file fl.c.

Referenced by funeral_player(), and funeral_sequence().

◆ nManeuverProximityRange

short nManeuverProximityRange
static

Definition at line 72 of file fl.c.

Referenced by Mveer_away(), perform_maneuver(), and SetManeuverProximityRange().

◆ nScrambleCanopyOffset

short nScrambleCanopyOffset

Definition at line 76 of file fl.c.

Referenced by DrawScrambleFrame(), landing(), and scramble().

◆ pScrambleOverlayShape

struct Shape* pScrambleOverlayShape

Definition at line 81 of file fl.c.

Referenced by DrawScrambleFrame(), and landing().

◆ stScrambleOverlay

ShortPoint stScrambleOverlay

Definition at line 80 of file fl.c.

Referenced by DrawScrambleFrame(), landing(), and scramble().