UFO: Alien Invasion
|
#include "../../cl_shared.h"
#include "cp_campaign.h"
#include "cp_capacity.h"
#include "cp_aircraft.h"
#include "cp_missions.h"
#include "cp_geoscape.h"
#include "cp_popup.h"
#include "cp_time.h"
#include "cp_ufo.h"
Go to the source code of this file.
Functions | |
void | CAP_RemoveAntimatterExceedingCapacity (base_t *base) |
Remove exceeding antimatter if an antimatter tank has been destroyed. More... | |
void | CAP_UpdateStorageCap (base_t *base) |
Update Storage Capacity. More... | |
void | CAP_SetMax (base_t *base, baseCapacities_t capacity, int value) |
Sets the maximal capacity on a base. More... | |
void | CAP_AddMax (base_t *base, baseCapacities_t capacity, int value) |
Changes the maximal capacity on a base. More... | |
void | CAP_SetCurrent (base_t *base, baseCapacities_t capacity, int value) |
Sets the current (used) capacity on a base. More... | |
void | CAP_AddCurrent (base_t *base, baseCapacities_t capacity, int value) |
Changes the current (used) capacity on a base. More... | |
int | CAP_GetFreeCapacity (const base_t *base, baseCapacities_t capacityType) |
Returns the free capacity of a type. More... | |
void | CAP_CheckOverflow (void) |
Checks capacity overflows on bases. More... | |
void CAP_AddCurrent | ( | base_t * | base, |
baseCapacities_t | capacity, | ||
int | value | ||
) |
Changes the current (used) capacity on a base.
[in,out] | base | The base to set capacity at |
[in] | capacity | Capacity type |
[in] | value | Capacity to add to the current (used) capacity value (negative to decrease) |
Definition at line 108 of file cp_capacity.cpp.
References base_s::capacities, and capacities_s::cur.
Referenced by AIR_Add(), AIR_Delete(), AIR_MoveAircraftIntoNewHomebase(), CAP_UpdateStorageCap(), CP_SpawnRescueMission(), E_HireEmployee(), E_MoveIntoNewBase(), RS_AssignScientist(), RS_RemoveScientist(), TR_TransferStart(), and Employee::unhire().
void CAP_AddMax | ( | base_t * | base, |
baseCapacities_t | capacity, | ||
int | value | ||
) |
Changes the maximal capacity on a base.
[in,out] | base | The base to set capacity at |
[in] | capacity | Capacity type |
[in] | value | Capacity to add to the maximal capacity value (negative to decrease) |
Definition at line 86 of file cp_capacity.cpp.
References base_s::capacities, and capacities_s::max.
Referenced by B_UpdateBaseCapacities().
Checks capacity overflows on bases.
Definition at line 129 of file cp_capacity.cpp.
References _, B_GetBuildingTemplateByType(), B_GetBuildingTypeByCapacity(), B_GetNext(), BASE_DESTROYED, base_s::baseStatus, CAP_AIRCRAFT_BIG, CAP_AIRCRAFT_SMALL, CAP_ALIENS, CAP_ANTIMATTER, CAP_EMPLOYEES, CAP_Get, CAP_ITEMS, CAP_LABSPACE, CAP_RemoveAntimatterExceedingCapacity(), CAP_WORKSPACE, cgi, CP_GameTimeStop(), capacities_s::cur, i, base_s::idx, capacities_s::max, MAX_CAP, building_s::name, base_s::name, PR_UpdateProductionCap(), and RS_RemoveScientistsExceedingCapacity().
Referenced by B_BuildingDestroy(), and CP_CampaignRun().
int CAP_GetFreeCapacity | ( | const base_t * | base, |
baseCapacities_t | capacityType | ||
) |
Returns the free capacity of a type.
[in] | base | Pointer to the base to check |
[in] | capacityType | Capacity type |
Definition at line 119 of file cp_capacity.cpp.
References CAP_Get, capacities_s::cur, and capacities_s::max.
Referenced by AIR_CheckMoveIntoNewHomebase(), B_BuildingDestroy_f(), B_ResetAllStatusAndCapacities(), B_SetUpFirstBase(), BS_Buy_f(), BS_BuyItem(), BS_BuyUGV(), BS_FillMarket_f(), E_HireEmployee(), PR_ProductionIncrease_f(), PR_ProductionInfo(), RS_AssignScientist(), RS_Change_f(), RS_FillTechnologyList_f(), RS_Max_f(), RS_RemoveScientistsExceedingCapacity(), RS_Stop_f(), and TEST_F().
Remove exceeding antimatter if an antimatter tank has been destroyed.
[in] | base | Pointer to the base. |
Definition at line 38 of file cp_capacity.cpp.
References B_AddAntimatter(), CAP_ANTIMATTER, CAP_GetCurrent, and CAP_GetMax.
Referenced by B_Destroy_AntimaterStorage_f(), and CAP_CheckOverflow().
void CAP_SetCurrent | ( | base_t * | base, |
baseCapacities_t | capacity, | ||
int | value | ||
) |
Sets the current (used) capacity on a base.
[in,out] | base | The base to set capacity at |
[in] | capacity | Capacity type |
[in] | value | New current (used) capacity value |
Definition at line 97 of file cp_capacity.cpp.
References base_s::capacities, and capacities_s::cur.
Referenced by B_Build(), B_Destroy(), B_ResetAllStatusAndCapacities(), B_UpdateAntimatterCap(), CAP_UpdateStorageCap(), and RS_RemoveScientistsExceedingCapacity().
void CAP_SetMax | ( | base_t * | base, |
baseCapacities_t | capacity, | ||
int | value | ||
) |
Sets the maximal capacity on a base.
[in,out] | base | The base to set capacity at |
[in] | capacity | Capacity type |
[in] | value | New maximal capacity value |
Definition at line 75 of file cp_capacity.cpp.
References base_s::capacities, and capacities_s::max.
Referenced by B_UpdateBaseCapacities().
Update Storage Capacity.
[in] | base | Pointer to the base |
Definition at line 52 of file cp_capacity.cpp.
References B_ItemInBase(), B_ItemIsStoredInBaseStorage(), CAP_AddCurrent(), CAP_ITEMS, CAP_SetCurrent(), cgi, cgame_import_s::csi, E_CountHired(), EMPL_ROBOT, i, INVSH_GetItemByIDX(), csi_s::numODs, objDef_s::size, and UGV_SIZE.
Referenced by B_InitialEquipment(), B_ResetAllStatusAndCapacities(), B_SellOrAddItems(), and CP_BaseAttackMissionDestroyBase().