33 #define MAX_BASETEMPLATES 5
34 #define MAX_BUILDINGS 32
35 #define MAX_BASE_SLOT 4
39 #define MAX_BASEBUILDINGS BASE_SIZE * BASE_SIZE
41 #define MAX_BLOCKEDFIELDS 4
42 #define MIN_BLOCKEDFIELDS 1
48 #define BASE_TILE_SIZE 512
49 #define BASE_TILE_UNITS (BASE_TILE_SIZE / UNIT_SIZE)
51 #define BASE_INITIALINTEREST 1.0
53 #define B_IsUnderAttack(base) ((base)->baseStatus == BASE_UNDER_ATTACK)
55 #define B_AtLeastOneExists() (B_GetNext(nullptr) != nullptr)
161 bool B_AssembleMap(
char* maps,
size_t mapsLength,
char* coords,
size_t coordsLength,
const base_t* base);
164 #define B_IsTileBlocked(base, x, y) (base)->map[(int)(y)][(int)(x)].blocked
165 #define B_GetBuildingAt(base, x, y) (base)->map[(int)(y)][(int)(x)].building
building_t * B_GetNextBuilding(const base_t *base, building_t *lastBuilding)
Iterates through buildings in a base.
bool AC_ContainmentAllowed(const base_t *base)
Returns true if the current base is able to handle captured aliens.
Header file for Alien Containment stuff.
#define MAX_BASEBUILDINGS
base_t * B_GetNext(base_t *lastBase)
Iterates through founded bases.
struct baseBuildingTile_s baseBuildingTile_t
baseStatus_t
Possible base states.
void B_UpdateBaseCapacities(baseCapacities_t cap, base_t *base)
Updates base capacities.
A building with all it's data.
struct base_s base_t
A base with all it's data.
production_queue_t productions
QGL_EXTERN GLint GLenum type
bool B_BuildingDestroy(building_t *building)
Removes a building from the given base.
int B_AddToStorage(base_t *base, const objDef_t *obj, int amount)
Add/remove items to/from the storage.
base_t * B_GetFoundedBaseByIDX(int baseIdx)
Array bound check for the base index.
base_t * B_GetFirstUnfoundedBase(void)
Get the first unfounded base.
base_t * B_Build(const struct campaign_s *campaign, const vec2_t pos, const char *name, bool fillBase=false)
building_t * B_GetNextBuildingByType(const base_t *base, building_t *lastBuilding, buildingType_t buildingType)
Iterates throught buildings of a type in a base.
bool AIR_AircraftAllowed(const base_t *base)
Returns true if the current base is able to handle aircraft.
int B_GetNumberOfBuildingsInBaseByTemplate(const base_t *base, const building_t *type)
Counts the number of buildings of a particular type in a base.
struct baseWeapon_s baseWeapon_t
class AlienContainment * alienContainment
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...
building_t * B_GetFreeBuildingType(buildingType_t type)
capacities_t capacities[MAX_CAP]
void B_InitStartup(void)
Resets console commands.
const baseTemplate_t * B_GetBaseTemplate(const char *baseTemplateName)
Returns the baseTemplate in the global baseTemplate list that has the unique name baseTemplateID...
buildingType_t
All different building types.
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.
template for creating a base
Defines all attributes of objects used in the inventory.
bool B_ItemIsStoredInBaseStorage(const objDef_t *obj)
Check if an item is stored in storage.
bool B_BaseHasItem(const base_t *base, const objDef_t *item)
Check if an item is available on a base.
bool B_SaveStorageXML(xmlNode_t *parent, const equipDef_t &equip)
Saves base storage.
void B_SaveBaseSlotsXML(const baseWeapon_t *weapons, const int numWeapons, xmlNode_t *p)
Saves the missile and laser slots of a base or sam site.
bool HOS_HospitalAllowed(const base_t *base)
Returns true if you can enter in the hospital.
A base with all it's data.
A production queue. Lists all items to be produced.
void B_ResetAllStatusAndCapacities(base_t *base, bool firstEnable)
Recalculate status and capacities of one base.
void B_SetName(base_t *base, const char *name)
Set the base name.
inventory definition with all its containers
aircraft_t * aircraftCurrent
bool B_MapIsCellFree(const base_t *base, int col, int row)
Check a base cell.
void B_SetBuildingStatus(base_t *const base, const buildingType_t type, bool newStatus)
Set status associated to a building.
bool B_GetBuildingStatus(const base_t *const base, const buildingType_t type)
Get the status associated to a building.
void B_UpdateBuildingConstructions(void)
Updates base data.
bool B_AssembleMap(char *maps, size_t mapsLength, char *coords, size_t coordsLength, const base_t *base)
Perform the base assembling in case of an alien attack.
Header for production related stuff.
baseBuildingTile_t map[BASE_SIZE][BASE_SIZE]
Header for base building related stuff.
bool RS_ResearchAllowed(const base_t *base)
Returns true if the current base is able to handle research.
int B_GetNumberOfBuildingsInBaseByBuildingType(const base_t *base, const buildingType_t type)
Counts the number of buildings of a particular building type in a base.
void B_ParseBaseTemplate(const char *name, const char **text)
Reads a base layout template.
base_t * B_GetCurrentSelectedBase(void)
returns the currently selected base
int B_GetInstallationLimit(void)
Counts the actual installation count limit.
bool PR_ProductionAllowed(const base_t *base)
Returns true if the current base is able to produce items.
baseCapacities_t
All possible capacities in base.
void B_SetCurrentSelectedBase(const base_t *base)
Sets the selected base.
baseWeapon_t batteries[MAX_BASE_SLOT]
bool BS_BuySellAllowed(const base_t *base)
Returns true if you can buy or sell equipment.
bool B_IsBuildingDestroyable(const building_t *building)
Returns if a base building is destroyable.
bool B_LoadStorageXML(xmlNode_t *parent, equipDef_t *equip)
Loads base storage.
void B_SelectBase(const base_t *base)
Select and opens a base.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
buildingType_t B_GetBuildingTypeByCapacity(baseCapacities_t cap)
Get building type by base capacity.
baseCapacities_t B_GetCapacityFromBuildingType(buildingType_t type)
Get the capacity associated to a building type.
void B_Delete(base_t *base)
Resets a base structure.
bool B_CheckBuildingTypeStatus(const base_t *const base, buildingType_t type, buildingStatus_t status, int *cnt)
Searches the base for a given building type with the given status.
void B_BaseResetStatus(base_t *const base)
Sets the baseStatus to BASE_NOT_USED.
baseWeapon_t lasers[MAX_BASE_SLOT]
const building_t * B_GetBuildingInBaseByType(const base_t *base, buildingType_t type, bool onlyWorking)
Gets a building of a given type in the given base.
void B_Destroy(base_t *base)
Destroy a base.
baseBuildingTile_t buildings[MAX_BASEBUILDINGS]
bool E_HireAllowed(const base_t *base)
Returns true if the current base is able to handle employees.
float B_GetMaxBuildingLevel(const base_t *base, const buildingType_t type)
Get the maximum level of a building type in a base.
void B_SetUpFirstBase(const struct campaign_s *campaign, base_t *base)
void B_AircraftReturnedToHomeBase(aircraft_t *aircraft)
Do anything when dropship returns to base.
Store capacities in base.
int B_LoadBaseSlotsXML(baseWeapon_t *weapons, int numWeapons, xmlNode_t *p)
Loads the missile and laser slots of a base or sam site.
building_t * B_BuildBuilding(base_t *base, const building_t *buildingTemplate, int col, int row)
Build a new building to the base.
An aircraft with all it's data.
int B_GetCount(void)
Returns the count of founded bases.
int B_AntimatterInBase(const base_t *base)
returns the amount of antimatter stored in a base
bool hasBuilding[MAX_BUILDING_TYPE]
struct baseTemplate_s baseTemplate_t
template for creating a base
int B_AddAntimatter(base_t *base, int amount)
Manages antimatter (adding, removing) through Antimatter Storage Facility.
void B_DumpAircraftToHomeBase(aircraft_t *aircraft)
Will unload all cargo to the homebase.
buildingStatus_t
All possible building status.