ScummVM API documentation
miscrecords.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program 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  * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef NANCY_ACTION_RECORDTYPES_H
23 #define NANCY_ACTION_RECORDTYPES_H
24 
25 #include "engines/nancy/action/actionrecord.h"
26 
27 namespace Nancy {
28 
29 class NancyEngine;
30 
31 namespace Action {
32 
33 // Changes the palette for the current scene's background. TVD only.
35 public:
36  void readData(Common::SeekableReadStream &stream) override;
37  void execute() override;
38 
39  byte _paletteID;
40  byte _unknownEnum; // enum w values 1-3
41  uint16 _paletteStart;
42  uint16 _paletteSize;
43 
44 protected:
45  Common::String getRecordTypeName() const override { return "PaletteThisScene"; }
46 };
47 
48 // Changes the palette for the next scene's background. TVD only.
50 public:
51  void readData(Common::SeekableReadStream &stream) override;
52  void execute() override;
53 
54  byte _paletteID;
55 
56 protected:
57  Common::String getRecordTypeName() const override { return "PaletteNextScene"; }
58 };
59 
60 // Turns on (temporary) lightning effect. TVD Only.
61 class LightningOn : public ActionRecord {
62 public:
63  void readData(Common::SeekableReadStream &stream) override;
64  void execute() override;
65 
66  int16 _distance;
67  uint16 _pulseTime;
68  int16 _rgbPercent;
69 
70 protected:
71  Common::String getRecordTypeName() const override { return "LightningOn"; }
72 };
73 
74 // Requests either a fade between two scenes, or a fade to black; fade executes when scene is changed. Nancy2 and up.
75 class SpecialEffect : public ActionRecord {
76 public:
77  void readData(Common::SeekableReadStream &stream) override;
78  void execute() override;
79 
80  byte _type = 1;
81  uint16 _fadeToBlackTime = 0;
82  uint16 _frameTime = 0;
83  uint16 _totalTime = 0;
84  Common::Rect _rect;
85 
86 protected:
87  Common::String getRecordTypeName() const override { return "SpecialEffect"; }
88 };
89 
90 // Adds a caption to the textbox.
91 class TextBoxWrite : public ActionRecord {
92 public:
93  void readData(Common::SeekableReadStream &stream) override;
94  void execute() override;
95 
96  Common::String _text;
97 
98 protected:
99  Common::String getRecordTypeName() const override { return "TextBoxWrite"; }
100 };
101 
102 // Clears the textbox. Used very rarely.
103 class TextboxClear : public ActionRecord {
104 public:
105  void readData(Common::SeekableReadStream &stream) override;
106  void execute() override;
107 
108 protected:
109  Common::String getRecordTypeName() const override { return "TextboxClear"; }
110 };
111 
112 // Changes the in-game time. Used prior to the introduction of SetPlayerClock.
114 public:
115  void readData(Common::SeekableReadStream &stream) override;
116  void execute() override;
117 
118  byte _relative;
119  uint16 _hours;
120  uint16 _minutes;
121 
122 protected:
123  Common::String getRecordTypeName() const override { return "BumpPlayerClock"; }
124 };
125 
126 // Creates a Second Chance save.
128 public:
129  void readData(Common::SeekableReadStream &stream) override;
130  void execute() override;
131 
132 protected:
133  Common::String getRecordTypeName() const override { return "SaveContinueGame"; }
134 };
135 
136 // Stops the screen from rendering. Our rendering system is different from the original engine's,
137 // so we have no use for this.
139 public:
140  void readData(Common::SeekableReadStream &stream) override;
141 
142 protected:
143  Common::String getRecordTypeName() const override { return "TurnOffMainRendering"; }
144 };
145 
146 // Restarts screen rendering. Our rendering system is different from the original engine's,
147 // so we have no use for this.
149 public:
150  void readData(Common::SeekableReadStream &stream) override;
151 
152 protected:
153  Common::String getRecordTypeName() const override { return "TurnOnMainRendering"; }
154 };
155 
156 // Starts the timer. Used in combination with Dependency types that check for
157 // how much time has passed since the timer was started.
159 public:
160  void readData(Common::SeekableReadStream &stream) override;
161  void execute() override;
162 
163 protected:
164  Common::String getRecordTypeName() const override { return "ResetAndStartTimer"; }
165 };
166 
167 // Stops the timer.
168 class StopTimer : public ActionRecord {
169 public:
170  void readData(Common::SeekableReadStream &stream) override;
171  void execute() override;
172 
173 protected:
174  Common::String getRecordTypeName() const override { return "StopTimer"; }
175 };
176 
177 // Returns the player back to the main menu
178 class GotoMenu : public ActionRecord {
179 public:
180  void readData(Common::SeekableReadStream &stream) override;
181  void execute() override;
182 
183 protected:
184  Common::String getRecordTypeName() const override { return "GotoMenu"; }
185 };
186 
187 // Stops the game and boots the player back to the Menu screen, while also making sure
188 // they can't Continue. The devs took care to add Second Chance saves before every one
189 // of these, to make sure the player can return to a state just before the dangerous part.
190 class LoseGame : public ActionRecord {
191 public:
192  void readData(Common::SeekableReadStream &stream) override;
193  void execute() override;
194 
195 protected:
196  Common::String getRecordTypeName() const override { return "LoseGame"; }
197 };
198 
199 // Adds a scene to the "stack" (which is just a single value). Used in combination with PopScene.
200 class PushScene : public ActionRecord {
201 public:
202  void readData(Common::SeekableReadStream &stream) override;
203  void execute() override;
204 
205 protected:
206  Common::String getRecordTypeName() const override { return "PushScene"; }
207 };
208 
209 // Changes to the scene pushed onto the "stack". Scenes can be pushed via PushScene, or Conversation types.
210 class PopScene : public ActionRecord {
211 public:
212  void readData(Common::SeekableReadStream &stream) override;
213  void execute() override;
214 
215 protected:
216  Common::String getRecordTypeName() const override { return "PopScene"; }
217 };
218 
219 // Ends the game and boots the player to the Credits screen.
220 // TODO: The original engine also sets a config option called PlayerWonTheGame,
221 // which in turn is used to trigger whichever event flag marks that the player
222 // has beat the game at least once, which in turn allows easter eggs to be shown.
223 // We currently support none of this.
224 class WinGame : public ActionRecord {
225 public:
226  void readData(Common::SeekableReadStream &stream) override;
227  void execute() override;
228 
229 protected:
230  Common::String getRecordTypeName() const override { return "WinGame"; }
231 };
232 
233 // Checks how many hints the player is allowed to get. If they are still allowed hints,
234 // it selects an appropriate one and plays its sound/displays its caption in the Textbox.
235 // The hint system was _only_ used in nancy1, since it's pretty limited and overly punishing.
236 class HintSystem : public ActionRecord {
237 public:
238  void readData(Common::SeekableReadStream &stream) override;
239  void execute() override;
240 
241  byte _characterID; // 0x00
242  SoundDescription _genericSound; // 0x01
243 
244  const Hint *selectedHint;
245  int16 _hintID;
246 
247  void selectHint();
248 
249 protected:
250  Common::String getRecordTypeName() const override { return "HintSystem"; }
251 };
252 
253 } // End of namespace Action
254 } // End of namespace Nancy
255 
256 #endif // NANCY_ACTION_MISCRECORDS_H
Definition: miscrecords.h:61
Definition: str.h:59
Definition: miscrecords.h:190
Definition: commontypes.h:301
Definition: miscrecords.h:200
Definition: miscrecords.h:224
Definition: miscrecords.h:148
Definition: rect.h:144
Definition: actionrecord.h:160
Definition: miscrecords.h:91
Definition: stream.h:745
Definition: miscrecords.h:75
Definition: miscrecords.h:103
Definition: miscrecords.h:168
Definition: miscrecords.h:34
Definition: miscrecords.h:178
Definition: miscrecords.h:138
Definition: actionrecord.h:97
Definition: miscrecords.h:210
Definition: miscrecords.h:127
Definition: commontypes.h:254
Definition: miscrecords.h:158
Definition: miscrecords.h:49
Definition: miscrecords.h:113
Definition: miscrecords.h:236
Definition: actionmanager.h:32