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

Shared game state, mission and manoeuvre tables, and the information display. More...

#include "wc1.h"

Go to the source code of this file.

Functions

void show_info_disp (void)

Variables

signed char cViewObject = -1
short nEyePitchRate = 1
short nEyeYawRate = 1
short nEyeRollRate = 1
short nFreeShipSlot = -1
signed char bCurrentKey = (signed char)0x80
volatile signed char cPreviousKey = (signed char)0x80
short nCurrentWave = -1
signed char cCurrentObjective = -1
int bIntroSecondaryScene = 0
signed char abHazardObjects [0x14]
int nCameraViewMode = -1
short nExternalViewShip = -1
short nEjectedPilotObject = 0
short nClosestVisibleObject = -1
short nYourWingman = -1
short nPlayerCollisionObject = -1
enum ObjectType eSelectedGunType = (enum ObjectType)-1
int nSelectedReleaseWeaponIndex = -1
short DAT_0046c05c = 0
short bTargetLockReadoutDirty = 0
short nTargetLockCountdown = 0
short nTargetLockMarkerAngle = 0
signed char cTargetDisplayObject = -1
static int DAT_0046c070 = 0
int bTargetLockAcquired = 0
short nTargetLockMode = 0
int bMissileCameraEnabled = 0
int bEngageAllowed = 0
short nAutoEngageTimer = -1
signed char cViableTargetCount = 0
short asIntroCameraSequence [20]
static short asCannedSequence32 [16]
static short asCannedSequence33 [12]
static short asCannedSequence34 [12]
static short asCannedSequence35 [42]
short asCampaignVictoryViewScript [24]
static short asCannedSequence37 [13]
static short asCannedSequence38 [13]
static short asCannedSequence39 [6]
static short asCannedSequence40 [39]
static short asCannedSequence41 [3] = { 0, 400, -1 }
short asTigerClawEscapeViewScript [12]
static short asCannedSequence42 [15]
static short asCannedSequence43 [21]
static short asCannedSequence44 [33]
static short asCannedSequence45 [4] = { 0, 20, 2, -1 }
MissionNavPoint aMissionNavPoints [MISSION_NAV_POINT_COUNT]
MissionShipRecord aMissionShips [MISSION_SHIP_STORAGE_COUNT]
int aiIntelligenceEvent [10] = {0}
static signed char aDefenseManeuversNovice [8]
static signed char aDefenseManeuversVeteran [8]
static signed char aDefenseManeuversElite [16]
static signed char aDefenseManeuversAce [16]
static signed char aDefenseManeuversBoss [16]
signed char * apDefenseManeuvers [5]
ManeuverChoice aRatedManeuverChoices [13][9][3]
ManeuverChoice aKilrathiManeuverChoices [5][9][3]
signed char acPilotAggression [24]
signed char acPilotRecovery [20]
short asObjectCounterArray [SPACE_OBJECT_COUNT]
short nTargetShip
enum SpecialManeuver aeSpecialManeuvers [12]
enum ShipMissionType aeShipMissionType [12]
short asShipTotal [16]
short asShipMaximumSpeedArray [16]
signed char acShipDmg [10]
signed char cMissionObjectiveCountValue
short asViableTgtDistList [16]
FixedVector aShipPositionsArray [SPACE_OBJECT_COUNT]
unsigned short awObjMassArray [SPACE_OBJECT_COUNT]
short asShipAfterburnerTimer [16]
short nShipMissionIndices [10]
signed char acShipCommunicatorArray [16]
FixedVector vStarFieldMotion

Detailed Description

Shared game state, mission and manoeuvre tables, and the information display.

Address range 433910-433abf. The data ownership follows the declarations-before-literals layout. The original source name is unknown.

Definition in file game.c.

Function Documentation

◆ show_info_disp()

Variable Documentation

◆ abHazardObjects

signed char abHazardObjects[0x14]
Initial value:
= {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1
}

Definition at line 43 of file game.c.

Referenced by remove_all_hazards(), remove_object(), start_hazard_field(), and update_hazards().

