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, _minSiteDepth, _maxSiteDepth, _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);
86  ~AlienDeployment();
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;
120  BriefingData getBriefingData() 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 }
Definition: AlienDeployment.h:44
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
Definition: AlienDeployment.h:32
Definition: AlienDeployment.h:37
Represents a specific type of Alien Deployment.
Definition: AlienDeployment.h:63
Holds pairs of relative weights and IDs.
Definition: WeightedOptions.h:33
Definition: BaseInfoState.cpp:40