OpenMW
|
Common creature stats. More...
#include <creaturestats.hpp>
Public Types | |
enum | AiSetting { AI_Hello = 0, AI_Fight = 1, AI_Flee = 2, AI_Alarm = 3 } |
enum | Flag { Flag_ForceRun = 1, Flag_ForceSneak = 2, Flag_Run = 4, Flag_Sneak = 8, Flag_ForceJump = 16, Flag_ForceMoveJump = 32 } |
enum | Stance { Stance_Run, Stance_Sneak } |
typedef std::pair< int, std::string > | SummonKey |
Public Member Functions | |
CreatureStats () | |
DrawState_ | getDrawState () const |
void | setDrawState (DrawState_ state) |
bool | needToRecalcDynamicStats () |
void | setNeedRecalcDynamicStats (bool val) |
void | addToFallHeight (float height) |
float | land () |
const AttributeValue & | getAttribute (int index) const |
const DynamicStat< float > & | getHealth () const |
const DynamicStat< float > & | getMagicka () const |
const DynamicStat< float > & | getFatigue () const |
const DynamicStat< float > & | getDynamic (int index) const |
const Spells & | getSpells () const |
const ActiveSpells & | getActiveSpells () const |
const MagicEffects & | getMagicEffects () const |
bool | getAttackingOrSpell () const |
int | getLevel () const |
Spells & | getSpells () |
ActiveSpells & | getActiveSpells () |
MagicEffects & | getMagicEffects () |
void | setAttribute (int index, const AttributeValue &value) |
void | setAttribute (int index, int base) |
void | setHealth (const DynamicStat< float > &value) |
void | setMagicka (const DynamicStat< float > &value) |
void | setFatigue (const DynamicStat< float > &value) |
void | setDynamic (int index, const DynamicStat< float > &value) |
void | modifyMagicEffects (const MagicEffects &effects) |
Set Modifier for each magic effect according to effects. Does not touch Base values. More... | |
void | setAttackingOrSpell (bool attackingOrSpell) |
void | setLevel (int level) |
void | setAiSetting (AiSetting index, Stat< int > value) |
void | setAiSetting (AiSetting index, int base) |
Stat< int > | getAiSetting (AiSetting index) const |
const AiSequence & | getAiSequence () const |
AiSequence & | getAiSequence () |
float | getFatigueTerm () const |
Return effective fatigue. More... | |
bool | isParalyzed () const |
bool | isDead () const |
bool | isDeathAnimationFinished () const |
void | setDeathAnimationFinished (bool finished) |
void | notifyDied () |
bool | hasDied () const |
void | clearHasDied () |
bool | hasBeenMurdered () const |
void | clearHasBeenMurdered () |
void | notifyMurder () |
void | resurrect () |
bool | hasCommonDisease () const |
bool | hasBlightDisease () const |
int | getFriendlyHits () const |
Number of friendly hits received. More... | |
void | friendlyHit () |
Increase number of friendly hits by one. More... | |
bool | hasTalkedToPlayer () const |
Has this creature talked with the player before? More... | |
void | talkedToPlayer () |
bool | isAlarmed () const |
void | setAlarmed (bool alarmed) |
bool | getAttacked () const |
void | setAttacked (bool attacked) |
float | getEvasion () const |
void | setKnockedDown (bool value) |
bool | getKnockedDown () const |
void | setKnockedDownOneFrame (bool value) |
bool | getKnockedDownOneFrame () const |
Returns true only for the first frame of the actor being knocked out; used for "onKnockedOut" command. More... | |
void | setKnockedDownOverOneFrame (bool value) |
bool | getKnockedDownOverOneFrame () const |
Returns true for all but the first frame of being knocked out; used to know to not reset mKnockedDownOneFrame. More... | |
void | setHitRecovery (bool value) |
bool | getHitRecovery () const |
void | setBlock (bool value) |
bool | getBlock () const |
std::map< SummonKey, int > & | getSummonedCreatureMap () |
std::vector< int > & | getSummonedCreatureGraveyard () |
bool | getMovementFlag (Flag flag) const |
void | setMovementFlag (Flag flag, bool state) |
bool | getStance (Stance flag) const |
Like getMovementFlag, but also takes into account if the flag is Forced. More... | |
void | setLastHitObject (const std::string &objectid) |
void | setLastHitAttemptObject (const std::string &objectid) |
const std::string & | getLastHitObject () const |
const std::string & | getLastHitAttemptObject () const |
void | writeState (ESM::CreatureStats &state) const |
void | readState (const ESM::CreatureStats &state) |
void | setLastRestockTime (MWWorld::TimeStamp tradeTime) |
MWWorld::TimeStamp | getLastRestockTime () const |
void | setGoldPool (int pool) |
int | getGoldPool () const |
signed char | getDeathAnimation () const |
void | setDeathAnimation (signed char index) |
MWWorld::TimeStamp | getTimeOfDeath () const |
int | getActorId () |
Will generate an actor ID, if the actor does not have one yet. More... | |
bool | matchesActorId (int id) const |
Static Public Member Functions | |
static void | writeActorIdCounter (ESM::ESMWriter &esm) |
static void | readActorIdCounter (ESM::ESMReader &esm) |
static void | cleanup () |
Public Attributes | |
std::set< int > | mBoundItems |
Protected Attributes | |
int | mLevel |
Private Attributes | |
DrawState_ | mDrawState |
AttributeValue | mAttributes [8] |
DynamicStat< float > | mDynamic [3] |
Spells | mSpells |
ActiveSpells | mActiveSpells |
MagicEffects | mMagicEffects |
Stat< int > | mAiSettings [4] |
AiSequence | mAiSequence |
bool | mDead |
bool | mDeathAnimationFinished |
bool | mDied |
bool | mMurdered |
int | mFriendlyHits |
bool | mTalkedTo |
bool | mAlarmed |
bool | mAttacked |
bool | mKnockdown |
bool | mKnockdownOneFrame |
bool | mKnockdownOverOneFrame |
bool | mHitRecovery |
bool | mBlock |
unsigned int | mMovementFlags |
float | mFallHeight |
std::string | mLastHitObject |
std::string | mLastHitAttemptObject |
bool | mRecalcMagicka |
MWWorld::TimeStamp | mLastRestock |
int | mGoldPool |
int | mActorId |
signed char | mDeathAnimation |
MWWorld::TimeStamp | mTimeOfDeath |
std::map< SummonKey, int > | mSummonedCreatures |
std::vector< int > | mSummonGraveyard |
Static Private Attributes | |
static int | sActorId = 0 |
Common creature stats.
typedef std::pair<int, std::string> MWMechanics::CreatureStats::SummonKey |
MWMechanics::CreatureStats::CreatureStats | ( | ) |
void MWMechanics::CreatureStats::addToFallHeight | ( | float | height | ) |
|
static |
void MWMechanics::CreatureStats::clearHasBeenMurdered | ( | ) |
void MWMechanics::CreatureStats::clearHasDied | ( | ) |
void MWMechanics::CreatureStats::friendlyHit | ( | ) |
Increase number of friendly hits by one.
const ActiveSpells & MWMechanics::CreatureStats::getActiveSpells | ( | ) | const |
ActiveSpells & MWMechanics::CreatureStats::getActiveSpells | ( | ) |
int MWMechanics::CreatureStats::getActorId | ( | ) |
Will generate an actor ID, if the actor does not have one yet.
const AiSequence & MWMechanics::CreatureStats::getAiSequence | ( | ) | const |
AiSequence & MWMechanics::CreatureStats::getAiSequence | ( | ) |
bool MWMechanics::CreatureStats::getAttacked | ( | ) | const |
bool MWMechanics::CreatureStats::getAttackingOrSpell | ( | ) | const |
const AttributeValue & MWMechanics::CreatureStats::getAttribute | ( | int | index | ) | const |
bool MWMechanics::CreatureStats::getBlock | ( | ) | const |
signed char MWMechanics::CreatureStats::getDeathAnimation | ( | ) | const |
DrawState_ MWMechanics::CreatureStats::getDrawState | ( | ) | const |
const DynamicStat< float > & MWMechanics::CreatureStats::getDynamic | ( | int | index | ) | const |
float MWMechanics::CreatureStats::getEvasion | ( | ) | const |
const DynamicStat< float > & MWMechanics::CreatureStats::getFatigue | ( | ) | const |
float MWMechanics::CreatureStats::getFatigueTerm | ( | ) | const |
Return effective fatigue.
int MWMechanics::CreatureStats::getFriendlyHits | ( | ) | const |
Number of friendly hits received.
int MWMechanics::CreatureStats::getGoldPool | ( | ) | const |
const DynamicStat< float > & MWMechanics::CreatureStats::getHealth | ( | ) | const |
bool MWMechanics::CreatureStats::getHitRecovery | ( | ) | const |
bool MWMechanics::CreatureStats::getKnockedDown | ( | ) | const |
Returns true for the entire duration of the actor being knocked down or knocked out, including transition animations (falling down & standing up)
bool MWMechanics::CreatureStats::getKnockedDownOneFrame | ( | ) | const |
Returns true only for the first frame of the actor being knocked out; used for "onKnockedOut" command.
bool MWMechanics::CreatureStats::getKnockedDownOverOneFrame | ( | ) | const |
Returns true for all but the first frame of being knocked out; used to know to not reset mKnockedDownOneFrame.
const std::string & MWMechanics::CreatureStats::getLastHitAttemptObject | ( | ) | const |
const std::string & MWMechanics::CreatureStats::getLastHitObject | ( | ) | const |
MWWorld::TimeStamp MWMechanics::CreatureStats::getLastRestockTime | ( | ) | const |
int MWMechanics::CreatureStats::getLevel | ( | ) | const |
const MagicEffects & MWMechanics::CreatureStats::getMagicEffects | ( | ) | const |
MagicEffects & MWMechanics::CreatureStats::getMagicEffects | ( | ) |
const DynamicStat< float > & MWMechanics::CreatureStats::getMagicka | ( | ) | const |
const Spells & MWMechanics::CreatureStats::getSpells | ( | ) | const |
Spells & MWMechanics::CreatureStats::getSpells | ( | ) |
Like getMovementFlag, but also takes into account if the flag is Forced.
std::vector< int > & MWMechanics::CreatureStats::getSummonedCreatureGraveyard | ( | ) |
std::map< CreatureStats::SummonKey, int > & MWMechanics::CreatureStats::getSummonedCreatureMap | ( | ) |
MWWorld::TimeStamp MWMechanics::CreatureStats::getTimeOfDeath | ( | ) | const |
bool MWMechanics::CreatureStats::hasBeenMurdered | ( | ) | const |
bool MWMechanics::CreatureStats::hasBlightDisease | ( | ) | const |
bool MWMechanics::CreatureStats::hasCommonDisease | ( | ) | const |
bool MWMechanics::CreatureStats::hasDied | ( | ) | const |
bool MWMechanics::CreatureStats::hasTalkedToPlayer | ( | ) | const |
Has this creature talked with the player before?
bool MWMechanics::CreatureStats::isAlarmed | ( | ) | const |
bool MWMechanics::CreatureStats::isDead | ( | ) | const |
bool MWMechanics::CreatureStats::isDeathAnimationFinished | ( | ) | const |
bool MWMechanics::CreatureStats::isParalyzed | ( | ) | const |
float MWMechanics::CreatureStats::land | ( | ) |
Reset the fall height
Check if id matches the actor ID of *this (if the actor does not have an ID assigned this function will return false).
void MWMechanics::CreatureStats::modifyMagicEffects | ( | const MagicEffects & | effects | ) |
Set Modifier for each magic effect according to effects. Does not touch Base values.
bool MWMechanics::CreatureStats::needToRecalcDynamicStats | ( | ) |
void MWMechanics::CreatureStats::notifyDied | ( | ) |
void MWMechanics::CreatureStats::notifyMurder | ( | ) |
|
static |
void MWMechanics::CreatureStats::readState | ( | const ESM::CreatureStats & | state | ) |
void MWMechanics::CreatureStats::resurrect | ( | ) |
void MWMechanics::CreatureStats::setAlarmed | ( | bool | alarmed | ) |
void MWMechanics::CreatureStats::setAttacked | ( | bool | attacked | ) |
void MWMechanics::CreatureStats::setAttackingOrSpell | ( | bool | attackingOrSpell | ) |
void MWMechanics::CreatureStats::setAttribute | ( | int | index, |
const AttributeValue & | value | ||
) |
void MWMechanics::CreatureStats::setBlock | ( | bool | value | ) |
void MWMechanics::CreatureStats::setDeathAnimation | ( | signed char | index | ) |
void MWMechanics::CreatureStats::setDeathAnimationFinished | ( | bool | finished | ) |
void MWMechanics::CreatureStats::setDrawState | ( | DrawState_ | state | ) |
void MWMechanics::CreatureStats::setDynamic | ( | int | index, |
const DynamicStat< float > & | value | ||
) |
void MWMechanics::CreatureStats::setFatigue | ( | const DynamicStat< float > & | value | ) |
void MWMechanics::CreatureStats::setGoldPool | ( | int | pool | ) |
void MWMechanics::CreatureStats::setHealth | ( | const DynamicStat< float > & | value | ) |
void MWMechanics::CreatureStats::setHitRecovery | ( | bool | value | ) |
void MWMechanics::CreatureStats::setKnockedDown | ( | bool | value | ) |
void MWMechanics::CreatureStats::setKnockedDownOneFrame | ( | bool | value | ) |
void MWMechanics::CreatureStats::setKnockedDownOverOneFrame | ( | bool | value | ) |
void MWMechanics::CreatureStats::setLastHitAttemptObject | ( | const std::string & | objectid | ) |
void MWMechanics::CreatureStats::setLastHitObject | ( | const std::string & | objectid | ) |
void MWMechanics::CreatureStats::setLastRestockTime | ( | MWWorld::TimeStamp | tradeTime | ) |
void MWMechanics::CreatureStats::setLevel | ( | int | level | ) |
void MWMechanics::CreatureStats::setMagicka | ( | const DynamicStat< float > & | value | ) |
void MWMechanics::CreatureStats::setNeedRecalcDynamicStats | ( | bool | val | ) |
void MWMechanics::CreatureStats::talkedToPlayer | ( | ) |
|
static |
void MWMechanics::CreatureStats::writeState | ( | ESM::CreatureStats & | state | ) | const |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
std::set<int> MWMechanics::CreatureStats::mBoundItems |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |