ScummVM API documentation
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 ULTIMA_ULTIMA1_U1DIALOGS_SPELL_H
23#define ULTIMA_ULTIMA1_U1DIALOGS_SPELL_H
24
25#include "ultima/shared/core/party.h"
26#include "ultima/ultima1/maps/map_base.h"
27#include "ultima/ultima1/maps/map_dungeon.h"
28
29namespace Ultima {
30namespace Ultima1 {
31
32class Ultima1Game;
33class Character;
34
35namespace Spells {
36
37enum SpellId {
38 SPELL_PRAYER = 0, SPELL_OPEN = 1, SPELL_UNLOCK = 2, SPELL_MAGIC_MISSILE = 3, SPELL_STEAL = 4,
39 SPELL_LADDER_DOWN = 5, SPELL_LADDER_UP = 6, SPELL_BLINK = 7, SPELL_CREATE = 8,
40 SPELL_DESTROY = 9, SPELL_KILL = 10
41};
42
46class Spell : public Shared::Spell {
47protected:
48 Ultima1Game *_game;
49 Character *_character;
50 SpellId _spellId;
51protected:
57 void addInfoMsg(const Common::String &text, bool newLine = true, bool replaceLine = false);
58protected:
62 Spell(Ultima1Game *game, Character *c, SpellId spellId);
63public:
67 void changeQuantity(int delta) override {
68 _quantity = (uint)CLIP((int)_quantity + delta, 0, 255);
69 }
70
74 virtual void cast(Maps::MapBase *map);
75
79 virtual void dungeonCast(Maps::MapDungeon *map);
80
84 uint getBuyCost() const;
85};
86
87} // End of namespace U1Dialogs
88} // End of namespace Ultima1
89} // End of namespace Ultima
90
91#endif
Definition: str.h:59
Definition: character.h:110
Definition: party.h:129
Definition: map_base.h:39
Definition: map_dungeon.h:48
Definition: spell.h:46
Spell(Ultima1Game *game, Character *c, SpellId spellId)
void addInfoMsg(const Common::String &text, bool newLine=true, bool replaceLine=false)
void changeQuantity(int delta) override
Definition: spell.h:67
virtual void dungeonCast(Maps::MapDungeon *map)
virtual void cast(Maps::MapBase *map)
Definition: game.h:42
T CLIP(T v, T amin, T amax)
Definition: util.h:69