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