ScummVM API documentation
combat_map.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 ULTIMA3_VIEWS_COMBAT_MAP_H
23#define ULTIMA3_VIEWS_COMBAT_MAP_H
24
25#include "ultima/ultima3/views/game.h"
26#include "ultima/ultima3/music.h"
27
28namespace Ultima {
29namespace Ultima3 {
30namespace Views {
31
36class CombatMap : public Game {
37private:
38 // What happens once the events from a command have been played
39 enum Next {
40 NOTHING,
41 NEXT_PLAYER,
42 NEXT_ROUND
43 };
44
45 bool _started = false;
46 Next _next = NOTHING;
47
48 // A tile shown over the arena for a frame
49 bool _overlay = false;
50 int _overlayX = 0, _overlayY = 0, _overlayTile = 0;
51
55 void beginRound();
56
61 void beginTurn();
62
66 void advanceTurn();
67
68 void monstersTurn();
69 void victory();
70 void doMove(int dx, int dy, const char *label);
71 void doNegateTime();
72 void doAttack();
73
74protected:
75 void drawViewport(GfxSurface &s) override;
76 void idleTimeout() override;
77 void endTurn() override;
78 void processFrame() override;
79 byte musicLocation() const override {
80 return MUSIC_LOCATION_COMBAT;
81 }
82 bool isWaiting() const override;
83 bool handleCommand(const KeypressMessage &msg) override;
84
85public:
86 CombatMap() : Game("CombatMap") {}
87 ~CombatMap() override {}
88
89 bool msgFocus(const FocusMessage &msg) override;
90 bool msgKeypress(const KeypressMessage &msg) override;
91
95 void win();
96};
97
98} // namespace Views
99} // namespace Ultima3
100} // namespace Ultima
101
102#endif
Definition: gfx_surface.h:34
Definition: combat_map.h:36
void drawViewport(GfxSurface &s) override
byte musicLocation() const override
Definition: combat_map.h:79
bool handleCommand(const KeypressMessage &msg) override
bool isWaiting() const override
Definition: game.h:43
Definition: messages.h:54