OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
MWMechanics::Spells Class Reference

Spell list. More...

#include <spells.hpp>

Collaboration diagram for MWMechanics::Spells:

Classes

struct  CorprusStats
 
struct  SpellParams
 

Public Types

typedef const ESM::SpellSpellKey
 
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 removeEffects (const std::string &id)
 
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::SpellgetSpell (const std::string &id) const
 Get spell from ID, throws exception if not found. More...
 

Private Attributes

TContainer mSpells
 
std::map< SpellKey, MagicEffectsmPermanentSpellEffects
 
std::string mSelectedSpell
 
std::map< SpellKey,
MWWorld::TimeStamp
mUsedPowers
 
std::map< SpellKey, CorprusStatsmCorprusSpells
 
bool mSpellsChanged
 
MagicEffects mEffects
 
std::map< SpellKey, MagicEffectsmSourcedEffects
 

Detailed Description

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).

Member Typedef Documentation

typedef TContainer::const_iterator MWMechanics::Spells::TIterator

Constructor & Destructor Documentation

MWMechanics::Spells::Spells ( )

Member Function Documentation

void MWMechanics::Spells::add ( const std::string &  spell)

Adding a spell that is already listed in *this is a no-op.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::add ( const ESM::Spell spell)

Adding a spell that is already listed in *this is a no-op.

Here is the call graph for this function:

Spells::TIterator MWMechanics::Spells::begin ( ) const

Here is the caller graph for this function:

bool MWMechanics::Spells::canUsePower ( const ESM::Spell spell) const

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::clear ( )

Remove all spells of al types.

Here is the caller graph for this function:

Spells::TIterator MWMechanics::Spells::end ( ) const

Here is the caller graph for this function:

const std::map< Spells::SpellKey, Spells::CorprusStats > & MWMechanics::Spells::getCorprusSpells ( ) const

Here is the caller graph for this function:

MagicEffects MWMechanics::Spells::getMagicEffects ( ) const

Return sum of magic effects resulting from abilities, blights, deseases and curses.

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string MWMechanics::Spells::getSelectedSpell ( ) const

May return an empty string.

Here is the caller graph for this function:

const ESM::Spell * MWMechanics::Spells::getSpell ( const std::string &  id) const
private

Get spell from ID, throws exception if not found.

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::Spells::hasBlightDisease ( ) const

Here is the caller graph for this function:

bool MWMechanics::Spells::hasCommonDisease ( ) const

Here is the caller graph for this function:

bool MWMechanics::Spells::hasCorprusEffect ( const ESM::Spell spell)
static

Here is the caller graph for this function:

bool MWMechanics::Spells::hasSpell ( const std::string &  spell) const

Here is the call graph for this function:

Here is the caller graph for this function:

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?

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::purgeBlightDisease ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::purgeCommonDisease ( )

Here is the caller graph for this function:

void MWMechanics::Spells::purgeCorprusDisease ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::purgeCurses ( )

Here is the caller graph for this function:

void MWMechanics::Spells::purgeEffect ( int  effectId)

Here is the caller graph for this function:

void MWMechanics::Spells::purgeEffect ( int  effectId,
const std::string &  sourceId 
)

Here is the call graph for this function:

void MWMechanics::Spells::readState ( const ESM::SpellState state)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::rebuildEffects ( ) const
private

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::removeEffects ( const std::string &  id)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::setSelectedSpell ( const std::string &  spellId)

This function does not verify, if the spell is available.

Here is the caller graph for this function:

void MWMechanics::Spells::usePower ( const ESM::Spell spell)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::visitEffectSources ( MWMechanics::EffectSourceVisitor visitor) const

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::worsenCorprus ( const ESM::Spell spell)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::Spells::writeState ( ESM::SpellState state) const

Here is the caller graph for this function:

Member Data Documentation

std::map<SpellKey, CorprusStats> MWMechanics::Spells::mCorprusSpells
private
MagicEffects MWMechanics::Spells::mEffects
mutableprivate
std::map<SpellKey, MagicEffects> MWMechanics::Spells::mPermanentSpellEffects
private
std::string MWMechanics::Spells::mSelectedSpell
private
std::map<SpellKey, MagicEffects> MWMechanics::Spells::mSourcedEffects
mutableprivate
TContainer MWMechanics::Spells::mSpells
private
bool MWMechanics::Spells::mSpellsChanged
mutableprivate
std::map<SpellKey, MWWorld::TimeStamp> MWMechanics::Spells::mUsedPowers
private

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