ScummVM API documentation
MM::MM1::Game::SpellCasting Class Reference

#include <spell_casting.h>

Inheritance diagram for MM::MM1::Game::SpellCasting:
MM::MM1::Console MM::MM1::Game::UseItem MM::MM1::Views::Spells::CastSpell MM::MM1::ViewsEnh::Spells::CastSpell MM::MM1::ViewsEnh::Spells::Spellbook MM::MM1::Views::CharacterInfo MM::MM1::ViewsEnh::CharacterInventory MM::MM1::ViewsEnh::Spells::Duplication MM::MM1::ViewsEnh::Spells::RechargeItem

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
 

Detailed Description

Support class for handling spell casting logic

Member Function Documentation

◆ isInCombat()

bool MM::MM1::Game::SpellCasting::isInCombat ( ) const
protected

Returns true if combat is in progress

◆ setSpell() [1/2]

void MM::MM1::Game::SpellCasting::setSpell ( const Character chr,
int  lvl,
int  num 
)

Sets the current spell

◆ getSpellIndex()

static int MM::MM1::Game::SpellCasting::getSpellIndex ( const Character chr,
int  lvl,
int  num 
)
static

Get the index in the spell array for a given spell

◆ getSpellLevelNum()

static void MM::MM1::Game::SpellCasting::getSpellLevelNum ( int  spellIndex,
int &  lvl,
int &  num 
)
static

Get the spell level and number from spell index

◆ setSpell() [2/2]

void MM::MM1::Game::SpellCasting::setSpell ( int  spellIndex,
int  requiredSp,
int  requiredGems 
)

Sets a spell directly by index

◆ hasCharTarget()

bool MM::MM1::Game::SpellCasting::hasCharTarget ( ) const

Returns true if the spell requires a target

◆ canCast()

bool MM::MM1::Game::SpellCasting::canCast ( ) const
inline

Returns true if a spell can be cast, with the exception of magic not being allowed at the current location.

◆ isMagicAllowed()

bool MM::MM1::Game::SpellCasting::isMagicAllowed ( ) const

Returns if magic is allowed at the current location

◆ getSpellState()

SpellState MM::MM1::Game::SpellCasting::getSpellState ( ) const
inline

Returns the spell error

◆ getSpellError()

Common::String MM::MM1::Game::SpellCasting::getSpellError ( ) const

Returns the error message


The documentation for this class was generated from the following file: