Most of the aircraft related stuff. More...
#include "../client.h"
#include "../ui/ui_main.h"
#include "../ui/ui_popup.h"
#include "../../shared/parse.h"
#include "cp_campaign.h"
#include "cp_mapfightequip.h"
#include "cp_map.h"
#include "cp_ufo.h"
#include "cp_alienbase.h"
#include "cp_team.h"
#include "cp_time.h"
#include "cp_missions.h"
#include "save/save_aircraft.h"
Go to the source code of this file.
Functions | |
aircraft_t * | AIR_GetNextFromBase (const base_t *b, aircraft_t *lastAircraft) |
Iterates through the aircraft of a base. | |
qboolean | AIR_BaseHasAircraft (const base_t *base) |
Checks whether there is any aircraft assigned to the given base. | |
static int | AIR_UpdateHangarCapForOne (const aircraft_t const *aircraftTemplate, base_t *base) |
Updates hangar capacities for one aircraft in given base. | |
void | AIR_UpdateHangarCapForAll (base_t *base) |
Updates current capacities for hangars in given base. | |
static void | AII_CollectingAmmo (aircraft_t *aircraft, const invList_t *magazine) |
Count and collect ammo from gun magazine. | |
void | AII_CollectItem (aircraft_t *aircraft, const objDef_t *item, int amount) |
Add an item to aircraft inventory. | |
static void | AII_CarriedItems (const le_t *soldier) |
Process items carried by soldiers. | |
void | AII_CollectingItems (aircraft_t *aircraft, int won) |
Collect items from the battlefield. | |
const char * | AIR_AircraftStatusToName (const aircraft_t *aircraft) |
Translates the aircraft status id to a translatable string. | |
qboolean | AIR_IsAircraftInBase (const aircraft_t *aircraft) |
Checks whether given aircraft is in its homebase. | |
qboolean | AIR_IsAircraftOnGeoscape (const aircraft_t *aircraft) |
Checks whether given aircraft is on geoscape. | |
int | AIR_CountTypeInBase (const base_t *base, aircraftType_t aircraftType) |
Calculates the amount of aircraft (of the given type) in the selected base. | |
const char * | AIR_GetAircraftString (aircraftType_t aircraftType) |
Returns the string that matches the given aircraft type. | |
int | CL_AircraftMenuStatsValues (const int value, const int stat) |
Some of the aircraft values needs special calculations when they are shown in the menus. | |
int | AIR_GetOperationRange (const aircraft_t *aircraft) |
Calculates the range an aircraft can fly on the geoscape. | |
int | AIR_GetRemainingRange (const aircraft_t *aircraft) |
Calculates the remaining range the aircraft can fly. | |
qboolean | AIR_AircraftHasEnoughFuel (const aircraft_t *aircraft, const vec2_t destination) |
check if aircraft has enough fuel to go to destination, and then come back home | |
qboolean | AIR_AircraftHasEnoughFuelOneWay (const aircraft_t const *aircraft, const vec2_t destination) |
check if aircraft has enough fuel to go to destination | |
void | AIR_AircraftReturnToBase (aircraft_t *aircraft) |
Calculates the way back to homebase for given aircraft and returns it. | |
int | AIR_GetAircraftIDXInBase (const aircraft_t *aircraft) |
Returns the index of the aircraft in the base->aircraft array. | |
aircraft_t * | AIR_GetAircraftFromBaseByIDXSafe (base_t *base, int index) |
aircraft_t * | AIR_GetAircraftSilent (const char *name) |
Searches the global array of aircraft types for a given aircraft. | |
aircraft_t * | AIR_GetAircraft (const char *name) |
Searches the global array of aircraft types for a given aircraft. | |
static void | AII_SetAircraftInSlots (aircraft_t *aircraft) |
Initialise aircraft pointer in each slot of an aircraft. | |
aircraft_t * | AIR_Add (base_t *base, const aircraft_t *aircraftTemplate) |
Adds a new aircraft from a given aircraft template to the base and sets the homebase for the new aircraft to the given base. | |
qboolean | AIR_Delete (base_t *base, const aircraft_t *aircraft) |
Will remove the given aircraft from the base. | |
aircraft_t * | AIR_NewAircraft (base_t *base, const char *name) |
Places a new aircraft in the given base. | |
int | AIR_GetCapacityByAircraftWeight (const aircraft_t *aircraft) |
static int | AIR_GetStorageRoom (const aircraft_t *aircraft) |
Calculate used storage room corresponding to items in an aircraft. | |
const char * | AIR_CheckMoveIntoNewHomebase (const aircraft_t *aircraft, const base_t *base, const int capacity) |
static void | AIR_TransferItemsCarriedByCharacterToBase (character_t *chr, base_t *sourceBase, base_t *destBase) |
Transfer items carried by a soldier from one base to another. | |
qboolean | AIR_MoveAircraftIntoNewHomebase (aircraft_t *aircraft, base_t *base) |
Moves a given aircraft to a new base (also the employees and inventory). | |
void | AIR_DeleteAircraft (aircraft_t *aircraft) |
Removes an aircraft from its base and the game. | |
void | AIR_DestroyAircraft (aircraft_t *aircraft) |
Removes an aircraft from its base and the game. | |
qboolean | AIR_AircraftMakeMove (int dt, aircraft_t *aircraft) |
Moves given aircraft. | |
static void | AIR_Move (aircraft_t *aircraft, int deltaTime) |
static void | AIR_Refuel (aircraft_t *aircraft, int deltaTime) |
void | CL_CampaignRunAircraft (int dt, qboolean updateRadarOverlay) |
Handles aircraft movement and actions in geoscape mode. | |
aircraft_t * | AIR_AircraftGetFromIDX (int idx) |
Returns aircraft for a given global index. | |
qboolean | AIR_SendAircraftToMission (aircraft_t *aircraft, mission_t *mission) |
Sends the specified aircraft to specified mission. | |
static void | AII_InitialiseAircraftSlots (aircraft_t *aircraftTemplate) |
Initialise all values of an aircraft slot. | |
void | AIR_ParseAircraft (const char *name, const char **text, qboolean assignAircraftItems) |
Parses all aircraft that are defined in our UFO-scripts. | |
void | AIR_AircraftsNotifyMissionRemoved (const mission_t *const mission) |
Notify that a mission has been removed. | |
void | AIR_AircraftsNotifyUFORemoved (const aircraft_t *const ufo, qboolean destroyed) |
Notify that a UFO has been removed. | |
void | AIR_AircraftsUFODisappear (const aircraft_t *const ufo) |
Notify that a UFO disappear from radars. | |
static float | AIR_GetDestinationFunction (const float c, const float B, const float speedRatio, float a) |
funtion we need to find roots. | |
static float | AIR_GetDestinationDerivativeFunction (const float c, const float B, const float speedRatio, float a) |
derivative of the funtion we need to find roots. | |
static float | AIR_GetDestinationFindRoot (const float c, const float B, const float speedRatio, float start) |
Find the roots of a function. | |
void | AIR_GetDestinationWhilePursuing (const aircraft_t const *shooter, const aircraft_t const *target, vec2_t *dest) |
Calculates the point where aircraft should go to intecept a moving target. | |
qboolean | AIR_SendAircraftPursuingUFO (aircraft_t *aircraft, aircraft_t *ufo) |
Make the specified aircraft purchasing a UFO. | |
void | AIR_ResetAircraftTeam (aircraft_t *aircraft) |
Resets team in given aircraft. | |
qboolean | AIR_AddToAircraftTeam (aircraft_t *aircraft, employee_t *employee) |
Adds given employee to given aircraft. | |
qboolean | AIR_RemoveFromAircraftTeam (aircraft_t *aircraft, const employee_t *employee) |
Removes given employee from given aircraft team. | |
qboolean | AIR_IsInAircraftTeam (const aircraft_t *aircraft, const employee_t *employee) |
Checks whether given employee is in given aircraft. | |
int | AIR_GetTeamSize (const aircraft_t *aircraft) |
Counts the number of soldiers in given aircraft. | |
void | AIR_AutoAddPilotToAircraft (base_t *base, employee_t *pilot) |
Adds the pilot to the first available aircraft at the specified base. | |
void | AIR_RemovePilotFromAssignedAircraft (base_t *base, const employee_t *pilot) |
Checks to see if the pilot is in any aircraft at this base. If he is then he is removed from that aircraft. | |
int | AIR_GetAircraftWeaponRanges (const aircraftSlot_t *slot, int maxSlot, float *weaponRanges) |
Get the all the unique weapon ranges of this aircraft. | |
static void | AIR_SaveRouteXML (mxml_node_t *node, const mapline_t *route) |
Saves an route plan of an aircraft. | |
static void | AIR_SaveAircraftSlotsXML (const aircraftSlot_t *slot, const int num, mxml_node_t *p, qboolean weapon) |
Saves an item slot. | |
static qboolean | AIR_SaveAircraftXML (mxml_node_t *p, const aircraft_t *const aircraft, qboolean const isUfo) |
Saves an aircraft. | |
qboolean | AIR_SaveXML (mxml_node_t *parent) |
Save callback for savegames in xml format. | |
static void | AIR_LoadAircraftSlotsXML (aircraft_t *aircraft, aircraftSlot_t *slot, mxml_node_t *p, qboolean weapon, const int max) |
Loads the weapon slots of an aircraft. | |
static qboolean | AIR_LoadRouteXML (mxml_node_t *p, mapline_t *route) |
Loads the route of an aircraft. | |
static qboolean | AIR_LoadAircraftXML (mxml_node_t *p, aircraft_t *craft) |
Loads an Aircraft from the savegame. | |
static void | AIR_CorrectAircraftSlotPointers (aircraft_t *aircraft) |
resets aircraftSlots' backreference pointers for aircraft | |
qboolean | AIR_LoadXML (mxml_node_t *parent) |
static void | AIR_PostLoadInitMissions (void) |
Set the mission pointers for all the aircraft after loading a savegame. | |
void | AIR_PostLoadInit (void) |
Actions needs to be done after loading the savegame. | |
qboolean | AIR_AircraftAllowed (const base_t *base) |
Returns true if the current base is able to handle aircraft. | |
qboolean | AIR_CanIntercept (const aircraft_t *aircraft) |
qboolean | AIR_ScriptSanityCheck (void) |
Checks the parsed aircraft for errors. | |
int | AIR_CalculateHangarStorage (const aircraft_t *aircraftTemplate, const base_t *base, int used) |
Calculates free space in hangars in given base. | |
qboolean | AIR_RemoveEmployee (employee_t *employee, aircraft_t *aircraft) |
Removes a soldier from an aircraft. | |
const aircraft_t * | AIR_IsEmployeeInAircraft (const employee_t *employee, const aircraft_t *aircraft) |
Tells you if a soldier is assigned to an aircraft. | |
void | AIR_RemoveEmployees (aircraft_t *aircraft) |
Removes all soldiers from an aircraft. | |
void | AIR_MoveEmployeeInventoryIntoStorage (const aircraft_t *aircraft, equipDef_t *ed) |
Move all the equipment carried by the team on the aircraft into the given equipment. | |
static qboolean | AIR_AddEmployee (employee_t *employee, aircraft_t *aircraft) |
Assigns a soldier to an aircraft. | |
void | AIM_AddEmployeeFromMenu (aircraft_t *aircraft, const int num) |
Adds or removes a soldier to/from an aircraft. | |
void | AIR_AssignInitial (aircraft_t *aircraft) |
Assigns initial team of soldiers to aircraft. | |
Variables | |
static equipDef_t | eTempEq |
static const char * | air_position_strings [AIR_POSITIONS_MAX] |
List of valid strings for itemPos_t. | |
static const value_t | aircraft_param_vals [] |
Valid aircraft parameter definitions from script files. | |
static const value_t | aircraft_vals [] |
Valid aircraft definition values from script files. |
Most of the aircraft related stuff.
Definition in file cp_aircraft.c.
static void AII_CarriedItems | ( | const le_t * | soldier | ) | [static] |
Process items carried by soldiers.
[in] | soldier | Pointer to le_t being a soldier from our team. |
Definition at line 309 of file cp_aircraft.c.
References item_s::a, objDef_s::ammo, ccs, CONTAINER, csi, ccs_s::eMission, objDef_s::idx, INVDEF, invList_s::item, item_s::m, invList_s::next, csi_s::numIDs, equipDef_s::numItems, equipDef_s::numItemsLoose, objDef_s::reload, RS_GetTechForItem(), RS_MarkCollected(), and item_s::t.
Referenced by AII_CollectingItems().
static void AII_CollectingAmmo | ( | aircraft_t * | aircraft, | |
const invList_t * | magazine | |||
) | [static] |
Count and collect ammo from gun magazine.
[in] | magazine | Pointer to invList_t being magazine. |
[in] | aircraft | Pointer to aircraft used in this mission. |
Definition at line 267 of file cp_aircraft.c.
References item_s::a, AII_CollectItem(), objDef_s::ammo, objDef_s::idx, invList_s::item, item_s::m, equipDef_s::numItemsLoose, and item_s::t.
Referenced by AII_CollectingItems().
void AII_CollectingItems | ( | aircraft_t * | aircraft, | |
int | won | |||
) |
Collect items from the battlefield.
Definition at line 349 of file cp_aircraft.c.
References item_s::a, AII_CarriedItems(), AII_CollectingAmmo(), AII_CollectItem(), itemsTmp_s::amount, ARMOUR, ccs, cls, Com_DPrintf(), DEBUG_CLIENT, FLOOR, i, itemsTmp_s::item, invList_s::item, missionResults_s::itemAmount, aircraft_s::itemcargo, missionResults_s::itemTypes, aircraft_s::itemTypes, LE_GetNextInUse(), LE_IsActor(), LE_IsDead, LE_IsItem, MAX_CARGO, ccs_s::missionResults, objDef_s::name, invList_s::next, objDef_s::reload, item_s::t, client_static_s::team, and le_s::team.
Referenced by GAME_CP_Results().
void AII_CollectItem | ( | aircraft_t * | aircraft, | |
const objDef_t * | item, | |||
int | amount | |||
) |
Add an item to aircraft inventory.
[in,out] | aircraft | Aircraft to load to |
[in] | item | Item to add |
amount | Number of items to add |
Definition at line 286 of file cp_aircraft.c.
References itemsTmp_s::amount, Com_DPrintf(), DEBUG_CLIENT, i, objDef_s::idx, itemsTmp_s::item, aircraft_s::itemcargo, aircraft_s::itemTypes, and objDef_s::name.
Referenced by AII_CollectingAmmo(), AII_CollectingItems(), and AL_AddAliens().
static void AII_InitialiseAircraftSlots | ( | aircraft_t * | aircraftTemplate | ) | [static] |
Initialise all values of an aircraft slot.
[in] | aircraftTemplate | Pointer to the aircraft which needs initalisation of its slots. |
Definition at line 1397 of file cp_aircraft.c.
References AC_ITEM_ELECTRONICS, AC_ITEM_SHIELD, AC_ITEM_WEAPON, AII_InitialiseSlot(), aircraft_s::electronics, i, MAX_AIRCRAFTSLOT, aircraft_s::shield, and aircraft_s::weapons.
Referenced by AIR_ParseAircraft().
static void AII_SetAircraftInSlots | ( | aircraft_t * | aircraft | ) | [static] |
Initialise aircraft pointer in each slot of an aircraft.
[in] | aircraft | Pointer to the aircraft where slots are. |
Definition at line 739 of file cp_aircraft.c.
References aircraftSlot_s::aircraft, aircraft_s::electronics, i, MAX_AIRCRAFTSLOT, aircraft_s::shield, and aircraft_s::weapons.
Referenced by AIR_NewAircraft().
void AIM_AddEmployeeFromMenu | ( | aircraft_t * | aircraft, | |
const int | num | |||
) |
Adds or removes a soldier to/from an aircraft.
[in,out] | aircraft | Aircraft to add to/remove from |
[in] | num | Index of Soldier (in menu) to add/remove |
Definition at line 3208 of file cp_aircraft.c.
References AIR_AddEmployee(), AIR_IsEmployeeInAircraft(), AIR_RemoveEmployee(), Com_DPrintf(), Com_Error(), DEBUG_CLIENT, E_GetEmployeeByMenuIndex(), ERR_DROP, and employee_s::idx.
Referenced by AIR_AssignInitial(), and CL_AssignSoldier_f().
aircraft_t* AIR_Add | ( | base_t * | base, | |
const aircraft_t * | aircraftTemplate | |||
) |
Adds a new aircraft from a given aircraft template to the base and sets the homebase for the new aircraft to the given base.
[out] | base | The base to add the aircraft to |
[in] | aircraftTemplate | The template to create the new aircraft from |
Definition at line 759 of file cp_aircraft.c.
References base_s::aircraft, byte, ccs, data, aircraft_s::homebase, LIST_Add(), and ccs_s::numAircraft.
Referenced by AIR_LoadXML(), AIR_MoveAircraftIntoNewHomebase(), and AIR_NewAircraft().
static qboolean AIR_AddEmployee | ( | employee_t * | employee, | |
aircraft_t * | aircraft | |||
) | [static] |
Assigns a soldier to an aircraft.
[in] | employee | The employee to be assigned to the aircraft. |
[in] | aircraft | What aircraft to assign employee to. |
Definition at line 3186 of file cp_aircraft.c.
References AIR_AddToAircraftTeam(), AIR_GetTeamSize(), AIR_IsEmployeeInAircraft(), aircraft_s::maxTeamSize, and qfalse.
Referenced by AIM_AddEmployeeFromMenu().
qboolean AIR_AddToAircraftTeam | ( | aircraft_t * | aircraft, | |
employee_t * | employee | |||
) |
Adds given employee to given aircraft.
[in] | aircraft | Pointer to an aircraft, to which we will add employee. |
[in] | employee | The employee to add to the aircraft. |
Definition at line 2180 of file cp_aircraft.c.
References aircraft_s::acTeam, AIR_GetTeamSize(), Com_DPrintf(), DEBUG_CLIENT, employee_s::idx, LIST_AddPointer(), aircraft_s::maxTeamSize, qfalse, and qtrue.
Referenced by AIR_AddEmployee(), and CP_BaseAttackStartMission().
Returns true if the current base is able to handle aircraft.
Definition at line 2905 of file cp_aircraft.c.
References B_GetBuildingStatus(), B_HANGAR, and B_SMALL_HANGAR.
Referenced by B_BaseInit_f(), and B_BuildingOpenAfterClick().
aircraft_t* AIR_AircraftGetFromIDX | ( | int | idx | ) |
Returns aircraft for a given global index.
[in] | idx | Global aircraft index. |
Definition at line 1318 of file cp_aircraft.c.
References AIR_GetNextFromBase(), B_GetFoundedBaseByIDX(), ccs, Com_DPrintf(), DEBUG_CLIENT, base_s::idx, aircraft_s::idx, base_s::name, and ccs_s::numBases.
Referenced by AIR_LoadAircraftXML(), AIRFIGHT_LoadXML(), CP_LoadMissionsXML(), MAP_MultiSelectExecuteAction_f(), PR_UpdateProductionList(), TR_AircraftListSelect(), TR_CargoList(), TR_CheckAircraft(), TR_EmptyTransferCargo(), TR_TransferAliensFromMission_f(), TR_TransferListSelect_f(), TR_TransferSelect(), and TR_TransferStart().
qboolean AIR_AircraftHasEnoughFuel | ( | const aircraft_t * | aircraft, | |
const vec2_t | destination | |||
) |
check if aircraft has enough fuel to go to destination, and then come back home
[in] | aircraft | Pointer to the aircraft |
[in] | destination | Pointer to the position the aircraft should go to |
Definition at line 592 of file cp_aircraft.c.
References AIR_GetRemainingRange(), GetDistanceOnGlobe(), aircraft_s::homebase, base_s::pos, aircraft_s::pos, and SECONDS_PER_HOUR.
Referenced by AIR_SendAircraftPursuingUFO(), AIR_SendAircraftToMission(), CL_CampaignRunAircraft(), CL_DisplayPopupInterceptUFO(), and MAP_MapClick().
qboolean AIR_AircraftHasEnoughFuelOneWay | ( | const aircraft_t const * | aircraft, | |
const vec2_t | destination | |||
) |
check if aircraft has enough fuel to go to destination
[in] | aircraft | Pointer to the aircraft |
[in] | destination | Pointer to the position the aircraft should go to |
Definition at line 618 of file cp_aircraft.c.
References AIR_GetRemainingRange(), GetDistanceOnGlobe(), aircraft_s::pos, and SECONDS_PER_HOUR.
Referenced by AIR_CheckMoveIntoNewHomebase().
qboolean AIR_AircraftMakeMove | ( | int | dt, | |
aircraft_t * | aircraft | |||
) |
Moves given aircraft.
[in] | dt | time delta |
[in] | aircraft | Pointer to aircraft on its way. |
Definition at line 1108 of file cp_aircraft.c.
References AIR_STATS_SPEED, mapline_s::distance, aircraft_s::fuel, aircraft_s::hasMoved, int(), MAP_CheckPositionBoundaries(), aircraft_s::numInterpolationPoints, mapline_s::numPoints, mapline_s::point, aircraft_s::point, aircraft_s::pos, aircraft_s::projectedPos, qfalse, qtrue, aircraft_s::route, SECONDS_PER_HOUR, aircraft_s::stats, aircraft_s::time, and VectorSet.
Referenced by AIR_Move(), and UFO_CampaignRunUFOs().
void AIR_AircraftReturnToBase | ( | aircraft_t * | aircraft | ) |
Calculates the way back to homebase for given aircraft and returns it.
[in] | aircraft | Pointer to aircraft, which should return to base. |
Definition at line 636 of file cp_aircraft.c.
References AIR_IsAircraftOnGeoscape(), AIR_RETURNING, Com_DPrintf(), DEBUG_CLIENT, aircraft_s::homebase, aircraft_s::id, aircraft_s::idx, MAP_MapCalcLine(), aircraft_s::mission, base_s::name, aircraft_s::point, base_s::pos, aircraft_s::pos, aircraft_s::route, aircraft_s::status, and aircraft_s::time.
Referenced by AIM_AircraftReturnToBase_f(), AIR_AircraftsNotifyMissionRemoved(), AIR_AircraftsNotifyUFORemoved(), AIR_AircraftsUFODisappear(), AIR_MoveAircraftIntoNewHomebase(), AIR_SendAircraftPursuingUFO(), AIRFIGHT_ExecuteActions(), AIRFIGHT_MissTarget(), CL_CampaignRunAircraft(), CL_PopupAircraftClick_f(), and CP_MissionEndActions().
void AIR_AircraftsNotifyMissionRemoved | ( | const mission_t *const | mission | ) |
Notify that a mission has been removed.
[in] | mission | Pointer to the mission that has been removed. |
Definition at line 1810 of file cp_aircraft.c.
References AIR_AircraftReturnToBase(), AIR_GetNextFromBase(), AIR_MISSION, B_GetFoundedBaseByIDX(), ccs, aircraft_s::mission, ccs_s::numBases, and aircraft_s::status.
Referenced by CP_MissionRemoveFromGeoscape().
void AIR_AircraftsNotifyUFORemoved | ( | const aircraft_t *const | ufo, | |
qboolean | destroyed | |||
) |
Notify that a UFO has been removed.
[in] | ufo | Pointer to UFO that has been removed. |
[in] | destroyed | True if the UFO has been destroyed, false if it only landed. |
Definition at line 1832 of file cp_aircraft.c.
References AIR_AircraftReturnToBase(), AIR_GetNextFromBase(), AIR_UFO, aircraft_s::aircraftTarget, B_GetFoundedBaseByIDX(), base_s::batteries, base_s::lasers, base_s::numBatteries, base_s::numLasers, aircraft_s::status, and baseWeapon_s::target.
Referenced by CP_UFORemoveFromGeoscape().
const char* AIR_AircraftStatusToName | ( | const aircraft_t * | aircraft | ) |
Translates the aircraft status id to a translatable string.
[in] | aircraft | Aircraft to translate the status of |
Definition at line 429 of file cp_aircraft.c.
References _, AIR_CRASHED, AIR_DROP, AIR_HOME, AIR_IDLE, AIR_INTERCEPT, AIR_IsAircraftInBase(), AIR_MISSION, AIR_NONE, AIR_REFUEL, AIR_RETURNING, AIR_TRANSFER, AIR_TRANSIT, AIR_UFO, BASE_UNDER_ATTACK, base_s::baseStatus, Com_Error(), ERR_DROP, aircraft_s::homebase, and aircraft_s::status.
Referenced by AIR_AircraftSelect(), CL_DisplayPopupInterceptMission(), CL_DisplayPopupInterceptUFO(), and MAP_GetAircraftText().
void AIR_AircraftsUFODisappear | ( | const aircraft_t *const | ufo | ) |
Notify that a UFO disappear from radars.
[in] | ufo | Pointer to a UFO that has disappeared. |
Definition at line 1875 of file cp_aircraft.c.
References AIR_AircraftReturnToBase(), AIR_GetNextFromBase(), AIR_UFO, aircraft_s::aircraftTarget, B_GetBaseByIDX(), and aircraft_s::status.
Referenced by UFO_CampaignCheckEvents().
void AIR_AssignInitial | ( | aircraft_t * | aircraft | ) |
Assigns initial team of soldiers to aircraft.
[in,out] | aircraft | soldiers to add to |
Definition at line 3236 of file cp_aircraft.c.
References AIM_AddEmployeeFromMenu(), Com_Printf(), E_GenerateHiredEmployeesList(), aircraft_s::homebase, and aircraft_s::maxTeamSize.
Referenced by B_SetUpFirstBase().
void AIR_AutoAddPilotToAircraft | ( | base_t * | base, | |
employee_t * | pilot | |||
) |
Adds the pilot to the first available aircraft at the specified base.
[in] | base | Which base has aircraft to add the pilot to. |
[in] | pilot | Which pilot to add. |
Definition at line 2277 of file cp_aircraft.c.
References AIR_GetNextFromBase(), and aircraft_s::pilot.
Referenced by E_HireEmployee().
Checks whether there is any aircraft assigned to the given base.
[in] | base | The base to check |
true
if there is at least one aircraft, false
otherwise (or when the base
pointer is NULL
) Definition at line 68 of file cp_aircraft.c.
References AIR_GetNextFromBase().
Referenced by AIR_AircraftSelect(), AIR_DeleteAircraft(), B_BaseInit_f(), and B_BuildingOpenAfterClick().
int AIR_CalculateHangarStorage | ( | const aircraft_t * | aircraftTemplate, | |
const base_t * | base, | |||
int | used | |||
) |
Calculates free space in hangars in given base.
[in] | aircraftTemplate | aircraft in aircraftTemplates list. |
[in] | base | The base to calc the free space in. |
[in] | used | Additional space "used" in hangars (use that when calculating space for more than one aircraft). |
Definition at line 2988 of file cp_aircraft.c.
References AIR_GetCapacityByAircraftWeight(), base_s::capacities, cap_maxcur_s::cur, base_s::founded, cap_maxcur_s::max, and aircraft_s::tpl.
Referenced by BS_BuyAircraft_f(), PR_ProductionFrame(), PR_ProductionIncrease_f(), PR_QueueNew(), TR_CheckAircraft(), and TR_EmptyTransferCargo().
qboolean AIR_CanIntercept | ( | const aircraft_t * | aircraft | ) |
aircraft | The aircraft to check |
true
if the given aircraft can go on interceptions Definition at line 2914 of file cp_aircraft.c.
References AIRCRAFT_LARGE, AIRCRAFT_SMALL, B_GetBuildingStatus(), B_HANGAR, B_SMALL_HANGAR, aircraft_s::homebase, aircraft_s::pilot, qfalse, qtrue, and aircraft_s::size.
Referenced by CL_DisplayPopupInterceptMission(), and CL_DisplayPopupInterceptUFO().
const char* AIR_CheckMoveIntoNewHomebase | ( | const aircraft_t * | aircraft, | |
const base_t * | base, | |||
const int | capacity | |||
) |
Definition at line 875 of file cp_aircraft.c.
References _, AIR_AircraftHasEnoughFuelOneWay(), AIR_GetStorageRoom(), B_GetBuildingStatus(), B_GetBuildingTypeByCapacity(), CAP_EMPLOYEES, CAP_ITEMS, base_s::capacities, cap_maxcur_s::cur, cap_maxcur_s::max, aircraft_s::maxTeamSize, aircraft_s::pilot, and base_s::pos.
Referenced by AIR_MoveAircraftIntoNewHomebase(), and CL_DisplayHomebasePopup().
static void AIR_CorrectAircraftSlotPointers | ( | aircraft_t * | aircraft | ) | [static] |
resets aircraftSlots' backreference pointers for aircraft
[in] | aircraft | Pointer to the aircraft |
Definition at line 2791 of file cp_aircraft.c.
References aircraftSlot_s::aircraft, aircraftSlot_s::base, aircraft_s::electronics, aircraftSlot_s::installation, aircraft_s::maxElectronics, aircraft_s::maxWeapons, aircraft_s::shield, and aircraft_s::weapons.
Referenced by AIR_LoadXML().
int AIR_CountTypeInBase | ( | const base_t * | base, | |
aircraftType_t | aircraftType | |||
) |
Calculates the amount of aircraft (of the given type) in the selected base.
[in] | base | The base to count the aircraft in |
[in] | aircraftType | The type of the aircraft you want |
Definition at line 515 of file cp_aircraft.c.
References AIR_GetNextFromBase(), count, and aircraft_s::type.
Referenced by BaseSummary_Init().
qboolean AIR_Delete | ( | base_t * | base, | |
const aircraft_t * | aircraft | |||
) |
Will remove the given aircraft from the base.
[out] | base | The base to remove the aircraft from |
aircraft | The aircraft to remove |
true
if the aircraft was removed, false
otherwise Definition at line 774 of file cp_aircraft.c.
References base_s::aircraft, ccs, LIST_Remove(), and ccs_s::numAircraft.
Referenced by AIR_DeleteAircraft(), and AIR_MoveAircraftIntoNewHomebase().
void AIR_DeleteAircraft | ( | aircraft_t * | aircraft | ) |
Removes an aircraft from its base and the game.
[in] | aircraft | Pointer to aircraft that should be removed. |
Definition at line 1020 of file cp_aircraft.c.
References AII_RemoveItemFromSlot(), AIR_BaseHasAircraft(), AIR_Delete(), AIR_GetNextFromBase(), AIR_IsAircraftOnGeoscape(), AIR_RemoveEmployees(), AIR_UpdateHangarCapForAll(), base_s::aircraftCurrent, Cmd_ExecuteString(), Cvar_Set(), Cvar_SetValue(), aircraft_s::electronics, aircraft_s::homebase, i, MAP_NotifyAircraftRemoved(), MAX_AIRCRAFTSLOT, qfalse, RADAR_UpdateWholeRadarOverlay(), aircraft_s::shield, TR_NotifyAircraftRemoved(), and aircraft_s::weapons.
Referenced by AIR_DestroyAircraft(), B_RemoveAircraftExceedingCapacity(), BS_SellAircraft_f(), and TR_EmptyTransferCargo().
void AIR_DestroyAircraft | ( | aircraft_t * | aircraft | ) |
Removes an aircraft from its base and the game.
[in] | aircraft | Pointer to aircraft that should be removed. |
Definition at line 1078 of file cp_aircraft.c.
References aircraft_s::acTeam, AIR_DeleteAircraft(), Com_Error(), linkedList_s::data, E_DeleteEmployee(), E_RemoveInventoryFromStorage(), ERR_DROP, aircraft_s::id, linkedList_s::next, aircraft_s::pilot, and employee_s::type.
Referenced by AIRFIGHT_ActionsAfterAirfight(), B_MoveAircraftOnGeoscapeToOtherBases(), and CP_MissionEndActions().
aircraft_t* AIR_GetAircraft | ( | const char * | name | ) |
Searches the global array of aircraft types for a given aircraft.
[in] | name | Aircraft id. |
Definition at line 724 of file cp_aircraft.c.
References AIR_GetAircraftSilent(), Com_Error(), and ERR_DROP.
Referenced by AIR_LoadAircraftXML(), AIR_NewAircraft(), AIR_ParseAircraft(), B_SetUpFirstBase(), BS_InitMarket(), CL_CampaignRunMarket(), PR_LoadXML(), RS_AssignTechLinks(), UFO_MissionResultToString(), UP_AircraftDescription(), UR_DialogInit_f(), and US_LoadXML().
aircraft_t* AIR_GetAircraftFromBaseByIDXSafe | ( | base_t * | base, | |
int | index | |||
) |
base | The base to get the aircraft from | |
index | The index of the aircraft in the given base |
NULL
if there is no such aircraft in the given base, or the aircraft pointer that belongs to the given index. Definition at line 683 of file cp_aircraft.c.
References AIR_GetNextFromBase(), and i.
Referenced by AIM_SelectAircraft_f().
int AIR_GetAircraftIDXInBase | ( | const aircraft_t * | aircraft | ) |
Returns the index of the aircraft in the base->aircraft array.
[in] | aircraft | The aircraft to get the index for. |
Definition at line 655 of file cp_aircraft.c.
References AIR_GetNextFromBase(), AIRCRAFT_INBASE_INVALID, aircraft_s::homebase, and i.
Referenced by AIR_RemoveFromAircraftTeam(), and B_SaveXML().
aircraft_t* AIR_GetAircraftSilent | ( | const char * | name | ) |
Searches the global array of aircraft types for a given aircraft.
[in] | name | Aircraft id. |
Definition at line 705 of file cp_aircraft.c.
References ccs_s::aircraftTemplates, ccs, i, aircraft_s::id, and ccs_s::numAircraftTemplates.
Referenced by AIR_GetAircraft(), and GAME_CP_DisplayItemInfo().
const char* AIR_GetAircraftString | ( | aircraftType_t | aircraftType | ) |
Returns the string that matches the given aircraft type.
Definition at line 531 of file cp_aircraft.c.
References _, AIRCRAFT_INTERCEPTOR, AIRCRAFT_TRANSPORTER, and AIRCRAFT_UFO.
Referenced by BaseSummary_Init().
int AIR_GetAircraftWeaponRanges | ( | const aircraftSlot_t * | slot, | |
int | maxSlot, | |||
float * | weaponRanges | |||
) |
Get the all the unique weapon ranges of this aircraft.
[in] | slot | Pointer to the aircrafts weapon slot list. |
[in] | maxSlot | maximum number of weapon slots in aircraft. |
[out] | weaponRanges | An array containing a unique list of weapons ranges. |
Definition at line 2316 of file cp_aircraft.c.
References AIR_STATS_WRANGE, aircraftSlot_s::ammo, objDef_s::craftitem, MAX_AIRCRAFTSLOT, Q_FloatSort(), and craftitem_s::stats.
int AIR_GetCapacityByAircraftWeight | ( | const aircraft_t * | aircraft | ) |
Definition at line 831 of file cp_aircraft.c.
References AIRCRAFT_LARGE, AIRCRAFT_SMALL, CAP_AIRCRAFT_BIG, CAP_AIRCRAFT_SMALL, Com_Error(), ERR_DROP, and aircraft_s::size.
Referenced by AIR_CalculateHangarStorage(), AIR_MoveAircraftIntoNewHomebase(), and CL_DisplayHomebasePopup().
static float AIR_GetDestinationDerivativeFunction | ( | const float | c, | |
const float | B, | |||
const float | speedRatio, | |||
float | a | |||
) | [inline, static] |
derivative of the funtion we need to find roots.
[in] | c | angle SOT |
[in] | B | angle STI |
[in] | speedRatio | ratio of speed of shooter divided by speed of target. |
[in] | a | angle TOI |
Definition at line 1919 of file cp_aircraft.c.
Referenced by AIR_GetDestinationFindRoot().
static float AIR_GetDestinationFindRoot | ( | const float | c, | |
const float | B, | |||
const float | speedRatio, | |||
float | start | |||
) | [static] |
Find the roots of a function.
[in] | c | angle SOT |
[in] | B | angle STI |
[in] | speedRatio | ratio of speed of shooter divided by speed of target. |
[in] | start | minimum value of the root to find |
< step for rough calculation. this value must be short enough so that we're sure there's only 1 root in this range.
< precision of the calculation
< maximum value of the root to search
< precision of current point
< abscissa of the point
< ordinate of the point
< derivative of the point
Definition at line 1935 of file cp_aircraft.c.
References AIR_GetDestinationDerivativeFunction(), AIR_GetDestinationFunction(), Com_DPrintf(), Com_Error(), DEBUG_CLIENT, and ERR_DROP.
Referenced by AIR_GetDestinationWhilePursuing().
static float AIR_GetDestinationFunction | ( | const float | c, | |
const float | B, | |||
const float | speedRatio, | |||
float | a | |||
) | [inline, static] |
funtion we need to find roots.
[in] | c | angle SOT |
[in] | B | angle STI |
[in] | speedRatio | ratio of speed of shooter divided by speed of target. |
[in] | a | angle TOI |
Definition at line 1903 of file cp_aircraft.c.
Referenced by AIR_GetDestinationFindRoot().
void AIR_GetDestinationWhilePursuing | ( | const aircraft_t const * | shooter, | |
const aircraft_t const * | target, | |||
vec2_t * | dest | |||
) |
Calculates the point where aircraft should go to intecept a moving target.
[in] | shooter | Pointer to shooting aircraft. |
[in] | target | Pointer to target aircraft. |
[out] | dest | Destination that shooting aircraft should aim to intercept target aircraft. |
In the following, we note S the position of the shooter, T the position of the target, D the destination of the target and I the interception point where shooter should reach target O is the center of earth. A, B and C are the angles TSI, STI and SIT a, b, and c are the angles TOI, SOI and SOT
According to geometry on a sphere, the values defined above must be solutions of both equations: sin(A) / sin(a) = sin(B) / sin(b) cos(a) = cos(b) * cos(c) + sin(b) * sin(c) * cos(A) And we have another equation, given by the fact that shooter and target must reach I at the same time: shooterSpeed * a = targetSpeed * b We the want to find and equation linking a, c and B (we know the last 2 values). We therefore eliminate b, then A, to get the equation we need to solve: pow(cos(a) - cos(speedRatio * a) * cos(c), 2.)
Definition at line 2040 of file cp_aircraft.c.
References AIR_GetDestinationFindRoot(), AIR_STATS_SPEED, Com_DPrintf(), CrossProduct(), DEBUG_CLIENT, DotProduct, f, GetDistanceOnGlobe(), mapline_s::numPoints, mapline_s::point, PolarToVec(), aircraft_s::pos, RotatePointAroundVector(), aircraft_s::route, aircraft_s::stats, todeg, torad, VecToPolar(), Vector2Copy, and VectorNormalize().
Referenced by AIR_SendAircraftPursuingUFO(), and UFO_SendPursuingAircraft().
aircraft_t* AIR_GetNextFromBase | ( | const base_t * | b, | |
aircraft_t * | lastAircraft | |||
) |
Iterates through the aircraft of a base.
[in] | lastAircraft | Pointer of the aircraft to iterate from. call with NULL to get the first one. |
Definition at line 49 of file cp_aircraft.c.
References AIR_CRASHED, base_s::aircraft, and LIST_GetNext().
Referenced by AB_UpdateStealthForAllBase(), AII_RepairAircraft(), AII_UpdateInstallationDelay(), AIM_PilotAssignedAircraft(), AIR_AircraftGetFromIDX(), AIR_AircraftSelect(), AIR_AircraftsNotifyMissionRemoved(), AIR_AircraftsNotifyUFORemoved(), AIR_AircraftsUFODisappear(), AIR_AircraftUpdateList_f(), AIR_AutoAddPilotToAircraft(), AIR_BaseHasAircraft(), AIR_CountTypeInBase(), AIR_DeleteAircraft(), AIR_GetAircraftFromBaseByIDXSafe(), AIR_GetAircraftIDXInBase(), AIR_IsEmployeeInAircraft(), AIR_MoveAircraftIntoNewHomebase(), AIR_PostLoadInitMissions(), AIR_RemoveEmployee(), AIR_RemovePilotFromAssignedAircraft(), AIR_SaveXML(), AIR_UpdateHangarCapForAll(), B_MoveAircraftOnGeoscapeToOtherBases(), B_RemoveAircraftExceedingCapacity(), B_SetCurrentSelectedBase(), B_SetUpFirstBase(), BS_GetStorageAmountInBase(), BS_SellAircraft_f(), CL_CampaignRunAircraft(), CL_DisplayPopupInterceptMission(), CL_DisplayPopupInterceptUFO(), CL_ResetSinglePlayerData(), CL_StatsUpdate_f(), CL_UpdateEquipmentMenuParameters_f(), CP_BaseAttackMissionIsFailure(), CP_NationHandleBudget(), CP_SpawnRescueMission(), E_DeleteEmployee(), E_IsAwayFromBase(), MAP_DrawMapMarkers(), MAP_GetGeoscapeAngle(), MAP_MapClick(), RADAR_AddDetectedUFOToEveryRadar(), RADAR_DeactivateRadarOverlay(), RADAR_NotifyUFORemoved(), RADAR_UpdateWholeRadarOverlay(), RS_InitTree(), UFO_CampaignCheckEvents(), and UFO_SearchAircraftTarget().
int AIR_GetOperationRange | ( | const aircraft_t * | aircraft | ) |
Calculates the range an aircraft can fly on the geoscape.
aircraft | The aircraft to calculate the range for |
Definition at line 568 of file cp_aircraft.c.
References AIR_STATS_FUELSIZE, AIR_STATS_SPEED, f, int(), KILOMETER_PER_DEGREE, SECONDS_PER_HOUR, and aircraft_s::stats.
Referenced by AIR_AircraftSelect(), and UP_AircraftDescription().
int AIR_GetRemainingRange | ( | const aircraft_t * | aircraft | ) |
Calculates the remaining range the aircraft can fly.
aircraft | The aircraft to calculate the remaining range for |
Definition at line 580 of file cp_aircraft.c.
References AIR_STATS_SPEED, aircraft_s::fuel, and aircraft_s::stats.
Referenced by AIR_AircraftHasEnoughFuel(), and AIR_AircraftHasEnoughFuelOneWay().
static int AIR_GetStorageRoom | ( | const aircraft_t * | aircraft | ) | [static] |
Calculate used storage room corresponding to items in an aircraft.
[in] | aircraft | Pointer to the aircraft. |
Definition at line 846 of file cp_aircraft.c.
References aircraft_s::acTeam, employee_s::chr, CONTAINER, csi, linkedList_s::data, INVDEF, invList_s::item, item_s::m, invList_s::next, linkedList_s::next, csi_s::numIDs, objDef_s::size, and item_s::t.
Referenced by AIR_CheckMoveIntoNewHomebase().
int AIR_GetTeamSize | ( | const aircraft_t * | aircraft | ) |
Counts the number of soldiers in given aircraft.
[in] | aircraft | Pointer to the aircraft, for which we return the amount of soldiers. |
Definition at line 2266 of file cp_aircraft.c.
References aircraft_s::acTeam, and LIST_Count().
Referenced by AIR_AddEmployee(), AIR_AddToAircraftTeam(), AIR_IsInAircraftTeam(), AIR_LoadAircraftXML(), AIR_MoveEmployeeInventoryIntoStorage(), AIR_RemoveEmployees(), AIR_RemoveFromAircraftTeam(), AIR_SendAircraftToMission(), BS_SellAircraft_f(), CL_CleanupAircraftCrew(), CL_DisplayPopupAircraft(), CL_DisplayPopupInterceptMission(), CL_DisplayPopupInterceptUFO(), CL_GameAutoGo(), CL_UpdateActorAircraftVar(), CL_UpdateEquipmentMenuParameters_f(), CP_BaseAttackStartMission(), CP_GetWinProbabilty(), CP_StartSelectedMission(), and MAP_GetAircraftText().
qboolean AIR_IsAircraftInBase | ( | const aircraft_t * | aircraft | ) |
Checks whether given aircraft is in its homebase.
[in] | aircraft | Pointer to an aircraft. |
Definition at line 474 of file cp_aircraft.c.
References AIR_HOME, AIR_REFUEL, qfalse, qtrue, and aircraft_s::status.
Referenced by AII_ReloadWeapon(), AII_RepairAircraft(), AII_UpdateInstallationDelay(), AIM_AircraftStart_f(), AIR_AircraftSelect(), AIR_AircraftStatusToName(), AIR_SendAircraftPursuingUFO(), AIR_SendAircraftToMission(), AIRFIGHT_ProjectileHits(), B_RemoveAircraftExceedingCapacity(), BS_SellAircraft_f(), CL_EquipSoldierState(), E_IsAwayFromBase(), MAP_DrawMap(), and TR_AircraftListSelect().
qboolean AIR_IsAircraftOnGeoscape | ( | const aircraft_t * | aircraft | ) |
Checks whether given aircraft is on geoscape.
[in] | aircraft | Pointer to an aircraft. |
Definition at line 488 of file cp_aircraft.c.
References AIR_CRASHED, AIR_DROP, AIR_HOME, AIR_IDLE, AIR_INTERCEPT, AIR_MISSION, AIR_NONE, AIR_REFUEL, AIR_RETURNING, AIR_TRANSFER, AIR_TRANSIT, AIR_UFO, Com_Error(), ERR_FATAL, qfalse, qtrue, and aircraft_s::status.
Referenced by AB_UpdateStealthForAllBase(), AIR_AircraftReturnToBase(), AIR_DeleteAircraft(), B_MoveAircraftOnGeoscapeToOtherBases(), B_RemoveAircraftExceedingCapacity(), CL_CampaignRunAircraft(), MAP_DrawMapMarkers(), MAP_GetGeoscapeAngle(), MAP_MapClick(), RADAR_AddDetectedUFOToEveryRadar(), RADAR_UpdateWholeRadarOverlay(), UFO_CampaignCheckEvents(), UFO_CheckShootBack(), and UFO_SearchAircraftTarget().
const aircraft_t* AIR_IsEmployeeInAircraft | ( | const employee_t * | employee, | |
const aircraft_t * | aircraft | |||
) |
Tells you if a soldier is assigned to an aircraft.
[in] | employee | The soldier to search for. |
[in] | aircraft | The aircraft to search the soldier in. Use NULL to check if the soldier is in any aircraft. |
Definition at line 3056 of file cp_aircraft.c.
References AIR_GetNextFromBase(), AIR_IsInAircraftTeam(), B_GetFoundedBaseByIDX(), ccs, EMPL_PILOT, ccs_s::numBases, aircraft_s::pilot, employee_s::transfer, and employee_s::type.
Referenced by AIM_AddEmployeeFromMenu(), AIR_AddEmployee(), AIR_RemoveEmployee(), CL_UpdateCharacterStats(), CL_UpdateEmployeeList(), CP_MissionEnd(), E_RemoveEmployeeFromBuildingOrAircraft(), and TR_CheckEmployee().
qboolean AIR_IsInAircraftTeam | ( | const aircraft_t * | aircraft, | |
const employee_t * | employee | |||
) |
Checks whether given employee is in given aircraft.
[in] | aircraft | The aircraft to check |
[in] | employee | Employee to check. |
true
if the given employee is assigned to the given aircraft. Definition at line 2243 of file cp_aircraft.c.
References aircraft_s::acTeam, AIR_GetTeamSize(), Com_DPrintf(), Com_Printf(), DEBUG_CLIENT, LIST_GetPointer(), and qfalse.
Referenced by AIR_IsEmployeeInAircraft(), and E_IsAwayFromBase().
static void AIR_LoadAircraftSlotsXML | ( | aircraft_t * | aircraft, | |
aircraftSlot_t * | slot, | |||
mxml_node_t * | p, | |||
qboolean | weapon, | |||
const int | max | |||
) | [static] |
Loads the weapon slots of an aircraft.
[in] | aircraft | Pointer to the aircraft. |
[out] | slot | Pointer to the slot where item should be added. |
[in] | p | XML Node structure, where we get the information from |
[in] | weapon | True if the slot is a weapon slot. |
[in] | max | Maximum number of slots for this aircraft that should be loaded. |
Definition at line 2573 of file cp_aircraft.c.
References AII_LoadOneSlotXML(), aircraftSlot_s::aircraft, Com_Printf(), mxml_GetNextNode(), mxml_GetNode(), and SAVE_AIRCRAFT_SLOT.
Referenced by AIR_LoadAircraftXML().
static qboolean AIR_LoadAircraftXML | ( | mxml_node_t * | p, | |
aircraft_t * | craft | |||
) | [static] |
Loads an Aircraft from the savegame.
[in] | p | XML Node structure, where we get the information from |
[out] | craft | Pointer to the aircraft |
Definition at line 2618 of file cp_aircraft.c.
References _, aircraft_s::acTeam, AIR_AircraftGetFromIDX(), AIR_GetAircraft(), AIR_GetTeamSize(), AIR_LoadAircraftSlotsXML(), AIR_LoadRouteXML(), AIR_STATS_DAMAGE, aircraft_s::aircraftTarget, AL_GetAircraftAlienCargo, AL_SetAircraftAlienCargoTypes, itemsTmp_s::amount, aliensTmp_s::amountAlive, aliensTmp_s::amountDead, B_GetBaseByIDX(), ccs, Com_GetConstIntFromNamespace(), Com_GetTeamDefinitionByID(), Com_Printf(), Com_RegisterConstList(), Com_UnregisterConstList(), cp_campaignPool, aircraft_s::damage, date_s::day, aircraft_s::defaultName, aircraft_s::detected, aircraft_s::detectionIdx, aircraft_s::direction, E_GetEmployeeFromChrUCN(), aircraft_s::electronics, aircraft_s::fuel, aircraft_s::hangar, aircraft_s::homebase, aircraft_s::id, aircraft_s::idx, INVSH_GetItemByID(), itemsTmp_s::item, aircraft_s::itemcargo, aircraft_s::itemTypes, aircraft_s::landed, aircraft_s::lastSpotted, LIST_AddPointer(), MAX_CARGO, aircraft_s::maxElectronics, aircraft_s::maxTeamSize, aircraft_s::maxWeapons, Mem_PoolStrDup, aircraft_s::missionID, mxml_GetBool(), mxml_GetDate(), mxml_GetInt(), mxml_GetLong(), mxml_GetNextNode(), mxml_GetNode(), mxml_GetPos3(), mxml_GetString(), aircraft_s::name, ccs_s::numUFOs, aircraft_s::pilot, aircraft_s::point, aircraft_s::pos, Q_strncpyz(), qfalse, qtrue, aircraft_s::radar, RADAR_InitialiseUFOs(), radar_s::range, aircraft_s::route, SAVE_AIRCRAFT_AIRCRAFTTARGET, SAVE_AIRCRAFT_AIRCRAFTTEAM, SAVE_AIRCRAFT_AIRSTAT, SAVE_AIRCRAFT_AIRSTATID, SAVE_AIRCRAFT_AIRSTATS, SAVE_AIRCRAFT_ALIENCARGO, SAVE_AIRCRAFT_ALIVE, SAVE_AIRCRAFT_AMOUNT, SAVE_AIRCRAFT_CARGO, SAVE_AIRCRAFT_DAMAGE, SAVE_AIRCRAFT_DEAD, SAVE_AIRCRAFT_DETECTED, SAVE_AIRCRAFT_DETECTIONIDX, SAVE_AIRCRAFT_DIRECTION, SAVE_AIRCRAFT_ELECTRONICS, SAVE_AIRCRAFT_FUEL, SAVE_AIRCRAFT_HANGAR, SAVE_AIRCRAFT_HOMEBASE, SAVE_AIRCRAFT_ID, SAVE_AIRCRAFT_IDX, SAVE_AIRCRAFT_ITEM, SAVE_AIRCRAFT_ITEMID, SAVE_AIRCRAFT_LANDED, SAVE_AIRCRAFT_LASTSPOTTED_DATE, SAVE_AIRCRAFT_MEMBER, SAVE_AIRCRAFT_MISSIONID, SAVE_AIRCRAFT_NAME, SAVE_AIRCRAFT_PILOTUCN, SAVE_AIRCRAFT_POINT, SAVE_AIRCRAFT_POS, SAVE_AIRCRAFT_RADAR_RANGE, SAVE_AIRCRAFT_RADAR_TRACKINGRANGE, SAVE_AIRCRAFT_SHIELDS, SAVE_AIRCRAFT_STATUS, SAVE_AIRCRAFT_TEAM_UCN, SAVE_AIRCRAFT_TEAMDEFID, SAVE_AIRCRAFT_TIME, SAVE_AIRCRAFT_VAL, SAVE_AIRCRAFT_WEAPONS, SAVE_AIRCRAFTSTAT_NAMESPACE, SAVE_AIRCRAFTSTATUS_NAMESPACE, saveAircraftConstants, date_s::sec, aircraft_s::shield, aircraft_s::stats, aircraft_s::status, aliensTmp_s::teamDef, aircraft_s::time, radar_s::trackingRange, ccs_s::ufos, and aircraft_s::weapons.
Referenced by AIR_LoadXML().
static qboolean AIR_LoadRouteXML | ( | mxml_node_t * | p, | |
mapline_t * | route | |||
) | [static] |
Loads the route of an aircraft.
[in] | p | XML Node structure, where we get the information from |
[out] | route | Route points of the aircraft |
Definition at line 2591 of file cp_aircraft.c.
References Com_Printf(), count, mapline_s::distance, LINE_MAXPTS, mxml_GetFloat(), mxml_GetNextPos2(), mxml_GetNode(), mxml_GetPos2(), mapline_s::numPoints, mapline_s::point, qfalse, qtrue, SAVE_AIRCRAFT_ROUTE, SAVE_AIRCRAFT_ROUTE_DISTANCE, and SAVE_AIRCRAFT_ROUTE_POINT.
Referenced by AIR_LoadAircraftXML().
qboolean AIR_LoadXML | ( | mxml_node_t * | parent | ) |
Definition at line 2812 of file cp_aircraft.c.
References AIR_Add(), AIR_CorrectAircraftSlotPointers(), AIR_LoadAircraftXML(), AIR_STATS_SPEED, AIRFIGHT_LoadXML(), ccs, Com_Printf(), aircraft_s::homebase, MAX_UFOONGEOSCAPE, mxml_GetNextNode(), mxml_GetNode(), ccs_s::numAircraft, ccs_s::numUFOs, qfalse, qtrue, SAVE_AIRCRAFT_AIRCRAFT, SAVE_AIRCRAFT_PHALANX, SAVE_AIRCRAFT_PROJECTILES, SAVE_AIRCRAFT_UFOS, aircraft_s::stats, aircraft_s::time, UFO_GetByIDX(), UFO_RemoveFromGeoscape(), and ccs_s::ufos.
Referenced by SAV_Init().
static void AIR_Move | ( | aircraft_t * | aircraft, | |
int | deltaTime | |||
) | [static] |
Definition at line 1156 of file cp_aircraft.c.
References mission_s::active, AIR_AircraftMakeMove(), AIR_DROP, AIR_IDLE, AIR_MISSION, AIR_REFUEL, AIR_RETURNING, AIR_TRANSFER, AIR_UFO, B_AircraftReturnedToHomeBase(), ccs, CL_GameTimeStop(), Com_DPrintf(), DEBUG_CLIENT, aircraft_s::idx, ccs_s::interceptAircraft, MAP_CheckPositionBoundaries(), MAP_SelectMission(), aircraft_s::mission, ccs_s::missionAircraft, mapline_s::numPoints, mapline_s::point, aircraft_s::pos, qtrue, aircraft_s::route, aircraft_s::status, UI_PushWindow(), and Vector2Copy.
Referenced by CL_CampaignRunAircraft().
qboolean AIR_MoveAircraftIntoNewHomebase | ( | aircraft_t * | aircraft, | |
base_t * | base | |||
) |
Moves a given aircraft to a new base (also the employees and inventory).
[in] | aircraft | The aircraft to move into a new base |
[in] | base | The base to move the aircraft into |
Definition at line 934 of file cp_aircraft.c.
References aircraft_s::acTeam, AIR_Add(), AIR_AircraftReturnToBase(), AIR_CheckMoveIntoNewHomebase(), AIR_Delete(), AIR_GetCapacityByAircraftWeight(), AIR_GetNextFromBase(), AIR_HOME, AIR_RETURNING, AIR_TRANSFER, AIR_TransferItemsCarriedByCharacterToBase(), aircraftSlot_s::aircraft, base_s::aircraftCurrent, base_s::capacities, employee_s::chr, Com_DPrintf(), cap_maxcur_s::cur, linkedList_s::data, DEBUG_CLIENT, E_MoveIntoNewBase(), aircraft_s::electronics, aircraft_s::homebase, i, aircraft_s::id, MAP_SelectAircraft(), aircraft_s::maxElectronics, aircraft_s::maxWeapons, base_s::name, linkedList_s::next, aircraft_s::pilot, aircraft_s::pos, base_s::pos, qfalse, qtrue, aircraft_s::shield, aircraft_s::status, VectorCopy, and aircraft_s::weapons.
Referenced by B_MoveAircraftOnGeoscapeToOtherBases(), CL_PopupChangeHomebase_f(), and TR_EmptyTransferCargo().
void AIR_MoveEmployeeInventoryIntoStorage | ( | const aircraft_t * | aircraft, | |
equipDef_t * | ed | |||
) |
Move all the equipment carried by the team on the aircraft into the given equipment.
[in] | aircraft | The craft with the team (and thus equipment) onboard. |
[out] | ed | The equipment definition which will receive all the stuff from the aircraft-team. |
Definition at line 3126 of file cp_aircraft.c.
References item_s::a, aircraft_s::acTeam, AIR_GetTeamSize(), objDef_s::ammo, employee_s::chr, Com_DPrintf(), Com_Printf(), CONTAINER, csi, linkedList_s::data, DEBUG_CLIENT, objDef_s::idx, INVDEF, invList_s::item, item_s::m, invList_s::next, next, linkedList_s::next, csi_s::numIDs, equipDef_s::numItems, equipDef_s::numItemsLoose, objDef_s::reload, item_s::t, and type.
Referenced by B_PackInitialEquipment().
aircraft_t* AIR_NewAircraft | ( | base_t * | base, | |
const char * | name | |||
) |
Places a new aircraft in the given base.
[in] | base | Pointer to base where aircraft should be added. |
[in] | name | Id of aircraft to add (aircraft->id). |
< set a unique index to this aircraft.
Definition at line 786 of file cp_aircraft.c.
References _, AII_SetAircraftInSlots(), AII_UpdateAircraftStats(), AIR_Add(), AIR_GetAircraft(), AIR_ResetAircraftTeam(), AIR_STATS_DAMAGE, AIR_STATS_FUELSIZE, AIR_UpdateHangarCapForOne(), AIRCRAFT_HANGAR_ERROR, base_s::aircraftCurrent, stats_s::aircraftHad, ccs_s::campaignStats, ccs, Cmd_ExecuteString(), Com_DPrintf(), Com_Printf(), Com_sprintf(), cp_messageBuffer, aircraft_s::damage, DEBUG_CLIENT, aircraft_s::defaultName, aircraft_s::direction, aircraft_s::fuel, aircraft_s::hangar, aircraft_s::homebase, aircraft_s::id, aircraft_s::idx, lengthof, MS_AddNewMessage(), MSG_STANDARD, base_s::name, aircraft_s::name, aircraft_s::pos, base_s::pos, Q_strncpyz(), qfalse, aircraft_s::radar, RADAR_AIRCRAFTRANGE, RADAR_AIRCRAFTTRACKINGRANGE, RADAR_Initialise(), aircraft_s::size, aircraft_s::stats, aircraft_s::tpl, Vector2Copy, and VectorSet.
Referenced by B_SetUpFirstBase(), BS_BuyAircraft_f(), and PR_ProductionFrame().
void AIR_ParseAircraft | ( | const char * | name, | |
const char ** | text, | |||
qboolean | assignAircraftItems | |||
) |
Parses all aircraft that are defined in our UFO-scripts.
Definition at line 1468 of file cp_aircraft.c.
References AC_ITEM_ELECTRONICS, AC_ITEM_WEAPON, AII_InitialiseAircraftSlots(), AIR_GetAircraft(), AIR_HOME, AIR_POSITIONS_MAX, air_slot_type_strings, AIR_STATS_FUELSIZE, AIR_STATS_SPEED, AIRCRAFT_INTERCEPTOR, AIRCRAFT_LARGE, AIRCRAFT_SMALL, AIRCRAFT_TRANSPORTER, AIRCRAFT_UFO, ccs_s::aircraftTemplates, aircraftSlot_s::ammo, ccs, cl_genericPool, Com_DPrintf(), Com_EParse(), Com_EParseValue(), Com_Error(), Com_Parse(), Com_Printf(), Com_UFOShortNameToID(), DEBUG_CLIENT, aircraft_s::electronics, ERR_DROP, f, FS_SkipBlock(), i, aircraft_s::id, int(), INVSH_GetItemByID(), aircraftSlot_s::item, ITEM_HEAVY, ITEM_LIGHT, ITEM_MEDIUM, MAX_ACITEMS, MAX_AIRCRAFT, aircraft_s::maxElectronics, aircraft_s::maxWeapons, Mem_PoolStrDup, Mem_PoolStrDupTo, MEMBER_SIZEOF, aircraft_s::name, ccs_s::numAircraftTemplates, value_s::ofs, aircraftSlot_s::pos, technology_s::provides, Q_strncpyz(), aircraft_s::radar, RADAR_InitialiseUFOs(), RS_GetTechByID(), SECONDS_PER_HOUR, aircraft_s::shield, aircraft_s::size, value_s::size, aircraftSlot_s::size, aircraft_s::stats, aircraft_s::status, value_s::string, Sys_Error(), aircraft_s::tpl, value_s::type, aircraft_s::type, UFO_MAX, aircraft_s::ufotype, V_CLIENT_HUNK_STRING, V_INT, V_TRANSLATION_STRING, and aircraft_s::weapons.
Referenced by CL_ParseScriptFirst(), and CL_ParseScriptSecond().
void AIR_PostLoadInit | ( | void | ) |
Actions needs to be done after loading the savegame.
Definition at line 2895 of file cp_aircraft.c.
References AIR_PostLoadInitMissions().
Referenced by SAV_GameActionsAfterLoad().
static void AIR_PostLoadInitMissions | ( | void | ) | [static] |
Set the mission pointers for all the aircraft after loading a savegame.
Definition at line 2861 of file cp_aircraft.c.
References AIR_GetNextFromBase(), B_GetFoundedBaseByIDX(), ccs, CP_GetMissionByID(), Mem_Free, aircraft_s::mission, aircraft_s::missionID, ccs_s::numBases, ccs_s::numUFOs, and UFO_GetByIDX().
Referenced by AIR_PostLoadInit().
static void AIR_Refuel | ( | aircraft_t * | aircraft, | |
int | deltaTime | |||
) | [static] |
Definition at line 1193 of file cp_aircraft.c.
References _, AIR_CANNOT_REFUEL, AIR_HOME, AIR_STATS_ANTIMATTER, AIR_STATS_FUELSIZE, AIRCRAFT_REFUEL_FACTOR, ANTIMATTER_TECH_ID, B_ItemInBase(), B_ManageAntimatter(), Com_sprintf(), cp_messageBuffer, aircraft_s::fuel, aircraft_s::homebase, INVSH_GetItemByID(), lengthof, MSG_STANDARD, MSO_CheckAddNewMessage(), base_s::name, aircraft_s::name, aircraft_s::notifySent, NT_AIRCRAFT_CANNOTREFUEL, NT_AIRCRAFT_REFUELED, qfalse, qtrue, aircraft_s::stats, and aircraft_s::status.
Referenced by CL_CampaignRunAircraft().
qboolean AIR_RemoveEmployee | ( | employee_t * | employee, | |
aircraft_t * | aircraft | |||
) |
Removes a soldier from an aircraft.
[in,out] | employee | The soldier to be removed from the aircraft. |
[in,out] | aircraft | The aircraft to remove the soldier from. Use NULL to remove the soldier from any aircraft. |
Definition at line 3012 of file cp_aircraft.c.
References AIR_GetNextFromBase(), AIR_IsEmployeeInAircraft(), AIR_RemoveFromAircraftTeam(), B_GetFoundedBaseByIDX(), ccs, employee_s::chr, cls, Com_DPrintf(), DEBUG_CLIENT, inventoryInterface_s::DestroyInventory, aircraft_s::homebase, character_s::i, client_static_s::i, aircraft_s::idx, base_s::idx, ccs_s::numBases, and qfalse.
Referenced by AIM_AddEmployeeFromMenu(), AIR_RemoveEmployees(), CP_SpawnRescueMission(), and E_RemoveEmployeeFromBuildingOrAircraft().
void AIR_RemoveEmployees | ( | aircraft_t * | aircraft | ) |
Removes all soldiers from an aircraft.
[in,out] | aircraft | The aircraft to remove the soldiers from. |
Definition at line 3099 of file cp_aircraft.c.
References aircraft_s::acTeam, AIR_GetTeamSize(), AIR_RemoveEmployee(), Com_Error(), linkedList_s::data, ERR_DROP, linkedList_s::next, and aircraft_s::pilot.
Referenced by AIR_DeleteAircraft(), and TR_TransferStart().
qboolean AIR_RemoveFromAircraftTeam | ( | aircraft_t * | aircraft, | |
const employee_t * | employee | |||
) |
Removes given employee from given aircraft team.
[in] | aircraft | The aircraft to remove the employee from. |
[in] | employee | The employee to remove from the team. |
Definition at line 2208 of file cp_aircraft.c.
References aircraft_s::acTeam, AIR_GetAircraftIDXInBase(), AIR_GetTeamSize(), Com_DPrintf(), Com_Printf(), linkedList_s::data, DEBUG_CLIENT, aircraft_s::homebase, base_s::idx, aircraft_s::idx, employee_s::idx, LIST_RemoveEntry(), aircraft_s::maxTeamSize, linkedList_s::next, qfalse, qtrue, and employee_s::type.
Referenced by AIR_RemoveEmployee().
void AIR_RemovePilotFromAssignedAircraft | ( | base_t * | base, | |
const employee_t * | pilot | |||
) |
Checks to see if the pilot is in any aircraft at this base. If he is then he is removed from that aircraft.
[in] | base | Which base has the aircraft to search for the employee in. |
[in] | pilot | Which pilot to search for. |
Definition at line 2296 of file cp_aircraft.c.
References AIR_GetNextFromBase(), and aircraft_s::pilot.
Referenced by CP_SpawnRescueMission(), and E_RemoveEmployeeFromBuildingOrAircraft().
void AIR_ResetAircraftTeam | ( | aircraft_t * | aircraft | ) |
Resets team in given aircraft.
[in] | aircraft | Pointer to an aircraft, where the team will be reset. |
Definition at line 2169 of file cp_aircraft.c.
References aircraft_s::acTeam, and LIST_Delete().
Referenced by AIR_NewAircraft().
static void AIR_SaveAircraftSlotsXML | ( | const aircraftSlot_t * | slot, | |
const int | num, | |||
mxml_node_t * | p, | |||
qboolean | weapon | |||
) | [static] |
Saves an item slot.
[in] | slot | Pointer to the slot where item is. |
[in] | num | Number of slots for this aircraft. |
[out] | p | XML Node structure, where we write the information to |
[in] | p | pointer where information are written. |
[in] | weapon | True if the slot is a weapon slot. |
Definition at line 2380 of file cp_aircraft.c.
References AII_SaveOneSlotXML(), mxml_AddNode(), and SAVE_AIRCRAFT_SLOT.
Referenced by AIR_SaveAircraftXML().
static qboolean AIR_SaveAircraftXML | ( | mxml_node_t * | p, | |
const aircraft_t *const | aircraft, | |||
qboolean const | isUfo | |||
) | [static] |
Saves an aircraft.
[out] | p | XML Node structure, where we write the information to |
[in] | aircraft | Aircraft we save |
[in] | isUfo | If this aircraft is a UFO |
detection id and time
Definition at line 2397 of file cp_aircraft.c.
References aircraft_s::acTeam, AIR_MISSION, AIR_SaveAircraftSlotsXML(), AIR_SaveRouteXML(), AIR_STATS_DAMAGE, aircraft_s::aircraftTarget, AL_GetAircraftAlienCargo, AL_GetAircraftAlienCargoTypes, itemsTmp_s::amount, ccs, employee_s::chr, Com_GetConstVariable(), Com_Printf(), Com_RegisterConstList(), Com_UnregisterConstList(), aircraft_s::damage, linkedList_s::data, date_s::day, aircraft_s::detected, aircraft_s::detectionIdx, aircraft_s::direction, aircraft_s::electronics, aircraft_s::fuel, aircraft_s::hangar, aircraft_s::homebase, objDef_s::id, mission_s::id, aircraft_s::id, aircraft_s::idx, base_s::idx, itemsTmp_s::item, aircraft_s::itemcargo, aircraft_s::itemTypes, aircraft_s::landed, aircraft_s::lastSpotted, aircraft_s::maxElectronics, aircraft_s::maxWeapons, aircraft_s::mission, mxml_AddBoolValue(), mxml_AddDate(), mxml_AddInt(), mxml_AddIntValue(), mxml_AddLong(), mxml_AddNode(), mxml_AddPos3(), mxml_AddString(), aircraft_s::name, linkedList_s::next, aircraft_s::pilot, aircraft_s::point, aircraft_s::pos, qfalse, qtrue, aircraft_s::radar, radar_s::range, aircraft_s::route, SAVE_AIRCRAFT_AIRCRAFT, SAVE_AIRCRAFT_AIRCRAFTTARGET, SAVE_AIRCRAFT_AIRCRAFTTEAM, SAVE_AIRCRAFT_AIRSTAT, SAVE_AIRCRAFT_AIRSTATID, SAVE_AIRCRAFT_AIRSTATS, SAVE_AIRCRAFT_ALIENCARGO, SAVE_AIRCRAFT_ALIVE, SAVE_AIRCRAFT_AMOUNT, SAVE_AIRCRAFT_CARGO, SAVE_AIRCRAFT_DAMAGE, SAVE_AIRCRAFT_DEAD, SAVE_AIRCRAFT_DETECTED, SAVE_AIRCRAFT_DETECTIONIDX, SAVE_AIRCRAFT_DIRECTION, SAVE_AIRCRAFT_ELECTRONICS, SAVE_AIRCRAFT_FUEL, SAVE_AIRCRAFT_HANGAR, SAVE_AIRCRAFT_HOMEBASE, SAVE_AIRCRAFT_ID, SAVE_AIRCRAFT_IDX, SAVE_AIRCRAFT_ITEM, SAVE_AIRCRAFT_ITEMID, SAVE_AIRCRAFT_LANDED, SAVE_AIRCRAFT_LASTSPOTTED_DATE, SAVE_AIRCRAFT_MEMBER, SAVE_AIRCRAFT_MISSIONID, SAVE_AIRCRAFT_NAME, SAVE_AIRCRAFT_PILOTUCN, SAVE_AIRCRAFT_POINT, SAVE_AIRCRAFT_POS, SAVE_AIRCRAFT_RADAR_RANGE, SAVE_AIRCRAFT_RADAR_TRACKINGRANGE, SAVE_AIRCRAFT_SHIELDS, SAVE_AIRCRAFT_STATUS, SAVE_AIRCRAFT_TEAM_UCN, SAVE_AIRCRAFT_TEAMDEFID, SAVE_AIRCRAFT_TIME, SAVE_AIRCRAFT_VAL, SAVE_AIRCRAFT_WEAPONS, SAVE_AIRCRAFTSTAT_NAMESPACE, SAVE_AIRCRAFTSTATUS_NAMESPACE, saveAircraftConstants, date_s::sec, aircraft_s::shield, aircraft_s::stats, aircraft_s::status, aircraft_s::time, radar_s::trackingRange, character_s::ucn, ccs_s::ufos, and aircraft_s::weapons.
Referenced by AIR_SaveXML().
static void AIR_SaveRouteXML | ( | mxml_node_t * | node, | |
const mapline_t * | route | |||
) | [static] |
Saves an route plan of an aircraft.
[out] | node | XML Node structure, where we write the information to |
[in] | route | Aircraft route plan |
Definition at line 2358 of file cp_aircraft.c.
References mapline_s::distance, mxml_AddFloatValue(), mxml_AddNode(), mxml_AddPos2(), mapline_s::numPoints, mapline_s::point, SAVE_AIRCRAFT_ROUTE, SAVE_AIRCRAFT_ROUTE_DISTANCE, and SAVE_AIRCRAFT_ROUTE_POINT.
Referenced by AIR_SaveAircraftXML().
qboolean AIR_SaveXML | ( | mxml_node_t * | parent | ) |
Save callback for savegames in xml format.
Definition at line 2527 of file cp_aircraft.c.
References AIR_GetNextFromBase(), AIR_SaveAircraftXML(), AIRFIGHT_SaveXML(), B_GetFoundedBaseByIDX(), aircraft_s::id, MAX_UFOONGEOSCAPE, mxml_AddNode(), qfalse, qtrue, SAVE_AIRCRAFT_PHALANX, SAVE_AIRCRAFT_PROJECTILES, SAVE_AIRCRAFT_UFOS, and UFO_GetByIDX().
Referenced by SAV_Init().
qboolean AIR_ScriptSanityCheck | ( | void | ) |
Checks the parsed aircraft for errors.
Definition at line 2933 of file cp_aircraft.c.
References AII_GetItemWeightBySize(), AIRCRAFT_UFO, ccs_s::aircraftTemplates, ccs, Com_Printf(), aircraft_s::defaultName, aircraft_s::electronics, error(), objDef_s::id, aircraft_s::id, aircraftSlot_s::item, aircraft_s::maxElectronics, aircraft_s::maxWeapons, aircraft_s::name, ccs_s::numAircraftTemplates, aircraftSlot_s::pos, aircraftSlot_s::size, aircraft_s::type, and aircraft_s::weapons.
qboolean AIR_SendAircraftPursuingUFO | ( | aircraft_t * | aircraft, | |
aircraft_t * | ufo | |||
) |
Make the specified aircraft purchasing a UFO.
[in] | aircraft | Pointer to an aircraft which will hunt for a UFO. |
[in] | ufo | Pointer to a UFO. |
Definition at line 2125 of file cp_aircraft.c.
References _, AII_ReloadAircraftWeapons(), AIR_AircraftHasEnoughFuel(), AIR_AircraftReturnToBase(), AIR_GetDestinationWhilePursuing(), AIR_IsAircraftInBase(), AIR_UFO, aircraft_s::aircraftTarget, ccs, Com_DPrintf(), DEBUG_CLIENT, dest, aircraft_s::homebase, MAP_MapCalcLine(), MS_AddNewMessage(), MSG_STANDARD, base_s::name, aircraft_s::name, ccs_s::numUFOs, aircraft_s::point, aircraft_s::pos, qfalse, qtrue, aircraft_s::route, aircraft_s::status, aircraft_s::time, ccs_s::ufos, va(), and Vector2Copy.
Referenced by AIRFIGHT_ExecuteActions(), and CL_PopupInterceptClick_f().
qboolean AIR_SendAircraftToMission | ( | aircraft_t * | aircraft, | |
mission_t * | mission | |||
) |
Sends the specified aircraft to specified mission.
[in] | aircraft | Pointer to aircraft to send to mission. |
[in] | mission | Pointer to given mission. |
Definition at line 1350 of file cp_aircraft.c.
References _, mission_s::active, AII_ReloadAircraftWeapons(), AIR_AircraftHasEnoughFuel(), AIR_GetTeamSize(), AIR_IsAircraftInBase(), AIR_MISSION, BASE_UNDER_ATTACK, base_s::baseStatus, ccs, aircraft_s::homebase, ccs_s::interceptAircraft, MAP_MapCalcLine(), aircraft_s::mission, MS_AddNewMessage(), MSG_STANDARD, aircraft_s::point, aircraft_s::pos, mission_s::pos, qfalse, qtrue, aircraft_s::route, aircraft_s::status, aircraft_s::time, UI_Popup(), and UI_PushWindow().
Referenced by CL_PopupAircraftClick_f(), and CL_PopupInterceptClick_f().
static void AIR_TransferItemsCarriedByCharacterToBase | ( | character_t * | chr, | |
base_t * | sourceBase, | |||
base_t * | destBase | |||
) | [static] |
Transfer items carried by a soldier from one base to another.
[in] | chr | Pointer to the character. |
[in] | sourceBase | Base where employee comes from. |
[in] | destBase | Base where employee is going. |
Definition at line 903 of file cp_aircraft.c.
References B_UpdateStorageAndCapacity(), CONTAINER, csi, INVDEF, invList_s::item, item_s::m, invList_s::next, csi_s::numIDs, qfalse, and item_s::t.
Referenced by AIR_MoveAircraftIntoNewHomebase().
void AIR_UpdateHangarCapForAll | ( | base_t * | base | ) |
Updates current capacities for hangars in given base.
[in,out] | base | The base we want to update. |
Definition at line 135 of file cp_aircraft.c.
References AIR_GetNextFromBase(), AIR_UpdateHangarCapForOne(), CAP_AIRCRAFT_BIG, CAP_AIRCRAFT_SMALL, base_s::capacities, Com_DPrintf(), cap_maxcur_s::cur, DEBUG_CLIENT, aircraft_s::id, base_s::name, and aircraft_s::tpl.
Referenced by AIR_DeleteAircraft(), B_ResetAllStatusAndCapacities(), and CP_SpawnRescueMission().
static int AIR_UpdateHangarCapForOne | ( | const aircraft_t const * | aircraftTemplate, | |
base_t * | base | |||
) | [static] |
Updates hangar capacities for one aircraft in given base.
[in] | aircraftTemplate | Aircraft template. |
[in,out] | base | Pointer to base. |
Definition at line 83 of file cp_aircraft.c.
References AIRCRAFT_HANGAR_BIG, AIRCRAFT_HANGAR_ERROR, AIRCRAFT_HANGAR_SMALL, AIRCRAFT_LARGE, B_GetBuildingStatus(), B_HANGAR, B_SMALL_HANGAR, CAP_AIRCRAFT_BIG, CAP_AIRCRAFT_SMALL, base_s::capacities, Com_Printf(), cap_maxcur_s::cur, cap_maxcur_s::max, aircraft_s::size, and aircraft_s::tpl.
Referenced by AIR_NewAircraft(), and AIR_UpdateHangarCapForAll().
int CL_AircraftMenuStatsValues | ( | const int | value, | |
const int | stat | |||
) |
Some of the aircraft values needs special calculations when they are shown in the menus.
Definition at line 549 of file cp_aircraft.c.
References AIR_STATS_FUELSIZE, AIR_STATS_MAXSPEED, AIR_STATS_SPEED, f, and int().
Referenced by AIR_AircraftSelect(), MAP_GetAircraftText(), MAP_GetUFOText(), UP_AircraftDescription(), and UP_AircraftItemDescription().
void CL_CampaignRunAircraft | ( | int | dt, | |
qboolean | updateRadarOverlay | |||
) |
Handles aircraft movement and actions in geoscape mode.
[in] | dt | time delta (may be 0 if radar overlay should be updated but no aircraft moves) |
[in] | updateRadarOverlay | True if radar overlay should be updated (not needed if geoscape isn't updated) |
Definition at line 1250 of file cp_aircraft.c.
References _, AII_ReloadWeapon(), AIR_AircraftHasEnoughFuel(), AIR_AircraftReturnToBase(), AIR_GetNextFromBase(), AIR_IDLE, AIR_IsAircraftOnGeoscape(), AIR_Move(), AIR_Refuel(), AIR_REFUEL, AIR_RETURNING, AIR_UFO, aircraft_s::aircraftTarget, AIRFIGHT_ExecuteActions(), aircraftSlot_s::ammoLeft, B_GetBaseByIDX(), aircraftSlot_s::delayNextShot, aircraft_s::fuel, aircraft_s::homebase, MAP_IsRadarOverlayActivated(), aircraft_s::maxWeapons, MS_AddNewMessage(), MSG_STANDARD, aircraft_s::name, aircraft_s::pos, qfalse, qtrue, RADAR_UpdateWholeRadarOverlay(), aircraft_s::status, va(), and aircraft_s::weapons.
Referenced by CL_CampaignFunctionPeriodicCall().
const char* air_position_strings[AIR_POSITIONS_MAX] [static] |
{ "nose_left", "nose_center", "nose_right", "wing_left", "wing_right", "rear_left", "rear_center", "rear_right" }
List of valid strings for itemPos_t.
itemPos_t
Definition at line 1413 of file cp_aircraft.c.
const value_t aircraft_param_vals[] [static] |
{ {"speed", V_INT, offsetof(aircraft_t, stats[AIR_STATS_SPEED]), MEMBER_SIZEOF(aircraft_t, stats[0])}, {"maxspeed", V_INT, offsetof(aircraft_t, stats[AIR_STATS_MAXSPEED]), MEMBER_SIZEOF(aircraft_t, stats[0])}, {"shield", V_INT, offsetof(aircraft_t, stats[AIR_STATS_SHIELD]), MEMBER_SIZEOF(aircraft_t, stats[0])}, {"ecm", V_INT, offsetof(aircraft_t, stats[AIR_STATS_ECM]), MEMBER_SIZEOF(aircraft_t, stats[0])}, {"damage", V_INT, offsetof(aircraft_t, stats[AIR_STATS_DAMAGE]), MEMBER_SIZEOF(aircraft_t, stats[0])}, {"accuracy", V_INT, offsetof(aircraft_t, stats[AIR_STATS_ACCURACY]), MEMBER_SIZEOF(aircraft_t, stats[0])}, {"antimatter", V_INT, offsetof(aircraft_t, stats[AIR_STATS_ANTIMATTER]), MEMBER_SIZEOF(aircraft_t, stats[0])}, {NULL, 0, 0, 0} }
Valid aircraft parameter definitions from script files.
Definition at line 1427 of file cp_aircraft.c.
const value_t aircraft_vals[] [static] |
{ {"name", V_STRING, offsetof(aircraft_t, name), 0}, {"defaultname", V_TRANSLATION_STRING, offsetof(aircraft_t, defaultName), 0}, {"numteam", V_INT, offsetof(aircraft_t, maxTeamSize), MEMBER_SIZEOF(aircraft_t, maxTeamSize)}, {"size", V_INT, offsetof(aircraft_t, size), MEMBER_SIZEOF(aircraft_t, size)}, {"nogeoscape", V_BOOL, offsetof(aircraft_t, notOnGeoscape), MEMBER_SIZEOF(aircraft_t, notOnGeoscape)}, {"interestlevel", V_INT, offsetof(aircraft_t, ufoInterestOnGeoscape), MEMBER_SIZEOF(aircraft_t, ufoInterestOnGeoscape)}, {"image", V_CLIENT_HUNK_STRING, offsetof(aircraft_t, image), 0}, {"model", V_CLIENT_HUNK_STRING, offsetof(aircraft_t, model), 0}, {"price", V_INT, offsetof(aircraft_t, price), MEMBER_SIZEOF(aircraft_t, price)}, {"building", V_CLIENT_HUNK_STRING, offsetof(aircraft_t, building), 0}, {NULL, 0, 0, 0} }
Valid aircraft definition values from script files.
Definition at line 1440 of file cp_aircraft.c.
equipDef_t eTempEq [static] |
Used to count ammo in magazines.
Definition at line 259 of file cp_aircraft.c.