29 #include "../../cl_shared.h"
30 #include "../../ui/ui_dataids.h"
31 #include "../../../shared/parse.h"
91 static void AIR_ListAircraft_f (
void)
95 if (
cgi->Cmd_Argc() == 2) {
101 if (base && aircraft->homebase != base)
104 cgi->Com_Printf(
"Aircraft %s\n", aircraft->name);
105 cgi->Com_Printf(
"...idx global %i\n", aircraft->idx);
106 cgi->Com_Printf(
"...homebase: %s\n", aircraft->homebase ? aircraft->homebase->name :
"NO HOMEBASE");
107 for (
int i = 0;
i < aircraft->maxWeapons;
i++) {
110 cgi->Com_Printf(
"...weapon slot %i contains %s",
i, slot->
item->
id);
113 cgi->Com_Printf(
" (functional)\n");
122 cgi->Com_Printf(
"......this weapon is loaded with ammo %s\n", slot->
ammo->
id);
124 cgi->Com_Printf(
"......no more ammo (%s)\n", slot->
ammo->
id);
127 cgi->Com_Printf(
"......this weapon isn't loaded with ammo\n");
130 cgi->Com_Printf(
"...weapon slot %i is empty\n",
i);
134 if (aircraft->shield.item) {
135 cgi->Com_Printf(
"...armour slot contains %s", aircraft->shield.item->id);
136 if (!aircraft->shield.installationTime) {
137 cgi->Com_Printf(
" (functional)\n");
138 }
else if (aircraft->shield.installationTime > 0) {
139 cgi->Com_Printf(
" (%i hours before installation is finished)\n", aircraft->shield.installationTime);
141 cgi->Com_Printf(
" (%i hours before removing is finished)\n", aircraft->shield.installationTime);
144 cgi->Com_Printf(
"...armour slot is empty\n");
147 for (
int j = 0; j < aircraft->maxElectronics; j++) {
150 cgi->Com_Printf(
"...electronics slot %i contains %s", j, slot->
item->
id);
153 cgi->Com_Printf(
" (functional)\n");
160 cgi->Com_Printf(
"...electronics slot %i is empty\n", j);
164 if (aircraft->pilot) {
166 cgi->Com_Printf(
"...pilot: ucn: %i name: %s\n", chr->
ucn, chr->
name);
168 cgi->Com_Printf(
"...no pilot assigned\n");
171 cgi->Com_Printf(
"...damage: %i\n", aircraft->damage);
172 cgi->Com_Printf(
"...stats: ");
175 cgi->Com_Printf(
"%.2f ", aircraft->stats[k] / 1000.0f);
177 cgi->Com_Printf(
"%i ", aircraft->stats[k]);
180 cgi->Com_Printf(
"\n");
181 cgi->Com_Printf(
"...name %s\n", aircraft->id);
182 cgi->Com_Printf(
"...team size %i\n", aircraft->maxTeamSize);
183 cgi->Com_Printf(
"...fuel %i\n", aircraft->fuel);
185 cgi->Com_Printf(
"...pos %.0f:%.0f\n", aircraft->pos[0], aircraft->pos[1]);
186 cgi->Com_Printf(
"...team: (%i/%i)\n",
cgi->LIST_Count(aircraft->acTeam), aircraft->maxTeamSize);
189 cgi->Com_Printf(
".........name: %s (ucn: %i)\n", chr->
name, chr->
ucn);
192 if (aircraft->itemCargo) {
193 cgi->Com_Printf(
"...itemCargo:\n");
196 cgi->Com_Printf(
"......item: %s amount: %d loose amount: %d\n", item->objDef->id, item->amount, item->looseAmount);
198 cgi->LIST_Delete(&cargo);
201 if (aircraft->alienCargo) {
202 cgi->Com_Printf(
"...alienCargo:\n");
205 cgi->Com_Printf(
"......team: %s alive: %d dead: %d\n", item->teamDef->id, item->alive, item->dead);
207 cgi->LIST_Delete(&cargo);
221 if (aircraft ==
nullptr)
238 if (aircraft ==
nullptr)
261 while ((cont = soldierInventory->
getNextCont(cont))) {
308 if (item->amount > 0)
309 cgi->Com_DPrintf(
DEBUG_CLIENT,
"Collected item: %s amount: %i\n", item->objDef->id, item->amount);
312 cgi->LIST_Delete(&items);
314 items = previousCargo->
list();
316 aircraft->
itemCargo->
add(item->objDef, item->amount, item->looseAmount);
318 cgi->LIST_Delete(&items);
319 delete previousCargo;
334 return _(
"ON RED ALERT");
336 switch (aircraft->
status) {
338 return _(
"Nothing - should not be displayed");
342 return _(
"refuelling");
346 return _(
"in transit");
348 return _(
"enroute to mission");
350 return _(
"pursuing a UFO");
352 return _(
"ready to drop soldiers");
354 return _(
"intercepting a UFO");
356 return _(
"enroute to new home base");
358 return _(
"returning to base");
360 cgi->Com_Error(
ERR_DROP,
"AIR_CRASHED should not be visible anywhere");
387 switch (aircraft->
status) {
417 if (aircraft->tpl == aircraftTemplate)
434 return 10 * (
int) (111.2 * value / 10.0
f);
561 return aircraftTemplate;
575 cgi->Com_Error(
ERR_DROP,
"AIR_GetAircraft called with invalid name!");
576 else if (aircraft ==
nullptr)
577 cgi->Com_Error(
ERR_DROP,
"Aircraft '%s' not found", name);
632 if (base && capType !=
MAX_CAP && !crashed)
675 cgi->Com_DPrintf(
DEBUG_CLIENT,
"Adding new aircraft %s with IDX %i for %s\n", aircraft->
id, aircraft->
idx, base->
name);
680 cgi->Cmd_ExecuteString(
"base_init %d", base->
idx);
690 if (aircraft ==
nullptr)
694 if (building ==
nullptr)
710 while ((cont = employee->chr.inv.getNextCont(cont,
true))) {
711 Item* item =
nullptr;
736 return _(
"No operational hangars at that base.");
740 return _(
"No free hangars at that base.");
743 return _(
"Insufficient free crew quarter space at that base.");
746 return _(
"Insufficient storage space at that base.");
750 return _(
"That base is beyond this aircraft's range.");
765 Item* item =
nullptr;
793 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_MoveAircraftIntoNewHomebase: Change homebase of '%s' to '%s'\n", aircraft->
id, base->
name);
874 cgi->Cmd_ExecuteString(
"base_init %d", base->
idx);
877 if (aircraftIsOnGeoscape)
906 cgi->Com_Error(
ERR_DROP,
"AIR_DestroyAircraft: Could not remove pilot from game: %s (ucn: %i)\n",
913 cgi->Com_Error(
ERR_DROP,
"AIR_DestroyAircraft: aircraft id %s had no pilot\n", aircraft->
id);
930 aircraft->
time += dt;
931 aircraft->
fuel -= dt;
941 const int p = (
int) frac;
959 const int p = (
int) frac;
979 switch (aircraft->
status) {
991 cgi->UI_PushWindow(
"popup_intercept_ready");
992 cgi->UI_ExecuteConfunc(
"pop_intready_aircraft \"%s\" \"%s\"", aircraft->
name,
1018 if (aircraft->
fuel < 0)
1032 int amLoad = amNextLevel - amCurrentLevel;
1034 if (amLoad > amAvailable) {
1037 amLoad = amAvailable;
1041 _(
"Craft %s couldn't be completely refueled at %s. Not enough antimatter."), aircraft->
name, aircraft->
homebase->
name);
1051 aircraft->
fuel += fillup;
1076 static bool radarOverlayReset =
false;
1083 assert(aircraft->homebase);
1084 if (aircraft->status ==
AIR_IDLE) {
1086 aircraft->fuel -= dt;
1090 radarOverlayReset =
true;
1099 MS_AddNewMessage(
_(
"Notice"),
va(
_(
"Craft %s is low on fuel and must return to base."), aircraft->name));
1104 if (aircraft->status ==
AIR_UFO) {
1109 for (
int k = 0; k < aircraft->maxWeapons; k++) {
1122 radarOverlayReset =
false;
1134 if (aircraft->idx == aircraftIdx) {
1135 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_AircraftGetFromIDX: aircraft idx: %i\n", aircraft->idx);
1151 if (!aircraft || !mission)
1155 CP_Popup(
_(
"Notice"),
_(
"Assign one or more soldiers to this aircraft first."));
1173 cgi->UI_PushWindow(
"popup_baseattack");
1185 aircraft->
point = 0;
1277 const char* errhead =
"AIR_ParseAircraft: unexpected end of file (aircraft ";
1285 cgi->Com_Printf(
"AIR_ParseAircraft: too many aircraft definitions; def \"%s\" ignored\n", name);
1289 if (!assignAircraftItems) {
1291 if (aircraftTemplateCheck) {
1292 cgi->Com_Printf(
"AIR_ParseAircraft: Second aircraft with same name found (%s) - second ignored\n", name);
1301 aircraftTemplate->
tpl = aircraftTemplate;
1316 aircraftTemplate =
nullptr;
1320 aircraftTemplate = aircraft;
1324 if (!aircraftTemplate)
1325 Sys_Error(
"Could not find aircraft '%s'", name);
1331 if (!*text || *token !=
'{') {
1332 cgi->Com_Printf(
"AIR_ParseAircraft: aircraft def \"%s\" without body ignored\n", name);
1347 if (token[0] ==
'_')
1351 }
else if (
Q_streq(token,
"radar")) {
1353 if (!*text || *token !=
'{') {
1354 cgi->Com_Printf(
"AIR_ParseAircraft: Invalid radar value for aircraft: %s\n", name);
1364 if (!
cgi->Com_ParseBlockToken(name, text, aircraftTemplate, aircraft_radar_vals,
cp_campaignPool, token))
1365 cgi->Com_Printf(
"AIR_ParseAircraft: Ignoring unknown radar value '%s'\n", token);
1369 if (assignAircraftItems) {
1372 if (*token ==
'{') {
1374 }
else if (
Q_streq(token,
"shield")) {
1378 cgi->Com_DPrintf(
DEBUG_CLIENT,
"use shield %s for aircraft %s\n", token, aircraftTemplate->
id);
1382 }
else if (
Q_streq(token,
"slot")) {
1384 if (!*text || *token !=
'{') {
1385 cgi->Com_Printf(
"AIR_ParseAircraft: Invalid slot value for aircraft: %s\n", name);
1400 if (
Q_streq(token, air_slot_type_strings[i])) {
1416 if (i == MAX_ACITEMS)
1417 cgi->Com_Error(
ERR_DROP,
"Unknown value '%s' for slot type\n", token);
1418 }
else if (
Q_streq(token,
"position")) {
1423 if (
Q_streq(token, air_position_strings[i])) {
1438 if (i == AIR_POSITIONS_MAX)
1439 cgi->Com_Error(
ERR_DROP,
"Unknown value '%s' for slot position\n", token);
1440 }
else if (
Q_streq(token,
"contains")) {
1449 cgi->Com_DPrintf(
DEBUG_CLIENT,
"use weapon %s for aircraft %s\n", token, aircraftTemplate->
id);
1453 cgi->Com_DPrintf(
DEBUG_CLIENT,
"use electronics %s for aircraft %s\n", token, aircraftTemplate->
id);
1456 cgi->Com_Printf(
"Ignoring item value '%s' due to unknown slot type\n", token);
1460 }
else if (
Q_streq(token,
"ammo")) {
1468 cgi->Com_DPrintf(
DEBUG_CLIENT,
"use ammo %s for aircraft %s\n", token, aircraftTemplate->
id);
1470 cgi->Com_Printf(
"Ignoring ammo value '%s' due to unknown slot type\n", token);
1472 }
else if (
Q_streq(token,
"size")) {
1479 else if (
Q_streq(token,
"medium"))
1481 else if (
Q_streq(token,
"heavy"))
1484 cgi->Com_Printf(
"Unknown size value for aircraft slot: '%s'\n", token);
1486 cgi->Com_Printf(
"Ignoring size parameter '%s' for non-weapon aircraft slots\n", token);
1488 cgi->Com_Printf(
"AIR_ParseAircraft: Ignoring unknown slot value '%s'\n", token);
1492 if (
Q_streq(token,
"shield")) {
1497 if (
cgi->Com_ParseBlockToken(name, text, aircraftTemplate, aircraft_vals,
cp_campaignPool, token))
1502 if (!*text || *token !=
'{') {
1503 cgi->Com_Printf(
"AIR_ParseAircraft: Invalid slot value for aircraft: %s\n", name);
1507 }
else if (
Q_streq(token,
"param")) {
1509 if (!*text || *token !=
'{') {
1510 cgi->Com_Printf(
"AIR_ParseAircraft: Invalid param value for aircraft: %s\n", name);
1520 if (
Q_streq(token,
"range")) {
1527 cgi->Com_Error(
ERR_DROP,
"AIR_ParseAircraft: speed value must be entered before range value");
1531 if (!
cgi->Com_ParseBlockToken(name, text, aircraftTemplate, aircraft_param_vals,
cp_campaignPool, token))
1532 cgi->Com_Printf(
"AIR_ParseAircraft: Ignoring unknown param value '%s'\n", token);
1536 cgi->Com_Printf(
"AIR_ParseAircraft: unknown token \"%s\" ignored (aircraft %s)\n", token, name);
1542 if (aircraftTemplate->
building ==
nullptr)
1543 aircraftTemplate->
setUfoType(
cgi->Com_UFOShortNameToID(aircraftTemplate->
id));
1550 static void AIR_ListCraftIndexes_f (
void)
1552 cgi->Com_Printf(
"globalIDX\t(Craftname)\n");
1554 cgi->Com_Printf(
"%i\t(%s)\n", aircraft->idx, aircraft->name);
1561 static void AIR_ListAircraftSamples_f (
void)
1566 cgi->Com_Printf(
"%i aircraft\n", max);
1567 if (
cgi->Cmd_Argc() == 2) {
1573 for (; i < max; i++) {
1575 cgi->Com_Printf(
"aircraft: '%s'\n", aircraftTemplate->
id);
1576 for (vp = aircraft_vals; vp->
string; vp++) {
1579 for (vp = aircraft_param_vals; vp->
string; vp++) {
1598 if (aircraft->mission == mission)
1618 }
else if (destroyed && (ufo < aircraft->aircraftTarget)) {
1619 aircraft->aircraftTarget--;
1625 while ((base =
B_GetNext(base)) !=
nullptr) {
1630 if (baseWeapon->
target == ufo)
1631 baseWeapon->
target =
nullptr;
1632 else if (destroyed && (baseWeapon->
target > ufo))
1637 if (baseWeapon->
target == ufo)
1638 baseWeapon->
target =
nullptr;
1639 else if (destroyed && (baseWeapon->
target > ufo))
1670 return pow(cos(a) - cos(speedRatio * a) * cos(c), 2.0
f)
1671 - sin(c) * sin(c) * (sin(speedRatio * a) * sin(speedRatio * a) - sin(a) * sin(a) * sin(B) * sin(B));
1686 return 2. * (cos(a) - cos(speedRatio * a) * cos(c)) * (- sin(a) + speedRatio * sin(speedRatio * a) * cos(c))
1687 - sin(c) * sin(c) * (speedRatio * sin(2. * speedRatio * a) - sin(2. * a) * sin(B) * sin(B));
1702 const float BIG_STEP = 0.05f;
1704 const float PRECISION_ROOT = 0.000001f;
1705 const float MAXIMUM_VALUE_ROOT = 2.0f *
M_PI;
1707 float begin, end, middle;
1708 float fBegin, fEnd, fMiddle;
1709 float fdBegin, fdEnd, fdMiddle;
1712 end = start + PRECISION_ROOT / 10.0f;
1720 end = begin + BIG_STEP;
1721 if (end > MAXIMUM_VALUE_ROOT) {
1722 end = MAXIMUM_VALUE_ROOT;
1728 }
while (fBegin * fEnd > 0 && fdBegin * fdEnd > 0);
1730 if (fBegin * fEnd > 0) {
1731 if (fdBegin * fdEnd < 0) {
1734 middle = (begin + end) / 2.;
1738 if (fdEnd * fdMiddle < 0) {
1743 }
else if (fdBegin * fdMiddle < 0) {
1749 cgi->Com_Error(
ERR_DROP,
"AIR_GetDestinationFindRoot: Error in calculation, can't find root");
1751 middle = (begin + end) / 2.;
1755 epsilon = end - middle ;
1757 if (epsilon < PRECISION_ROOT) {
1762 }
while (fBegin * fEnd > 0);
1765 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_GetDestinationFindRoot: Did not find solution is range %.2f, %.2f\n", start, MAXIMUM_VALUE_ROOT);
1772 middle = (begin + end) / 2.;
1776 if (fEnd * fMiddle < 0) {
1780 }
else if (fBegin * fMiddle < 0) {
1785 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_GetDestinationFindRoot: Error in calculation, one of the value is nan\n");
1788 middle = (begin + end) / 2.;
1791 epsilon = end - middle ;
1792 }
while (epsilon > PRECISION_ROOT);
1807 vec3_t shooterPos, targetPos, targetDestPos, shooterDestPos, rotationAxis;
1808 vec3_t tangentVectTS, tangentVectTD;
1847 B = acos(
DotProduct(tangentVectTS, tangentVectTD));
1868 if (fabs(b - speedRatio * a) < .1)
1871 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_GetDestinationWhilePursuing: reject solution: doesn't fit %.2f == %.2f\n", b, speedRatio * a);
1882 assert(dest[0] <= 180.0
f && dest[0] >= -180.0
f && dest[1] <= 90.0
f && dest[1] >= -90.0
f);
1908 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_SendAircraftPursuingUFO: not enough fuel to anticipate target movement: go directly to target position\n");
1920 aircraft->
point = 0;
1953 cgi->LIST_AddPointer(&aircraft->
acTeam, employee);
1981 return cgi->LIST_Count(aircraft->
acTeam);
1994 if (aircraft->
pilot ==
nullptr || pilot ==
nullptr) {
1995 aircraft->
pilot = pilot;
2024 if (aircraft ==
nullptr)
2027 if (aircraft->
pilot ==
nullptr)
2031 float baseProbability = (float) pilotSkill;
2038 float randomProbability =
crand() * (float) pilotSkill;
2039 if (randomProbability > 0.25
f * baseProbability) {
2040 while (randomProbability > 0.25
f * baseProbability)
2041 randomProbability /= 2.0f;
2044 const float survivalProbability = baseProbability + randomProbability;
2045 return survivalProbability >= (float) pilotSkill;
2088 int numAllWeaponRanges = 0;
2089 int numUniqueWeaponRanges = 0;
2094 for (idxSlot = 0; idxSlot < maxSlot; idxSlot++) {
2102 numAllWeaponRanges++;
2105 if (numAllWeaponRanges > 0) {
2107 qsort(allWeaponRanges, numAllWeaponRanges,
sizeof(allWeaponRanges[0]),
Q_FloatSort);
2110 for (idxAllWeap = 0; idxAllWeap < numAllWeaponRanges; idxAllWeap++) {
2111 if (allWeaponRanges[idxAllWeap] != weaponRanges[numUniqueWeaponRanges - 1] || idxAllWeap == 0) {
2112 weaponRanges[numUniqueWeaponRanges] = allWeaponRanges[idxAllWeap];
2113 numUniqueWeaponRanges++;
2118 return numUniqueWeaponRanges;
2130 for (
int j = 0; j < route->
numPoints; j++) {
2147 for (
int i = 0; i < num; i++) {
2193 cgi->Com_Printf(
"Error: UFO '%s'is not linked to any mission\n", aircraft->
id);
2221 cgi->Com_Printf(
"Warning: ufo '%s' stats %i: %i is smaller than 0\n", aircraft->
id, i, aircraft->
stats[i]);
2223 if (aircraft->
stats[i] != 0) {
2286 if (!ufo || (ufo->
id ==
nullptr))
2318 cgi->Com_Printf(
"Error: Trying to assign more than max (%d) Aircraft Slots (cur is %d)\n", max, i);
2341 cgi->Com_Printf(
"AIR_Load: number of points (%i) for UFO route exceed maximum value (%i)\n", count,
LINE_MAXPTS);
2358 const char* statusId;
2366 *craft = *crafttype;
2372 if (craft->
idx < 0) {
2373 cgi->Com_Printf(
"Invalid (or no) aircraft index %i\n", craft->
idx);
2381 cgi->Com_Printf(
"Invalid aircraft status '%s'\n", statusId);
2420 cgi->Com_Printf(
"Invalid aircraft stat '%s'\n", statId);
2428 cgi->Com_Printf(
"Warning: ufo '%s' stats %i: %i is smaller than 0\n", craft->
id, idx, craft->
stats[idx]);
2483 cgi->Com_Error(
ERR_DROP,
"AIR_LoadAircraftXML: Cannot create ItemCargo object\n");
2492 cgi->Com_Error(
ERR_DROP,
"AIR_LoadAircraftXML: Cannot create AlienCargo object\n");
2560 cgi->Com_Printf(
"AIR_Load: Found invalid ufo entry - remove it - time: %i - speed: %i\n",
2574 bool success =
true;
2587 if (!aircraft->mission) {
2588 cgi->Com_Printf(
"Aircraft %s (idx: %i) is linked to an invalid mission: %s\n", aircraft->name, aircraft->idx, aircraft->missionID);
2592 cgi->Free(aircraft->missionID);
2593 aircraft->missionID =
nullptr;
2604 cgi->Com_Printf(
"Warning: %s (idx: %i) has no mission assigned, removing it\n", ufo->
name, ufo->
idx);
2610 cgi->Com_Printf(
"Warning: %s (idx: %i) is linked to an invalid mission %s, removing it\n", ufo->
name, ufo->
idx, ufo->
missionID);
2669 int i, j, k, error = 0;
2673 if (a->
name[0] ==
'\0') {
2675 cgi->Com_Printf(
"...... aircraft '%s' has no name\n", a->
id);
2679 cgi->Com_Printf(
"...... aircraft '%s' has no defaultName\n", a->
id);
2686 cgi->Com_Printf(
"...... aircraft '%s' has an item (%s) too heavy for its slot\n", a->
id, a->
weapons[j].
item->
id);
2696 cgi->Com_Printf(
"...... aircraft '%s' has 2 weapons slots at the same location\n", a->
id);
2704 cgi->Com_Printf(
"...... aircraft '%s' has 2 electronics slots at the same location\n", a->
id);
2738 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_RemoveEmployee: base: %i - aircraft->idx: %i\n",
2744 cgi->Com_Printf(
"Warning: pilot of aircraft %i is not a qualified pilot (ucn: %i)\n", aircraft->
idx, employee->
chr.
ucn);
2749 return cgi->LIST_Remove(&aircraft->
acTeam, employee);
2804 cgi->Com_Error(
ERR_DROP,
"AIR_RemoveEmployees: Error, there went something wrong with soldier-removing from aircraft.");
2816 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_MoveEmployeeInventoryIntoStorage: No team to remove equipment from.\n");
2822 while ((cont = employee->chr.inv.getNextCont(cont,
true))) {
2825 const Item item = *ic;
2851 if (!employee || !aircraft)
2875 cgi->Com_Printf(
"AIR_AssignInitial: No aircraft given\n");
2886 if (employee->baseHired != base)
2895 {
"debug_listaircraftsample", AIR_ListAircraftSamples_f,
"Show aircraft parameter on game console"},
2896 {
"debug_listaircraft", AIR_ListAircraft_f,
"Debug function to list all aircraft in all bases"},
2897 {
"debug_listaircraftidx", AIR_ListCraftIndexes_f,
"Debug function to list local/global aircraft indexes"},
2899 {
nullptr,
nullptr,
nullptr}
2908 cgi->Cmd_TableAddList(aircraftDebugCmds);
2918 if (craft->alienCargo !=
nullptr) {
2919 delete craft->alienCargo;
2920 craft->alienCargo =
nullptr;
2922 if (craft->itemCargo !=
nullptr) {
2923 delete craft->itemCargo;
2924 craft->itemCargo =
nullptr;
2930 cgi->Cmd_TableRemoveList(aircraftDebugCmds);
#define SAVE_AIRCRAFT_AIRSTATS
void AIR_AircraftsNotifyUFORemoved(const aircraft_t *const ufo, bool destroyed)
Notify that a UFO has been removed.
#define SAVE_AIRCRAFT_LASTSPOTTED_DATE
static void AIR_TransferItemsCarriedByCharacterToBase(character_t *chr, base_t *sourceBase, base_t *destBase)
Transfer items carried by a soldier from one base to another.
bool Q_strnull(const char *string)
#define SAVE_AIRCRAFT_MEMBER
aircraft_t ufos[MAX_UFOONGEOSCAPE]
bool AIR_Delete(base_t *base, aircraft_t *aircraft)
Will remove the given aircraft from the base.
#define SAVE_AIRCRAFT_WEAPONS
bool notifySent[MAX_AIR_NOTIFICATIONS]
void GEO_NotifyAircraftRemoved(const aircraft_t *aircraft)
Notify that an aircraft has been removed from game.
int B_ItemInBase(const objDef_t *item, const base_t *base)
Check if the item has been collected (i.e it is in the storage) in the given base.
struct installation_s * installation
void Sys_Error(const char *error,...)
bool AIR_IsAircraftInBase(const aircraft_t *aircraft)
Checks whether given aircraft is in its homebase.
#define MAX_UFOONGEOSCAPE
#define VectorSet(v, x, y, z)
void RADAR_Initialise(radar_t *radar, float range, float trackingRange, float level, bool updateSourceRadarMap)
Set radar range to new value.
virtual bool add(const objDef_t *od, int amount, int looseAmount)
Add items to the cargo.
A building with all it's data.
#define GEO_SetInterceptorAircraft(interceptor)
uiMessageListNodeMessage_t * MSO_CheckAddNewMessage(const notify_t messagecategory, const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup)
Adds a new message to message stack. It uses message settings to verify whether sound should be playe...
const objDef_t * INVSH_GetItemByID(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn't found.
QGL_EXTERN GLint GLenum type
void AII_CollectingItems(aircraft_t *aircraft, int won)
Collect items from the battlefield.
bool B_GetBuildingStatus(const base_t *const base, const buildingType_t buildingType)
Get the status associated to a building.
static const value_t aircraft_radar_vals[]
Valid radar definition values for an aircraft from script files.
bool AIR_SendAircraftPursuingUFO(aircraft_t *aircraft, aircraft_t *ufo)
Make the specified aircraft purchasing a UFO.
aircraft_t * AIR_NewAircraft(base_t *base, const aircraft_t *aircraftTemplate)
Places a new aircraft in the given base.
bool AIR_AddEmployee(Employee *employee, aircraft_t *aircraft)
Assigns a soldier to an aircraft.
#define SAVE_AIRCRAFT_SLOT
#define SAVE_AIRCRAFT_ROUTE_DISTANCE
#define SAVE_AIRCRAFT_LANDED
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...
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 airc...
void CAP_AddCurrent(base_t *base, baseCapacities_t capacity, int value)
Changes the current (used) capacity on a base.
float ufoDetectionProbability
#define E_Foreach(employeeType, var)
const aircraft_t * AIR_IsEmployeeInAircraft(const Employee *employee, const aircraft_t *aircraft)
Tells you if an employee is assigned to an aircraft.
aircraft_t * UFO_GetNext(aircraft_t *lastUFO)
Iterates through the UFOs.
void VecToPolar(const vec3_t v, vec2_t a)
Converts vector coordinates into polar coordinates.
void AII_CollectItem(aircraft_t *aircraft, const objDef_t *item, int amount)
Add an item to aircraft inventory.
void AII_UpdateAircraftStats(aircraft_t *aircraft)
Update the value of stats array of an aircraft.
int AIR_AircraftMenuStatsValues(const int value, const int stat)
Some of the aircraft values needs special calculations when they are shown in the menus...
const char * AIR_AircraftStatusToName(const aircraft_t *aircraft)
Translates the aircraft status id to a translatable string.
bool AIR_PostLoadInit(void)
Actions needs to be done after loading the savegame.
#define SAVE_AIRCRAFT_AIRCRAFTTARGET
#define SAVE_AIRCRAFT_VAL
void addClip(const Item *item)
Combine the rounds of partially used clips.
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
int B_AddToStorage(base_t *base, const objDef_t *obj, int amount)
Add/remove items to/from the storage.
#define B_IsUnderAttack(base)
void GEO_CalcLine(const vec2_t start, const vec2_t end, mapline_t *line)
Calculate the shortest way to go from start to end on a sphere.
static bool AIR_LoadAircraftXML(xmlNode_t *p, aircraft_t *craft)
Loads an Aircraft from the savegame.
static void AIR_LoadAircraftSlotsXML(aircraft_t *aircraft, aircraftSlot_t *slot, xmlNode_t *p, bool weapon, const int max)
Loads the weapon slots of an aircraft.
void empty(void)
Empties the cargo.
#define SAVE_AIRCRAFT_PROJECTILES
const aircraft_t * AIR_GetAircraftSilent(const char *name)
Searches the global array of aircraft types for a given aircraft.
#define SAVE_AIRCRAFT_HOMEBASE
mission_t * CP_GetMissionByID(const char *missionId)
Get a mission in ccs.missions by Id.
#define AIRCRAFT_REFUEL_FACTOR
bool AIR_RemoveEmployee(Employee *employee, aircraft_t *aircraft)
Removes a soldier from an aircraft.
#define SAVE_AIRCRAFT_DIRECTION
xmlNode_t *IMPORT * XML_GetPos3(xmlNode_t *parent, const char *name, vec3_t pos)
void CrossProduct(const vec3_t v1, const vec3_t v2, vec3_t cross)
binary operation on vectors in a three-dimensional space
const objDef_t * def(void) const
static void AIR_SaveRouteXML(xmlNode_t *node, const mapline_t *route)
Saves an route plan of an aircraft.
aircraft_t * AIR_AircraftGetFromIDX(int aircraftIdx)
Returns aircraft for a given global index.
bool AIR_IsInAircraftTeam(const aircraft_t *aircraft, const Employee *employee)
Checks whether given employee is in given aircraft.
bool AIR_AircraftHasEnoughFuelOneWay(const aircraft_t *aircraft, const vec2_t destination)
check if aircraft has enough fuel to go to destination
#define SAVE_AIRCRAFT_ROUTE
void AIR_MoveAircraftIntoNewHomebase(aircraft_t *aircraft, base_t *base)
Moves a given aircraft to a new base (also the employees and inventory)
void AIR_AircraftsNotifyMissionRemoved(const mission_t *const mission)
Notify aircraft that a mission has been removed.
#define SAVE_AIRCRAFT_AIRCRAFT
#define SAVE_AIRCRAFT_TIME
const aircraft_t * AIR_GetAircraft(const char *name)
Searches the global array of aircraft types for a given aircraft.
void RotatePointAroundVector(vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
Rotate a point around a given vector.
const byte * GEO_GetColor(const vec2_t pos, mapType_t type, bool *coast)
Returns the color value from geoscape of a certain mask (terrain, culture or population) at a given p...
static float AIR_GetDestinationFunction(const float c, const float B, const float speedRatio, float a)
funtion we need to find roots.
static void AII_InitialiseAircraftSlots(aircraft_t *aircraftTemplate)
Initialise all values of an aircraft slot.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
static const constListEntry_t saveAircraftConstants[]
bool GEO_IsRadarOverlayActivated(void)
employeeType_t getType() const
float stats[AIR_STATS_MAX]
#define SAVE_AIRCRAFT_STATUS
#define SAVE_AIRCRAFT_CARGO
bool isReloadable() const
bool load(xmlNode_t *root)
Load item cargo from xml savegame.
static void AII_CarriedItems(const Inventory *soldierInventory)
Process items carried by soldiers.
#define SAVE_AIRCRAFT_POS
bool AIRFIGHT_SaveXML(xmlNode_t *parent)
Save callback for savegames in XML Format.
Defines all attributes of objects used in the inventory.
void AIRFIGHT_ExecuteActions(const campaign_t *campaign, aircraft_t *shooter, aircraft_t *target)
Decide what an attacking aircraft can do.
itemWeight_t AII_GetItemWeightBySize(const objDef_t *od)
Returns craftitem weight based on size.
baseCapacities_t AIR_GetHangarCapacityType(const aircraft_t *aircraft)
Returns capacity type needed for an aircraft.
uiMessageListNodeMessage_t * MS_AddNewMessage(const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup, bool playSound)
Adds a new message to message stack.
struct mission_s * mission
memPool_t * cp_campaignPool
void CP_GameTimeStop(void)
Stop game time speed.
A base with all it's data.
base_t * B_GetFoundedBaseByIDX(int baseIdx)
Array bound check for the base index.
class ItemCargo * itemCargo
float getSurvivalChance(const byte *const color) const
Translate color value to terrain type and then to survival probability.
int CAP_GetFreeCapacity(const base_t *base, baseCapacities_t capacityType)
Returns the free capacity of a type.
Header file for menu related console command callbacks.
#define SAVE_AIRCRAFT_TEAM_UCN
#define SAVE_AIRCRAFTSTAT_NAMESPACE
int AIR_GetAircraftWeaponRanges(const aircraftSlot_t *slot, int maxSlot, float *weaponRanges)
Get the all the unique weapon ranges of this aircraft.
void AIR_RemovePilotFromAssignedAircraft(const base_t *base, const Employee *pilot)
Checks to see if the pilot is in any aircraft at this base. If he is then he is removed from that air...
void RADAR_InitialiseUFOs(radar_t *radar)
Reset UFO sensored on radar.
void AIR_InitStartup(void)
Init actions for aircraft-subsystem.
item instance data, with linked list capability
bool E_DeleteEmployee(Employee *employee)
Removes the employee completely from the game (buildings + global list).
void AIR_GetDestinationWhilePursuing(const aircraft_t *shooter, const aircraft_t *target, vec2_t dest)
Calculates the point where aircraft should go to intecept a moving target.
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
void setUfoType(ufoType_t ufoT)
xmlNode_t *IMPORT * XML_GetDate(xmlNode_t *parent, const char *name, int *day, int *sec)
void AII_ReloadAircraftWeapons(aircraft_t *aircraft)
Reload the weapons of an aircraft.
cvar_t *IMPORT * Cvar_Set(const char *varName, const char *value,...) __attribute__((format(__printf__
void AIR_AutoAddPilotToAircraft(const base_t *base, Employee *pilot)
Adds the pilot to the first available aircraft at the specified base.
inventory definition with all its containers
#define SAVE_AIRCRAFT_POINT
aircraft_t * aircraftCurrent
#define DotProduct(x, y)
Returns the distance between two 3-dimensional vectors.
static int AIR_GetStorageRoom(const aircraft_t *aircraft)
Calculate used storage room corresponding to items in an aircraft.
bool 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
static void AIR_Move(aircraft_t *aircraft, int deltaTime)
bool AIR_ScriptSanityCheck(void)
Checks the parsed aircraft for errors.
#define UFO_GetGeoscapeIDX(ufo)
int AIR_GetOperationRange(const aircraft_t *aircraft)
Calculates the range an aircraft can fly on the geoscape.
bool AIR_BaseHasAircraft(const base_t *base)
Checks whether there is any aircraft assigned to the given base.
static void AIR_CorrectAircraftSlotPointers(aircraft_t *aircraft)
resets aircraftSlots' backreference pointers for aircraft
static bool AIR_LoadRouteXML(xmlNode_t *p, mapline_t *route)
Loads the route of an aircraft.
aircraft_t * AIR_GetFirstFromBase(const base_t *b)
Iterates through the aircraft of a base.
static const value_t aircraft_param_vals[]
Valid aircraft parameter definitions from script files.
bool AIR_PilotSurvivedCrash(const aircraft_t *aircraft)
Determine if an aircraft's pilot survived a crash, based on his piloting skill (and a bit of randomne...
void AIR_AircraftReturnToBase(aircraft_t *aircraft)
Calculates the way back to homebase for given aircraft and returns it.
Campaign missions headers.
bool AIRFIGHT_LoadXML(xmlNode_t *parent)
Load callback for savegames in XML Format.
#define SAVE_AIRCRAFT_NAME
base_t * B_GetNext(base_t *lastBase)
Iterates through founded bases.
void AIR_ParseAircraft(const char *name, const char **text, bool assignAircraftItems)
Parses all aircraft that are defined in our UFO-scripts.
void PolarToVec(const vec2_t a, vec3_t v)
Converts longitude and latitude to a 3D vector in Euclidean coordinates.
void RS_MarkCollected(technology_t *tech)
Marks a give technology as collected.
#define SAVE_AIRCRAFT_MISSIONID
bool E_MoveIntoNewBase(Employee *employee, base_t *newBase)
const cgame_import_t * cgi
void AIR_ShutdownCallbacks(void)
void B_AircraftReturnedToHomeBase(aircraft_t *aircraft)
Do anything when dropship returns to base.
const char *IMPORT * Com_GetConstVariable(const char *space, int value)
struct aircraft_s * aircraftTarget
This is the technology parsed from research.ufo.
Employee * AIR_GetPilot(const aircraft_t *aircraft)
Get pilot of an aircraft.
aircraft_t aircraftTemplates[MAX_AIRCRAFT]
base_t * B_GetBaseByIDX(int baseIdx)
Array bound check for the base index. Will also return unfounded bases as long as the index is in the...
Campaign geoscape time header.
#define SAVE_AIRCRAFT_ELECTRONICS
XML tag constants for savegame.
int AIR_BaseCountAircraft(const base_t *base)
Returns the number of aircraft on the given base.
aircraftSlot_t weapons[MAX_AIRCRAFTSLOT]
Item * getNextItem(const Item *prev) const
Header for Geoscape management.
Header for base building related stuff.
static float AIR_GetDestinationFindRoot(const float c, const float B, const float speedRatio, float start)
Find the roots of a function.
building_t * B_GetBuildingTemplateSilent(const char *buildingName)
Returns the building in the global building-types list that has the unique name buildingID.
technology_t * RS_GetTechByID(const char *id)
return a pointer to the technology identified by given id string
QGL_EXTERN GLenum GLuint * dest
void AIR_CampaignRun(const campaign_t *campaign, int dt, bool updateRadarOverlay)
Handles aircraft movement and actions in geoscape mode.
#define SAVE_AIRCRAFT_DETECTED
char cp_messageBuffer[MAX_MESSAGE_TEXT]
enum aircraftStatus_s aircraftStatus_t
void E_RemoveInventoryFromStorage(Employee *employee)
Removes the items of an employee (soldier) from the base storage (s)he is hired at.
bool AIR_IsAircraftOnGeoscape(const aircraft_t *aircraft)
Checks whether given aircraft is on geoscape.
bool AIR_AircraftAllowed(const base_t *base)
Returns true if the current base is able to handle aircraft.
void AIR_AircraftsUFODisappear(const aircraft_t *const ufo)
Notify that a UFO disappear from radars.
CGAME_HARD_LINKED_FUNCTIONS linkedList_t * LIST_Add(linkedList_t **listDest, void const *data, size_t length)
#define AIR_ForeachFromBase(var, base)
iterates trough all aircraft from a specific homebase
int AIR_GetRemainingRange(const aircraft_t *aircraft)
Calculates the remaining range the aircraft can fly.
static float AIR_GetDestinationDerivativeFunction(const float c, const float B, const float speedRatio, float a)
derivative of the funtion we need to find roots.
baseCapacities_t
All possible capacities in base.
baseWeapon_t batteries[MAX_BASE_SLOT]
vec2_t point[LINE_MAXPTS]
void AIR_DestroyAircraft(aircraft_t *aircraft, bool killPilot)
Removes an aircraft from its base and the game.
#define SAVE_AIRCRAFT_FUEL
const char * Com_Parse(const char *data_p[], char *target, size_t size, bool replaceWhitespaces)
Parse a token out of a string.
aircraft_t * UFO_GetByIDX(const int idx)
returns the UFO on the geoscape with a certain index
xmlNode_t *IMPORT * XML_GetPos2(xmlNode_t *parent, const char *name, vec2_t pos)
bool AIR_CanIntercept(const aircraft_t *aircraft)
static char const *const air_position_strings[]
List of valid strings for itemPos_t.
int Q_FloatSort(const void *float1, const void *float2)
Compare two floats.
#define SAVE_AIRCRAFT_DAMAGE
#define AIR_SLOT_TYPE_STRINGS
#define SAVE_AIRCRAFT_PHALANX
void AII_InitialiseSlot(aircraftSlot_t *slot, aircraft_t *aircraftTemplate, base_t *base, installation_t *installation, aircraftItemType_t type)
Initialise values of one slot of an aircraft or basedefence common to all types of items...
void AII_LoadOneSlotXML(xmlNode_t *node, aircraftSlot_t *slot, bool weapon)
Loads one slot (base, installation or aircraft)
#define SAVE_AIRCRAFT_UFOS
#define AIR_IsUFO(aircraft)
#define SAVE_AIRCRAFT_AIRSTATID
const Container * getNextCont(const Container *prev, bool inclTemp=false) const
xmlNode_t *IMPORT * XML_GetNextNode(xmlNode_t *current, xmlNode_t *parent, const char *name)
#define SAVE_AIRCRAFT_IDX
int AIR_GetTeamSize(const aircraft_t *aircraft)
Counts the number of soldiers in given aircraft.
int numItems[MAX_OBJDEFS]
Header for slot management related stuff.
void AIR_AssignInitial(aircraft_t *aircraft)
Assigns initial team of soldiers to aircraft.
aircraftItemType_t
All different types of craft items.
vec_t VectorNormalize(vec3_t v)
Calculate unit vector for a given vec3_t.
#define SAVE_AIRCRAFT_SHIELDS
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
CASSERT(lengthof(air_slot_type_strings)==MAX_ACITEMS)
bool save(xmlNode_t *root) const
Save item cargo to xml savegame.
#define SAVE_AIRCRAFT_AIRCRAFTTEAM
void GEO_CheckPositionBoundaries(float *pos)
Check that a position (in latitude / longitude) is within boundaries.
static bool AIR_SaveAircraftXML(xmlNode_t *p, const aircraft_t *const aircraft, bool const isUfo)
Saves an aircraft.
int B_AddAntimatter(base_t *base, int amount)
Manages antimatter (adding, removing) through Antimatter Storage Facility.
Employee * E_GetEmployeeFromChrUCN(int uniqueCharacterNumber)
Searches all employee for the ucn (character id)
#define SAVE_AIRCRAFT_AIRSTAT
Alien cargo class header.
#define MEMBER_SIZEOF(TYPE, MEMBER)
float crand(void)
Return random values between -1 and 1.
missionResults_t missionResults
const objDef_t * ammoDef(void) const
#define LIST_Foreach(list, type, var)
Iterates over a linked list, it's safe to delete the returned entry from the list while looping over ...
#define Vector2Copy(src, dest)
bool AIR_SendAircraftToMission(aircraft_t *aircraft, mission_t *mission)
Sends the specified aircraft to specified mission.
Header file for single player campaign control.
void RADAR_UpdateWholeRadarOverlay(void)
Update radar overlay of base, installation and aircraft range.
static void AIR_SaveAircraftSlotsXML(const aircraftSlot_t *slot, const int num, xmlNode_t *p, bool weapon)
Saves an item slot.
void AIR_InitCallbacks(void)
bool load(xmlNode_t *root)
Load alien cargo from xml savegame.
#define SAVE_AIRCRAFT_DETECTIONIDX
xmlNode_t *IMPORT * XML_AddNode(xmlNode_t *parent, const char *name)
baseWeapon_t lasers[MAX_BASE_SLOT]
aircraft_t * AIR_GetAircraftFromBaseByIDXSafe(const base_t *base, int index)
static void AII_SetAircraftInSlots(aircraft_t *aircraft)
Initialise aircraft pointer in each slot of an aircraft.
const char *IMPORT * Com_EParse(const char **text, const char *errhead, const char *errinfo)
#define SAVE_AIRCRAFT_ALIENCARGO
const char *const air_slot_type_strings[]
GLsizei const GLvoid * data
bool AIR_SetPilot(aircraft_t *aircraft, Employee *pilot)
Assign a pilot to an aircraft.
bool AIR_LoadXML(xmlNode_t *parent)
buildingType_t buildingType
#define AIR_Foreach(var)
iterates trough all aircraft
const char * AIR_CheckMoveIntoNewHomebase(const aircraft_t *aircraft, const base_t *base)
Checks if destination base can store an aircraft and its team.
static const value_t aircraft_vals[]
Valid aircraft definition values from script files.
const char * MIS_GetName(const mission_t *mission)
Returns a short translated name for a mission.
char *IMPORT * PoolStrDup(const char *in, memPool_t *pool, const int tagNum)
An aircraft with all it's data.
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 void AII_CollectAmmo(void *data, const Item *magazine)
Count and collect ammo from gun magazine.
technology_t * RS_GetTechForItem(const objDef_t *item)
Returns technology entry for an item.
class AlienCargo * alienCargo
xmlNode_t *IMPORT * XML_GetNextPos2(xmlNode_t *actual, xmlNode_t *parent, const char *name, vec2_t pos)
linkedList_t *IMPORT * LIST_GetPointer(linkedList_t *list, const void *data)
void UFO_RemoveFromGeoscape(aircraft_t *ufo)
Remove the specified ufo from geoscape.
linkedList_t * list(void) const
Returns a copy of the cargo list.
static bool AIR_PostLoadInitMissions(void)
Set the mission pointers for all the aircraft after loading a savegame.
bool save(xmlNode_t *root) const
Save alien cargo to xml savegame.
bool AIR_AddToAircraftTeam(aircraft_t *aircraft, Employee *employee)
Adds given employee to given aircraft.
#define ANTIMATTER_ITEM_ID
void AIR_RemoveEmployees(aircraft_t &aircraft)
Removes all soldiers from an aircraft.
void AII_RemoveItemFromSlot(base_t *base, aircraftSlot_t *slot, bool ammo)
Remove the item from the slot (or optionally its ammo only) and put it the base storage.
void TR_NotifyAircraftRemoved(const aircraft_t *aircraft)
Notify that an aircraft has been removed.
baseCapacities_t B_GetCapacityFromBuildingType(buildingType_t type)
Get the capacity associated to a building type.
itemPos_t
different positions for aircraft items
#define SAVE_AIRCRAFT_ROUTE_POINT
struct aircraft_s * aircraft
void AIR_ResetAircraftTeam(aircraft_t *aircraft)
Resets team in given aircraft.
int skills[SKILL_NUM_TYPES]
static const cmdList_t aircraftDebugCmds[]
void AII_SaveOneSlotXML(xmlNode_t *p, const aircraftSlot_t *slot, bool weapon)
Save callback for savegames in XML Format.
#define GEO_SetMissionAircraft(aircraft)
A path on the map described by 2D points.
const char *IMPORT * Cmd_Argv(int n)
static void AIR_Refuel(aircraft_t *aircraft, int deltaTime)
aircraftSlot_t electronics[MAX_AIRCRAFTSLOT]
Employee * E_GetEmployeeByTypeFromChrUCN(employeeType_t type, int uniqueCharacterNumber)
Searches employee from a type for the ucn (character id)
#define SAVE_AIRCRAFTSTATUS_NAMESPACE
bool AIR_SaveXML(xmlNode_t *parent)
Save callback for savegames in xml format.
const char *IMPORT * XML_GetString(xmlNode_t *parent, const char *name)
mission_t * GEO_SelectMission(mission_t *mission)
Select the specified mission.
xmlNode_t *IMPORT * XML_GetNode(xmlNode_t *parent, const char *name)
static void AII_CollectItem_(void *data, const objDef_t *item, int amount)
#define KILOMETER_PER_DEGREE
void GEO_SelectAircraft(aircraft_t *aircraft)
Select the specified aircraft on the geoscape.
#define SAVE_AIRCRAFT_PILOTUCN
void AIR_Shutdown(void)
Closing actions for aircraft-subsystem.
buildingType_t B_GetBuildingTypeByCapacity(baseCapacities_t cap)
Get building type by base capacity.
void Com_SkipBlock(const char **text)
Skips a block of {} in our script files.
bool AII_ReloadWeapon(aircraftSlot_t *slot)
Reloads an aircraft/defence-system weapon.
double GetDistanceOnGlobe(const vec2_t pos1, const vec2_t pos2)
Calculate distance on the geoscape.
int AIR_CountInBaseByTemplate(const base_t *base, const aircraft_t *aircraftTemplate)
Calculates the amount of aircraft (of the given type) in the selected base.
bool AIR_AircraftMakeMove(int dt, aircraft_t *aircraft)
Moves given aircraft.
const char *IMPORT * Com_ValueToStr(const void *base, const valueTypes_t type, const int ofs)
void AIR_DeleteAircraft(aircraft_t *aircraft)
Removes an aircraft from its base and the game.
Describes a character with all its attributes.