OpenMW
|
Lasting spell effects. More...
#include <activespells.hpp>
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) |
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 MagicEffects & | getMagicEffects () 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 TContainer & | getActiveSpells () 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 |
MWMechanics::ActiveSpells::ActiveSpells | ( | ) |
void MWMechanics::ActiveSpells::addSpell | ( | const std::string & | id, |
bool | stack, | ||
std::vector< ActiveEffect > | effects, | ||
const std::string & | displayName, | ||
int | casterActorId | ||
) |
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 |
void MWMechanics::ActiveSpells::clear | ( | ) |
Remove all spells.
ActiveSpells::TIterator MWMechanics::ActiveSpells::end | ( | ) | const |
|
private |
const MagicEffects & MWMechanics::ActiveSpells::getMagicEffects | ( | ) | const |
bool MWMechanics::ActiveSpells::isSpellActive | ( | const std::string & | id | ) | const |
case insensitive
|
private |
Add any effects that are in "from" and not in "addTo" to "addTo".
void MWMechanics::ActiveSpells::purge | ( | int | casterActorId | ) |
Remove all effects with CASTER_LINKED flag that were cast by casterActorId.
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 effect id.
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 | ) |
|
private |
void MWMechanics::ActiveSpells::removeEffects | ( | const std::string & | id | ) |
Removes the active effects from this spell/potion/.. with id.
|
private |
Returns time (in in-game hours) until the spell pointed to by iterator expires.
|
private |
void MWMechanics::ActiveSpells::visitEffectSources | ( | MWMechanics::EffectSourceVisitor & | visitor | ) | const |
void MWMechanics::ActiveSpells::writeState | ( | ESM::ActiveSpells & | state | ) | const |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |