ScummVM API documentation
locations.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 XEEN_LOCATIONS_H
23#define XEEN_LOCATIONS_H
24
25#include "common/scummsys.h"
26#include "common/str-array.h"
27#include "mm/xeen/dialogs/dialogs.h"
28#include "mm/xeen/dialogs/dialogs_message.h"
29#include "mm/xeen/party.h"
30
31namespace MM {
32namespace Xeen {
33
34enum LocationAction {
35 BANK = 0, BLACKSMITH = 1, GUILD = 2, TAVERN = 3, TEMPLE = 4,
36 TRAINING = 5, ARENA = 6, NO_ACTION = 7, REAPER = 8, GOLEM = 9,
37 DWARF_MINE = 10, SPHINX = 11, PYRAMID = 12, DWARF_TOWN = 13
38};
39
40class XeenEngine;
41
42namespace Locations {
43
45protected:
46 LocationAction _locationActionId;
48 SpriteResource _icons1, _icons2;
49 int _townMaxId;
50 const int &_ccNum;
51 int _animFrame;
52 Common::Path _vocName, _songName;
53 Common::Point _animPos;
54 int _drawFrameIndex;
55 uint _farewellTime;
56 int _drawCtr1, _drawCtr2;
57 bool _exitToUi;
58 bool _ttsVoiceText;
59#ifdef USE_TTS
60 bool _resetText;
61#endif
62protected:
66 void drawWindow();
67
72 return "";
73 }
74
78 virtual void drawBackground();
79
84 return c;
85 }
86
87#ifdef USE_TTS
88 virtual void speakTextAndButtons(const Common::String &text) { }
89#endif
90
94 virtual void farewell() {
95 }
96public:
97 BaseLocation(LocationAction action);
98 ~BaseLocation() override;
99
103 virtual int show();
104
108 void drawAnim(bool flag);
109
113 int wait();
114};
115
117private:
121 void depositWithdrawl(PartyBank whereId);
122
123#ifdef USE_TTS
128 void speakTextAndButtons(const Common::String &text) override;
129
135 void speakDepositWithdrawalText(const Common::String &text, Common::String oldButtonTexts[]);
136#endif
137protected:
142
146 void drawBackground() override;
147
152public:
153 BankLocation();
154 ~BankLocation() override {
155 }
156};
157
159private:
160#ifdef USE_TTS
165 void speakTextAndButtons(const Common::String &text) override;
166#endif
167protected:
172
176 void farewell() override;
177
182public:
184 ~BlacksmithLocation() override {
185 }
186};
187
189private:
190#ifdef USE_TTS
195 void speakTextAndButtons(const Common::String &text) override;
196#endif
197protected:
202
207public:
209 ~GuildLocation() override {
210 }
211};
212
214private:
215#ifdef USE_TTS
220 void speakTextAndButtons(const Common::String &text) override;
221
226 void speakNotificationText(const Common::String &text) const;
227#endif
228private:
229 int _v21;
230 uint _v22;
231 int _v23;
232 int _v24;
233protected:
238
242 void farewell() override;
243
248public:
250 ~TavernLocation() override {
251 }
252};
253
255private:
256#ifdef USE_TTS
261 void speakTextAndButtons(const Common::String &text) override;
262#endif
263private:
264 int _currentCharLevel;
265 int _donation;
266 int _healCost;
267 int _uncurseCost;
268 int _dayOfWeek;
269 int _v10, _v11, _v12;
270 int _v13, _v14;
271 bool _blessed;
272 int _v5, _v6;
273protected:
278
283public:
285 ~TempleLocation() override {
286 }
287};
288
290private:
291#ifdef USE_TTS
296 void speakTextAndButtons(const Common::String &text) override;
297#endif
298private:
299 int _charIndex;
300 bool _charsTrained[MAX_ACTIVE_PARTY];
301 uint _experienceToNextLevel;
302protected:
306 int maxLevel() const;
307
312
317public:
319 ~TrainingLocation() override {
320 }
321};
322
324public:
326 ~ArenaLocation() override {
327 }
328
332 int show() override;
333};
334
336protected:
337 Subtitles _subtitles;
338 int _mazeId;
339 Direction _mazeDir;
340 Common::Point _mazePos;
341 bool _keyFound;
342protected:
347public:
348 CutsceneLocation(LocationAction action);
349};
350
352private:
356 void getNewLocation();
357public:
359 ~ReaperCutscene() override {
360 }
361
365 int show() override;
366};
367
369private:
373 void getNewLocation();
374public:
376 ~GolemCutscene() override {
377 }
378
382 int show() override;
383};
384
386private:
390 void getNewLocation();
391public:
393 ~DwarfCutscene() override {
394 }
395
399 int show() override;
400};
401
403private:
407 void getNewLocation();
408public:
410 ~SphinxCutscene() override {
411 }
412
416 int show() override;
417};
418
420public:
422 ~PyramidLocation() override {
423 }
424
428 int show() override;
429};
430
431} // End of namespace Locations
432
434private:
435 SpriteResource _iconSprites;
436
439 }
440
441 bool execute(int portrait, const Common::String &name,
442 const Common::String &text, int confirm);
443
444 void loadButtons();
445
446#ifdef USE_TTS
447 void speakText(const Common::String &text, const Common::String &name, bool voiceName) const;
448#endif
449public:
450 static bool showMessage(int portrait, const Common::String &name,
451 const Common::String &text, int confirm);
452};
453
455private:
456 Locations::BaseLocation *_location;
457public:
459
463 int doAction(int actionId);
464
468 bool isActive() const;
469
473 void drawAnim(bool flag);
474
478 int wait();
479};
480
481} // End of namespace Xeen
482} // End of namespace MM
483
484#endif
Definition: array.h:52
Definition: path.h:52
Definition: str.h:59
Definition: sprites.h:52
Definition: dialogs.h:88
Definition: character.h:106
Definition: locations.h:454
void drawAnim(bool flag)
int doAction(int actionId)
Definition: locations.h:433
Definition: locations.h:323
Definition: locations.h:116
Character * doOptions(Character *c) override
Common::String createLocationText(Character &ch) override
Definition: locations.h:44
virtual Character * doOptions(Character *c)
Definition: locations.h:83
virtual void farewell()
Definition: locations.h:94
virtual Common::String createLocationText(Character &ch)
Definition: locations.h:71
Definition: locations.h:158
Character * doOptions(Character *c) override
Common::String createLocationText(Character &ch) override
Definition: locations.h:335
Definition: locations.h:385
Definition: locations.h:368
Definition: locations.h:188
Common::String createLocationText(Character &ch) override
Character * doOptions(Character *c) override
Definition: locations.h:419
Definition: locations.h:351
Definition: locations.h:402
Definition: locations.h:213
Common::String createLocationText(Character &ch) override
Character * doOptions(Character *c) override
Definition: locations.h:254
Character * doOptions(Character *c) override
Common::String createLocationText(Character &ch) override
Definition: locations.h:289
Character * doOptions(Character *c) override
Common::String createLocationText(Character &ch) override
Definition: subtitles.h:31
Definition: detection.h:27
Definition: rect.h:144