ScummVM API documentation
map_city_castle.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 ULTIMA_ULTIMA1_MAP_MAP_CITY_CASTLE_H
23#define ULTIMA_ULTIMA1_MAP_MAP_CITY_CASTLE_H
24
25#include "ultima/ultima1/maps/map_base.h"
26
27namespace Ultima {
28namespace Ultima1 {
29namespace Widgets {
30 class Person;
31 class Merchant;
32}
33
34namespace Maps {
35
36enum CityTile {
37 CTILE_GROUND = 1, CTILE_POND_EDGE1 = 51, CTILE_POND_EDGE2 = 52, CTILE_POND_EDGE3 = 53,
38 CTILE_GATE = 11, CTILE_LOCK1 = 60, CTILE_LOCK2 = 61, CTILE_63 = 63
39};
40
44class MapCityCastle : public MapBase {
45protected:
50
55
60
65public:
66 bool _guardsHostile; // Flag for whether guards are hostile
67 uint _tipCounter; // Tip counter for taverns
68public:
72 MapCityCastle(Ultima1Game *game, Ultima1Map *map) : MapBase(game, map),
73 _guardsHostile(false), _tipCounter(0) {}
74
78 void load(Shared::Maps::MapId mapId) override;
79
83 void getTileAt(const Point &pt, Shared::Maps::MapTile *tile, bool includePlayer = true) override;
84
88 void clear() override;
89
93 Point getViewportPosition(const Point &viewportSize) override;
94
98 void cast() override;
99
103 void drop() override;
104
108 void inform() override;
109
113 void steal() override;
114
124 void attack(int direction, int effectId, uint maxDistance, uint amount, uint agility, const Common::String &hitWidget) override;
125
129 bool isWenchNearby() const;
130};
131
135class MapCity : public MapCityCastle {
136public:
140 MapCity(Ultima1Game *game, Ultima1Map *map) : MapCityCastle(game, map) {}
141
145 ~MapCity() override {}
146
150 void load(Shared::Maps::MapId mapId) override;
151
155 void dropCoins(uint coins) override;
156
160 void get() override;
161
165 void talk() override;
166
170 void unlock() override;
171};
172
176class MapCastle : public MapCityCastle {
177public:
178 uint _castleKey; // Key for castle map lock
179 int _getCounter; // Counter for allowed gets without stealing check
180 bool _freeingPrincess; // Set when freeing the princess is in progress
181public:
185 MapCastle(Ultima1Game *game, Ultima1Map *map) : MapCityCastle(game, map), _castleKey(0),
186 _getCounter(0), _freeingPrincess(false) {}
187
191 void load(Shared::Maps::MapId mapId) override;
192
197
201 void dropCoins(uint coins) override;
202
206 void get() override;
207
211 void talk() override;
212
216 void unlock() override;
217
218
223};
224
225} // End of namespace Maps
226} // End of namespace Ultima1
227} // End of namespace Ultima
228
229#endif
Definition: serializer.h:80
Definition: str.h:59
Definition: map_tile.h:36
Definition: map_base.h:39
Definition: map_city_castle.h:176
void dropCoins(uint coins) override
void synchronize(Common::Serializer &s) override
void load(Shared::Maps::MapId mapId) override
MapCastle(Ultima1Game *game, Ultima1Map *map)
Definition: map_city_castle.h:185
Definition: map_city_castle.h:44
void attack(int direction, int effectId, uint maxDistance, uint amount, uint agility, const Common::String &hitWidget) override
Widgets::Merchant * getStealMerchant()
MapCityCastle(Ultima1Game *game, Ultima1Map *map)
Definition: map_city_castle.h:72
void getTileAt(const Point &pt, Shared::Maps::MapTile *tile, bool includePlayer=true) override
Point getViewportPosition(const Point &viewportSize) override
void load(Shared::Maps::MapId mapId) override
Definition: map_city_castle.h:135
void dropCoins(uint coins) override
~MapCity() override
Definition: map_city_castle.h:145
void load(Shared::Maps::MapId mapId) override
MapCity(Ultima1Game *game, Ultima1Map *map)
Definition: map_city_castle.h:140
Definition: game.h:42
Definition: merchant.h:34
Definition: person.h:38
Definition: rect.h:144