25#include "../../../cl_shared.h"
26#include "../../../ui/ui_dataids.h"
27#include "../cp_campaign.h"
28#include "../cp_capacity.h"
29#include "../cp_geoscape.h"
31#include "../cp_missions.h"
32#include "../cp_time.h"
33#include "../cp_popup.h"
34#include "../cp_alien_interest.h"
156 cgi->Com_DPrintf(
DEBUG_CLIENT,
"Base attack: %s at %.0f:%.0f\n", mission->
id, mission->
pos[0], mission->
pos[1]);
180 cgi->UI_PushWindow(
"popup_baseattack");
206 cgi->Com_DPrintf(
DEBUG_CLIENT,
"CP_BaseAttackStartMission: Base '%s' has no Command Center: it can't defend itself. Destroy base.\n", base->
name);
218 if (!employee->isHiredInBase(base))
220 if (employee->isAwayFromBase())
225 cgi->Com_DPrintf(
DEBUG_CLIENT,
"CP_BaseAttackStartMission: Base '%s' has no soldiers at home: it can't defend itself. Destroy base.\n", base->
name);
257 while ((base =
B_GetNext(base)) !=
nullptr)
259 randomNumber =
frand() * sum;
260 while ((base =
B_GetNext(base)) !=
nullptr) {
262 if (randomNumber < 0)
267 assert(base && (randomNumber < 0));
291 cgi->Com_Printf(
"CP_BaseAttackGoToBase: no base found\n");
300 cgi->Com_Error(
ERR_DROP,
"Could not find mapdef baseattack");
322 switch (mission->
stage) {
344 cgi->Com_Printf(
"CP_BaseAttackMissionNextStage: Unknown stage: %i, removing mission.\n", mission->
stage);
aircraft_t * AIR_GetFirstFromBase(const base_t *b)
Iterates through the aircraft of a base.
void INT_ChangeIndividualInterest(float interestFactor, interestCategory_t category)
Change individual interest value.
@ INTERESTCATEGORY_BASE_ATTACK
@ INTERESTCATEGORY_BUILDING
@ INTERESTCATEGORY_TERROR_ATTACK
@ INTERESTCATEGORY_INTERCEPT
@ INTERESTCATEGORY_HARVEST
base_t * B_GetNext(base_t *lastBase)
Iterates through founded bases.
void B_SetCurrentSelectedBase(const base_t *base)
Sets the selected base.
void B_Destroy(base_t *base)
Destroy a base.
int B_GetNumberOfBuildingsInBaseByBuildingType(const base_t *base, const buildingType_t buildingType)
Counts the number of buildings of a particular building type in a base.
bool B_GetBuildingStatus(const base_t *const base, const buildingType_t buildingType)
Get the status associated to a building.
#define B_IsUnderAttack(base)
const cgame_import_t * cgi
void CAP_UpdateStorageCap(base_t *base)
Update Storage Capacity.
int E_CountByType(employeeType_t type)
Returns number of employees of a type.
#define E_Foreach(employeeType, var)
mission_t * GEO_SelectMission(mission_t *mission)
Select the specified mission.
void GEO_NotifyMissionRemoved(const mission_t *mission)
Notify that a mission has been removed.
#define GEO_SetInterceptorAircraft(interceptor)
#define GEO_SetMissionAircraft(aircraft)
uiMessageListNodeMessage_t * MSO_CheckAddNewMessage(const notify_t messagecategory, const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup)
Adds a new message to message stack. It uses message settings to verify whether sound should be playe...
uiMessageListNodeMessage_t * MS_AddNewMessage(const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup, bool playSound)
Adds a new message to message stack.
char cp_messageBuffer[MAX_MESSAGE_TEXT]
static aircraft_t baseAttackFakeAircraft
This fake aircraft is used to assign soldiers for a base attack mission.
void CP_CheckBaseAttacks(void)
Check and start baseattack missions.
static void CP_BaseAttackPrepareBattle(mission_t *mission)
Prepare things for baseattack battle.
void CP_BaseAttackMissionIsSuccess(mission_t *mission)
Base attack mission is over and is a success (from an alien point of view): change interest values.
void CP_BaseAttackMissionOnSpawn(void)
Run when the mission is spawned.
void CP_BaseAttackMissionLeave(mission_t *mission)
Base attack mission ends: UFO leave earth.
static base_t * CP_BaseAttackChooseBase(void)
Choose Base that will be attacked.
void CP_BaseAttackMissionDestroyBase(mission_t *mission)
Base attack mission ends: UFO leave earth.
void CP_BaseAttackMissionNextStage(mission_t *mission)
Determine what action should be performed when a Base Attack mission stage ends.
static void CP_BaseAttackGoToBase(mission_t *mission)
Set base attack mission, and go to base position.
void CP_BaseAttackStartMission(mission_t *mission)
Start Base Attack.
void CP_BaseAttackMissionIsFailure(mission_t *mission)
Base attack mission is over and is a failure (from an alien point of view): change interest values.
Campaign mission headers.
bool CP_MissionBegin(mission_t *mission)
mission begins: UFO arrive on earth.
void CP_UFORemoveFromGeoscape(mission_t *mission, bool destroyed)
Removes (temporarily or permanently) a UFO from geoscape: make it land and call notify functions.
void CP_MissionRemove(mission_t *mission)
Removes a mission from mission global array.
void CP_MissionDisableTimeLimit(mission_t *mission)
Disable time limit for given mission.
#define MIS_Foreach(var)
iterates through missions
void CP_GameTimeStop(void)
Stop game time speed.
void UFO_SendToDestination(aircraft_t *ufo, const vec2_t dest)
Make the specified UFO go to destination.
void UFO_SetRandomDest(aircraft_t *ufocraft)
Give a random destination to the given UFO, and make him to move there.
float frand(void)
Return random values between 0 and 1.
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...
An aircraft with all it's data.
struct mission_s * mission
A base with all it's data.
aircraft_t * aircraftCurrent
mapDef_t *IMPORT * Com_GetMapDefinitionByID(const char *mapDefID)
union mission_t::missionData_t data
#define VectorCopy(src, dest)
#define Vector2Copy(src, dest)