ScummVM API documentation
cast_spell.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_INTERACTIONS_CAST_SPELL_H
23#define ULTIMA3_VIEWS_INTERACTIONS_CAST_SPELL_H
24
25#include "ultima/ultima3/views/interactions/interaction.h"
26
27namespace Ultima {
28namespace Ultima3 {
29namespace Views {
30namespace Interactions {
31
36class CastSpell : public Interaction {
37private:
38 enum Stage {
39 CHOOSE_CASTER,
40 CHOOSE_TYPE,
41 CHOOSE_SPELL,
42 DIRECTION,
43 TARGET,
44 OVERVIEW
45 };
46
47 // The things the spells do
48 enum Effect {
49 SLAY_ORCS, MISSILE, LIGHT, DESCEND, ASCEND, FIREBALL, TELEPORT, MIND_BLAST,
50 GREAT_LIGHT, WIZARD_TO_CLERIC, FIRE_STORM, ANNIHILATE, HOLD_TIME, MIND_STORM,
51 DRAIN, DEATH_STORM, SLAY_SKELETONS, UNLOCK, HEAL_SMALL, RECALL_FLOOR,
52 CURE, LEAVE_DUNGEON, HEAL_LARGE, VISION, RESURRECT, RECALL
53 };
54
55 Stage _stage = CHOOSE_CASTER;
56 bool _inCombat;
57 bool _finished = false;
58 bool _cleric = false;
59 int _slot;
60 int _cost = 0;
61 int _spell = 0;
62 Effect _effect = SLAY_ORCS;
63 int _amount = 0;
64 PlayerChooser _players;
65 DirectionChooser _directions;
66
70 void begin();
71
76 bool perform(Effect effect);
77
78 bool fail();
79 void fanfare();
80
84 bool applyToPlayer(int target);
85
86public:
91 CastSpell(int slot = -1);
92 ~CastSpell() override;
93
94 bool isFinished() const override {
95 return _finished;
96 }
97
98 bool keypress(const KeypressMessage &msg) override;
99};
100
101} // namespace Interactions
102} // namespace Views
103} // namespace Ultima3
104} // namespace Ultima
105
106#endif
bool keypress(const KeypressMessage &msg) override
bool isFinished() const override
Definition: cast_spell.h:94
Definition: messages.h:54