OpenXcom  1.0
Open-source clone of the original X-Com
AlienDeployment.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include <vector>
21 #include <string>
22 #include <yaml-cpp/yaml.h>
23 #include "Mod.h"
24 #include "../Savegame/WeightedOptions.h"
25 
26 namespace OpenXcom
27 {
28 
29 class RuleTerrain;
30 class Mod;
31 
32 struct ItemSet
33 {
34  std::vector<std::string> items;
35 };
36 
38 {
39  int alienRank;
40  int lowQty, highQty, dQty, extraQty;
41  int percentageOutsideUfo;
42  std::vector<ItemSet> itemSets;
43 };
45 {
46  int palette, textOffset;
47  std::string title, desc, music, background, cutscene;
48  bool showCraft, showTarget;
49  BriefingData() : palette(0), textOffset(0), music("GMDEFEND"), background("BACK16.SCR"), showCraft(true), showTarget(true) { /*Empty by Design*/ };
50 };
51 enum ChronoTrigger { FORCE_LOSE, FORCE_ABORT, FORCE_WIN };
52 enum EscapeType { ESCAPE_NONE, ESCAPE_EXIT, ESCAPE_ENTRY, ESCAPE_EITHER };
64 {
65 private:
66  std::string _type;
67  std::vector<DeploymentData> _data;
68  int _width, _length, _height, _civilians;
69  std::vector<std::string> _terrains, _music;
70  int _shade;
71  std::string _nextStage, _race, _script;
72  bool _finalDestination, _isAlienBase;
73  std::string _winCutscene, _loseCutscene, _abortCutscene;
74  std::string _alert, _alertBackground;
75  BriefingData _briefingData;
76  std::string _markerName, _objectivePopup, _objectiveCompleteText, _objectiveFailedText;
77  WeightedOptions _genMission;
78  int _markerIcon, _durationMin, _durationMax, _minDepth, _maxDepth, _genMissionFrequency;
79  int _objectiveType, _objectivesRequired, _objectiveCompleteScore, _objectiveFailedScore, _despawnPenalty, _points, _turnLimit, _cheatTurn;
80  ChronoTrigger _chronoTrigger;
81  EscapeType _escapeType;
82 public:
84  AlienDeployment(const std::string &type);
88  void load(const YAML::Node& node, Mod *mod);
90  std::string getType() const;
92  std::vector<DeploymentData>* getDeploymentData();
94  void getDimensions(int *width, int *length, int *height) const;
96  int getCivilians() const;
98  std::vector<std::string> getTerrains() const;
100  int getShade() const;
102  std::string getNextStage() const;
104  std::string getRace() const;
106  std::string getScript() const;
108  bool isFinalDestination() const;
110  std::string getWinCutscene() const;
112  std::string getLoseCutscene() const;
114  std::string getAbortCutscene() const;
116  std::string getAlertMessage() const;
118  std::string getAlertBackground() const;
122  std::string getMarkerName() const;
124  int getMarkerIcon() const;
126  int getDurationMin() const;
128  int getDurationMax() const;
130  std::vector<std::string> &getMusic();
132  int getMinDepth() const;
134  int getMaxDepth() const;
136  int getMinSiteDepth() const;
138  int getMaxSiteDepth() const;
140  int getObjectiveType() const;
142  int getObjectivesRequired() const;
144  std::string getObjectivePopup() const;
146  bool getObjectiveCompleteInfo(std::string &text, int &score) const;
148  bool getObjectiveFailedInfo(std::string &text, int &score) const;
150  int getDespawnPenalty() const;
152  int getPoints() const;
154  int getTurnLimit() const;
156  ChronoTrigger getChronoTrigger() const;
158  int getCheatTurn() const;
160  bool isAlienBase() const;
161 
162  std::string getGenMissionType() const;
163 
164  int getGenMissionFrequency() const;
165 
166  EscapeType getEscapeType() const;
167 
168 };
169 
170 }
bool isFinalDestination() const
Checks if this is the destination for the final mission (mars stage 1, t&#39;leth stage 1)...
Definition: AlienDeployment.cpp:288
int getMaxDepth() const
Gets the maximum depth.
Definition: AlienDeployment.cpp:405
int getCivilians() const
Gets civilians.
Definition: AlienDeployment.cpp:234
std::string getAlertBackground() const
Gets the alert background for this mission type.
Definition: AlienDeployment.cpp:333
bool getObjectiveFailedInfo(std::string &text, int &score) const
Fills out the objective failed info.
Definition: AlienDeployment.cpp:456
std::string getNextStage() const
Gets the next stage of the mission.
Definition: AlienDeployment.cpp:261
Definition: AlienDeployment.h:44
bool isAlienBase() const
Gets whether or not this is an alien base (purely for new battle mode)
Definition: AlienDeployment.cpp:509
~AlienDeployment()
Cleans up the Alien Deployment ruleset.
Definition: AlienDeployment.cpp:125
std::string getAbortCutscene() const
Gets the cutscene to play when this mission is aborted.
Definition: AlienDeployment.cpp:315
int getTurnLimit() const
Gets the turn limit for this deployment.
Definition: AlienDeployment.cpp:486
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
std::string getAlertMessage() const
Gets the alert message for this mission type.
Definition: AlienDeployment.cpp:324
int getObjectiveType() const
Gets the target type for this mission.
Definition: AlienDeployment.cpp:414
std::vector< DeploymentData > * getDeploymentData()
Gets a pointer to the data.
Definition: AlienDeployment.cpp:212
int getDurationMin() const
Gets the minimum duration for this mission.
Definition: AlienDeployment.cpp:369
std::string getWinCutscene() const
Gets the cutscene to play when this mission is won.
Definition: AlienDeployment.cpp:297
std::string getMarkerName() const
Gets the marker name for this mission.
Definition: AlienDeployment.cpp:351
int getCheatTurn() const
Gets which turn the aliens start cheating on.
Definition: AlienDeployment.cpp:504
Definition: AlienDeployment.h:32
int getPoints() const
Gets the (half hourly) score penalty XCom receives for this site existing.
Definition: AlienDeployment.cpp:477
BriefingData getBriefingData() const
Gets the briefing data for this mission type.
Definition: AlienDeployment.cpp:342
std::string getType() const
Gets the Alien Deployment&#39;s type.
Definition: AlienDeployment.cpp:203
std::string getObjectivePopup() const
Gets the string to pop up when the mission objectives are complete.
Definition: AlienDeployment.cpp:432
int getDurationMax() const
Gets the maximum duration for this mission.
Definition: AlienDeployment.cpp:378
AlienDeployment(const std::string &type)
Creates a blank Alien Deployment ruleset.
Definition: AlienDeployment.cpp:116
ChronoTrigger getChronoTrigger() const
Gets the action that triggers when the timer runs out.
Definition: AlienDeployment.cpp:495
int getMinDepth() const
Gets the minimum depth.
Definition: AlienDeployment.cpp:396
std::vector< std::string > getTerrains() const
Gets the terrain for battlescape generation.
Definition: AlienDeployment.cpp:243
std::string getRace() const
Gets the race to use in the next stage.
Definition: AlienDeployment.cpp:270
std::string getLoseCutscene() const
Gets the cutscene to play when this mission is lost.
Definition: AlienDeployment.cpp:306
std::string getScript() const
Gets the script to use for this deployment.
Definition: AlienDeployment.cpp:279
bool getObjectiveCompleteInfo(std::string &text, int &score) const
Fills out the objective complete info.
Definition: AlienDeployment.cpp:443
std::vector< std::string > & getMusic()
Gets the list of music to pick from.
Definition: AlienDeployment.cpp:387
Definition: AlienDeployment.h:37
int getObjectivesRequired() const
Gets a fixed number of objectives requires (if any).
Definition: AlienDeployment.cpp:423
int getShade() const
Gets the shade level for battlescape generation.
Definition: AlienDeployment.cpp:252
void load(const YAML::Node &node, Mod *mod)
Loads Alien Deployment data from YAML.
Definition: AlienDeployment.cpp:134
int getMarkerIcon() const
Gets the marker icon for this mission.
Definition: AlienDeployment.cpp:360
int getMinSiteDepth() const
Gets the minimum site depth.
Represents a specific type of Alien Deployment.
Definition: AlienDeployment.h:63
Holds pairs of relative weights and IDs.
Definition: WeightedOptions.h:33
int getMaxSiteDepth() const
Gets the maximum site depth.
int getDespawnPenalty() const
Gets the score penalty XCom receives for ignoring this site.
Definition: AlienDeployment.cpp:467
Definition: BaseInfoState.cpp:40
void getDimensions(int *width, int *length, int *height) const
Gets dimensions.
Definition: AlienDeployment.cpp:223