◆ acPilotAggression

signed char acPilotAggression[24]
Initial value:
= {
3, 3, 3, 2, 2, 3, 2, 3, 0, 3, 2, 5,
4, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0
}

Definition at line 536 of file game.c.

Referenced by handle_stress(), and reset_stress().

◆ acPilotRecovery

signed char acPilotRecovery[20]
Initial value:
= {
6, 7, 8, 8, 9, 8, 6, 8, 10, 7,
8, 9, 7, 0, 7, 7, 8, 8, 0, 0
}

Definition at line 542 of file game.c.

Referenced by handle_stress().

◆ acShipCommunicatorArray

signed char acShipCommunicatorArray[16]

◆ acShipDmg

◆ aDefenseManeuversAce

signed char aDefenseManeuversAce[16]
static
Initial value:
= {
17, 23, 15, 19, 9, 14, 20, 12, -1, 0, 0, 0, 0, 0, 0, 0
}

Definition at line 311 of file game.c.

◆ aDefenseManeuversBoss

signed char aDefenseManeuversBoss[16]
static
Initial value:
= {
15, 19, 12, 11, 17, 23, 7, 35, -1, 0, 0, 0, 0, 0, 0, 0
}

Definition at line 316 of file game.c.

◆ aDefenseManeuversElite

signed char aDefenseManeuversElite[16]
static
Initial value:
= {
8, 15, 17, 23, 19, 9, 20, 34, 14, -1, 0, 0, 0, 0, 0, 0
}

Definition at line 306 of file game.c.

◆ aDefenseManeuversNovice

signed char aDefenseManeuversNovice[8]
static
Initial value:
= {
24, 34, 13, 14, -1, 0, 0, 0
}

Definition at line 296 of file game.c.

◆ aDefenseManeuversVeteran

signed char aDefenseManeuversVeteran[8]
static
Initial value:
= {
8, 13, 15, 14, 19, 24, -1, 0
}

Definition at line 301 of file game.c.

◆ aeShipMissionType

◆ aeSpecialManeuvers

◆ aiIntelligenceEvent

int aiIntelligenceEvent[10] = {0}

Definition at line 293 of file game.c.

Referenced by intelligence_events(), and pick_regular_maneuver().

◆ aKilrathiManeuverChoices

ManeuverChoice aKilrathiManeuverChoices[5][9][3]

Definition at line 477 of file game.c.

Referenced by pick_kilrathi_maneuver().

◆ aMissionNavPoints

Initial value:
= {
{ 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 },
{ 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 },
{
"", 1, { 0, 0, 0 }, 50000,
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
{ 32, 33, 34, 35, -1, -1, -1, -1, -1, -1 }
},
{
"", 1, { 0, 0, 0 }, 50000,
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
{ 36, -1, -1, -1, -1, -1, -1, -1, -1, -1 }
},
{
"", 1, { 0, 0, 0 }, 50000,
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
{ 37, 38, 39, 40, 41, -1, -1, -1, -1, -1 }
},
{
"", 1, { 0, 0, 0 }, 50000,
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
{ 42, 43, 44, 45, -1, -1, -1, -1, -1, -1 }
}
}
ObjectType
Definition wcdata.h:54
@ OBJECT_TYPE_SCIMITAR
Definition wcdata.h:57
@ OBJECT_TYPE_KRANT
Definition wcdata.h:66
@ OBJECT_TYPE_GRATHA
Definition wcdata.h:67
@ OBJECT_TYPE_ASTEROID_FIELD
Definition wcdata.h:77
@ OBJECT_TYPE_RAPIER
Definition wcdata.h:56
@ OBJECT_TYPE_HORNET
Definition wcdata.h:55
@ OBJECT_TYPE_DRALTHI
Definition wcdata.h:65

Definition at line 199 of file game.c.

Referenced by auto_pilot_sequence(), Build_objective_list(), BuildMap(), cleanup_objectives(), find_ships_sphere(), FindNearestNavPoint(), get_follow_point(), hostile_sphere(), init_intelligence_data(), init_ship(), LoadMissionData(), locate_ship(), orbit_sphere(), set_sphere_point(), set_up_action_sphere(), set_up_next_wave(), and update_objective_location().

◆ aMissionShips

◆ apDefenseManeuvers

signed char* apDefenseManeuvers[5]
Initial value:
= {
}
static signed char aDefenseManeuversNovice[8]
Definition game.c:296
static signed char aDefenseManeuversBoss[16]
Definition game.c:316
static signed char aDefenseManeuversVeteran[8]
Definition game.c:301
static signed char aDefenseManeuversElite[16]
Definition game.c:306
static signed char aDefenseManeuversAce[16]
Definition game.c:311

Definition at line 321 of file game.c.

Referenced by any_defense().

◆ aRatedManeuverChoices

ManeuverChoice aRatedManeuverChoices[13][9][3]

Definition at line 330 of file game.c.

Referenced by process_maneuver_node().

◆ asCampaignVictoryViewScript

short asCampaignVictoryViewScript[24]
Initial value:
= {
16, 38, 0, 1200, 0, 1600, 1, 180,
0, 0, 15, 3, 4, 14, 100, 2,
15, 3, 15, 14, 120, -1, 0, 0
}

Definition at line 140 of file game.c.

Referenced by ShowCampaignVictorySequence().

◆ asCannedSequence32

short asCannedSequence32[16]
static
Initial value:
= {
0, 20, 1, 0, 0, 180, 40, 1, 0, 0, 180, 40,
2, 0, 400, -1
}

Definition at line 116 of file game.c.

◆ asCannedSequence33

short asCannedSequence33[12]
static
Initial value:
= {
0, 20, 0, 20, 1, 0, -15, -60, 50, 0, 400, -1
}

Definition at line 122 of file game.c.

◆ asCannedSequence34

short asCannedSequence34[12]
static
Initial value:
= {
0, 20, 0, 20, 1, 0, 15, 60, 50, 0, 400, -1
}

Definition at line 127 of file game.c.

◆ asCannedSequence35

short asCannedSequence35[42]
static
Initial value:
= {
0, 17, 0, 6, 3, 0, 6, 3, 0, 6, 3, 0, 6, 3,
0, 6, 3, 0, 6, 3, 0, 6, 3,
1, 0, 0, 180, 40, 1, 0, 0, 180, 40,
1, 0, -30, 60, 40, 0, 400, -1
}

Definition at line 132 of file game.c.

◆ asCannedSequence37

short asCannedSequence37[13]
static
Initial value:
= {
0, 100, 1, 0, 30, 0, 50, 0, 20, 2, 0, 400, -1
}

Definition at line 147 of file game.c.

◆ asCannedSequence38

short asCannedSequence38[13]
static
Initial value:
= {
0, 110, 1, 0, 30, 0, 50, 0, 10, 2, 0, 400, -1
}

Definition at line 152 of file game.c.

◆ asCannedSequence39

short asCannedSequence39[6]
static
Initial value:
= {
0, 10, 2, 0, 400, -1
}

Definition at line 157 of file game.c.

◆ asCannedSequence40

short asCannedSequence40[39]
static
Initial value:
= {
0, 40,
3, 1, 0, 0, 90, 60, 3, 1, 0, 0, 90, 60,
3, 1, 0, 0, 90, 60, 3, 1, 0, 0, 90, 60,
3, 1, 0, 0, 90, 60, 3, 1, 0, 0, 90, 60, -1
}

Definition at line 162 of file game.c.

◆ asCannedSequence41

short asCannedSequence41[3] = { 0, 400, -1 }
static

Definition at line 170 of file game.c.

◆ asCannedSequence42

short asCannedSequence42[15]
static
Initial value:
= {
0, 120, 1, 0, 0, 180, 50, 3, 1, 0, 0, 180, 50, 3, -1
}

Definition at line 178 of file game.c.

◆ asCannedSequence43

