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

Lasting spell effects. More...

#include <activespells.hpp>

Collaboration diagram for MWMechanics::ActiveSpells:

Classes

struct  ActiveSpellParams
 

Public Types

typedef ESM::ActiveEffect ActiveEffect
 
typedef std::multimap
< std::string,
ActiveSpellParams
TContainer
 
typedef TContainer::const_iterator TIterator
 

Public Member Functions

void readState (const ESM::ActiveSpells &state)
 
void writeState (ESM::ActiveSpells &state) const
 
TIterator begin () const
 
TIterator end () const
 
 ActiveSpells ()
 
void addSpell (const std::string &id, bool stack, std::vector< ActiveEffect > effects, const std::string &displayName, int casterActorId)
 addSpell More...
 
void removeEffects (const std::string &id)
 Removes the active effects from this spell/potion/.. with id. More...
 
void purgeEffect (short effectId)
 Remove all active effects with this effect id. More...
 
void purgeEffect (short effectId, const std::string &sourceId)
 Remove all active effects with this effect id and source id. More...
 
void purgeAll (float chance, bool spellOnly=false)
 Remove all active effects, if roll succeeds (for each effect) More...
 
void purge (int casterActorId)
 Remove all effects with CASTER_LINKED flag that were cast by casterActorId. More...
 
void clear ()
 Remove all spells. More...
 
bool isSpellActive (const std::string &id) const
 case insensitive More...
 
const MagicEffectsgetMagicEffects () const
 
void visitEffectSources (MWMechanics::EffectSourceVisitor &visitor) const
 

Private Member Functions

void update () const
 
void rebuildEffects () const
 
void mergeEffects (std::vector< ActiveEffect > &addTo, const std::vector< ActiveEffect > &from)
 Add any effects that are in "from" and not in "addTo" to "addTo". More...
 
double timeToExpire (const TIterator &iterator) const
 
const TContainergetActiveSpells () const
 

Private Attributes

TContainer mSpells
 
MagicEffects mEffects
 
bool mSpellsChanged
 
MWWorld::TimeStamp mLastUpdate
 

Detailed Description

Lasting spell effects.

Note
The name of this class is slightly misleading, since it also handels lasting potion effects.

Member Typedef Documentation

typedef std::multimap<std::string, ActiveSpellParams > MWMechanics::ActiveSpells::TContainer
typedef TContainer::const_iterator MWMechanics::ActiveSpells::TIterator

Constructor & Destructor Documentation

MWMechanics::ActiveSpells::ActiveSpells ( )

Member Function Documentation

void MWMechanics::ActiveSpells::addSpell ( const std::string &  id,
bool  stack,
std::vector< ActiveEffect effects,
const std::string &  displayName,
int  casterActorId 
)

addSpell

Add lasting effects

Parameters
idID for stacking purposes.
stackIf false, the spell is not added if one with the same ID exists already.
effects
displayNameName for display in magic menu.

Here is the call graph for this function:

Here is the caller graph for this function:

ActiveSpells::TIterator MWMechanics::ActiveSpells::begin ( ) const

Here is the caller graph for this function:

void MWMechanics::ActiveSpells::clear ( )

Remove all spells.

Here is the caller graph for this function:

ActiveSpells::TIterator MWMechanics::ActiveSpells::end ( ) const

Here is the caller graph for this function:

const ActiveSpells::TContainer & MWMechanics::ActiveSpells::getActiveSpells ( ) const
private

Here is the caller graph for this function:

const MagicEffects & MWMechanics::ActiveSpells::getMagicEffects ( ) const

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::ActiveSpells::isSpellActive ( const std::string &  id) const

case insensitive

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::ActiveSpells::mergeEffects ( std::vector< ActiveEffect > &  addTo,
const std::vector< ActiveEffect > &  from 
)
private

Add any effects that are in "from" and not in "addTo" to "addTo".

Here is the caller graph for this function:

void MWMechanics::ActiveSpells::purge ( int  casterActorId)

Remove all effects with CASTER_LINKED flag that were cast by casterActorId.

Here is the caller graph for this function:

void MWMechanics::ActiveSpells::purgeAll ( float  chance,
bool  spellOnly = false 
)

Remove all active effects, if roll succeeds (for each effect)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::ActiveSpells::purgeEffect ( short  effectId)

Remove all active effects with this effect id.

Here is the caller graph for this function:

void MWMechanics::ActiveSpells::purgeEffect ( short  effectId,
const std::string &  sourceId 
)

Remove all active effects with this effect id and source id.

void MWMechanics::ActiveSpells::readState ( const ESM::ActiveSpells state)

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Removes the active effects from this spell/potion/.. with id.

Here is the caller graph for this function:

double MWMechanics::ActiveSpells::timeToExpire ( const TIterator iterator) const
private

Returns time (in in-game hours) until the spell pointed to by iterator expires.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::ActiveSpells::update ( ) const
private

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::ActiveSpells::writeState ( ESM::ActiveSpells state) const

Here is the caller graph for this function:

Member Data Documentation

MagicEffects MWMechanics::ActiveSpells::mEffects
mutableprivate
MWWorld::TimeStamp MWMechanics::ActiveSpells::mLastUpdate
mutableprivate
TContainer MWMechanics::ActiveSpells::mSpells
mutableprivate
bool MWMechanics::ActiveSpells::mSpellsChanged
mutableprivate

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