ScummVM API documentation
city_castle_logic.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 ULTIMA2_LOGIC_CITY_CASTLE_LOGIC_H
24#define ULTIMA2_LOGIC_CITY_CASTLE_LOGIC_H
25
26#include "ultima/ultima1/logic/logic.h"
27
28namespace Ultima {
29namespace Ultima1 {
30namespace Logic {
31
32class CityCastleLogic : public Logic {
33private:
37 int checkAt(int x, int y) const;
38
42 void updateBardJester(int entityIndex);
43
47 void updateWench(int entityIndex);
48
52 void updatePrincess(int entityIndex);
53
57 bool guardMove(int entityIndex);
58
63 void guardAttack(int entityIndex);
64
70 int randomWanderDelta();
71
77 bool moveEntityBy(int entityIndex, int deltaX, int deltaY);
78
86 void attackPerson(Data::Direction dir, int maxDistance, int strike, int hitChance);
87
88protected:
93
97 bool move(Data::Direction dir) override;
98
102 void updateCreatures() override;
103
109 void damage(Data::Direction dir, int effectNum, int maxDistance, int strike, int hitChance, int tileId) override;
110
114 bool drop() override;
115
120 bool get() override;
121
125 bool steal() override;
126
131 bool unlock() override;
132
138
146
151 void findWeapon(bool checkCaught);
152
158 void findFood(bool checkCaught);
159
165 void findArmor(bool checkCaught);
166
167public:
169 ~CityCastleLogic() override {
170 }
171
172 void entering() override;
173 bool isPersisted() const override {
174 return true;
175 }
176
180 virtual void leaving();
181};
182
184protected:
189 bool transact() override;
190
191public:
192 CityLogic();
193 ~CityLogic() override {
194 }
195
196 void entering() override;
197};
198
200private:
205 bool isPrincessAtDelta(int deltaX, int deltaY) const;
206
210 bool isPrincessSaved();
211
215 void princessSaved();
216
217protected:
221 bool transact() override;
222
227 bool unlock() override;
228
229public:
230 CastleLogic();
231 ~CastleLogic() override {
232 }
233
234 void entering() override;
235
239 void leaving() override;
240};
241
242} // namespace Logic
243} // namespace Ultima1
244} // namespace Ultima
245
246#endif
Definition: city_castle_logic.h:199
Definition: city_castle_logic.h:32
bool isPersisted() const override
Definition: city_castle_logic.h:173
void damage(Data::Direction dir, int effectNum, int maxDistance, int strike, int hitChance, int tileId) override
bool move(Data::Direction dir) override
Definition: city_castle_logic.h:183
Definition: logic.h:40