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 
31 namespace MM {
32 namespace Xeen {
33 
34 enum 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 
40 class XeenEngine;
41 
42 namespace Locations {
43 
44 class BaseLocation : public ButtonContainer {
45 protected:
46  LocationAction _locationActionId;
47  Common::Array<SpriteResource> _townSprites;
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 protected:
62  void drawWindow();
63 
68  return "";
69  }
70 
74  virtual void drawBackground();
75 
79  virtual Character *doOptions(Character *c) {
80  return c;
81  }
82 
86  virtual void farewell() {
87  }
88 public:
89  BaseLocation(LocationAction action);
90  ~BaseLocation() override;
91 
95  virtual int show();
96 
100  void drawAnim(bool flag);
101 
105  int wait();
106 };
107 
108 class BankLocation : public BaseLocation {
109 private:
113  void depositWithdrawl(PartyBank whereId);
114 protected:
119 
123  void drawBackground() override;
124 
128  Character *doOptions(Character *c) override;
129 public:
130  BankLocation();
131  ~BankLocation() override {
132  }
133 };
134 
136 protected:
141 
145  void farewell() override;
146 
150  Character *doOptions(Character *c) override;
151 public:
153  ~BlacksmithLocation() override {
154  }
155 };
156 
157 class GuildLocation : public BaseLocation {
158 protected:
163 
167  Character *doOptions(Character *c) override;
168 public:
169  GuildLocation();
170  ~GuildLocation() override {
171  }
172 };
173 
174 class TavernLocation : public BaseLocation {
175 private:
176  int _v21;
177  uint _v22;
178  int _v23;
179  int _v24;
180 protected:
185 
189  void farewell() override;
190 
194  Character *doOptions(Character *c) override;
195 public:
196  TavernLocation();
197  ~TavernLocation() override {
198  }
199 };
200 
201 class TempleLocation : public BaseLocation {
202 private:
203  int _currentCharLevel;
204  int _donation;
205  int _healCost;
206  int _uncurseCost;
207  int _dayOfWeek;
208  int _v10, _v11, _v12;
209  int _v13, _v14;
210  bool _blessed;
211  int _v5, _v6;
212 protected:
217 
221  Character *doOptions(Character *c) override;
222 public:
223  TempleLocation();
224  ~TempleLocation() override {
225  }
226 };
227 
229 private:
230  int _charIndex;
231  bool _charsTrained[MAX_ACTIVE_PARTY];
232  uint _experienceToNextLevel;
233 protected:
237  int maxLevel() const;
238 
243 
247  Character *doOptions(Character *c) override;
248 public:
250  ~TrainingLocation() override {
251  }
252 };
253 
254 class ArenaLocation : public BaseLocation {
255 public:
256  ArenaLocation();
257  ~ArenaLocation() override {
258  }
259 
263  int show() override;
264 };
265 
267 protected:
268  Subtitles _subtitles;
269  int _mazeId;
270  Direction _mazeDir;
271  Common::Point _mazePos;
272  bool _keyFound;
273 protected:
277  void setNewLocation();
278 public:
279  CutsceneLocation(LocationAction action);
280 };
281 
283 private:
287  void getNewLocation();
288 public:
289  ReaperCutscene();
290  ~ReaperCutscene() override {
291  }
292 
296  int show() override;
297 };
298 
300 private:
304  void getNewLocation();
305 public:
306  GolemCutscene();
307  ~GolemCutscene() override {
308  }
309 
313  int show() override;
314 };
315 
317 private:
321  void getNewLocation();
322 public:
323  DwarfCutscene();
324  ~DwarfCutscene() override {
325  }
326 
330  int show() override;
331 };
332 
334 private:
338  void getNewLocation();
339 public:
340  SphinxCutscene();
341  ~SphinxCutscene() override {
342  }
343 
347  int show() override;
348 };
349 
351 public:
352  PyramidLocation();
353  ~PyramidLocation() override {
354  }
355 
359  int show() override;
360 };
361 
362 } // End of namespace Locations
363 
365 private:
366  SpriteResource _iconSprites;
367 
369  setWaitBounds();
370  }
371 
372  bool execute(int portrait, const Common::String &name,
373  const Common::String &text, int confirm);
374 
375  void loadButtons();
376 public:
377  static bool showMessage(int portrait, const Common::String &name,
378  const Common::String &text, int confirm);
379 };
380 
382 private:
383  Locations::BaseLocation *_location;
384 public:
385  LocationManager();
386 
390  int doAction(int actionId);
391 
395  bool isActive() const;
396 
400  void drawAnim(bool flag);
401 
405  int wait();
406 };
407 
408 } // End of namespace Xeen
409 } // End of namespace MM
410 
411 #endif
Definition: str.h:59
Definition: locations.h:228
Definition: array.h:52
Definition: sprites.h:52
virtual Common::String createLocationText(Character &ch)
Definition: locations.h:67
Definition: locations.h:282
Definition: subtitles.h:31
Definition: locations.h:135
Definition: path.h:52
virtual void farewell()
Definition: locations.h:86
Definition: locations.h:299
Definition: locations.h:364
Definition: locations.h:254
Definition: locations.h:44
Definition: locations.h:350
Definition: locations.h:333
Definition: character.h:106
Definition: detection.h:27
Definition: rect.h:45
Definition: locations.h:266
Definition: dialogs.h:74
Definition: locations.h:108
Definition: locations.h:316
Definition: locations.h:201
virtual Character * doOptions(Character *c)
Definition: locations.h:79
Definition: locations.h:381
Definition: locations.h:174
Definition: locations.h:157