ScummVM API documentation
recordtypes.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/commontypes.h"
26 #include "engines/nancy/renderobject.h"
27 
28 #include "engines/nancy/action/actionrecord.h"
29 
30 namespace Nancy {
31 
32 class NancyEngine;
33 
34 namespace Action {
35 
36 class Unimplemented : public ActionRecord {
37  void execute() override;
38 };
39 
40 class SceneChange : public ActionRecord {
41 public:
42  void readData(Common::SeekableReadStream &stream) override;
43  void execute() override;
44 
45  SceneChangeDescription _sceneChange;
46 
47 protected:
48  Common::String getRecordTypeName() const override { return "SceneChange"; }
49 };
50 
52 public:
53  void readData(Common::SeekableReadStream &stream) override;
54  void execute() override;
55 
57 
58 protected:
59  Common::String getRecordTypeName() const override { return "HotMultiframeSceneChange"; }
60 };
61 
63 public:
64  void readData(Common::SeekableReadStream &stream) override;
65  void execute() override;
66 
67  HotspotDescription _hotspotDesc;
68 
69 protected:
70  Common::String getRecordTypeName() const override { return "Hot1FrSceneChange"; }
71 };
72 
74  CursorManager::CursorType getHoverCursor() const override { return CursorManager::kExit; }
75 
76 protected:
77  Common::String getRecordTypeName() const override { return "Hot1FrExitSceneChange"; }
78 };
79 
81 public:
82  void readData(Common::SeekableReadStream &stream) override;
83 
84 protected:
85  Common::String getRecordTypeName() const override { return "HotMultiframeMultisceneChange"; }
86 };
87 
89 public:
90  void readData(Common::SeekableReadStream &stream) override;
91  void execute() override;
92 
93  byte _paletteID;
94  byte _unknownEnum; // enum w values 1-3
95  uint16 _paletteStart;
96  uint16 _paletteSize;
97 
98 protected:
99  Common::String getRecordTypeName() const override { return "PaletteThisScene"; }
100 };
101 
103 public:
104  void readData(Common::SeekableReadStream &stream) override;
105  void execute() override;
106 
107  byte _paletteID;
108 
109 protected:
110  Common::String getRecordTypeName() const override { return "PaletteNextScene"; }
111 };
112 
114 public:
115  void readData(Common::SeekableReadStream &stream) override;
116 
117 protected:
118  Common::String getRecordTypeName() const override { return "StartFrameNextScene"; }
119 };
120 
122 public:
123  void readData(Common::SeekableReadStream &stream) override;
124  // TODO add a Start and Stop subclass
125 
126  byte _type = 0;
127 
128 protected:
129  Common::String getRecordTypeName() const override { return "StartStopPlayerScrolling"; }
130 };
131 
132 class LightningOn : public Unimplemented {
133 public:
134  void readData(Common::SeekableReadStream &stream) override;
135 
136 protected:
137  Common::String getRecordTypeName() const override { return "LightningOn"; }
138 };
139 
140 class LightningOff : public Unimplemented {
141 public:
142  void readData(Common::SeekableReadStream &stream) override;
143 
144 protected:
145  Common::String getRecordTypeName() const override { return "LightningOff"; }
146 };
147 
149 public:
150  void readData(Common::SeekableReadStream &stream) override;
151 
152 protected:
153  Common::String getRecordTypeName() const override { return "AmbientLightUp"; }
154 };
155 
157 public:
158  void readData(Common::SeekableReadStream &stream) override;
159 
160 protected:
161  Common::String getRecordTypeName() const override { return "AmbientLightDown"; }
162 };
163 
165 public:
166  void readData(Common::SeekableReadStream &stream) override;
167 
168 protected:
169  Common::String getRecordTypeName() const override { return "AmbientLightToTod"; }
170 };
171 
173 public:
174  void readData(Common::SeekableReadStream &stream) override;
175 
176 protected:
177  Common::String getRecordTypeName() const override { return "AmbientLightToTodOff"; }
178 };
179 
180 class FlickerOn : public Unimplemented {
181 public:
182  void readData(Common::SeekableReadStream &stream) override;
183 
184 protected:
185  Common::String getRecordTypeName() const override { return "FlickerOn"; }
186 };
187 
188 class FlickerOff : public Unimplemented {
189 public:
190  void readData(Common::SeekableReadStream &stream) override;
191 
192 protected:
193  Common::String getRecordTypeName() const override { return "FlickerOff"; }
194 };
195 
196 class MapCall : public ActionRecord {
197 public:
198  void readData(Common::SeekableReadStream &stream) override;
199  void execute() override;
200 
201  CursorManager::CursorType getHoverCursor() const override { return CursorManager::kExit; }
202 
203 protected:
204  Common::String getRecordTypeName() const override { return "MapCall"; }
205 };
206 
207 class MapCallHot1Fr : public MapCall {
208 public:
209  void readData(Common::SeekableReadStream &stream) override;
210  void execute() override;
211 
212  HotspotDescription _hotspotDesc;
213 
214 protected:
215  Common::String getRecordTypeName() const override { return "MapCallHot1Fr"; }
216 };
217 
219 public:
220  void readData(Common::SeekableReadStream &stream) override;
221  void execute() override;
222 
224 
225 protected:
226  Common::String getRecordTypeName() const override { return "MapCallHotMultiframe"; }
227 };
228 
230 public:
231  void readData(Common::SeekableReadStream &stream) override;
232 
233 protected:
234  Common::String getRecordTypeName() const override { return "MapLocationAccess"; }
235 };
236 
237 class MapLightning : public Unimplemented {
238 public:
239  void readData(Common::SeekableReadStream &stream) override;
240 
241 protected:
242  Common::String getRecordTypeName() const override { return "MapLightning"; }
243 };
244 
246 public:
247  void readData(Common::SeekableReadStream &stream) override;
248 
249 protected:
250  Common::String getRecordTypeName() const override { return "MapLightningOff"; }
251 };
252 
253 class MapSound : public Unimplemented {
254 public:
255  void readData(Common::SeekableReadStream &stream) override;
256 
257 protected:
258  Common::String getRecordTypeName() const override { return "MapSound"; }
259 };
260 
262 public:
263  void readData(Common::SeekableReadStream &stream) override;
264 
265 protected:
266  Common::String getRecordTypeName() const override { return "MapAviOverride"; }
267 };
268 
270 public:
271  void readData(Common::SeekableReadStream &stream) override;
272 
273 protected:
274  Common::String getRecordTypeName() const override { return "MapAviOverrideOff"; }
275 };
276 
277 class TextBoxWrite : public Unimplemented {
278 public:
279  void readData(Common::SeekableReadStream &stream) override;
280 
281 protected:
282  Common::String getRecordTypeName() const override { return "TextBoxWrite"; }
283 };
284 
285 class TextBoxClear : public Unimplemented {
286 public:
287  void readData(Common::SeekableReadStream &stream) override;
288 
289 protected:
290  Common::String getRecordTypeName() const override { return "TextBoxClear"; }
291 };
292 
294 public:
295  void readData(Common::SeekableReadStream &stream) override;
296 
297 protected:
298  Common::String getRecordTypeName() const override { return "BumpPlayerClock"; }
299 };
300 
302 public:
303  void readData(Common::SeekableReadStream &stream) override;
304  void execute() override;
305 
306 protected:
307  Common::String getRecordTypeName() const override { return "SaveContinueGame"; }
308 };
309 
311 public:
312  void readData(Common::SeekableReadStream &stream) override;
313 
314 protected:
315  Common::String getRecordTypeName() const override { return "TurnOffMainRendering"; }
316 };
317 
319 public:
320  void readData(Common::SeekableReadStream &stream) override;
321 
322 protected:
323  Common::String getRecordTypeName() const override { return "TurnOnMainRendering"; }
324 };
325 
327 public:
328  void readData(Common::SeekableReadStream &stream) override;
329  void execute() override;
330 
331 protected:
332  Common::String getRecordTypeName() const override { return "ResetAndStartTimer"; }
333 };
334 
335 class StopTimer : public ActionRecord {
336 public:
337  void readData(Common::SeekableReadStream &stream) override;
338  void execute() override;
339 
340 protected:
341  Common::String getRecordTypeName() const override { return "StopTimer"; }
342 };
343 
344 class EventFlags : public ActionRecord {
345 public:
346  void readData(Common::SeekableReadStream &stream) override;
347  void execute() override;
348 
350 
351 protected:
352  Common::String getRecordTypeName() const override { return "EventFlags"; }
353 };
354 
356 public:
357  void readData(Common::SeekableReadStream &stream) override;
358  void execute() override;
359 
361 
362 protected:
363  Common::String getRecordTypeName() const override { return "EventFlagsMultiHS"; }
364 };
365 
366 class LoseGame : public ActionRecord {
367 public:
368  void readData(Common::SeekableReadStream &stream) override;
369  void execute() override;
370 
371 protected:
372  Common::String getRecordTypeName() const override { return "LoseGame"; }
373 };
374 
375 class PushScene : public Unimplemented {
376 public:
377  void readData(Common::SeekableReadStream &stream) override;
378 
379 protected:
380  Common::String getRecordTypeName() const override { return "PushScene"; }
381 };
382 
383 class PopScene : public Unimplemented {
384 public:
385  void readData(Common::SeekableReadStream &stream) override;
386 
387 protected:
388  Common::String getRecordTypeName() const override { return "PopScene"; }
389 };
390 
391 class WinGame : public ActionRecord {
392 public:
393  void readData(Common::SeekableReadStream &stream) override;
394  void execute() override;
395 
396 protected:
397  Common::String getRecordTypeName() const override { return "WinGame"; }
398 };
399 
401 public:
402  void readData(Common::SeekableReadStream &stream) override;
403  void execute() override;
404 
405  uint _itemID;
406 
407 protected:
408  Common::String getRecordTypeName() const override { return "AddInventoryNoHS"; }
409 };
410 
412 public:
413  void readData(Common::SeekableReadStream &stream) override;
414 
415 protected:
416  Common::String getRecordTypeName() const override { return "RemoveInventoryNoHS"; }
417 };
418 
420 public:
421  void readData(Common::SeekableReadStream &stream) override;
422  void execute() override;
423 
424  uint16 _difficulty = 0;
425  EventFlagDescription _flag;
426 
427 protected:
428  Common::String getRecordTypeName() const override { return "DifficultyLevel"; }
429 };
430 
432 public:
433  void readData(Common::SeekableReadStream &stream) override;
434  void execute() override;
435 
436  ShowInventoryItem(RenderObject &redrawFrom) : RenderObject(redrawFrom, 9) {}
437  virtual ~ShowInventoryItem() { _fullSurface.free(); }
438 
439  void init() override;
440  void onPause(bool pause) override;
441 
442  uint16 _objectID = 0;
443  Common::String _imageName;
445 
446  int16 _drawnFrameID = -1;
447  Graphics::ManagedSurface _fullSurface;
448 
449 protected:
450  Common::String getRecordTypeName() const override { return "ShowInventoryItem"; }
451  bool isViewportRelative() const override { return true; }
452 };
453 
455 public:
456  void readData(Common::SeekableReadStream &stream) override;
457  void execute() override;
458  // TODO subclass into Play and Stop (?)
459 
460  SoundDescription _sound;
461  SceneChangeDescription _sceneChange;
462  EventFlagDescription _flagOnTrigger;
463 
464 protected:
465  Common::String getRecordTypeName() const override { return "PlayDigiSoundAndDie"; }
466 };
467 
469 public:
470  void readData(Common::SeekableReadStream &stream) override;
471  void execute() override;
472 
473  SoundDescription _sound;
474 
475 protected:
476  Common::String getRecordTypeName() const override { return "PlaySoundPanFrameAnchorAndDie"; }
477 };
478 
480 public:
481  void readData(Common::SeekableReadStream &stream) override;
482  void execute() override;
483 
484  SoundDescription _sound; // 0x0
485  SceneChangeDescription _sceneChange; // 0x22
486  EventFlagDescription _flag; // 0x2A
487  Common::Array<HotspotDescription> _hotspots; // 0x31
488 
489 protected:
490  Common::String getRecordTypeName() const override { return "PlaySoundMultiHS"; }
491 };
492 
493 class HintSystem : public ActionRecord {
494 public:
495  void readData(Common::SeekableReadStream &stream) override;
496  void execute() override;
497 
498  byte _characterID; // 0x00
499  SoundDescription _genericSound; // 0x01
500 
501  Common::String _text;
502  SceneChangeDescription _sceneChange;
503  uint16 _hintID;
504  int16 _hintWeight;
505 
506  void selectHint();
507  void getHint(uint hint, uint difficulty);
508 
509 protected:
510  Common::String getRecordTypeName() const override { return "HintSystem"; }
511 };
512 
513 } // End of namespace Action
514 } // End of namespace Nancy
515 
516 #endif // NANCY_ACTION_RECORDTYPES_H
Definition: managed_surface.h:45
Definition: recordtypes.h:196
Definition: commontypes.h:96
Definition: recordtypes.h:132
Definition: recordtypes.h:156
Definition: str.h:59
Definition: recordtypes.h:454
Definition: recordtypes.h:366
Definition: recordtypes.h:172
Definition: commontypes.h:63
Definition: recordtypes.h:261
Definition: array.h:52
Definition: recordtypes.h:253
Definition: recordtypes.h:400
Definition: recordtypes.h:269
Definition: recordtypes.h:375
Definition: recordtypes.h:40
Definition: recordtypes.h:391
Definition: recordtypes.h:188
Definition: recordtypes.h:318
Definition: recordtypes.h:36
Definition: recordtypes.h:277
Definition: stream.h:652
Definition: recordtypes.h:419
Definition: recordtypes.h:285
Definition: recordtypes.h:148
Definition: renderobject.h:36
Definition: recordtypes.h:335
Definition: recordtypes.h:88
Definition: recordtypes.h:310
Definition: recordtypes.h:51
Definition: recordtypes.h:344
Definition: recordtypes.h:121
Definition: commontypes.h:73
Definition: actionrecord.h:79
Definition: recordtypes.h:479
Definition: recordtypes.h:113
Definition: recordtypes.h:245
Definition: recordtypes.h:383
Definition: recordtypes.h:301
Definition: recordtypes.h:73
Definition: recordtypes.h:218
Definition: commontypes.h:113
Definition: recordtypes.h:180
Definition: recordtypes.h:207
Definition: recordtypes.h:229
Definition: recordtypes.h:431
Definition: recordtypes.h:140
Definition: recordtypes.h:326
Definition: recordtypes.h:102
Definition: recordtypes.h:62
Definition: commontypes.h:79
Definition: recordtypes.h:293
Definition: recordtypes.h:237
Definition: recordtypes.h:411
Definition: recordtypes.h:493
Definition: actionmanager.h:32
Definition: recordtypes.h:355
Definition: recordtypes.h:164