OpenMW
|
Lasting spell effects. More...
#include <activespells.hpp>
Classes | |
struct | ActiveSpellParams |
struct | Effect |
Public Types | |
typedef std::multimap < std::string, ActiveSpellParams > | TContainer |
typedef TContainer::const_iterator | TIterator |
Public Member Functions | |
ActiveSpells () | |
void | addSpell (const std::string &id, bool stack, std::vector< Effect > effects, const std::string &displayName) |
addSpell | |
void | purgeEffect (short effectId) |
Remove all active effects with this id. | |
void | purgeAll (float chance) |
Remove all active effects, if roll succeeds (for each effect) | |
bool | isSpellActive (std::string id) const |
case insensitive | |
const MagicEffects & | getMagicEffects () const |
void | visitEffectSources (MWMechanics::EffectSourceVisitor &visitor) const |
Private Member Functions | |
void | update () const |
void | rebuildEffects () const |
double | timeToExpire (const TIterator &iterator) const |
const TContainer & | getActiveSpells () const |
TIterator | begin () const |
TIterator | end () const |
Private Attributes | |
TContainer | mSpells |
MagicEffects | mEffects |
bool | mSpellsChanged |
MWWorld::TimeStamp | mLastUpdate |
Lasting spell effects.
typedef std::multimap<std::string, ActiveSpellParams > MWMechanics::ActiveSpells::TContainer |
typedef TContainer::const_iterator MWMechanics::ActiveSpells::TIterator |
void MWMechanics::ActiveSpells::addSpell | ( | const std::string & | id, |
bool | stack, | ||
std::vector< Effect > | effects, | ||
const std::string & | displayName | ||
) |
addSpell
Add lasting effects
id | ID for stacking purposes. |
stack | If false, the spell is not added if one with the same ID exists already. |
effects | |
displayName | Name for display in magic menu. |
ActiveSpells::TIterator MWMechanics::ActiveSpells::begin | ( | ) | const [private] |
ActiveSpells::TIterator MWMechanics::ActiveSpells::end | ( | ) | const [private] |
const ActiveSpells::TContainer & MWMechanics::ActiveSpells::getActiveSpells | ( | ) | const [private] |
const MagicEffects & MWMechanics::ActiveSpells::getMagicEffects | ( | ) | const |
bool MWMechanics::ActiveSpells::isSpellActive | ( | std::string | id | ) | const |
case insensitive
void MWMechanics::ActiveSpells::purgeAll | ( | float | chance | ) |
Remove all active effects, if roll succeeds (for each effect)
void MWMechanics::ActiveSpells::purgeEffect | ( | short | effectId | ) |
Remove all active effects with this id.
void MWMechanics::ActiveSpells::rebuildEffects | ( | ) | const [private] |
double MWMechanics::ActiveSpells::timeToExpire | ( | const TIterator & | iterator | ) | const [private] |
Returns time (in in-game hours) until the spell pointed to by iterator expires.
void MWMechanics::ActiveSpells::update | ( | ) | const [private] |
void MWMechanics::ActiveSpells::visitEffectSources | ( | MWMechanics::EffectSourceVisitor & | visitor | ) | const |
MagicEffects MWMechanics::ActiveSpells::mEffects [mutable, private] |
MWWorld::TimeStamp MWMechanics::ActiveSpells::mLastUpdate [mutable, private] |
TContainer MWMechanics::ActiveSpells::mSpells [mutable, private] |
bool MWMechanics::ActiveSpells::mSpellsChanged [mutable, private] |