cp_alienbase.h File Reference

This graph shows which files directly or indirectly include this file:

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_tAB_GetNext (alienBase_t *lastBase)
 Iterates through the alien bases.
alienBase_tAB_GetByIDX (int baseIDX)
 Get Alien Base per Idx.
void AB_SetAlienBasePosition (vec2_t pos)
 Set new base position.
alienBase_tAB_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_tAB_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)

Detailed Description

Definition in file cp_alienbase.h.


Define Documentation

 
#define AB_Exists (  )     (AB_GetNext(NULL) != NULL)

Typedef Documentation

typedef struct alienBase_s alienBase_t

Alien Base.


Function Documentation

void AB_BaseSearchedByNations ( void   ) 

Nations help in searching alien base.

Note:
called once per day, but will update stealth only every daysPerWeek day
See also:
CL_CampaignRun

< 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.

Parameters:
[in] pos Position of the new base.
Returns:
Pointer to the base that has been built.

< 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.

Returns:
True if there is at least one base to supply.

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.

Returns:
Pointer to the base.

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.

Parameters:
[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.

Returns:
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.

Parameters:
[in] baseIDX The unique IDX of the alien Base.
Returns:
Pointer to the 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.

Parameters:
[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   ) 
See also:
UI_InitStartup

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.

Parameters:
[out] pos Position of the new base.
Note:
This function generates 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.

Parameters:
[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.

Note:
Called every DETECTION_INTERVAL
See also:
CL_CampaignRun
UFO_UpdateAlienInterestForOneBase

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  ) 

Generated by  doxygen 1.6.2