forked from Warzone2100/warzone2100
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmission.h
216 lines (156 loc) · 6.77 KB
/
mission.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/*
This file is part of Warzone 2100.
Copyright (C) 1999-2004 Eidos Interactive
Copyright (C) 2005-2019 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** @file
* Mission defines for the game
*/
#ifndef __INCLUDED_SRC_MISSION_H__
#define __INCLUDED_SRC_MISSION_H__
#include "map.h"
#include "power.h"
#include "levels.h"
#include "missiondef.h"
#include "group.h"
/**
* The number of areas that can be defined to prevent buildings being placed -
* used for Transporter Landing Zones 0-7 are for players, 8 = LIMBO_LANDING
*/
#define MAX_NOGO_AREAS (MAX_PLAYERS + 1)
#define LIMBO_LANDING MAX_PLAYERS
extern MISSION mission;
extern bool offWorldKeepLists;
extern DROID *apsLimboDroids[MAX_PLAYERS];
/** Return positions for vtols. */
extern Vector2i asVTOLReturnPos[MAX_PLAYERS];
extern bool Cheated;
void initMission();
bool missionShutDown();
void missionDestroyObjects();
/** This is called everytime the game is quit. */
void releaseMission();
/** On the PC - sets the countdown played flag. */
void setMissionCountDown();
bool startMission(LEVEL_TYPE missionType, char *pGame);
void endMission();
/** Initialise the mission stuff for a save game. */
bool startMissionSave(SDWORD missionType);
/** Sets up the game to start a new mission. */
bool setUpMission(UDWORD type);
/** This causes the new mission data to be loaded up. */
void launchMission();
/** The update routine for all droids left back at home base. Only interested in Transporters at present. */
void missionDroidUpdate(DROID *psDroid);
bool missionIsOffworld();
bool missionCanReEnforce();
bool missionForReInforcements();
/** Returns true if the mission is a Limbo Expand mission. */
bool missionLimboExpand();
/** This is called mid Limbo mission via the script. */
void resetLimboMission();
void swapMissionPointers();
// mission results.
#define IDTIMER_FORM 11000
#define IDTIMER_DISPLAY 11001
#define IDMISSIONRES_FORM 11002
#define IDMISSIONRES_QUIT 11007
#define IDMISSIONRES_SAVE 11006
//timer display for transporter timer
#define IDTRANTIMER_DISPLAY 11010
// Timer position defines
#define TIMER_X (568 + E_W)
#define TIMER_Y 22
// status of the mission result screens.
extern bool MissionResUp;
void intRemoveMissionResult();
void intRemoveMissionResultNoAnim();
void intProcessMissionResult(UDWORD id);
void intRunMissionResult();
void unloadTransporter(DROID *psTransporter, UDWORD x, UDWORD y, bool goingHome);
/** Sets the appropriate pause states for when the interface is up but the game needs to be paused. */
void setMissionPauseState();
/** Resets the pause states. */
void resetMissionPauseState();
/** Returns the x coord for where the Transporter can land. */
UWORD getLandingX(SDWORD iPlayer);
/** Returns the y coord for where the Transporter can land. */
UWORD getLandingY(SDWORD iPlayer);
/** Checks that the timer has been set and that a Transporter exists before adding the timer button. */
void addTransporterTimerInterface();
void intRemoveTransporterTimer();
/** Update routine for mission details. */
void missionTimerUpdate();
/** Checks the time has been set and then adds the timer if not already on the display. */
void addMissionTimerInterface();
void intRemoveMissionTimer();
//access functions for bPlayCountDown flag
void setPlayCountDown(UBYTE set);
bool getPlayCountDown();
/** Checks the x,y passed in are not within the boundary of the Landing Zone x and y in tile coords. */
bool withinLandingZone(UDWORD x, UDWORD y);
//sets the coords for the Transporter to land
LANDING_ZONE *getLandingZone(SDWORD i);
/** Initialises all the nogo areas to 0. */
void initNoGoAreas();
/** Sets the coords for a no go area. */
void setNoGoArea(UBYTE x1, UBYTE y1, UBYTE x2, UBYTE y2, UBYTE area);
/** Fly in transporters at start of level. */
void missionFlyTransportersIn(SDWORD iPlayer, bool bTrackTransporter);
/** Move transporter offworld. */
void missionMoveTransporterOffWorld(DROID *psTransporter);
/** Pick nearest map edge to point. */
void missionGetNearestCorner(UWORD iX, UWORD iY, UWORD *piOffX, UWORD *piOffY);
void missionSetReinforcementTime(UDWORD iTime);
UDWORD missionGetReinforcementTime();
/** Builds a droid back at the home base whilst on a mission - stored in a list made available to the transporter interface. */
DROID *buildMissionDroid(DROID_TEMPLATE *psTempl, UDWORD x, UDWORD y, UDWORD player);
/** This is just a very big number - bigger than a map width/height could ever be! */
#define INVALID_XY (512 * 127)
void missionSetTransporterEntry(SDWORD iPlayer, SDWORD iEntryTileX, SDWORD iEntryTileY);
void missionSetTransporterExit(SDWORD iPlayer, SDWORD iExitTileX, SDWORD iExitTileY);
void missionGetTransporterEntry(SDWORD iPlayer, UWORD *iX, UWORD *iY);
void missionGetTransporterExit(SDWORD iPlayer, UDWORD *iX, UDWORD *iY);
//access functions for droidsToSafety flag
void setDroidsToSafetyFlag(bool set);
bool getDroidsToSafetyFlag();
/** Checks to see if the player has any droids (except Transporters left). */
bool missionDroidsRemaining(UDWORD player);
/**
* Called when a Transporter gets to the edge of the world and the droids are being flown to safety.
* The droids inside the Transporter are placed into the mission list for later use.
*/
void moveDroidsToSafety(DROID *psTransporter);
/** Called when ESC is pressed. */
void clearMissionWidgets();
/** Resets if return to game after an ESC. */
void resetMissionWidgets();
UDWORD getCampaignNumber();
void setCampaignNumber(UDWORD number);
bool intAddMissionResult(bool result, bool bPlaySuccess, bool showBackDrop);
/** Reset the vtol landing pos. */
void resetVTOLLandingPos();
/** This is called via a script function to place the Limbo droids once the mission has started. */
void placeLimboDroids();
/** bCheating = true == start of cheat, bCheating = false == end of cheat. */
void setMissionCheatTime(bool bCheating);
#define MISSIONRES_X 20 // pos & size of box.
#define MISSIONRES_Y 380
#define MISSIONRES_W 600
#define MISSIONRES_H 80
#define MISSIONRES_TITLE_X 20
#define MISSIONRES_TITLE_Y 20
#define MISSIONRES_TITLE_W 600
#define MISSIONRES_TITLE_H 40
#endif // __INCLUDED_SRC_MISSION_H__