short asCannedSequence43[21]
static
Initial value:
= {
0, 120, 1, 0, 0, 180, 50, 3, 1, 0, 0, 180, 50,
3, 1, 0, 0, 180, 50, 3, -1
}

Definition at line 183 of file game.c.

◆ asCannedSequence44

short asCannedSequence44[33]
static
Initial value:
= {
0, 5, 3, 0, 5, 3, 0, 5, 3, 0, 5, 3,
1, 0, 0, 180, 50, 1, 0, 0, 180, 50,
1, 0, 0, 180, 50, 1, 0, 0, 180, 50, -1
}

Definition at line 189 of file game.c.

◆ asCannedSequence45

short asCannedSequence45[4] = { 0, 20, 2, -1 }
static

Definition at line 196 of file game.c.

◆ aShipPositionsArray

FixedVector aShipPositionsArray[SPACE_OBJECT_COUNT]

Definition at line 556 of file game.c.

Referenced by accelerate_and_move_object(), animate_object(), approach(), approve_xyz(), auto_pilot_sequence(), auto_position(), BuildMap(), check_for_collision(), check_hazards(), child_object(), ComputeObjectToObjectDelta(), ComputeObjectToPointDelta(), Create_explosion_debris(), Create_ship_hit_debris(), CreateCannedSceneObject(), distance_from_object(), distance_from_point(), draw_nav_pointer(), DrawNavLocationReadout(), DrawNavPlayerMarker(), ejection_sequence(), explosion_shock_wave(), facing_to_object(), find_squad_center(), fire(), fire_turrets(), fire_weapon(), generate_stars(), get_facing_range_from_object(), get_follow_point(), get_front_spot(), get_rear_spot(), GetShipDistanceToNavPoint(), goto_formation(), imperial_formation(), init_formation_burst(), init_hazard(), initialize_object(), InitializeConstellationObject(), IsPointWithinEyeViewCone(), kilrathi_near(), locate_ship(), look_at(), make_shard(), match_ship_to_eye(), Mline_up_drop(), MoveObjectAlongDirection(), Msit_n_spin(), new_view(), object_collision(), offset_location(), ok_hazard_spot(), onboard_explosion(), parse_view_script(), PlaySfxWaveFileByNumber(), point_at(), point_capital_ship_at_object(), point_perpendicular(), point_ship_at_object(), point_ship_at_point(), point_ship_behind_object(), point_ship_below_object(), pop_flack(), position_child(), position_relative_ijk(), prevent_collision(), real_crash_time(), RenderSpaceViewFrame(), scan_for_enemy(), send_at_point(), servicetrack(), set_eye_direction_and_position(), set_formation_position(), set_objective_range(), Set_up_ship_info(), SetFleetOverviewView(), SetScale(), ShipExplosion(), ships_within_range(), ShowCarrierLaunchSequence(), ShowGameOverScreen(), ShowTigerClawEscapeScene(), start_dust(), steer_away_from_object(), steer_away_from_predicted_object(), transform_objects_to_your_view(), try_far_spot(), unwarp(), update_objective_location(), update_star_field(), and warp().

◆ asIntroCameraSequence

short asIntroCameraSequence[20]
Initial value:
= {
0, -1000, 0, -4263, 2, 15, 1, 0, 30, 0,
3, 15, 4, 30, 1, 13, 14, 400, -1, 0
}

Definition at line 110 of file game.c.

Referenced by Title_Sequence().

◆ asObjectCounterArray

◆ asShipAfterburnerTimer

short asShipAfterburnerTimer[16]

◆ asShipMaximumSpeedArray

short asShipMaximumSpeedArray[16]

◆ asShipTotal

◆ asTigerClawEscapeViewScript

short asTigerClawEscapeViewScript[12]
Initial value:
= {
0, 0, 0, 0, 2, 15, 3, 15, 14, 400, -1, 0
}

Definition at line 173 of file game.c.

Referenced by ShowTigerClawEscapeScene().

◆ asViableTgtDistList

