UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cp_mapfightequip.h
Go to the documentation of this file.
1 
6 /*
7 Copyright (C) 2002-2020 UFO: Alien Invasion.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 
24 */
25 
26 #pragma once
27 
33 typedef enum {
41 
46 typedef enum {
50  /* positive values are used for number of ammo left in the weapon */
51 } ammoStatus_t;
52 
57 typedef enum {
64 
65 /* Base defence functions. */
66 void BDEF_AddBattery(basedefenceType_t basedefType, base_t* base);
67 void BDEF_RemoveBattery(base_t* base, basedefenceType_t basedefType, int idx);
70 void BDEF_ReloadBattery(void);
71 void BDEF_AutoSelectTarget(void);
72 
75 bool AII_AddItemToSlot(base_t* base, const technology_t* tech, aircraftSlot_t* slot, bool nextItem);
76 bool AII_AddAmmoToSlot(base_t* base, const technology_t* tech, aircraftSlot_t* slot);
77 void AII_RemoveItemFromSlot(base_t* base, aircraftSlot_t* slot, bool ammo);
78 void AII_RemoveNextItemFromSlot(base_t* base, aircraftSlot_t* slot, bool ammo);
79 bool AIM_PilotAssignedAircraft(const base_t* base, const Employee* pilot);
80 void AIM_AutoEquipAircraft(aircraft_t* aircraft);
81 void AII_InitialiseSlot(aircraftSlot_t* slot, aircraft_t* aircraft, base_t* base, installation_t* installation, aircraftItemType_t type);
82 float AIR_GetMaxAircraftWeaponRange(const aircraftSlot_t* slot, int maxSlot);
83 void AII_RepairAircraft(void);
84 void AII_UpdateAircraftStats(aircraft_t* aircraft);
85 int AII_BaseCanShoot(const base_t* base);
86 bool AII_InstallationCanShoot(const installation_t* installation);
87 
89 
90 const char* AII_WeightToName(itemWeight_t weight);
92 bool AIM_SelectableCraftItem(const aircraftSlot_t* slot, const technology_t* tech);
93 
97 
100 
101 void AII_SaveOneSlotXML(xmlNode_t* p, const aircraftSlot_t* slot, bool weapon);
102 void AII_LoadOneSlotXML(xmlNode_t* node, aircraftSlot_t* slot, bool weapon);
A installation with all it's data.
QGL_EXTERN GLint GLenum type
Definition: r_gl.h:94
aircraftSlot_t * AII_GetAircraftSlotByIDX(aircraft_t *aircraft, aircraftItemType_t type, int idx)
returns the aircraftSlot of an aircraft at an index or the first free slot
void AII_InitialiseSlot(aircraftSlot_t *slot, aircraft_t *aircraft, 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_ReloadAircraftWeapons(aircraft_t *aircraft)
Reload the weapons of an aircraft.
void BDEF_AutoSelectTarget(void)
Chooses target for all base defences and sam sites.
bool AII_ReloadWeapon(aircraftSlot_t *slot)
Reloads an aircraft/defence-system weapon.
ammoStatus_t
Different status for numAmmo.
void AII_AutoAddAmmo(aircraftSlot_t *slot)
Auto add ammo corresponding to weapon, if there is enough in storage.
void AII_UpdateAircraftStats(aircraft_t *aircraft)
Update the value of stats array of an aircraft.
Defines all attributes of objects used in the inventory.
Definition: inv_shared.h:264
bool AIM_PilotAssignedAircraft(const base_t *base, const Employee *pilot)
Checks to see if the pilot is in any aircraft at this base.
void AII_UpdateInstallationDelay(void)
Update the installation delay of all slots of a given aircraft.
A base with all it's data.
Definition: cp_base.h:84
#define xmlNode_t
Definition: xml.h:24
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 AII_RepairAircraft(void)
Repair aircraft.
void BDEF_ReloadBattery(void)
aircraftSlot_t * BDEF_GetInstallationSlotByIDX(installation_t *installation, aircraftItemType_t type, int idx)
returns the aircraftSlot of an installaion at an index or the first free slot
zoneaircraftParams_t
Zone number in airequip menu or base defence menu.
This is the technology parsed from research.ufo.
Definition: cp_research.h:137
void BDEF_RemoveBattery(base_t *base, basedefenceType_t basedefType, int idx)
Remove a base defence sytem from base.
const char * AII_WeightToName(itemWeight_t weight)
Translate a weight int to a translated string.
void BDEF_AddBattery(basedefenceType_t basedefType, base_t *base)
Adds a defence system to base.
slot of aircraft
Definition: cp_aircraft.h:77
void BDEF_InitialiseInstallationSlots(installation_t *installation)
Initialise all values of installation slot defence.
void BDEF_InitialiseBaseSlots(base_t *base)
Initialise all values of base slot defence.
int AII_BaseCanShoot(const base_t *base)
Check if the base has weapon and ammo.
aircraftSlot_t * BDEF_GetBaseSlotByIDX(base_t *base, aircraftItemType_t type, int idx)
returns the aircraftSlot of a base at an index or the first free slot
bool AIM_SelectableCraftItem(const aircraftSlot_t *slot, const technology_t *tech)
Check if an aircraft item should or should not be displayed in airequip menu.
aircraftItemType_t
All different types of craft items.
Definition: inv_shared.h:197
void AII_RemoveNextItemFromSlot(base_t *base, aircraftSlot_t *slot, bool ammo)
Cancel replacing item, move nextItem (or optionally its ammo only) back to the base storage...
basedefenceType_t
The different possible types of base defence systems.
bool AII_InstallationCanShoot(const installation_t *installation)
Check if the installation has a weapon and ammo.
An aircraft with all it's data.
Definition: cp_aircraft.h:114
itemWeight_t AII_GetItemWeightBySize(const objDef_t *od)
Returns craftitem weight based on size.
bool AII_AddAmmoToSlot(base_t *base, const technology_t *tech, aircraftSlot_t *slot)
Add an ammo to an aircraft weapon slot.
technology_t ** AII_GetCraftitemTechsByType(aircraftItemType_t type)
Returns a list of craftitem technologies for the given type.
bool AII_AddItemToSlot(base_t *base, const technology_t *tech, aircraftSlot_t *slot, bool nextItem)
Add an item to an aircraft slot.
void AII_LoadOneSlotXML(xmlNode_t *node, aircraftSlot_t *slot, bool weapon)
Loads one slot (base, installation or aircraft)
itemWeight_t
different weight for aircraft items
Definition: cp_aircraft.h:47
void AIM_AutoEquipAircraft(aircraft_t *aircraft)
Auto Add weapon and ammo to an aircraft.
float AIR_GetMaxAircraftWeaponRange(const aircraftSlot_t *slot, int maxSlot)
Get the maximum weapon range of aircraft.
void AII_SaveOneSlotXML(xmlNode_t *p, const aircraftSlot_t *slot, bool weapon)
Save callback for savegames in XML Format.