|
UFO: Alien Invasion
|
Header for slot management related stuff. More...

Go to the source code of this file.
Enumerations | |
| enum | zoneaircraftParams_t { ZONE_NONE , ZONE_MAIN , ZONE_AMMO , ZONE_MAX } |
| Zone number in airequip menu or base defence menu. More... | |
| enum | ammoStatus_t { AMMO_STATUS_NOT_SET = -1 , AMMO_STATUS_NO_MORE_AMMO = 0 } |
| Different status for numAmmo. More... | |
| enum | basedefenceType_t { BASEDEF_RANDOM , BASEDEF_MISSILE , BASEDEF_LASER , BASEDEF_MAX } |
| The different possible types of base defence systems. More... | |
Functions | |
| void | BDEF_AddBattery (basedefenceType_t basedefType, base_t *base) |
| Adds a defence system to base. | |
| void | BDEF_RemoveBattery (base_t *base, basedefenceType_t basedefType, int idx) |
| Remove a base defence sytem from base. | |
| void | BDEF_InitialiseBaseSlots (base_t *base) |
| Initialise all values of base slot defence. | |
| void | BDEF_InitialiseInstallationSlots (installation_t *installation) |
| Initialise all values of installation slot defence. | |
| void | BDEF_ReloadBattery (void) |
| void | BDEF_AutoSelectTarget (void) |
| Chooses target for all base defences and sam sites. | |
| technology_t ** | AII_GetCraftitemTechsByType (aircraftItemType_t type) |
| Returns a list of craftitem technologies for the given type. | |
| void | AII_UpdateInstallationDelay (void) |
| Update the installation delay of all slots of a given aircraft. | |
| bool | AII_AddItemToSlot (base_t *base, const technology_t *tech, aircraftSlot_t *slot, bool nextItem) |
| Add an item to an aircraft slot. | |
| bool | AII_AddAmmoToSlot (base_t *base, const technology_t *tech, aircraftSlot_t *slot) |
| Add an ammo to an aircraft weapon 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_RemoveNextItemFromSlot (base_t *base, aircraftSlot_t *slot, bool ammo) |
| Cancel replacing item, move nextItem (or optionally its ammo only) back to the base storage. | |
| bool | AIM_PilotAssignedAircraft (const base_t *base, const Employee *pilot) |
| Checks to see if the pilot is in any aircraft at this base. | |
| void | AIM_AutoEquipAircraft (aircraft_t *aircraft) |
| Auto Add weapon and ammo to an aircraft. | |
| 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. | |
| float | AIR_GetMaxAircraftWeaponRange (const aircraftSlot_t *slot, int maxSlot) |
| Get the maximum weapon range of aircraft. | |
| void | AII_RepairAircraft (void) |
| Repair aircraft. | |
| void | AII_UpdateAircraftStats (aircraft_t *aircraft) |
| Update the value of stats array of an aircraft. | |
| 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. | |
| itemWeight_t | AII_GetItemWeightBySize (const objDef_t *od) |
| Returns craftitem weight based on size. | |
| const char * | AII_WeightToName (itemWeight_t weight) |
| Translate a weight int to a translated string. | |
| void | AII_AutoAddAmmo (aircraftSlot_t *slot) |
| Auto add ammo corresponding to weapon, if there is enough in storage. | |
| 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. | |
| 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 | |
| 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 | |
| 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 | |
| bool | AII_ReloadWeapon (aircraftSlot_t *slot) |
| Reloads an aircraft/defence-system weapon. | |
| void | AII_ReloadAircraftWeapons (aircraft_t *aircraft) |
| Reload the weapons of an aircraft. | |
| void | AII_SaveOneSlotXML (xmlNode_t *p, const aircraftSlot_t *slot, bool weapon) |
| Save callback for savegames in XML Format. | |
| void | AII_LoadOneSlotXML (xmlNode_t *node, aircraftSlot_t *slot, bool weapon) |
| Loads one slot (base, installation or aircraft). | |
Header for slot management related stuff.
Definition in file cp_mapfightequip.h.
| enum ammoStatus_t |
Different status for numAmmo.
| Enumerator | |
|---|---|
| AMMO_STATUS_NOT_SET | This weapon can't shoot yet. |
| AMMO_STATUS_NO_MORE_AMMO | This weapon has no ammo. |
Definition at line 46 of file cp_mapfightequip.h.
| enum basedefenceType_t |
The different possible types of base defence systems.
Definition at line 57 of file cp_mapfightequip.h.
| enum zoneaircraftParams_t |
Zone number in airequip menu or base defence menu.
Definition at line 33 of file cp_mapfightequip.h.
| bool AII_AddAmmoToSlot | ( | base_t * | base, |
| const technology_t * | tech, | ||
| aircraftSlot_t * | slot ) |
Add an ammo to an aircraft weapon slot.
| [in] | base | Pointer to the base which provides items (nullptr if items shouldn't be removed of storage) |
| [in] | tech | Pointer to the tech to add to slot |
| [in] | slot | Pointer to the slot where you want to add ammos |
Definition at line 647 of file cp_mapfightequip.cpp.
References AC_ITEM_AMMO, AII_ReloadWeapon(), AII_RemoveItemFromSlot(), AII_RemoveNextItemFromSlot(), aircraftSlot_t::ammo, objDef_t::ammos, B_AddToStorage(), B_BaseHasItem(), cgi, objDef_t::craftitem, objDef_t::id, objDef_t::idx, INVSH_GetItemByID(), aircraftSlot_t::item, aircraftSlot_t::nextAmmo, aircraftSlot_t::nextItem, objDef_t::numAmmos, technology_t::provides, and craftItem::type.
Referenced by AII_AutoAddAmmo(), AII_LoadOneSlotXML(), and AIM_AircraftEquipAddItem_f().
| bool AII_AddItemToSlot | ( | base_t * | base, |
| const technology_t * | tech, | ||
| aircraftSlot_t * | slot, | ||
| bool | nextItem ) |
Add an item to an aircraft slot.
| [in] | base | Pointer to the base where item will be removed (nullptr for ufos, virtual ammos or while loading game) |
| [in] | tech | Pointer to the tech that will be added in this slot. |
| [in] | slot | Pointer to the aircraft, base, or installation slot. |
| [in] | nextItem | False if we are changing current item in slot, true if this is the item to install after current removal is over. |
Definition at line 722 of file cp_mapfightequip.cpp.
References AC_ITEM_AMMO, AII_GetItemWeightBySize(), B_AddToStorage(), B_BaseHasItem(), cgi, objDef_t::craftitem, objDef_t::id, aircraftSlot_t::idx, aircraftSlot_t::installationTime, craftItem::installationTime, INVSH_GetItemByID(), aircraftSlot_t::item, aircraftSlot_t::nextItem, technology_t::provides, aircraftSlot_t::size, objDef_t::size, aircraftSlot_t::type, and craftItem::type.
Referenced by AII_LoadOneSlotXML(), AIM_AircraftEquipAddItem_f(), AIM_AutoEquipAircraft(), and BDEF_AddItem_f().
| void AII_AutoAddAmmo | ( | aircraftSlot_t * | slot | ) |
Auto add ammo corresponding to weapon, if there is enough in storage.
| [in] | slot | Pointer to the slot where you want to add ammo |
Definition at line 433 of file cp_mapfightequip.cpp.
References AC_ITEM_WEAPON, AII_AddAmmoToSlot(), AIM_SelectableCraftItem(), AIR_IsAircraftInBase(), AIR_IsUFO, aircraftSlot_t::aircraft, aircraftSlot_t::ammo, objDef_t::ammos, aircraftSlot_t::base, objDef_t::craftitem, objDef_t::isVirtual, aircraftSlot_t::item, aircraftSlot_t::nextAmmo, aircraftSlot_t::nextItem, objDef_t::numAmmos, RS_GetTechForItem(), and craftItem::type.
Referenced by AII_ReloadWeapon(), AIM_AircraftEquipAddItem_f(), AIM_AutoEquipAircraft(), and BDEF_AddItem_f().
Check if the base has weapon and ammo.
| [in] | base | Pointer to the base you want to check (may not be nullptr) |
Definition at line 1150 of file cp_mapfightequip.cpp.
References AII_WeaponsCanShoot(), B_DEFENCE_LASER, B_DEFENCE_MISSILE, B_GetBuildingStatus(), base_t::batteries, base_t::lasers, base_t::numBatteries, and base_t::numLasers.
Referenced by AIRFIGHT_CampaignRunBaseDefence(), CL_DisplayPopupInterceptUFO(), CL_PopupInterceptBaseClick_f(), and GEO_DrawMapOneBase().
| 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
| [in] | aircraft | Pointer to aircraft |
| [in] | type | base defence type, see aircraftItemType_t |
| [in] | idx | index of aircraftslot |
Definition at line 964 of file cp_mapfightequip.cpp.
References AC_ITEM_ELECTRONICS, AC_ITEM_SHIELD, AC_ITEM_WEAPON, aircraft_t::electronics, i, aircraftSlot_t::item, aircraft_t::maxElectronics, aircraft_t::maxWeapons, aircraftSlot_t::nextItem, aircraft_t::shield, type, and aircraft_t::weapons.
| technology_t ** AII_GetCraftitemTechsByType | ( | aircraftItemType_t | type | ) |
Returns a list of craftitem technologies for the given type.
| [in] | type | Type of the craft-items to return. |
Definition at line 44 of file cp_mapfightequip.cpp.
References cgi, objDef_t::craftitem, i, INVSH_GetItemByIDX(), MAX_TECHNOLOGIES, RS_GetTechForItem(), craftItem::type, and type.
Referenced by AIM_UpdateAircraftItemList(), BDEF_AddItem_f(), BDEF_SelectItem_f(), and BDEF_UpdateAircraftItemList().
| itemWeight_t AII_GetItemWeightBySize | ( | const objDef_t * | od | ) |
Returns craftitem weight based on size.
| [in] | od | Pointer to objDef_t object being craftitem. |
Definition at line 74 of file cp_mapfightequip.cpp.
References ITEM_HEAVY, ITEM_LIGHT, ITEM_MEDIUM, and objDef_t::size.
Referenced by AII_AddItemToSlot(), AIM_AutoEquipAircraft(), AIM_CheckTechnologyIntoSlot(), AIM_SelectableCraftItem(), AIR_ScriptSanityCheck(), and UP_AircraftItemDescription().
| 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.
| [in] | slot | Pointer to the slot to initialize. |
| [in] | aircraftTemplate | Template Pointer to aircraft template. |
| [in] | base | Pointer to base. |
| [in] | installation | Pointer to the thing being installed. |
| [in] | type | The type of item that can fit in this slot. |
sa BDEF_AddBattery: it needs to be AMMO_STATUS_NOT_SET and not 0
Definition at line 847 of file cp_mapfightequip.cpp.
References aircraftSlot_t::aircraft, aircraftSlot_t::ammo, AMMO_STATUS_NOT_SET, aircraftSlot_t::ammoLeft, aircraftSlot_t::base, aircraftSlot_t::installation, aircraftSlot_t::installationTime, aircraftSlot_t::item, ITEM_HEAVY, aircraftSlot_t::nextAmmo, aircraftSlot_t::nextItem, OBJZERO, aircraftSlot_t::size, aircraftSlot_t::type, and type.
Referenced by AII_InitialiseAircraftSlots(), BDEF_InitialiseBaseSlots(), BDEF_InitialiseInstallationSlots(), and BDEF_RemoveBattery().
| bool AII_InstallationCanShoot | ( | const installation_t * | installation | ) |
Check if the installation has a weapon and ammo.
| [in] | installation | Pointer to the installation you want to check (may not be nullptr) |
Definition at line 1173 of file cp_mapfightequip.cpp.
References AII_WeaponsCanShoot(), installation_t::batteries, INSTALLATION_WORKING, installation_t::installationStatus, installation_t::installationTemplate, and installationTemplate_t::maxBatteries.
Referenced by AIRFIGHT_CampaignRunBaseDefence(), CL_DisplayPopupInterceptUFO(), CL_PopupInterceptBaseClick_f(), and GEO_DrawMapOneInstallation().
| void AII_LoadOneSlotXML | ( | xmlNode_t * | node, |
| aircraftSlot_t * | slot, | ||
| bool | weapon ) |
Loads one slot (base, installation or aircraft).
| [in] | node | XML Node structure, where we get the information from |
| [out] | slot | Pointer to the slot where item should be added. |
| [in] | weapon | True if the slot is a weapon slot. |
Definition at line 1333 of file cp_mapfightequip.cpp.
References AII_AddAmmoToSlot(), AII_AddItemToSlot(), aircraftSlot_t::ammoLeft, cgi, aircraftSlot_t::delayNextShot, aircraftSlot_t::installationTime, name, RS_GetTechByProvided(), SAVE_SLOT_AMMOID, SAVE_SLOT_AMMOLEFT, SAVE_SLOT_DELAYNEXTSHOT, SAVE_SLOT_INSTALLATIONTIME, SAVE_SLOT_ITEMID, SAVE_SLOT_NEXTAMMOID, SAVE_SLOT_NEXTITEMID, and xmlNode_t.
Referenced by AIR_LoadAircraftSlotsXML(), and B_LoadBaseSlotsXML().
| void AII_ReloadAircraftWeapons | ( | aircraft_t * | aircraft | ) |
Reload the weapons of an aircraft.
| [in,out] | aircraft | Pointer to the aircraft to reload |
Definition at line 630 of file cp_mapfightequip.cpp.
References AII_ReloadWeapon(), i, aircraft_t::maxWeapons, and aircraft_t::weapons.
Referenced by AIM_AircraftStart_f(), AIR_SendAircraftPursuingUFO(), AIR_SendAircraftToMission(), B_AircraftReturnedToHomeBase(), and UFO_AddToGeoscape().
| bool AII_ReloadWeapon | ( | aircraftSlot_t * | slot | ) |
Reloads an aircraft/defence-system weapon.
| [in,out] | slot | Pointer to the aircraftSlot where weapon is attached to |
Definition at line 567 of file cp_mapfightequip.cpp.
References AII_AutoAddAmmo(), AII_UpdateAircraftStats(), AIR_IsAircraftInBase(), AIR_IsUFO, aircraftSlot_t::aircraft, AIRCRAFT_RELOAD_DELAY_MULTIPLIER, aircraftSlot_t::ammo, objDef_t::ammo, aircraftSlot_t::ammoLeft, B_AddToStorage(), B_BaseHasItem(), aircraftSlot_t::base, BASE_RELOAD_DELAY_MULTIPLIER, cgi, objDef_t::craftitem, aircraftSlot_t::delayNextShot, ERR_DROP, aircraftSlot_t::installation, INSTALLATION_RELOAD_DELAY_MULTIPLIER, aircraftSlot_t::item, UFO_RELOAD_DELAY_MULTIPLIER, and craftItem::weaponDelay.
Referenced by AII_AddAmmoToSlot(), AII_ReloadAircraftWeapons(), AIR_CampaignRun(), AIRFIGHT_AddProjectile(), and AIRFIGHT_CampaignRunBaseDefence().
| 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.
| [in] | base | The base to add the item to (may be nullptr if item shouldn't be removed from any base). |
| [in] | slot | The slot to remove the item from. |
| [in] | ammo | true if we want to remove only ammo. false if the whole item should be removed. |
Definition at line 482 of file cp_mapfightequip.cpp.
References AII_RemoveItemFromSlot(), aircraftSlot_t::ammo, objDef_t::ammo, aircraftSlot_t::ammoLeft, B_AddToStorage(), objDef_t::craftitem, aircraftSlot_t::installationTime, craftItem::installationTime, objDef_t::isVirtual, aircraftSlot_t::item, aircraftSlot_t::nextAmmo, and aircraftSlot_t::nextItem.
Referenced by AII_AddAmmoToSlot(), AII_RemoveItemFromSlot(), AII_UpdateOneInstallationDelay(), AIM_AircraftEquipAddItem_f(), AIM_AircraftEquipRemoveItem_f(), AIR_DeleteAircraft(), BDEF_AddItem_f(), and BDEF_RemoveItem_f().
| 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.
| [in] | base | The base to add the item to (may be nullptr if item shouldn't be removed from any base). |
| [in] | slot | The slot to remove the item from. |
| [in] | ammo | true if we want to remove only ammo. false if the whole item should be removed. |
Definition at line 535 of file cp_mapfightequip.cpp.
References AII_RemoveNextItemFromSlot(), B_AddToStorage(), objDef_t::isVirtual, aircraftSlot_t::nextAmmo, and aircraftSlot_t::nextItem.
Referenced by AII_AddAmmoToSlot(), AII_RemoveNextItemFromSlot(), AIM_AircraftEquipAddItem_f(), and AIM_AircraftEquipRemoveItem_f().
Repair aircraft.
< Number of damage points repaired per hour: 1% of aircraft max damage value
Definition at line 1035 of file cp_mapfightequip.cpp.
References AIR_ForeachFromBase, AIR_IsAircraftInBase(), AIR_STATS_DAMAGE, B_GetNext(), cgi, and DEBUG_CLIENT.
Referenced by CP_CampaignRun().
| void AII_SaveOneSlotXML | ( | xmlNode_t * | p, |
| const aircraftSlot_t * | slot, | ||
| bool | weapon ) |
Save callback for savegames in XML Format.
| [out] | p | XML Node structure, where we write the information to |
| [in] | slot | The aircraftslot to save |
| [in] | weapon | True if this is a weapon slot |
Definition at line 1309 of file cp_mapfightequip.cpp.
References aircraftSlot_t::ammo, aircraftSlot_t::ammoLeft, cgi, aircraftSlot_t::delayNextShot, objDef_t::id, aircraftSlot_t::installationTime, aircraftSlot_t::item, aircraftSlot_t::nextAmmo, aircraftSlot_t::nextItem, SAVE_SLOT_AMMOID, SAVE_SLOT_AMMOLEFT, SAVE_SLOT_DELAYNEXTSHOT, SAVE_SLOT_INSTALLATIONTIME, SAVE_SLOT_ITEMID, SAVE_SLOT_NEXTAMMOID, SAVE_SLOT_NEXTITEMID, and xmlNode_t.
Referenced by AIR_SaveAircraftSlotsXML(), and B_SaveBaseSlotsXML().
| void AII_UpdateAircraftStats | ( | aircraft_t * | aircraft | ) |
Update the value of stats array of an aircraft.
| [in] | aircraft | Pointer to the aircraft |
Definition at line 1056 of file cp_mapfightequip.cpp.
References AII_CheckUpdateAircraftStats(), AIR_GetMaxAircraftWeaponRange(), AIR_HOME, AIR_REFUEL, AIR_STATS_DAMAGE, AIR_STATS_FUELSIZE, AIR_STATS_MAX, AIR_STATS_SPEED, AIR_STATS_WRANGE, objDef_t::craftitem, aircraft_t::damage, aircraft_t::electronics, EQUAL, aircraft_t::fuel, i, int(), aircraftSlot_t::item, aircraft_t::maxElectronics, aircraft_t::maxWeapons, aircraft_t::shield, aircraft_t::stats, craftItem::stats, aircraft_t::status, aircraft_t::tpl, and aircraft_t::weapons.
Referenced by AII_ReloadWeapon(), AII_UpdateOneInstallationDelay(), AIM_AircraftEquipAddItem_f(), AIM_AircraftEquipRemoveItem_f(), AIM_AutoEquipAircraft(), AIR_NewAircraft(), and UFO_AddToGeoscape().
Update the installation delay of all slots of a given aircraft.
Definition at line 392 of file cp_mapfightequip.cpp.
References AII_UpdateOneInstallationDelay(), AIR_Foreach, AIR_IsAircraftInBase(), B_GetNext(), base_t::batteries, INS_Foreach, base_t::lasers, base_t::numBatteries, base_t::numLasers, and baseWeapon_t::slot.
Referenced by CP_CampaignRun().
| const char * AII_WeightToName | ( | itemWeight_t | weight | ) |
Translate a weight int to a translated string.
Definition at line 1285 of file cp_mapfightequip.cpp.
References _, ITEM_HEAVY, ITEM_LIGHT, and ITEM_MEDIUM.
Referenced by AIM_AircraftEquipMenuUpdate(), and UP_AircraftItemDescription().
| void AIM_AutoEquipAircraft | ( | aircraft_t * | aircraft | ) |
Auto Add weapon and ammo to an aircraft.
| [in] | aircraft | Pointer to the aircraft |
Definition at line 784 of file cp_mapfightequip.cpp.
References AII_AddItemToSlot(), AII_AutoAddAmmo(), AII_GetItemWeightBySize(), AII_UpdateAircraftStats(), B_BaseHasItem(), cgi, ERR_DROP, aircraft_t::homebase, i, aircraftSlot_t::installationTime, INVSH_GetItemByID(), aircraftSlot_t::item, aircraft_t::maxWeapons, technology_t::provides, RS_GetTechByID(), aircraftSlot_t::size, and aircraft_t::weapons.
Referenced by B_SetUpFirstBase().
Checks to see if the pilot is in any aircraft at this base.
| [in] | base | Which base has the aircraft to search for the employee in. |
| [in] | pilot | Which employee to search for. |
Definition at line 166 of file cp_mapfightequip.cpp.
References AIR_ForeachFromBase, and AIR_GetPilot().
| 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.
| [in] | slot | Pointer to an aircraft slot (can be base/installation too) |
| [in] | tech | Pointer to the technology to test |
Definition at line 92 of file cp_mapfightequip.cpp.
References AC_ITEM_AMMO, AII_GetItemWeightBySize(), aircraftSlot_t::aircraft, objDef_t::ammos, B_BaseHasItem(), aircraftSlot_t::base, objDef_t::craftitem, objDef_t::idx, craftItem::installationTime, INVSH_GetItemByID(), aircraftSlot_t::item, aircraftSlot_t::nextItem, objDef_t::numAmmos, technology_t::provides, RS_IsResearched_ptr(), aircraftSlot_t::size, aircraftSlot_t::type, craftItem::type, and objDef_t::weapons.
Referenced by AII_AutoAddAmmo(), AIM_UpdateAircraftItemList(), BDEF_AddItem_f(), BDEF_SelectItem_f(), and BDEF_UpdateAircraftItemList().
| float AIR_GetMaxAircraftWeaponRange | ( | const aircraftSlot_t * | slot, |
| int | maxSlot ) |
Get the maximum weapon range of aircraft.
| [in] | slot | Pointer to the aircrafts weapon slot list. |
| [in] | maxSlot | maximum number of weapon slots in aircraft. |
Definition at line 1004 of file cp_mapfightequip.cpp.
References AII_CheckUpdateAircraftStats(), AIR_STATS_WRANGE, aircraftSlot_t::ammo, objDef_t::craftitem, i, and craftItem::stats.
Referenced by AII_UpdateAircraftStats().
| void BDEF_AddBattery | ( | basedefenceType_t | basedefType, |
| base_t * | base ) |
Adds a defence system to base.
| [in] | basedefType | Base defence type (see basedefenceType_t) |
| [in] | base | Pointer to the base in which the battery will be added |
Definition at line 186 of file cp_mapfightequip.cpp.
References AMMO_STATUS_NOT_SET, aircraftSlot_t::ammoLeft, baseWeapon_t::autofire, BASEDEF_LASER, BASEDEF_MISSILE, base_t::batteries, cgi, base_t::lasers, MAX_BASE_SLOT, base_t::numBatteries, base_t::numLasers, and baseWeapon_t::slot.
Referenced by BDEF_AddBattery_f().
Chooses target for all base defences and sam sites.
Definition at line 1266 of file cp_mapfightequip.cpp.
References B_GetNext(), base_t::batteries, BDEF_AutoTarget(), INS_Foreach, base_t::lasers, base_t::numBatteries, and base_t::numLasers.
Referenced by CP_CampaignRun().
| 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
| [in] | base | Pointer to base |
| [in] | type | defence type, see aircraftItemType_t |
| [in] | idx | index of aircraftslot |
Definition at line 900 of file cp_mapfightequip.cpp.
References AC_ITEM_BASE_LASER, AC_ITEM_BASE_MISSILE, base_t::batteries, i, aircraftSlot_t::item, base_t::lasers, aircraftSlot_t::nextItem, base_t::numBatteries, base_t::numLasers, baseWeapon_t::slot, and type.
Referenced by BDEF_AddItem_f(), BDEF_RemoveItem_f(), and BDEF_SelectItem_f().
| 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
| [in] | installation | Pointer to the installation |
| [in] | type | defence type, see aircraftItemType_t |
| [in] | idx | index of aircraftslot |
Definition at line 938 of file cp_mapfightequip.cpp.
References AC_ITEM_BASE_MISSILE, installation_t::batteries, i, aircraftSlot_t::item, aircraftSlot_t::nextItem, installation_t::numBatteries, baseWeapon_t::slot, and type.
Referenced by BDEF_AddItem_f(), BDEF_RemoveItem_f(), and BDEF_SelectItem_f().
Initialise all values of base slot defence.
| [in] | base | Pointer to the base which needs initalisation of its slots. |
Definition at line 283 of file cp_mapfightequip.cpp.
References AC_ITEM_BASE_LASER, AC_ITEM_BASE_MISSILE, AII_InitialiseSlot(), baseWeapon_t::autofire, base_t::batteries, i, base_t::lasers, MAX_BASE_SLOT, baseWeapon_t::slot, and baseWeapon_t::target.
Referenced by B_Build(), and B_LoadXML().
| void BDEF_InitialiseInstallationSlots | ( | installation_t * | installation | ) |
Initialise all values of installation slot defence.
| [in] | installation | Pointer to the installation which needs initialisation of its slots. |
Definition at line 301 of file cp_mapfightequip.cpp.
References AC_ITEM_BASE_MISSILE, AII_InitialiseSlot(), baseWeapon_t::autofire, installation_t::batteries, i, installation_t::installationTemplate, installationTemplate_t::maxBatteries, baseWeapon_t::slot, and baseWeapon_t::target.
Referenced by INS_FinishInstallation(), and INS_LoadXML().
| void BDEF_RemoveBattery | ( | base_t * | base, |
| basedefenceType_t | basedefType, | ||
| int | idx ) |
Remove a base defence sytem from base.
| [in] | base | The base that is affected |
| [in] | basedefType | (see basedefenceType_t) |
| [in] | idx | index of the battery to destroy |
Definition at line 230 of file cp_mapfightequip.cpp.
References AC_ITEM_BASE_LASER, AC_ITEM_BASE_MISSILE, AII_InitialiseSlot(), BASEDEF_LASER, BASEDEF_MISSILE, base_t::batteries, cgi, i, aircraftSlot_t::item, base_t::lasers, base_t::numBatteries, base_t::numLasers, REMOVE_ELEM, and baseWeapon_t::slot.
Referenced by BDEF_RemoveBattery_f().