ScummVM API documentation
special.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 ASYLUM_RESOURCES_SPECIAL_H
23 #define ASYLUM_RESOURCES_SPECIAL_H
24 
25 #include "common/scummsys.h"
26 #include "common/rect.h"
27 
28 #include "asylum/shared.h"
29 #include "asylum/asylum.h"
30 
31 namespace Asylum {
32 
33 class Object;
34 
35 class Special {
36 public:
37 
38  Special(AsylumEngine *engine);
39  ~Special() {};
40 
41  void run(Object *object, ActorIndex index);
42 
43  void reset(bool resetPaletteTick2);
44 
45 private:
46  AsylumEngine *_vm;
47 
48  // Counters
49  int32 _chapter5Counter;
50 
51  bool _paletteFlag;
52  uint32 _paletteTick1;
53  uint32 _paletteTick2;
54 
56  // Spec functions
58  void chapter1(Object *object, ActorIndex actorIndex);
59  void chapter2(Object *object, ActorIndex actorIndex);
60  void chapter3(Object *object, ActorIndex actorIndex);
61  void chapter4(Object *object, ActorIndex actorIndex);
62  void chapter5(Object *object, ActorIndex actorIndex);
63  void chapter6(Object *object, ActorIndex actorIndex);
64  void chapter7(Object *object, ActorIndex actorIndex);
65  void chapter8(Object *object, ActorIndex actorIndex);
66  void chapter9(Object *object, ActorIndex actorIndex);
67  void chapter11(Object *object, ActorIndex actorIndex);
68  void chapter12(Object *object, ActorIndex actorIndex);
69  void chapter13(Object *object, ActorIndex actorIndex);
70 
72  // Sound logic
74  void playChapterSound(Object *object, ActorIndex actorIndex);
75  void playSoundChapter1(Object *object, ActorIndex actorIndex);
76  void playSoundChapter2(Object *object, ActorIndex actorIndex);
77  void playSoundChapter3(Object *object, ActorIndex actorIndex);
78  void playSoundChapter4(Object *object, ActorIndex actorIndex);
79  void playSoundChapter6(Object *object, ActorIndex actorIndex);
80  void playSoundChapter7(Object *object, ActorIndex actorIndex);
81  void playSoundChapter8(Object *object, ActorIndex actorIndex);
82 
84  // Misc
86  void setPaletteGamma(ResourceId palette1, ResourceId palette2);
87 
88  void playSoundPanning(ResourceId resourceId, int32 attenuation, Object *object);
89  void playSoundPanning(ResourceId resourceId, int32 attenuation, ActorIndex actorIndex);
90 
91  void updateObjectFlag(ObjectId id);
92  void checkFlags(ObjectId id, GameFlag flag1, GameFlag flag2, GameFlag flag3, GameFlag flag4, uint32 *val1, uint32 *val2, GameFlag flag5, uint32 *val3);
93 
95  // Helpers
97  ResourceId getResourceId(Object *object, ActorIndex actorIndex);
98  uint32 getCounter(ActorIndex index) const;
99  bool chance() { return _vm->getRandom(10000) < 30; }
100 
101  void checkObject(Object *object, GameFlag flagToSet, GameFlag flagToClear, ObjectId objectId = kObjectNone);
102  void checkOtherObject(Object *object, ObjectId otherObjectId, GameFlag flagToClear, GameFlag flagToSet);
103 
105  // Chapter 11 helpers
107 
108  void tentacle(ActorIndex actorIndex, GameFlag flag1, GameFlag flag2, GameFlag flag3, const int16 (*rectPtr)[4]);
109  void rock(ActorIndex actorIndex, GameFlag flag1, GameFlag flag2, GameFlag flag3, GameFlag flag4, const int16 (*rectPtr)[4]);
110 };
111 
112 } // End of namespace Asylum
113 
114 #endif // ASYLUM_RESOURCES_SPECIAL_H
Definition: asylum.h:53
Definition: asylum.h:73
Definition: special.h:35
Definition: object.h:38