OpenMW
|
Spell list. More...
#include <spells.hpp>
Classes | |
struct | CorprusStats |
struct | SpellParams |
Public Types | |
typedef const ESM::Spell * | SpellKey |
typedef std::map< SpellKey, SpellParams > | TContainer |
typedef TContainer::const_iterator | TIterator |
Public Member Functions | |
Spells () | |
void | worsenCorprus (const ESM::Spell *spell) |
const std::map< SpellKey, CorprusStats > & | getCorprusSpells () const |
void | purgeEffect (int effectId) |
void | purgeEffect (int effectId, const std::string &sourceId) |
bool | canUsePower (const ESM::Spell *spell) const |
void | usePower (const ESM::Spell *spell) |
void | purgeCommonDisease () |
void | purgeBlightDisease () |
void | purgeCorprusDisease () |
void | purgeCurses () |
TIterator | begin () const |
TIterator | end () const |
bool | hasSpell (const std::string &spell) const |
bool | hasSpell (const ESM::Spell *spell) const |
void | add (const std::string &spell) |
Adding a spell that is already listed in *this is a no-op. More... | |
void | add (const ESM::Spell *spell) |
Adding a spell that is already listed in *this is a no-op. More... | |
void | remove (const std::string &spell) |
MagicEffects | getMagicEffects () const |
Return sum of magic effects resulting from abilities, blights, deseases and curses. More... | |
void | clear () |
Remove all spells of al types. More... | |
void | setSelectedSpell (const std::string &spellId) |
This function does not verify, if the spell is available. More... | |
const std::string | getSelectedSpell () const |
May return an empty string. More... | |
bool | isSpellActive (const std::string &id) const |
Are we under the effects of the given spell ID? More... | |
bool | hasCommonDisease () const |
bool | hasBlightDisease () const |
void | visitEffectSources (MWMechanics::EffectSourceVisitor &visitor) const |
void | readState (const ESM::SpellState &state) |
void | writeState (ESM::SpellState &state) const |
Static Public Member Functions | |
static bool | hasCorprusEffect (const ESM::Spell *spell) |
Private Member Functions | |
void | rebuildEffects () const |
const ESM::Spell * | getSpell (const std::string &id) const |
Get spell from ID, throws exception if not found. More... | |
Private Attributes | |
TContainer | mSpells |
std::map< SpellKey, MagicEffects > | mPermanentSpellEffects |
std::string | mSelectedSpell |
std::map< SpellKey, MWWorld::TimeStamp > | mUsedPowers |
std::map< SpellKey, CorprusStats > | mCorprusSpells |
bool | mSpellsChanged |
MagicEffects | mEffects |
std::map< SpellKey, MagicEffects > | mSourcedEffects |
Spell list.
This class manages known spells as well as abilities, powers and permanent negative effects like diseases. It also keeps track of used powers (which can only be used every 24h).
typedef const ESM::Spell* MWMechanics::Spells::SpellKey |
typedef std::map<SpellKey, SpellParams> MWMechanics::Spells::TContainer |
typedef TContainer::const_iterator MWMechanics::Spells::TIterator |
MWMechanics::Spells::Spells | ( | ) |
void MWMechanics::Spells::add | ( | const std::string & | spell | ) |
Adding a spell that is already listed in *this is a no-op.
void MWMechanics::Spells::add | ( | const ESM::Spell * | spell | ) |
Adding a spell that is already listed in *this is a no-op.
Spells::TIterator MWMechanics::Spells::begin | ( | ) | const |
bool MWMechanics::Spells::canUsePower | ( | const ESM::Spell * | spell | ) | const |
void MWMechanics::Spells::clear | ( | ) |
Remove all spells of al types.
Spells::TIterator MWMechanics::Spells::end | ( | ) | const |
const std::map< Spells::SpellKey, Spells::CorprusStats > & MWMechanics::Spells::getCorprusSpells | ( | ) | const |
MagicEffects MWMechanics::Spells::getMagicEffects | ( | ) | const |
Return sum of magic effects resulting from abilities, blights, deseases and curses.
const std::string MWMechanics::Spells::getSelectedSpell | ( | ) | const |
May return an empty string.
|
private |
Get spell from ID, throws exception if not found.
bool MWMechanics::Spells::hasBlightDisease | ( | ) | const |
bool MWMechanics::Spells::hasCommonDisease | ( | ) | const |
|
static |
bool MWMechanics::Spells::hasSpell | ( | const std::string & | spell | ) | const |
bool MWMechanics::Spells::hasSpell | ( | const ESM::Spell * | spell | ) | const |
bool MWMechanics::Spells::isSpellActive | ( | const std::string & | id | ) | const |
Are we under the effects of the given spell ID?
void MWMechanics::Spells::purgeBlightDisease | ( | ) |
void MWMechanics::Spells::purgeCommonDisease | ( | ) |
void MWMechanics::Spells::purgeCorprusDisease | ( | ) |
void MWMechanics::Spells::purgeCurses | ( | ) |
void MWMechanics::Spells::purgeEffect | ( | int | effectId | ) |
void MWMechanics::Spells::purgeEffect | ( | int | effectId, |
const std::string & | sourceId | ||
) |
void MWMechanics::Spells::readState | ( | const ESM::SpellState & | state | ) |
|
private |
void MWMechanics::Spells::remove | ( | const std::string & | spell | ) |
If the spell to be removed is the selected spell, the selected spell will be changed to no spell (empty string).
void MWMechanics::Spells::setSelectedSpell | ( | const std::string & | spellId | ) |
This function does not verify, if the spell is available.
void MWMechanics::Spells::usePower | ( | const ESM::Spell * | spell | ) |
void MWMechanics::Spells::visitEffectSources | ( | MWMechanics::EffectSourceVisitor & | visitor | ) | const |
void MWMechanics::Spells::worsenCorprus | ( | const ESM::Spell * | spell | ) |
void MWMechanics::Spells::writeState | ( | ESM::SpellState & | state | ) | const |
|
private |
|
mutableprivate |
|
private |
|
private |
|
mutableprivate |
|
private |
|
mutableprivate |
|
private |