short asViableTgtDistList[16]

◆ awObjMassArray

unsigned short awObjMassArray[SPACE_OBJECT_COUNT]

◆ bCurrentKey

signed char bCurrentKey = (signed char)0x80

◆ bEngageAllowed

int bEngageAllowed = 0

Definition at line 101 of file game.c.

Referenced by allow_engage(), disallow_engage(), imperial_formation(), and request().

◆ bIntroSecondaryScene

int bIntroSecondaryScene = 0

Definition at line 40 of file game.c.

Referenced by check_hazards(), init_hazard(), Title_Sequence(), and update_hazards().

◆ bMissileCameraEnabled

int bMissileCameraEnabled = 0

Definition at line 98 of file game.c.

Referenced by HandleSpaceFlightControls(), and init_3Space_objects().

◆ bTargetLockAcquired

int bTargetLockAcquired = 0

Definition at line 92 of file game.c.

Referenced by decrement_lock_time(), and DrawTargetRangeReadout().

◆ bTargetLockReadoutDirty

short bTargetLockReadoutDirty = 0

Definition at line 76 of file game.c.

Referenced by DrawTargetRangeReadout(), lock_off(), and start_lock().

◆ cCurrentObjective

◆ cMissionObjectiveCountValue

◆ cPreviousKey

volatile signed char cPreviousKey = (signed char)0x80

Definition at line 31 of file game.c.

Referenced by HandleSpaceFlightControls(), player_input(), and process_player_input().

◆ cTargetDisplayObject

signed char cTargetDisplayObject = -1

Definition at line 85 of file game.c.

Referenced by DrawTargetRangeReadout(), and show_target_disp().

◆ cViableTargetCount

◆ cViewObject

◆ DAT_0046c05c

short DAT_0046c05c = 0

Definition at line 73 of file game.c.

Referenced by overlay_head_up_display().

◆ DAT_0046c070

int DAT_0046c070 = 0
static

Definition at line 89 of file game.c.

◆ eSelectedGunType

enum ObjectType eSelectedGunType = (enum ObjectType)-1

Definition at line 67 of file game.c.

Referenced by select_new_gun(), set_objects_data(), and show_weapon_disp().

◆ nAutoEngageTimer

short nAutoEngageTimer = -1

◆ nCameraViewMode

◆ nClosestVisibleObject

short nClosestVisibleObject = -1

Definition at line 58 of file game.c.

Referenced by init_3Space_objects(), and transform_objects_to_your_view().

◆ nCurrentWave

◆ nEjectedPilotObject

short nEjectedPilotObject = 0

Definition at line 55 of file game.c.

Referenced by ejection_sequence().

◆ nExternalViewShip

short nExternalViewShip = -1

◆ nEyePitchRate

short nEyePitchRate = 1

Definition at line 16 of file game.c.

Referenced by new_view(), parse_view_script(), and rotate_eye_to_goal().

◆ nEyeRollRate

short nEyeRollRate = 1

◆ nEyeYawRate

short nEyeYawRate = 1

Definition at line 19 of file game.c.

Referenced by new_view(), parse_view_script(), and rotate_eye_to_goal().

◆ nFreeShipSlot

short nFreeShipSlot = -1

Definition at line 25 of file game.c.

Referenced by get_ship_slot(), and prepare_mission().

◆ nPlayerCollisionObject

short nPlayerCollisionObject = -1

Definition at line 64 of file game.c.

Referenced by GameFlow(), house_keep_objects(), and init_3Space_objects().

◆ nSelectedReleaseWeaponIndex

◆ nShipMissionIndices

◆ nTargetLockCountdown

◆ nTargetLockMarkerAngle

short nTargetLockMarkerAngle = 0

Definition at line 82 of file game.c.

Referenced by draw_target_box(), and start_lock().

◆ nTargetLockMode

◆ nTargetShip

◆ nYourWingman

◆ vStarFieldMotion

FixedVector vStarFieldMotion

Definition at line 561 of file game.c.

Referenced by update_star_field().