Skip to content

Commit 4665e68

Browse files
committed
Changing TerrorSite to MissionSite.
1 parent 18bba3f commit 4665e68

27 files changed

Lines changed: 336 additions & 229 deletions

‎bin/data/Ruleset/Xcom1Ruleset/alienMissions.rul‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ alienMissions:
244244
timer: 60
245245
- type: STR_ALIEN_TERROR
246246
points: 10
247+
deployment: STR_TERROR_MISSION
248+
markerName: STR_TERROR_SITE
247249
raceWeights:
248250
0:
249251
STR_SECTOID: 30

‎src/Battlescape/BattlescapeGenerator.cpp‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace OpenXcom
6969
* Sets up a BattlescapeGenerator.
7070
* @param game pointer to Game object.
7171
*/
72-
BattlescapeGenerator::BattlescapeGenerator(Game *game) : _game(game), _save(game->getSavedGame()->getSavedBattle()), _res(_game->getResourcePack()), _craft(0), _ufo(0), _base(0), _terror(0), _alienBase(0), _terrain(0),
72+
BattlescapeGenerator::BattlescapeGenerator(Game *game) : _game(game), _save(game->getSavedGame()->getSavedBattle()), _res(_game->getResourcePack()), _craft(0), _ufo(0), _base(0), _mission(0), _alienBase(0), _terrain(0),
7373
_mapsize_x(0), _mapsize_y(0), _mapsize_z(0), _worldTexture(0), _worldShade(0), _unitSequence(0), _craftInventoryTile(0), _alienItemLevel(0), _baseInventory(false), _generateFuel(true), _craftDeployed(false), _craftZ(0)
7474
{
7575
_allowAutoLoadout = !Options::disableAutoEquip;
@@ -177,13 +177,13 @@ void BattlescapeGenerator::setBase(Base *base)
177177
}
178178

179179
/**
180-
* Sets the terror site involved in the battle.
181-
* @param terror Pointer to terror site.
180+
* Sets the mission site involved in the battle.
181+
* @param mission Pointer to mission site.
182182
*/
183-
void BattlescapeGenerator::setTerrorSite(TerrorSite *terror)
183+
void BattlescapeGenerator::setMissionSite(MissionSite *mission)
184184
{
185-
_terror = terror;
186-
_terror->setInBattlescape(true);
185+
_mission = mission;
186+
_mission->setInBattlescape(true);
187187
}
188188

189189

@@ -290,8 +290,8 @@ void BattlescapeGenerator::nextStage()
290290
size_t unitCount = _save->getUnits()->size();
291291

292292
// Let's figure out what race we're up against.
293-
for (std::vector<TerrorSite*>::iterator i = _game->getSavedGame()->getTerrorSites()->begin();
294-
_alienRace == "" && i != _game->getSavedGame()->getTerrorSites()->end(); ++i)
293+
for (std::vector<MissionSite*>::iterator i = _game->getSavedGame()->getMissionSites()->begin();
294+
_alienRace == "" && i != _game->getSavedGame()->getMissionSites()->end(); ++i)
295295
{
296296
if ((*i)->isInBattlescape())
297297
{

‎src/Battlescape/BattlescapeGenerator.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AlienRace;
4040
class AlienDeployment;
4141
class Game;
4242
class Base;
43-
class TerrorSite;
43+
class MissionSite;
4444
class AlienBase;
4545
class BattleUnit;
4646
class MapScript;
@@ -57,7 +57,7 @@ class BattlescapeGenerator
5757
Craft *_craft;
5858
Ufo *_ufo;
5959
Base *_base;
60-
TerrorSite *_terror;
60+
MissionSite *_mission;
6161
AlienBase *_alienBase;
6262
RuleTerrain *_terrain;
6363
int _mapsize_x, _mapsize_y, _mapsize_z;
@@ -152,8 +152,8 @@ class BattlescapeGenerator
152152
void setAlienItemlevel(int alienItemLevel);
153153
/// Sets the XCom base.
154154
void setBase(Base *base);
155-
/// Sets the terror site.
156-
void setTerrorSite(TerrorSite* site);
155+
/// Sets the mission site.
156+
void setMissionSite(MissionSite* mission);
157157
/// Sets the alien base
158158
void setAlienBase(AlienBase* base);
159159
/// Runs the generator.

‎src/Battlescape/DebriefingState.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,13 @@ void DebriefingState::prepareDebriefing()
501501
}
502502
}
503503

504-
// terror site disappears (even when you abort)
505-
for (std::vector<TerrorSite*>::iterator i = save->getTerrorSites()->begin(); i != save->getTerrorSites()->end(); ++i)
504+
// mission site disappears (even when you abort)
505+
for (std::vector<MissionSite*>::iterator i = save->getMissionSites()->begin(); i != save->getMissionSites()->end(); ++i)
506506
{
507507
if ((*i)->isInBattlescape())
508508
{
509509
delete *i;
510-
save->getTerrorSites()->erase(i);
510+
save->getMissionSites()->erase(i);
511511
break;
512512
}
513513
}

