ScummVM API documentation
duckman_specialcode.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 ILLUSIONS_DUCKMAN_SPECIALCODE_H
23 #define ILLUSIONS_DUCKMAN_SPECIALCODE_H
24 
25 #include "illusions/illusions.h"
26 #include "illusions/specialcode.h"
27 #include "common/algorithm.h"
28 
29 namespace Illusions {
30 
31 class IllusionsEngine_Duckman;
32 class DuckmanCredits;
33 class DuckmanInventory;
34 class PropertyTimers;
35 
36 typedef Common::Functor1<OpCall&, void> SpecialCodeFunction;
37 
39 public:
41  ~DuckmanSpecialCode() override;
42  void init() override;
43  void run(uint32 specialCodeId, OpCall &opCall) override;
44 public:
46  typedef SpecialCodeMap::iterator SpecialCodeMapIterator;
47 
49  SpecialCodeMap _specialCodeMap;
50 
51  PropertyTimers *_propertyTimers;
52  DuckmanInventory *_inventory;
53 
54  uint _chinesePuzzleIndex;
55  byte _chinesePuzzleAnswers[3];
56  Common::Point _teleporterPosition;
57  int16 _counter;
58  bool _wasCursorHoldingElvisPoster;
59  int16 _savedTempMasterSfxVolume;
60  int16 _lastRandomSoundIndex;
61 
62  DuckmanCredits *_credits;
63 
64  // Special code interface functions
65  void runSpecialCode(uint32 specialCodeId, OpCall &opCall);
66  void spcStartScreenShaker(OpCall &opCall);
67  void spcSetCursorHandMode(OpCall &opCall);
68  void spcResetChinesePuzzle(OpCall &opCall);
69  void spcAddChinesePuzzleAnswer(OpCall &opCall);
70  void spcOpenInventory(OpCall &opCall);
71  void spcPutBackInventoryItem(OpCall &opCall);
72  void spcClearInventorySlot(OpCall &opCall);
73  void spcAddPropertyTimer(OpCall &opCall);
74  void spcSetPropertyTimer(OpCall &opCall);
75  void spcRemovePropertyTimer(OpCall &opCall);
76  void spcInitTeleporterPosition(OpCall &opCall);
77  void spcUpdateTeleporterPosition(OpCall &opCall);
78  void spcCenterNewspaper(OpCall &opCall);
79  void spcStopScreenShaker(OpCall &opCall);
80  void spcIncrCounter(OpCall &opCall);
81  void spcUpdateObject272Sequence(OpCall &opCall);
82  void spcPlayRandomSound(OpCall &opCall);
83  void spcHoldGlowingElvisPoster(OpCall &opCall);
84  void spcStartCredits(OpCall &opCall);
85  void spcSetCursorInventoryMode(OpCall &opCall);
86  void spcCenterCurrentScreenText(OpCall &opCall);
87  void spcSetDefaultTextCoords(OpCall &opCall);
88  void spcSetTextDuration(OpCall &opCall);
89  void spcSetTempMasterSfxVolume(OpCall &opCall);
90  void spcRestoreTempMasterSfxVolume(OpCall &opCall);
91 
92  void updateTeleporterProperties();
93 
94  void startCredits();
95  int updateCredits(uint flags);
96  char *readNextCreditsLine();
97  Common::Point getCreditsItemPosition(int index);
98  void charToWChar(char *text, uint16 *wtext, uint size);
99 
100 };
101 
102 } // End of namespace Illusions
103 
104 #endif // ILLUSIONS_ILLUSIONS_H
Definition: actor.h:34
Definition: duckman_credits.h:38
Definition: duckman_inventory.h:41
Definition: duckman_specialcode.h:38
Definition: rect.h:45
Definition: specialcode.h:44
Definition: func.h:437
Definition: illusions_duckman.h:78
Definition: propertytimers.h:43
Definition: scriptopcodes.h:32