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" 30 #include "../cp_ufo.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);
static base_t * CP_BaseAttackChooseBase(void)
Choose Base that will be attacked.
#define VectorCopy(src, dest)
#define GEO_SetInterceptorAircraft(interceptor)
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...
void UFO_SetRandomDest(aircraft_t *ufocraft)
Give a random destination to the given UFO, and make him to move there.
bool B_GetBuildingStatus(const base_t *const base, const buildingType_t buildingType)
Get the status associated to a building.
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...
A base with all it's data.
#define E_Foreach(employeeType, var)
#define MIS_Foreach(var)
iterates through missions
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
#define B_IsUnderAttack(base)
void CP_BaseAttackMissionLeave(mission_t *mission)
Base attack mission ends: UFO leave earth.
void INT_ChangeIndividualInterest(float interestFactor, interestCategory_t category)
Change individual interest value.
void GEO_NotifyMissionRemoved(const mission_t *mission)
Notify that a mission has been removed.
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.
void CP_GameTimeStop(void)
Stop game time speed.
union mission_t::missionData_t data
aircraft_t * aircraftCurrent
void CP_CheckBaseAttacks(void)
Check and start baseattack missions.
aircraft_t * AIR_GetFirstFromBase(const base_t *b)
Iterates through the aircraft of a base.
int E_CountByType(employeeType_t type)
Returns number of employees of a type.
base_t * B_GetNext(base_t *lastBase)
Iterates through founded bases.
void CP_BaseAttackMissionIsFailure(mission_t *mission)
Base attack mission is over and is a failure (from an alien point of view): change interest values...
const cgame_import_t * cgi
bool CP_MissionBegin(mission_t *mission)
mission begins: UFO arrive on earth.
void CP_MissionRemove(mission_t *mission)
Removes a mission from mission global array.
void B_Destroy(base_t *base)
Destroy a base.
void B_SetCurrentSelectedBase(const base_t *base)
Sets the selected base.
char cp_messageBuffer[MAX_MESSAGE_TEXT]
int B_GetNumberOfBuildingsInBaseByBuildingType(const base_t *base, const buildingType_t buildingType)
Counts the number of buildings of a particular building type in a base.
void CP_BaseAttackMissionDestroyBase(mission_t *mission)
Base attack mission ends: UFO leave earth.
An aircraft with all it's data.
void CAP_UpdateStorageCap(base_t *base)
Update Storage Capacity.
struct mission_s * mission
float frand(void)
Return random values between 0 and 1.
void CP_BaseAttackMissionNextStage(mission_t *mission)
Determine what action should be performed when a Base Attack mission stage ends.
void CP_BaseAttackStartMission(mission_t *mission)
Start Base Attack.
void CP_UFORemoveFromGeoscape(mission_t *mission, bool destroyed)
Removes (temporarily or permanently) a UFO from geoscape: make it land and call notify functions...
static aircraft_t baseAttackFakeAircraft
This fake aircraft is used to assign soldiers for a base attack mission.
#define Vector2Copy(src, dest)
void UFO_SendToDestination(aircraft_t *ufo, const vec2_t dest)
Make the specified UFO go to destination.
static void CP_BaseAttackPrepareBattle(mission_t *mission)
Prepare things for baseattack battle.
Campaign mission headers.
mapDef_t *IMPORT * Com_GetMapDefinitionByID(const char *mapDefID)
void CP_BaseAttackMissionIsSuccess(mission_t *mission)
Base attack mission is over and is a success (from an alien point of view): change interest values...
#define GEO_SetMissionAircraft(aircraft)
void CP_MissionDisableTimeLimit(mission_t *mission)
Disable time limit for given mission.
mission_t * GEO_SelectMission(mission_t *mission)
Select the specified mission.
void CP_BaseAttackMissionOnSpawn(void)
Run when the mission is spawned.
static void CP_BaseAttackGoToBase(mission_t *mission)
Set base attack mission, and go to base position.