‎src/Geoscape/AlienTerrorState.cpp‎

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919
#include "AlienTerrorState.h"
20-
#include <sstream>
2120
#include "../Engine/Game.h"
2221
#include "../Resource/ResourcePack.h"
2322
#include "../Engine/Language.h"
@@ -36,20 +35,20 @@ namespace OpenXcom
3635
{
3736

3837
/**
39-
* Initializes all the elements in the Aliens Terrorise window.
38+
* Initializes all the elements in the Mission Detected window.
4039
* @param game Pointer to the core game.
41-
* @param terror Pointer to the respective Terror Site.
42-
* @param city Terrorized city name.
40+
* @param mission Pointer to the respective Mission Site.
41+
* @param city Attacked city name, if any.
4342
* @param state Pointer to the Geoscape.
4443
*/
45-
AlienTerrorState::AlienTerrorState(TerrorSite *terror, const std::string &city, GeoscapeState *state) : _terror(terror), _state(state)
44+
MissionDetectedState::MissionDetectedState(MissionSite *mission, const std::string &city, GeoscapeState *state) : _mission(mission), _state(state)
4645
{
4746
_screen = false;
4847

4948
// Create objects
5049
_window = new Window(this, 256, 200, 0, 0, POPUP_BOTH);
5150
_btnIntercept = new TextButton(200, 16, 28, 130);
52-
_btnCentre = new TextButton(200, 16, 28, 150);
51+
_btnCenter = new TextButton(200, 16, 28, 150);
5352
_btnCancel = new TextButton(200, 16, 28, 170);
5453
_txtTitle = new Text(246, 32, 5, 48);
5554
_txtCity = new Text(246, 17, 5, 80);
@@ -59,7 +58,7 @@ AlienTerrorState::AlienTerrorState(TerrorSite *terror, const std::string &city,
5958

6059
add(_window, "window", "terrorSite");
6160
add(_btnIntercept, "button", "terrorSite");
62-
add(_btnCentre, "button", "terrorSite");
61+
add(_btnCenter, "button", "terrorSite");
6362
add(_btnCancel, "button", "terrorSite");
6463
add(_txtTitle, "text", "terrorSite");
6564
add(_txtCity, "text", "terrorSite");
@@ -70,14 +69,14 @@ AlienTerrorState::AlienTerrorState(TerrorSite *terror, const std::string &city,
7069
_window->setBackground(_game->getResourcePack()->getSurface("BACK03.SCR"));
7170

7271
_btnIntercept->setText(tr("STR_INTERCEPT"));
73-
_btnIntercept->onMouseClick((ActionHandler)&AlienTerrorState::btnInterceptClick);
72+
_btnIntercept->onMouseClick((ActionHandler)&MissionDetectedState::btnInterceptClick);
7473

75-
_btnCentre->setText(tr("STR_CENTER_ON_SITE_TIME_5_SECONDS"));
76-
_btnCentre->onMouseClick((ActionHandler)&AlienTerrorState::btnCentreClick);
74+
_btnCenter->setText(tr("STR_CENTER_ON_SITE_TIME_5_SECONDS"));
75+
_btnCenter->onMouseClick((ActionHandler)&MissionDetectedState::btnCenterClick);
7776

7877
_btnCancel->setText(tr("STR_CANCEL_UC"));
79-
_btnCancel->onMouseClick((ActionHandler)&AlienTerrorState::btnCancelClick);
80-
_btnCancel->onKeyboardPress((ActionHandler)&AlienTerrorState::btnCancelClick, Options::keyCancel);
78+
_btnCancel->onMouseClick((ActionHandler)&MissionDetectedState::btnCancelClick);
79+
_btnCancel->onKeyboardPress((ActionHandler)&MissionDetectedState::btnCancelClick, Options::keyCancel);
8180

8281
_txtTitle->setBig();
8382
_txtTitle->setAlign(ALIGN_CENTER);
@@ -92,38 +91,38 @@ AlienTerrorState::AlienTerrorState(TerrorSite *terror, const std::string &city,
9291
/**
9392
*
9493
*/
95-
AlienTerrorState::~AlienTerrorState()
94+
MissionDetectedState::~MissionDetectedState()
9695
{
9796

9897
}
9998

10099
/**
101-
* Picks a craft to intercept the UFO.
100+
* Picks a craft to intercept the mission site.
102101
* @param action Pointer to an action.
103102
*/
104-
void AlienTerrorState::btnInterceptClick(Action *)
103+
void MissionDetectedState::btnInterceptClick(Action *)
105104
{
106105
_state->timerReset();
107-
_state->getGlobe()->center(_terror->getLongitude(), _terror->getLatitude());
108-
_game->pushState(new InterceptState(_state->getGlobe(), 0, _terror));
106+
_state->getGlobe()->center(_mission->getLongitude(), _mission->getLatitude());
107+
_game->pushState(new InterceptState(_state->getGlobe(), 0, _mission));
109108
}
110109

111110
/**
112-
* Centers on the UFO and returns to the previous screen.
111+
* Centers on the mission site and returns to the previous screen.
113112
* @param action Pointer to an action.
114113
*/
115-
void AlienTerrorState::btnCentreClick(Action *)
114+
void MissionDetectedState::btnCenterClick(Action *)
116115
{
117116
_state->timerReset();
118-
_state->getGlobe()->center(_terror->getLongitude(), _terror->getLatitude());
117+
_state->getGlobe()->center(_mission->getLongitude(), _mission->getLatitude());
119118
_game->popState();
120119
}
121120

122121
/**
123122
* Returns to the previous screen.
124123
* @param action Pointer to an action.
125124
*/
126-
void AlienTerrorState::btnCancelClick(Action *)
125+
void MissionDetectedState::btnCancelClick(Action *)
127126
{
128127
_game->popState();
129128
}

‎src/Geoscape/AlienTerrorState.h‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,33 @@
2424
namespace OpenXcom
2525
{
2626

27-
class TerrorSite;
27+
class MissionSite;
2828
class TextButton;
2929
class Window;
3030
class Text;
3131
class GeoscapeState;
3232

3333
/**
34-
* Displays info on a terror site.
34+
* Displays info on a detected mission site.
3535
*/
36-
class AlienTerrorState : public State
36+
class MissionDetectedState : public State
3737
{
3838
private:
39-
TerrorSite *_terror;
39+
MissionSite *_mission;
4040
GeoscapeState *_state;
4141

42-
TextButton *_btnIntercept, *_btnCentre, *_btnCancel;
42+
TextButton *_btnIntercept, *_btnCenter, *_btnCancel;
4343
Window *_window;
4444
Text *_txtTitle, *_txtCity;
4545
public:
46-
/// Creates the Ufo Detected state.
47-
AlienTerrorState(TerrorSite *terror, const std::string &city, GeoscapeState *state);
48-
/// Cleans up the Ufo Detected state.
49-
~AlienTerrorState();
46+
/// Creates the Mission Detected state.
47+
MissionDetectedState(MissionSite *mission, const std::string &city, GeoscapeState *state);
48+
/// Cleans up the Mission Detected state.
49+
~MissionDetectedState();
5050
/// Handler for clicking the Intercept button.
5151
void btnInterceptClick(Action *action);
52-
/// Handler for clicking the Centre on UFO button.
53-
void btnCentreClick(Action *action);
52+
/// Handler for clicking the Center on Site button.
53+
void btnCenterClick(Action *action);
5454
/// Handler for clicking the Cancel button.
5555
void btnCancelClick(Action *action);
5656
};

‎src/Geoscape/ConfirmLandingState.cpp‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "../Geoscape/GeoscapeState.h"
4141
#include "../Engine/Exception.h"
4242
#include "../Engine/Options.h"
43+
#include "../Ruleset/RuleAlienMission.h"
4344

4445
namespace OpenXcom
4546
{
@@ -125,7 +126,7 @@ void ConfirmLandingState::btnYesClick(Action *)
125126
{
126127
_game->popState();
127128
Ufo* u = dynamic_cast<Ufo*>(_craft->getDestination());
128-
TerrorSite* t = dynamic_cast<TerrorSite*>(_craft->getDestination());
129+
MissionSite* m = dynamic_cast<MissionSite*>(_craft->getDestination());
129130
AlienBase* b = dynamic_cast<AlienBase*>(_craft->getDestination());
130131

131132
SavedBattleGame *bgame = new SavedBattleGame();
@@ -143,11 +144,11 @@ void ConfirmLandingState::btnYesClick(Action *)
143144
bgen.setUfo(u);
144145
bgen.setAlienRace(u->getAlienRace());
145146
}
146-
else if (t != 0)
147+
else if (m != 0)
147148
{
148-
bgame->setMissionType("STR_TERROR_MISSION");
149-
bgen.setTerrorSite(t);
150-
bgen.setAlienRace(t->getAlienRace());
149+
bgame->setMissionType(m->getRules()->getDeployment());
150+
bgen.setMissionSite(m);
151+
bgen.setAlienRace(m->getAlienRace());
151152
}
152153
else if (b != 0)
153154
{

0 commit comments

Comments
 (0)