Go to the source code of this file.
Data Structures | |
struct | alienBase_s |
Alien Base. More... | |
Defines | |
#define | AB_Exists() (AB_GetNext(NULL) != NULL) |
Typedefs | |
typedef struct alienBase_s | alienBase_t |
Alien Base. | |
Functions | |
alienBase_t * | AB_GetNext (alienBase_t *lastBase) |
Iterates through the alien bases. | |
alienBase_t * | AB_GetByIDX (int baseIDX) |
Get Alien Base per Idx. | |
void | AB_SetAlienBasePosition (vec2_t pos) |
Set new base position. | |
alienBase_t * | AB_BuildBase (const vec2_t pos) |
Build a new alien base. | |
void | AB_DestroyBase (alienBase_t *base) |
Destroy an alien base. | |
void | AB_UpdateStealthForAllBase (void) |
Update stealth value of every base for every aircraft. | |
void | AB_BaseSearchedByNations (void) |
Nations help in searching alien base. | |
qboolean | AB_CheckSupplyMissionPossible (void) |
Check if a supply mission is possible. | |
alienBase_t * | AB_ChooseBaseToSupply (void) |
Choose Alien Base that should be supplied. | |
void | AB_SupplyBase (alienBase_t *base, qboolean decreaseStealth) |
Supply a base. | |
int | AB_GetAlienBaseNumber (void) |
Check number of alien bases. | |
void | CP_SpawnAlienBaseMission (alienBase_t *alienBase) |
Spawn a new alien base mission after it has been discovered. | |
void | AB_InitStartup (void) |
Definition in file cp_alienbase.h.
#define AB_Exists | ( | ) | (AB_GetNext(NULL) != NULL) |
Definition at line 40 of file cp_alienbase.h.
Referenced by AB_CheckSupplyMissionPossible(), AB_DestroyBase(), and AB_SetAlienBasePosition().
typedef struct alienBase_s alienBase_t |
Alien Base.
void AB_BaseSearchedByNations | ( | void | ) |
Nations help in searching alien base.
daysPerWeek
day < delay (in days) between base stealth update
< base probability, will be modified below
< xviInfection value of nation that will divide probability to find alien base by 2
Definition at line 258 of file cp_alienbase.c.
References AB_GetNext(), ccs, ccs_s::date, date_s::day, MAP_GetNation(), alienBase_s::pos, nation_s::stats, alienBase_s::stealth, alienBase_s::supply, and nationInfo_s::xviInfection.
Referenced by CL_CampaignRun().
alienBase_t* AB_BuildBase | ( | const vec2_t | pos | ) |
Build a new alien base.
[in] | pos | Position of the new base. |
< How hard PHALANX will find the base
Definition at line 93 of file cp_alienbase.c.
References ccs_s::alienBases, stats_s::alienBasesBuilt, ccs_s::campaignStats, ccs, data, alienBase_s::idx, LIST_Add(), alienBase_s::pos, alienBase_s::stealth, and Vector2Copy.
Referenced by CP_BuildBaseSetUpBase().
qboolean AB_CheckSupplyMissionPossible | ( | void | ) |
Check if a supply mission is possible.
Definition at line 288 of file cp_alienbase.c.
References AB_Exists.
Referenced by CP_SupplyGoToBase(), CP_SupplyMissionCreate(), and CP_SupplySetStayAtBase().
alienBase_t* AB_ChooseBaseToSupply | ( | void | ) |
Choose Alien Base that should be supplied.
Definition at line 297 of file cp_alienbase.c.
References AB_GetAlienBaseNumber(), and AB_GetByIDX().
Referenced by CP_SupplyGoToBase().
void AB_DestroyBase | ( | alienBase_t * | base | ) |
Destroy an alien base.
[in] | base | Pointer to the alien base. |
Definition at line 110 of file cp_alienbase.c.
References AB_Exists, ccs_s::alienBases, ccs, ccs_s::interest, INTERESTCATEGORY_SUPPLY, and LIST_Remove().
Referenced by CP_BuildBaseMissionBaseDestroyed().
int AB_GetAlienBaseNumber | ( | void | ) |
Check number of alien bases.
Definition at line 323 of file cp_alienbase.c.
References ccs_s::alienBases, ccs, and LIST_Count().
Referenced by AB_ChooseBaseToSupply(), CP_ReconMissionIsSuccess(), CP_SpawnNewMissions(), and STATS_LoadXML().
alienBase_t* AB_GetByIDX | ( | int | baseIDX | ) |
Get Alien Base per Idx.
[in] | baseIDX | The unique IDX of the alien Base. |
Definition at line 135 of file cp_alienbase.c.
References AB_GetNext(), and alienBase_s::idx.
Referenced by AB_ChooseBaseToSupply(), and CP_LoadMissionsXML().
alienBase_t* AB_GetNext | ( | alienBase_t * | lastBase | ) |
Iterates through the alien bases.
[in] | lastBase | Pointer of the alien base to iterate from. call with NULL to get the first one. |
Definition at line 125 of file cp_alienbase.c.
References ccs_s::alienBases, ccs, and LIST_GetNext().
Referenced by AB_BaseSearchedByNations(), AB_GetByIDX(), AB_SaveXML(), AB_SetAlienBasePosition(), and AB_UpdateStealthForAllBase().
void AB_InitStartup | ( | void | ) |
Definition at line 365 of file cp_alienbase.c.
References Cmd_AddCommand().
Referenced by CP_InitStartup().
void AB_SetAlienBasePosition | ( | vec2_t | pos | ) |
Set new base position.
[out] | pos | Position of the new base. |
maxLoopPosition
random positions, and select among those the one that is the farthest from every other alien bases. This is intended to get a rather uniform distribution of alien bases, while still keeping a random base localisation. < distance between current selected alien base
< Number of random position among which the final one will be selected
Definition at line 43 of file cp_alienbase.c.
References AB_Exists, AB_GetNext(), CP_GetRandomPosOnGeoscape(), GetDistanceOnGlobe(), MAP_PositionCloseToBase(), alienBase_s::pos, qtrue, and Vector2Copy.
Referenced by CP_BuildBaseGoToBase().
void AB_SupplyBase | ( | alienBase_t * | base, | |
qboolean | decreaseStealth | |||
) |
Supply a base.
[in] | base | Pointer to the supplied base. |
[in] | decreaseStealth | If the stealth level of the base should be decreased. |
< How much stealth is reduced because Supply UFO was seen
Definition at line 308 of file cp_alienbase.c.
References alienBase_s::stealth, and alienBase_s::supply.
Referenced by CP_SupplySetStayAtBase().
void AB_UpdateStealthForAllBase | ( | void | ) |
Update stealth value of every base for every aircraft.
DETECTION_INTERVAL
Definition at line 231 of file cp_alienbase.c.
References AB_GetNext(), AB_UpdateStealthForOneBase(), AIR_GetNextFromBase(), AIR_IsAircraftOnGeoscape(), B_GetFoundedBaseByIDX(), and MAX_BASES.
Referenced by CL_CampaignFunctionPeriodicCall().
void CP_SpawnAlienBaseMission | ( | alienBase_t * | alienBase | ) |
Spawn a new alien base mission after it has been discovered.
Definition at line 149 of file cp_alienbase.c.
References _, ALIENBASE_DISCOVERED_TECH, Cmd_ExecuteString(), Com_DPrintf(), Com_Error(), Com_GetMapDefinitionByID(), Com_Printf(), Com_sprintf(), CP_CreateNewMission(), CP_MissionAddToGeoscape(), CP_MissionDisableTimeLimit(), mission_s::data, DEBUG_CLIENT, ERR_FATAL, INTERESTCATEGORY_ALIENBASE, mission_s::location, mission_s::mapDef, MAPDEF_ALIENBASE, mission_s::pos, alienBase_s::pos, mission_s::posAssigned, qfalse, qtrue, RS_MarkStoryLineEventResearched(), mission_s::stage, STAGE_BASE_DISCOVERED, and Vector2Copy.
Referenced by AB_UpdateStealthForOneBase().