ScummVM API documentation
walker.h
1 
2 /* ScummVM - Graphic Adventure Engine
3  *
4  * ScummVM is the legal property of its developers, whose names
5  * are too numerous to list here. Please refer to the COPYRIGHT
6  * file distributed with this source distribution.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef M4_BURGER_WALKER_H
24 #define M4_BURGER_WALKER_H
25 
26 #include "common/array.h"
27 #include "m4/adv_r/adv_walk.h"
28 
29 namespace M4 {
30 namespace Burger {
31 
32 #define PARSER_ITEM_END "Th-th-th-that's all folks..."
33 
34 struct WilburMatch {
35  const char *_word0;
36  const char *_word1;
37  int _trigger;
38  const int32 *_testVariable;
39  int _testValue;
40  int32 *_newVariable;
41  int _newValue;
42 };
43 
44 #define WILBUR_MATCH_END { nullptr, nullptr, -1, nullptr, 0, nullptr, 0 }
45 
46 class Walker : public M4::Walker {
47 private:
48  const char *_name = nullptr;
49  int _channel = 0;
50  int _room = 0;
51  int _vol = 0;
52  int32 _trigger = 0;
53  bool _animateLips = false;
54  int _wilburPoof = -1;
55 
59  static void player_walker_callback(frac16 myMessage, machine *sender);
60 
64  void speech_random(int count, int trigger, const char *name1,
65  const char *name2, const char *name3 = nullptr,
66  const char *name4 = nullptr, const char *name5 = nullptr,
67  const char *name6 = nullptr, const char *name7 = nullptr,
68  const char *name8 = nullptr, const char *name9 = nullptr);
69 
70 public:
71  ~Walker() override {}
72 
73  bool walk_load_walker_and_shadow_series() override;
74  machine *walk_initialize_walker() override;
75 
76  void reset_walker_sprites();
77  static void unloadSprites();
78 
79  void wilbur_speech(const char *name, int trigger = -1, int room = -1, byte flags = 0,
80  int vol = 256, int channel = 1);
81  void wilbur_say();
82  void wilburs_speech_finished();
83 
90  bool wilbur_said(const char *list[][4]);
91 
92  void wilbur_speech_random(const char *name1, const char *name2, int trigger = -1) {
93  speech_random(2, trigger, name1, name2);
94  }
95  void wilbur_speech_random(const char *name1, const char *name2,
96  const char *name3, int trigger = -1) {
97  speech_random(3, trigger, name1, name2, name3);
98  }
99  void wilbur_speech_random(const char *name1, const char *name2,
100  const char *name3, const char *name4, int trigger = -1) {
101  speech_random(4, trigger, name1, name2, name3, name4);
102  }
103  void wilbur_speech_random(const char *name1, const char *name2,
104  const char *name3, const char *name4, const char *name5, int trigger = -1) {
105  speech_random(5, trigger, name1, name2, name3, name4, name5);
106  }
107  void wilbur_speech_random(const char *name1, const char *name2,
108  const char *name3, const char *name4, const char *name5,
109  const char *name6, int trigger = -1) {
110  speech_random(6, trigger, name1, name2, name3, name4, name5, name6);
111  }
112  void wilbur_speech_random(const char *name1, const char *name2,
113  const char *name3, const char *name4, const char *name5,
114  const char *name6, const char *name7, int trigger = -1) {
115  speech_random(7, trigger, name1, name2, name3, name4, name5, name6, name7);
116  }
117 
118  bool wilbur_parser(const char **list);
119 
120  bool wilbur_match(const WilburMatch *list);
121 
122  void wilbur_poof();
123  void wilbur_unpoof();
124 };
125 
126 void enable_player();
127 void disable_player();
128 void wilbur_abduct(int trigger);
129 void player_walk_to(int32 x, int32 y, int32 facing_x, int32 facing_y, int trigger = -1);
130 void player_walk_to(int32 x, int32 y, int trigger = -1);
131 void wilbur_speech(const char *name, int trigger = -1, int room = -1, byte flags = 0,
132  int vol = 256, int channel = 1);
133 
134 } // namespace Burger
135 } // namespace M4
136 
137 #endif
Definition: ws_machine.h:130
Definition: adv_walk.h:32
Definition: walker.h:34
intptr frac16
Definition: m4_types.h:46
Definition: walker.h:46
Definition: database.h:28