ScummVM API documentation
dungeon_logic.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
23#ifndef ULTIMA2_LOGIC_DUNGEON_LOGIC_H
24#define ULTIMA2_LOGIC_DUNGEON_LOGIC_H
25
26#include "ultima/ultima2/logic/logic.h"
27
28namespace Ultima {
29namespace Ultima2 {
30namespace Logic {
31
37class DungeonLogic : public Logic {
38private:
42 byte &cellAt(int x, int y) const;
43
48 int findMonsterAhead() const;
49
53 bool advance();
54 bool retreat();
55 bool turn(bool left);
56
61 void changeLevel(int delta);
62 void surface();
63 void printLevel();
64
68 void killMonster(int slot);
69
73 void spawnMonsters();
74
79 bool monsterAttacks(int slot);
80
86 int tryMoveMonster(int slot, int x, int y);
87
88protected:
89 void updateCreatures() override;
90 bool castSpell(Data::SpellType spell) override;
91
92 bool move(Data::Direction dir) override;
93 bool descend() override;
94 bool klimb() override;
95 bool get() override;
96
97public:
98 ~DungeonLogic() override {}
99
104 void entering() override {
105 endOfTurn();
106 }
107
108 bool attack(Data::Direction dir) override;
109};
110
111} // namespace Logic
112} // namespace Ultima2
113} // namespace Ultima
114
115#endif
Definition: dungeon_logic.h:37
void entering() override
Definition: dungeon_logic.h:104
bool castSpell(Data::SpellType spell) override
Definition: logic.h:38