#include <spell_casting.h>
Public Member Functions | |
void | setSpell (const Character *chr, int lvl, int num) |
void | setSpell (int spellIndex, int requiredSp, int requiredGems) |
bool | hasCharTarget () const |
bool | canCast () const |
bool | isMagicAllowed () const |
SpellState | getSpellState () const |
Common::String | getSpellError () const |
Static Public Member Functions | |
static int | getSpellIndex (const Character *chr, int lvl, int num) |
static void | getSpellLevelNum (int spellIndex, int &lvl, int &num) |
Protected Member Functions | |
bool | isInCombat () const |
Protected Attributes | |
int | _spellIndex = 0 |
int | _requiredSp = 0 |
int | _requiredGems = 0 |
SpellState | _spellState = SS_OK |
Support class for handling spell casting logic
|
protected |
Returns true if combat is in progress
void MM::MM1::Game::SpellCasting::setSpell | ( | const Character * | chr, |
int | lvl, | ||
int | num | ||
) |
Sets the current spell
|
static |
Get the index in the spell array for a given spell
|
static |
Get the spell level and number from spell index
void MM::MM1::Game::SpellCasting::setSpell | ( | int | spellIndex, |
int | requiredSp, | ||
int | requiredGems | ||
) |
Sets a spell directly by index
bool MM::MM1::Game::SpellCasting::hasCharTarget | ( | ) | const |
Returns true if the spell requires a target
|
inline |
Returns true if a spell can be cast, with the exception of magic not being allowed at the current location.
bool MM::MM1::Game::SpellCasting::isMagicAllowed | ( | ) | const |
Returns if magic is allowed at the current location
|
inline |
Returns the spell error
Common::String MM::MM1::Game::SpellCasting::getSpellError | ( | ) | const |
Returns the error message