ScummVM API documentation
dungeon_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_DUNGEON_LOGIC_H
24#define ULTIMA2_LOGIC_DUNGEON_LOGIC_H
25
26#include "ultima/ultima1/data/map_dungeon.h"
27#include "ultima/ultima1/logic/logic.h"
28
29namespace Ultima {
30namespace Ultima1 {
31namespace Logic {
32
33class DungeonLogic : public Logic {
34private:
39 int getDirDeltaX() const;
40 int getDirDeltaY() const;
41
47 bool isBlocked(int deltaX, int deltaY) const;
48
53 void turnLeft();
54 void turnRight();
55
59 void turnAround();
60
65 void moveForward();
66
71 void climbLadderUp();
72 void climbLadderDown();
73
80 void showNearbyText();
81
85 void moveCreatures();
86
90 int getMonsterDistance(int maxDistance) const;
91
97 void writeMonsterName(int monsterId);
98
105 void monsterDead(int monsterId);
106
112 void dungeonAttackAt(int effectNum, int agility, int strike, int x, int y);
113
122 void dungeonMonsterAttack(int deltaX, int deltaY);
123
130 bool dungeonCreatureMove(int x, int y, int deltaX, int deltaY,
131 bool moved[][Data::DUNGEON_WIDTH]);
132
139 int getMagicWeaponPower();
140
145 void castOpen();
146
150 void castPrayer();
151
155 void castSpell(int spell, bool showPhrase);
156
157protected:
161 bool move(Data::Direction dir) override;
162
166 bool attack(Data::Direction dir) override;
167
171 bool cast() override;
172
176 bool climb() override;
177
183 bool unlock() override;
184
189 bool open() override;
190
194 bool inform() override;
195
199 void updateCreatures() override;
200
201public:
202 DungeonLogic();
203 ~DungeonLogic() override {
204 }
205
206 void entering() override;
207};
208
209} // namespace Logic
210} // namespace Ultima1
211} // namespace Ultima
212
213#endif
Definition: dungeon_logic.h:33
bool move(Data::Direction dir) override
bool attack(Data::Direction dir) override
Definition: logic.h:40