|
UFO: Alien Invasion
|
Alien base related functions. More...
#include "../../cl_shared.h"#include "cp_campaign.h"#include "cp_alienbase.h"#include "cp_geoscape.h"#include "cp_missions.h"#include "save/save_alienbase.h"
Go to the source code of this file.
Macros | |
| #define | MAPDEF_ALIENBASE "alienbase" |
Functions | |
| 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. | |
| alienBase_t * | AB_GetByIDX (int baseIDX) |
| Get Alien Base per Idx. | |
| void | CP_SpawnAlienBaseMission (alienBase_t *alienBase) |
| Spawn a new alien base mission after it has been discovered. | |
| static void | AB_UpdateStealthForOneBase (const aircraft_t *aircraft, alienBase_t *base) |
| Update stealth value of one alien base due to one aircraft. | |
| void | AB_UpdateStealthForAllBase (void) |
| Update stealth value of every base for every aircraft. | |
| void | AB_BaseSearchedByNations (void) |
| Nations help in searching alien base. | |
| bool | 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, bool decreaseStealth) |
| Supply a base. | |
| int | AB_GetAlienBaseNumber (void) |
| Check number of alien bases. | |
| bool | AB_LoadXML (xmlNode_t *p) |
| Load callback for alien base data. | |
| bool | AB_SaveXML (xmlNode_t *p) |
| Save callback for alien base data. | |
| void | AB_InitStartup (void) |
| Init actions for alienbase-subsystem. | |
| void | AB_Shutdown (void) |
| Closing actions for alienbase-subsystem. | |
Variables | |
| static const cmdList_t | debugAlienBaseCmds [] |
Alien base related functions.
Definition in file cp_alienbase.cpp.
| #define MAPDEF_ALIENBASE "alienbase" |
Definition at line 32 of file cp_alienbase.cpp.
Referenced by CP_SpawnAlienBaseMission().
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 238 of file cp_alienbase.cpp.
References AB_Foreach, ccs, CP_SpawnAlienBaseMission(), GEO_GetNation(), NAT_GetCurrentMonthInfo(), and nationInfo_t::xviInfection.
Referenced by CP_CampaignRun(), and TEST_F().
| 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 90 of file cp_alienbase.cpp.
References ccs, alienBase_t::idx, LIST_Add(), OBJZERO, alienBase_t::pos, alienBase_t::stealth, and Vector2Copy.
Referenced by CP_BuildBaseSetUpBase(), TEST_F(), and TEST_F().
| bool AB_CheckSupplyMissionPossible | ( | void | ) |
Check if a supply mission is possible.
Definition at line 274 of file cp_alienbase.cpp.
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 283 of file cp_alienbase.cpp.
References AB_Foreach, AB_GetAlienBaseNumber(), cgi, and i.
Referenced by CP_SupplyGoToBase().
| void AB_DestroyBase | ( | alienBase_t * | base | ) |
Destroy an alien base.
| [in] | base | Pointer to the alien base. |
Definition at line 107 of file cp_alienbase.cpp.
References AB_Exists, ccs, cgi, and INTERESTCATEGORY_SUPPLY.
Referenced by CP_BuildBaseMissionBaseDestroyed().
Check number of alien bases.
Definition at line 323 of file cp_alienbase.cpp.
Referenced by AB_ChooseBaseToSupply(), CP_ReconMissionIsSuccess(), CP_SpawnNewMissions(), TEST_F(), and TEST_F().
| alienBase_t * AB_GetByIDX | ( | int | baseIDX | ) |
Get Alien Base per Idx.
| [in] | baseIDX | The unique IDX of the alien Base. |
Definition at line 123 of file cp_alienbase.cpp.
References AB_Foreach.
Referenced by MIS_LoadXML().
Init actions for alienbase-subsystem.
Definition at line 423 of file cp_alienbase.cpp.
References cgi, and debugAlienBaseCmds.
Referenced by CP_InitStartup().
| bool AB_LoadXML | ( | xmlNode_t * | p | ) |
Load callback for alien base data.
| [in] | p | XML Node structure, where we get the information from |
<
Definition at line 363 of file cp_alienbase.cpp.
References ccs, cgi, i, alienBase_t::idx, LIST_Add(), alienBase_t::pos, SAVE_ALIENBASE_ALIENBASES, SAVE_ALIENBASE_BASE, SAVE_ALIENBASE_IDX, SAVE_ALIENBASE_POS, SAVE_ALIENBASE_STEALTH, SAVE_ALIENBASE_SUPPLY, alienBase_t::stealth, alienBase_t::supply, and xmlNode_t.
Referenced by SAV_Init().
| bool AB_SaveXML | ( | xmlNode_t * | p | ) |
Save callback for alien base data.
| [out] | p | XML Node structure, where we write the information to |
Definition at line 397 of file cp_alienbase.cpp.
References AB_Foreach, cgi, SAVE_ALIENBASE_ALIENBASES, SAVE_ALIENBASE_BASE, SAVE_ALIENBASE_IDX, SAVE_ALIENBASE_POS, SAVE_ALIENBASE_STEALTH, SAVE_ALIENBASE_SUPPLY, and xmlNode_t.
Referenced by SAV_Init().
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 41 of file cp_alienbase.cpp.
References AB_Exists, AB_Foreach, CP_GetRandomPosOnGeoscape(), GEO_PositionCloseToBase(), GetDistanceOnGlobe(), and Vector2Copy.
Referenced by CP_BuildBaseGoToBase().
Closing actions for alienbase-subsystem.
Definition at line 431 of file cp_alienbase.cpp.
References ccs, cgi, and debugAlienBaseCmds.
Referenced by CP_Shutdown().
| void AB_SupplyBase | ( | alienBase_t * | base, |
| bool | 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.cpp.
References alienBase_t::stealth, and alienBase_t::supply.
Referenced by CP_SupplySetStayAtBase().
Update stealth value of every base for every aircraft.
DETECTION_INTERVAL Definition at line 218 of file cp_alienbase.cpp.
References AB_Foreach, AB_UpdateStealthForOneBase(), AIR_ForeachFromBase, AIR_IsAircraftOnGeoscape(), and B_GetNext().
Referenced by CP_CampaignFunctionPeriodicCall().
|
static |
Update stealth value of one alien base due to one aircraft.
| [in] | aircraft | Pointer to the aircraft_t. |
| [in] | base | Pointer to the alien base. |
radarratio times radar range. < base probability, will be modified below
< stealth decreases faster if base is inside radarratio times radar range
< factor applied when outside radarratio times radar range
Definition at line 177 of file cp_alienbase.cpp.
References CP_SpawnAlienBaseMission(), DETECTION_INTERVAL, GetDistanceOnGlobe(), aircraft_t::pos, alienBase_t::pos, aircraft_t::radar, alienBase_t::stealth, and alienBase_t::supply.
Referenced by AB_UpdateStealthForAllBase().
| void CP_SpawnAlienBaseMission | ( | alienBase_t * | alienBase | ) |
Spawn a new alien base mission after it has been discovered.
Definition at line 135 of file cp_alienbase.cpp.
References mission_t::missionData_t::alienBase, ALIENBASE_DISCOVERED, cgi, CP_CreateNewMission(), CP_MissionAddToGeoscape(), CP_MissionDisableTimeLimit(), CP_TriggerEvent(), mission_t::data, ERR_FATAL, INTERESTCATEGORY_ALIENBASE, mission_t::mapDef, MAPDEF_ALIENBASE, MIS_Foreach, alienBase_t::pos, mission_t::pos, mission_t::posAssigned, mission_t::stage, STAGE_BASE_DISCOVERED, and Vector2Copy.
Referenced by AB_BaseSearchedByNations(), and AB_UpdateStealthForOneBase().
|
static |
Definition at line 412 of file cp_alienbase.cpp.
Referenced by AB_InitStartup(), and AB_Shutdown().