ScummVM API documentation
module1000_sprites.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 NEVERHOOD_MODULES_MODULE1000_SPRITES_H
23 #define NEVERHOOD_MODULES_MODULE1000_SPRITES_H
24 
25 #include "neverhood/neverhood.h"
26 #include "neverhood/module.h"
27 #include "neverhood/scene.h"
28 
29 namespace Neverhood {
30 
32 public:
34 protected:
35  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
36  void hammerHitsDoor();
37  void stShowIdleDoor();
38  void stBustedDoorMove();
39  void stBustedDoorGone();
40 };
41 
43 public:
45 protected:
46  Sprite *_asDoor;
47  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
48 };
49 
51 public:
53 protected:
54  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
55 };
56 
58 public:
59  AsScene1001Lever(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y, int deltaXType);
60 protected:
61  Scene *_parentScene;
62  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
63 };
64 
66 public:
67  SsCommonButtonSprite(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash, int surfacePriority, uint32 soundFileHash);
68 protected:
69  Scene *_parentScene;
70  uint32 _soundFileHash;
71  int16 _countdown;
72  void update();
73  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
74 };
75 
77 public:
78  AsScene1002Ring(NeverhoodEngine *vm, Scene *parentScene, bool isSpecial, int16 x, int16 y, int16 clipY1, bool isRingLow);
79 protected:
80  Scene *_parentScene;
81  bool _isSpecial;
82  void update();
83  uint32 hmRingIdle(int messageNum, const MessageParam &param, Entity *sender);
84  uint32 hmRingPulled1(int messageNum, const MessageParam &param, Entity *sender);
85  uint32 hmRingPulled2(int messageNum, const MessageParam &param, Entity *sender);
86  uint32 hmRingHangingLow(int messageNum, const MessageParam &param, Entity *sender);
87  uint32 hmRingReleased(int messageNum, const MessageParam &param, Entity *sender);
88 };
89 
90 class AsScene1002Door : public StaticSprite {
91 public:
92  AsScene1002Door(NeverhoodEngine *vm, NRect &clipRect);
93 protected:
94  void update();
95  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
96  void suOpenDoor();
97  void suCloseDoor();
98 };
99 
101 public:
103 protected:
104  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
105 };
106 
108 public:
109  AsScene1002DoorSpy(NeverhoodEngine *vm, NRect &clipRect, Scene *parentScene, Sprite *asDoor, Sprite *asScene1002BoxingGloveHitEffect);
110 protected:
111  Scene *_parentScene;
112  Sprite *_asDoor;
113  Sprite *_asBoxingGloveHitEffect;
114  NRect _clipRect;
115  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
116  uint32 hmDoorSpyAnimation(int messageNum, const MessageParam &param, Entity *sender);
117  void suDoorSpy();
118  void stDoorSpyIdle();
119  void stDoorSpyBoxingGlove();
120 };
121 
123 public:
124  SsCommonPressButton(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int surfacePriority, uint32 soundFileHash);
125  void setFileHashes(uint32 fileHash1, uint32 fileHash2);
126 protected:
127  Scene *_parentScene;
128  uint32 _soundFileHash;
129  uint32 _fileHashes[2];
130  int _status;
131  int _countdown;
132  void update();
133  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
134 };
135 
137 public:
138  AsScene1002VenusFlyTrap(NeverhoodEngine *vm, Scene *parentScene, Sprite *klaymen, bool isSecond);
139 protected:
140  Scene *_parentScene;
141  Sprite *_klaymen;
142  int _countdown;
143  bool _isSecond;
144  void update();
145  void upIdle();
146  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
147  uint32 hmAnimationSimple(int messageNum, const MessageParam &param, Entity *sender);
148  uint32 hmAnimationExt(int messageNum, const MessageParam &param, Entity *sender);
149  void stWalkBack();
150  void stWalk();
151  void stRelease();
152  void stGrabRing();
153  void stRingGrabbed();
154  void stKlaymenInside();
155  void stIdle();
156  void stKlaymenInsideMoving();
157  void stSpitOutKlaymen();
158  void swallowKlaymen();
159 };
160 
162 public:
164 protected:
165  int _countdown;
166  bool _isDoorClosed;
167  void update();
168  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
169  uint32 hmAnimation(int messageNum, const MessageParam &param, Entity *sender);
170  void stOpenDoor();
171  void stCloseDoor();
172  void stDoorClosed();
173 };
174 
176 public:
178 protected:
179  Klaymen *_klaymen;
180  void update();
181 };
182 
184 public:
185  AsScene1002KlaymenPeekHand(NeverhoodEngine *vm, Scene *parentScene, Klaymen *klaymen);
186 protected:
187  Scene *_parentScene;
188  Klaymen *_klaymen;
189  bool _isClipRectSaved;
190  NRect _savedClipRect;
191  void update();
192  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
193 };
194 
196 public:
198 protected:
199  uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
200 };
201 
202 class KmScene1001 : public Klaymen {
203 public:
204  KmScene1001(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
205 protected:
206  void stWakeUp();
207  void stSleeping();
208  void stPullHammerLever();
209  uint32 hmSleeping(int messageNum, const MessageParam &param, Entity *sender);
210  uint32 hmPullHammerLever(int messageNum, const MessageParam &param, Entity *sender);
211 
212  uint32 xHandleMessage(int messageNum, const MessageParam &param) override;
213 };
214 
215 class KmScene1002 : public Klaymen {
216 public:
217  KmScene1002(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
218 protected:
219  void stJumpToRing1();
220  void stJumpToRing2();
221  void stJumpToRing3();
222  void stJumpToRing4();
223  void setupJumpToRing();
224  void stHangOnRing();
225  void stHoldRing3();
226  void stDropFromRing();
227  void stJumpToRingVenusFlyTrap();
228  void stJumpAndFall();
229  void stMoveVenusFlyTrap();
230  void stContinueMovingVenusFlyTrap();
231  void evMoveVenusFlyTrapDone();
232  void stPressDoorButton();
233  void stHitByBoxingGlove();
234  void evHitByBoxingGloveDone();
235 
236  uint32 hmJumpToRing(int messageNum, const MessageParam &param, Entity *sender);
237  uint32 hmJumpToRing3(int messageNum, const MessageParam &param, Entity *sender);
238  uint32 hmHoldRing3(int messageNum, const MessageParam &param, Entity *sender);
239  uint32 hmJumpToRingVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender);
240  uint32 hmJumpAndFall(int messageNum, const MessageParam &param, Entity *sender);
241  uint32 hmMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender);
242  uint32 hmFirstMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender);
243  uint32 hmPressDoorButton(int messageNum, const MessageParam &param, Entity *sender);
244  uint32 hmHitByBoxingGlove(int messageNum, const MessageParam &param, Entity *sender);
245 
246  void xUpdate() override;
247  uint32 xHandleMessage(int messageNum, const MessageParam &param) override;
248 };
249 
250 class KmScene1004 : public Klaymen {
251 public:
252  KmScene1004(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
253 protected:
254  void stReadNote();
255  uint32 hmReadNote(int messageNum, const MessageParam &param, Entity *sender);
256  uint32 xHandleMessage(int messageNum, const MessageParam &param) override;
257 };
258 
259 } // End of namespace Neverhood
260 
261 #endif /* NEVERHOOD_MODULES_MODULE1000_SPRITES_H */
Definition: background.h:30
Definition: module1000_sprites.h:100
Definition: module1000_sprites.h:65
Definition: module1000_sprites.h:50
Definition: module1000_sprites.h:136
Definition: neverhood.h:60
Definition: module1000_sprites.h:175
Definition: module1000_sprites.h:122
Definition: module1000_sprites.h:90
Definition: module1000_sprites.h:215
Definition: module1000_sprites.h:42
Definition: module1000_sprites.h:76
Definition: sprite.h:140
Definition: module1000_sprites.h:57
Definition: graphics.h:42
Definition: entity.h:42
Definition: entity.h:77
Definition: module1000_sprites.h:202
Definition: module1000_sprites.h:250
Definition: scene.h:41
Definition: module1000_sprites.h:31
Definition: sprite.h:54
Definition: sprite.h:119
Definition: module1000_sprites.h:107
Definition: module1000_sprites.h:195
Definition: module1000_sprites.h:161
Definition: klaymen.h:59
Definition: module1000_sprites.h:183