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 };
63 {
64 private:
65  std::string _type;
66  std::vector<DeploymentData> _data;
67  int _width, _length, _height, _civilians;
68  std::vector<std::string> _terrains, _music;
69  int _shade;
70  std::string _nextStage, _race, _script;
71  bool _finalDestination, _isAlienBase;
72  std::string _winCutscene, _loseCutscene;
73  std::string _alert, _alertBackground;
74  BriefingData _briefingData;
75  std::string _markerName, _objectivePopup, _objectiveCompleteText, _objectiveFailedText;
76  WeightedOptions _genMission;
77  int _markerIcon, _durationMin, _durationMax, _minDepth, _maxDepth, _minSiteDepth, _maxSiteDepth, _genMissionFrequency;
78  int _objectiveType, _objectivesRequired, _objectiveCompleteScore, _objectiveFailedScore, _despawnPenalty, _points, _turnLimit, _cheatTurn;
79  ChronoTrigger _chronoTrigger;
80 public:
82  AlienDeployment(const std::string &type);
86  void load(const YAML::Node& node, Mod *mod);
88  std::string getType() const;
90  std::vector<DeploymentData>* getDeploymentData();
92  void getDimensions(int *width, int *length, int *height) const;
94  int getCivilians() const;
96  std::vector<std::string> getTerrains() const;
98  int getShade() const;
100  std::string getNextStage() const;
102  std::string getRace() const;
104  std::string getScript() const;
106  bool isFinalDestination() const;
108  std::string getWinCutscene() const;
110  std::string getLoseCutscene() const;
112  std::string getAlertMessage() const;
114  std::string getAlertBackground() const;
118  std::string getMarkerName() const;
120  int getMarkerIcon() const;
122  int getDurationMin() const;
124  int getDurationMax() const;
126  std::vector<std::string> &getMusic();
128  int getMinDepth() const;
130  int getMaxDepth() const;
132  int getMinSiteDepth() const;
134  int getMaxSiteDepth() const;
136  int getObjectiveType() const;
138  int getObjectivesRequired() const;
140  std::string getObjectivePopup() const;
142  bool getObjectiveCompleteInfo(std::string &text, int &score) const;
144  bool getObjectiveFailedInfo(std::string &text, int &score) const;
146  int getDespawnPenalty() const;
148  int getPoints() const;
150  int getTurnLimit() const;
152  ChronoTrigger getChronoTrigger() const;
154  int getCheatTurn() const;
156  bool isAlienBase() const;
157 
158  std::string getGenMissionType() const;
159 
160  int getGenMissionFrequency() const;
161 
162 };
163 
164 }
bool isFinalDestination() const
Checks if this is the destination for the final mission (mars stage 1, t&#39;leth stage 1)...
Definition: AlienDeployment.cpp:292
int getMaxDepth() const
Gets the maximum depth.
Definition: AlienDeployment.cpp:400
int getCivilians() const
Gets civilians.
Definition: AlienDeployment.cpp:238
std::string getAlertBackground() const
Gets the alert background for this mission type.
Definition: AlienDeployment.cpp:328
bool getObjectiveFailedInfo(std::string &text, int &score) const
Fills out the objective failed info.
Definition: AlienDeployment.cpp:469
std::string getNextStage() const
Gets the next stage of the mission.
Definition: AlienDeployment.cpp:265
Definition: AlienDeployment.h:44
bool isAlienBase() const
Gets whether or not this is an alien base (purely for new battle mode)
Definition: AlienDeployment.cpp:522
~AlienDeployment()
Cleans up the Alien Deployment ruleset.
Definition: AlienDeployment.cpp:125
int getTurnLimit() const
Gets the turn limit for this deployment.
Definition: AlienDeployment.cpp:499
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:319
int getObjectiveType() const
Gets the target type for this mission.
Definition: AlienDeployment.cpp:427
std::vector< DeploymentData > * getDeploymentData()
Gets a pointer to the data.
Definition: AlienDeployment.cpp:216
int getDurationMin() const
Gets the minimum duration for this mission.
Definition: AlienDeployment.cpp:364
std::string getWinCutscene() const
Gets the cutscene to play when this mission is won.
Definition: AlienDeployment.cpp:301
std::string getMarkerName() const
Gets the marker name for this mission.
Definition: AlienDeployment.cpp:346
int getCheatTurn() const
Gets which turn the aliens start cheating on.
Definition: AlienDeployment.cpp:517
Definition: AlienDeployment.h:32
int getPoints() const
Gets the (half hourly) score penalty XCom receives for this site existing.
Definition: AlienDeployment.cpp:490
BriefingData getBriefingData() const
Gets the briefing data for this mission type.
Definition: AlienDeployment.cpp:337
std::string getType() const
Gets the Alien Deployment&#39;s type.
Definition: AlienDeployment.cpp:207
std::string getObjectivePopup() const
Gets the string to pop up when the mission objectives are complete.
Definition: AlienDeployment.cpp:445
int getDurationMax() const
Gets the maximum duration for this mission.
Definition: AlienDeployment.cpp:373
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:508
int getMinDepth() const
Gets the minimum depth.
Definition: AlienDeployment.cpp:391
std::vector< std::string > getTerrains() const
Gets the terrain for battlescape generation.
Definition: AlienDeployment.cpp:247
std::string getRace() const
Gets the race to use in the next stage.
Definition: AlienDeployment.cpp:274
std::string getLoseCutscene() const
Gets the cutscene to play when this mission is lost.
Definition: AlienDeployment.cpp:310
std::string getScript() const
Gets the script to use for this deployment.
Definition: AlienDeployment.cpp:283
bool getObjectiveCompleteInfo(std::string &text, int &score) const
Fills out the objective complete info.
Definition: AlienDeployment.cpp:456
std::vector< std::string > & getMusic()
Gets the list of music to pick from.
Definition: AlienDeployment.cpp:382
Definition: AlienDeployment.h:37
int getObjectivesRequired() const
Gets a fixed number of objectives requires (if any).
Definition: AlienDeployment.cpp:436
int getShade() const
Gets the shade level for battlescape generation.
Definition: AlienDeployment.cpp:256
void load(const YAML::Node &node, Mod *mod)
Loads Alien Deployment data from YAML.
Definition: AlienDeployment.cpp:133
int getMarkerIcon() const
Gets the marker icon for this mission.
Definition: AlienDeployment.cpp:355
int getMinSiteDepth() const
Gets the minimum site depth.
Definition: AlienDeployment.cpp:409
Represents a specific type of Alien Deployment.
Definition: AlienDeployment.h:62
Holds pairs of relative weights and IDs.
Definition: WeightedOptions.h:33
int getMaxSiteDepth() const
Gets the maximum site depth.
Definition: AlienDeployment.cpp:418
int getDespawnPenalty() const
Gets the score penalty XCom receives for ignoring this site.
Definition: AlienDeployment.cpp:480
Definition: BaseInfoState.cpp:40
void getDimensions(int *width, int *length, int *height) const
Gets dimensions.
Definition: AlienDeployment.cpp:227