UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_missions.h
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24*/
25
26#pragma once
27
28#include "../../DateTime.h"
29#include "cp_campaign.h"
30
31extern const int MAX_POS_LOOP;
32
55
56typedef enum {
59
81
115
119#define MIS_Foreach(var) LIST_Foreach(ccs.missions, mission_t, var)
120
121const char* MIS_GetName(const mission_t* mission);
122
123void BATTLE_SetVars(const battleParam_t* battleParameters);
124void CP_CreateBattleParameters(mission_t* mission, battleParam_t* param, const aircraft_t* aircraft);
125void BATTLE_Start(mission_t* mission, const battleParam_t* battleParameters);
126mission_t* CP_GetMissionByIDSilent(const char* missionId);
127mission_t* CP_GetMissionByID(const char* missionId);
128int MIS_GetIdx(const mission_t* mis);
129mission_t* MIS_GetByIdx(int id);
130mission_t* CP_CreateNewMission(interestCategory_t category, bool beginNow);
131void CP_UFOProceedMission(const struct campaign_s* campaign, struct aircraft_s* ufocraft);
132void CP_MissionRemove(mission_t* mission);
133bool CP_MissionBegin(mission_t* mission);
135bool CP_CheckMissionLimitedInTime(const mission_t* mission);
137void CP_MissionNotifyBaseDestroyed(const base_t* base);
139const char* MIS_GetModel(const mission_t* mission);
141void CP_MissionAddToGeoscape(mission_t* mission, bool force);
142void CP_UFORemoveFromGeoscape(mission_t* mission, bool destroyed);
144void CP_SpawnRescueMission(aircraft_t* aircraft, aircraft_t* ufo);
146void CP_MissionStageEnd(const campaign_t* campaign, mission_t* mission);
148void CP_SpawnNewMissions(void);
149void CP_MissionIsOver(mission_t* mission);
150void CP_MissionIsOverByUFO(aircraft_t* ufocraft);
151void CP_MissionEnd(const campaign_t* campaign, mission_t* mission, const battleParam_t* battleParameters, bool won);
152void CP_MissionEndActions(mission_t* mission, aircraft_t* aircraft, bool won);
153bool CP_ChooseMap(mission_t* mission, const vec2_t pos);
154bool CP_CheckNextStageDestination(const struct campaign_s* campaign, struct aircraft_s* ufo);
157
158void MIS_InitStartup(void);
159void MIS_Shutdown(void);
DateTime class definition.
Class describing a point of time.
Definition DateTime.h:31
interestCategory_t
Header file for single player campaign control.
const int MAX_POS_LOOP
void MIS_InitStartup(void)
Init actions for missions-subsystem.
void CP_InitializeSpawningDelay(void)
Initialize spawning delay.
void BATTLE_Start(mission_t *mission, const battleParam_t *battleParameters)
Select the mission type and start the map from mission definition.
void CP_MissionNotifyBaseDestroyed(const base_t *base)
Notify that a base has been removed.
int MIS_GetIdx(const mission_t *mis)
Find idx corresponding to mission.
void CP_CreateBattleParameters(mission_t *mission, battleParam_t *param, const aircraft_t *aircraft)
Create parameters needed for battle. This is the data that is used for starting the tactical part of ...
int CP_CountMissionOnGeoscape(void)
Count the number of mission active and displayed on geoscape.
void CP_MissionNotifyInstallationDestroyed(const installation_t *installation)
Notify missions that an installation has been destroyed.
void MIS_Shutdown(void)
Closing actions for missions-subsystem.
bool CP_CheckMissionLimitedInTime(const mission_t *mission)
Check if mission should end because of limited time.
missionState_t
Definition cp_missions.h:56
@ LOST
Definition cp_missions.h:57
@ WON
Definition cp_missions.h:57
@ DRAW
Definition cp_missions.h:57
void CP_UFOProceedMission(const struct campaign_s *campaign, struct aircraft_s *ufocraft)
mission_t * CP_GetMissionByID(const char *missionId)
Get a mission in ccs.missions by Id.
void CP_UpdateMissionVisibleOnGeoscape(void)
Update all mission visible on geoscape (in base radar range).
void BATTLE_SetVars(const battleParam_t *battleParameters)
Set some needed cvars from a battle definition.
void CP_MissionEndActions(mission_t *mission, aircraft_t *aircraft, bool won)
Actions to be done after mission finished.
void CP_SpawnRescueMission(aircraft_t *aircraft, aircraft_t *ufo)
Spawn a new rescue mission for a crashed (phalanx) aircraft.
bool CP_MissionBegin(mission_t *mission)
mission begins: UFO arrive on earth.
const char * MIS_GetModel(const mission_t *mission)
Get mission model that should be shown on the geoscape.
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.
missionStage_t
Definition cp_missions.h:34
@ STAGE_RECON_GROUND
Definition cp_missions.h:40
@ STAGE_RETURN_TO_ORBIT
Definition cp_missions.h:51
@ STAGE_HARVEST
Definition cp_missions.h:49
@ STAGE_MISSION_GOTO
Definition cp_missions.h:39
@ STAGE_SPREAD_XVI
Definition cp_missions.h:46
@ STAGE_BASE_DISCOVERED
Definition cp_missions.h:48
@ STAGE_BUILD_BASE
Definition cp_missions.h:42
@ STAGE_SUPPLY
Definition cp_missions.h:45
@ STAGE_NOT_ACTIVE
Definition cp_missions.h:35
@ STAGE_COME_FROM_ORBIT
Definition cp_missions.h:36
@ STAGE_INTERCEPT
Definition cp_missions.h:47
@ STAGE_SUBVERT_GOV
Definition cp_missions.h:44
@ STAGE_BASE_ATTACK
Definition cp_missions.h:43
@ STAGE_TERROR_MISSION
Definition cp_missions.h:41
@ STAGE_OVER
Definition cp_missions.h:53
@ STAGE_RECON_AIR
Definition cp_missions.h:38
bool CP_CheckNextStageDestination(const struct campaign_s *campaign, struct aircraft_s *ufo)
void CP_MissionIsOverByUFO(aircraft_t *ufocraft)
Mission is finished because Phalanx team ended it.
mission_t * CP_CreateNewMission(interestCategory_t category, bool beginNow)
Create a new mission of given category.
bool CP_ChooseMap(mission_t *mission, const vec2_t pos)
Choose a map for given mission.
bool CP_CheckNewMissionDetectedOnGeoscape(void)
Check if mission has been detected by radar.
void CP_MissionEnd(const campaign_t *campaign, mission_t *mission, const battleParam_t *battleParameters, bool won)
Closing actions after fighting a battle.
void CP_MissionRemoveFromGeoscape(mission_t *mission)
Removes a mission from geoscape: make it non visible and call notify functions.
void CP_MissionAddToGeoscape(mission_t *mission, bool force)
Add a mission to geoscape: make it visible and stop time.
void CP_MissionIsOver(mission_t *mission)
Mission is finished because Phalanx team won it.
const char * MIS_GetName(const mission_t *mission)
Returns a short translated name for a mission.
void CP_MissionStageEnd(const campaign_t *campaign, mission_t *mission)
Determine what action should be performed when a mission stage ends.
void CP_SpawnCrashSiteMission(aircraft_t *ufo)
Spawn a new crash site after a UFO has been destroyed.
ufoType_t CP_MissionChooseUFO(const mission_t *mission)
Choose UFO type for a given mission category.
mission_t * CP_GetMissionByIDSilent(const char *missionId)
Get a mission in ccs.missions by Id without error messages.
void CP_MissionDisableTimeLimit(mission_t *mission)
Disable time limit for given mission.
mission_t * MIS_GetByIdx(int id)
Find mission corresponding to idx.
void CP_SpawnNewMissions(void)
Spawn new missions.
QGL_EXTERN GLsizei const GLvoid * data
Definition r_gl.h:89
short ufoType_t
Definition scripts.h:145
#define MAX_VAR
Definition shared.h:36
An aircraft with all it's data.
Alien Base.
A base with all it's data.
Definition cp_base.h:84
City definition.
Definition cp_nation.h:70
A installation with all it's data.
mission definition
Definition cp_missions.h:86
aircraft_t * ufo
missionResults_t missionResults
mapDef_t * mapDef
Definition cp_missions.h:89
bool onGeoscape
char onwin[256]
bool active
Definition cp_missions.h:90
int initialOverallInterest
missionStage_t stage
Definition cp_missions.h:99
class DateTime startDate
interestCategory_t category
Definition cp_missions.h:98
vec2_t pos
bool posAssigned
char onlose[256]
class DateTime finalDate
int initialIndividualInterest
Structure with mission info needed to create results summary at menu won.
Definition cp_missions.h:61
int civiliansKilledFriendlyFire
Definition cp_missions.h:78
ufoType_t ufotype
Definition cp_missions.h:66
const struct mission_s * mission
Definition cp_missions.h:62
missionState_t state
Definition cp_missions.h:63
vec_t vec2_t[2]
Definition ufotypes.h:38
installation_t * installation
Definition cp_missions.h:94
alienBase_t * alienBase
Definition cp_missions.h:95