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

Common creature stats. More...

#include <creaturestats.hpp>

Inheritance diagram for MWMechanics::CreatureStats:
Collaboration diagram for MWMechanics::CreatureStats:

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 (bool isPlayer=false)
 
const AttributeValuegetAttribute (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 SpellsgetSpells () const
 
const ActiveSpellsgetActiveSpells () const
 
const MagicEffectsgetMagicEffects () const
 
bool getAttackingOrSpell () const
 
int getLevel () const
 
SpellsgetSpells ()
 
ActiveSpellsgetActiveSpells ()
 
MagicEffectsgetMagicEffects ()
 
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< intgetAiSetting (AiSetting index) const
 
const AiSequencegetAiSequence () const
 
AiSequencegetAiSequence ()
 
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)
 
const std::string & getLastHitObject () const
 
void setLastHitAttemptObject (const std::string &objectid)
 
const std::string & getLastHitAttemptObject () const
 
void setHitAttemptActorId (const int actorId)
 
int getHitAttemptActorId () 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< intmBoundItems
 

Protected Attributes

int mLevel
 

Private Attributes

DrawState_ mDrawState
 
AttributeValue mAttributes [8]
 
DynamicStat< float > mDynamic [3]
 
Spells mSpells
 
ActiveSpells mActiveSpells
 
MagicEffects mMagicEffects
 
Stat< intmAiSettings [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
 
int mHitAttemptActorId
 
signed char mDeathAnimation
 
MWWorld::TimeStamp mTimeOfDeath
 
std::map< SummonKey, intmSummonedCreatures
 
std::vector< intmSummonGraveyard
 

Static Private Attributes

static int sActorId = 0
 

Detailed Description

Common creature stats.

Member Typedef Documentation

typedef std::pair<int, std::string> MWMechanics::CreatureStats::SummonKey

Member Enumeration Documentation

Enumerator
AI_Hello 
AI_Fight 
AI_Flee 
AI_Alarm 
Enumerator
Flag_ForceRun 
Flag_ForceSneak 
Flag_Run 
Flag_Sneak 
Flag_ForceJump 
Flag_ForceMoveJump 
Enumerator
Stance_Run 
Stance_Sneak 

Constructor & Destructor Documentation

MWMechanics::CreatureStats::CreatureStats ( )

Member Function Documentation

void MWMechanics::CreatureStats::addToFallHeight ( float  height)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::cleanup ( )
static

Here is the caller graph for this function:

void MWMechanics::CreatureStats::clearHasBeenMurdered ( )

Here is the caller graph for this function:

void MWMechanics::CreatureStats::clearHasDied ( )

Here is the caller graph for this function:

void MWMechanics::CreatureStats::friendlyHit ( )

Increase number of friendly hits by one.

Here is the caller graph for this function:

const ActiveSpells & MWMechanics::CreatureStats::getActiveSpells ( ) const

Here is the caller graph for this function:

ActiveSpells & MWMechanics::CreatureStats::getActiveSpells ( )
int MWMechanics::CreatureStats::getActorId ( )

Will generate an actor ID, if the actor does not have one yet.

Here is the caller graph for this function:

const AiSequence & MWMechanics::CreatureStats::getAiSequence ( ) const
AiSequence & MWMechanics::CreatureStats::getAiSequence ( )
Stat< int > MWMechanics::CreatureStats::getAiSetting ( AiSetting  index) const

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::getAttacked ( ) const

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::getAttackingOrSpell ( ) const
const AttributeValue & MWMechanics::CreatureStats::getAttribute ( int  index) const

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::getBlock ( ) const

Here is the caller graph for this function:

signed char MWMechanics::CreatureStats::getDeathAnimation ( ) const

Here is the caller graph for this function:

DrawState_ MWMechanics::CreatureStats::getDrawState ( ) const

Here is the caller graph for this function:

const DynamicStat< float > & MWMechanics::CreatureStats::getDynamic ( int  index) const

Here is the caller graph for this function:

float MWMechanics::CreatureStats::getEvasion ( ) const

Here is the call graph for this function:

Here is the caller graph for this function:

const DynamicStat< float > & MWMechanics::CreatureStats::getFatigue ( ) const

Here is the caller graph for this function:

float MWMechanics::CreatureStats::getFatigueTerm ( ) const

Return effective fatigue.

Here is the call graph for this function:

Here is the caller graph for this function:

int MWMechanics::CreatureStats::getFriendlyHits ( ) const

Number of friendly hits received.

Here is the caller graph for this function:

int MWMechanics::CreatureStats::getGoldPool ( ) const

Here is the caller graph for this function:

const DynamicStat< float > & MWMechanics::CreatureStats::getHealth ( ) const

Here is the caller graph for this function:

int MWMechanics::CreatureStats::getHitAttemptActorId ( ) const

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::getHitRecovery ( ) const

Here is the caller graph for this function:

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)

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::getKnockedDownOneFrame ( ) const

Returns true only for the first frame of the actor being knocked out; used for "onKnockedOut" command.

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::getKnockedDownOverOneFrame ( ) const

Returns true for all but the first frame of being knocked out; used to know to not reset mKnockedDownOneFrame.

Here is the caller graph for this function:

const std::string & MWMechanics::CreatureStats::getLastHitAttemptObject ( ) const

Here is the caller graph for this function:

const std::string & MWMechanics::CreatureStats::getLastHitObject ( ) const

Here is the caller graph for this function:

MWWorld::TimeStamp MWMechanics::CreatureStats::getLastRestockTime ( ) const

Here is the caller graph for this function:

int MWMechanics::CreatureStats::getLevel ( ) const

Here is the caller graph for this function:

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

Here is the caller graph for this function:

MagicEffects & MWMechanics::CreatureStats::getMagicEffects ( )
const DynamicStat< float > & MWMechanics::CreatureStats::getMagicka ( ) const

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::getMovementFlag ( Flag  flag) const

Here is the caller graph for this function:

const Spells & MWMechanics::CreatureStats::getSpells ( ) const

Here is the caller graph for this function:

Spells & MWMechanics::CreatureStats::getSpells ( )
bool MWMechanics::CreatureStats::getStance ( Stance  flag) const

Like getMovementFlag, but also takes into account if the flag is Forced.

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< int > & MWMechanics::CreatureStats::getSummonedCreatureGraveyard ( )

Here is the caller graph for this function:

std::map< CreatureStats::SummonKey, int > & MWMechanics::CreatureStats::getSummonedCreatureMap ( )

Here is the caller graph for this function:

MWWorld::TimeStamp MWMechanics::CreatureStats::getTimeOfDeath ( ) const

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::hasBeenMurdered ( ) const

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::hasBlightDisease ( ) const

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::hasCommonDisease ( ) const

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::hasDied ( ) const

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::hasTalkedToPlayer ( ) const

Has this creature talked with the player before?

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::isAlarmed ( ) const
bool MWMechanics::CreatureStats::isDead ( ) const
bool MWMechanics::CreatureStats::isDeathAnimationFinished ( ) const

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::isParalyzed ( ) const

Here is the call graph for this function:

Here is the caller graph for this function:

float MWMechanics::CreatureStats::land ( bool  isPlayer = false)

Reset the fall height

Returns
total fall height

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::matchesActorId ( int  id) const

Check if id matches the actor ID of *this (if the actor does not have an ID assigned this function will return false).

Here is the caller graph for this function:

void MWMechanics::CreatureStats::modifyMagicEffects ( const MagicEffects effects)

Set Modifier for each magic effect according to effects. Does not touch Base values.

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::CreatureStats::needToRecalcDynamicStats ( )

Here is the caller graph for this function:

void MWMechanics::CreatureStats::notifyDied ( )
void MWMechanics::CreatureStats::notifyMurder ( )

Here is the caller graph for this function:

void MWMechanics::CreatureStats::readActorIdCounter ( ESM::ESMReader esm)
static

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CreatureStats::resurrect ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setAiSetting ( AiSetting  index,
Stat< int value 
)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setAiSetting ( AiSetting  index,
int  base 
)

Here is the call graph for this function:

void MWMechanics::CreatureStats::setAlarmed ( bool  alarmed)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setAttacked ( bool  attacked)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setAttackingOrSpell ( bool  attackingOrSpell)
void MWMechanics::CreatureStats::setAttribute ( int  index,
const AttributeValue value 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setAttribute ( int  index,
int  base 
)

Here is the call graph for this function:

void MWMechanics::CreatureStats::setBlock ( bool  value)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setDeathAnimation ( signed char  index)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setDeathAnimationFinished ( bool  finished)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setDrawState ( DrawState_  state)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setDynamic ( int  index,
const DynamicStat< float > &  value 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setFatigue ( const DynamicStat< float > &  value)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setGoldPool ( int  pool)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setHealth ( const DynamicStat< float > &  value)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setHitAttemptActorId ( const int  actorId)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setHitRecovery ( bool  value)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setKnockedDown ( bool  value)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setKnockedDownOneFrame ( bool  value)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setKnockedDownOverOneFrame ( bool  value)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setLastHitAttemptObject ( const std::string &  objectid)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setLastHitObject ( const std::string &  objectid)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setLastRestockTime ( MWWorld::TimeStamp  tradeTime)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setLevel ( int  level)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setMagicka ( const DynamicStat< float > &  value)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setMovementFlag ( Flag  flag,
bool  state 
)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::setNeedRecalcDynamicStats ( bool  val)

Here is the caller graph for this function:

void MWMechanics::CreatureStats::talkedToPlayer ( )

Here is the caller graph for this function:

void MWMechanics::CreatureStats::writeActorIdCounter ( ESM::ESMWriter esm)
static

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

ActiveSpells MWMechanics::CreatureStats::mActiveSpells
private
int MWMechanics::CreatureStats::mActorId
private
AiSequence MWMechanics::CreatureStats::mAiSequence
private
Stat<int> MWMechanics::CreatureStats::mAiSettings[4]
private
bool MWMechanics::CreatureStats::mAlarmed
private
bool MWMechanics::CreatureStats::mAttacked
private
AttributeValue MWMechanics::CreatureStats::mAttributes[8]
private
bool MWMechanics::CreatureStats::mBlock
private
std::set<int> MWMechanics::CreatureStats::mBoundItems
bool MWMechanics::CreatureStats::mDead
private
signed char MWMechanics::CreatureStats::mDeathAnimation
private
bool MWMechanics::CreatureStats::mDeathAnimationFinished
private
bool MWMechanics::CreatureStats::mDied
private
DrawState_ MWMechanics::CreatureStats::mDrawState
private
DynamicStat<float> MWMechanics::CreatureStats::mDynamic[3]
private
float MWMechanics::CreatureStats::mFallHeight
private
int MWMechanics::CreatureStats::mFriendlyHits
private
int MWMechanics::CreatureStats::mGoldPool
private
int MWMechanics::CreatureStats::mHitAttemptActorId
private
bool MWMechanics::CreatureStats::mHitRecovery
private
bool MWMechanics::CreatureStats::mKnockdown
private
bool MWMechanics::CreatureStats::mKnockdownOneFrame
private
bool MWMechanics::CreatureStats::mKnockdownOverOneFrame
private
std::string MWMechanics::CreatureStats::mLastHitAttemptObject
private
std::string MWMechanics::CreatureStats::mLastHitObject
private
MWWorld::TimeStamp MWMechanics::CreatureStats::mLastRestock
private
int MWMechanics::CreatureStats::mLevel
protected
MagicEffects MWMechanics::CreatureStats::mMagicEffects
private
unsigned int MWMechanics::CreatureStats::mMovementFlags
private
bool MWMechanics::CreatureStats::mMurdered
private
bool MWMechanics::CreatureStats::mRecalcMagicka
private
Spells MWMechanics::CreatureStats::mSpells
private
std::map<SummonKey, int> MWMechanics::CreatureStats::mSummonedCreatures
private
std::vector<int> MWMechanics::CreatureStats::mSummonGraveyard
private
bool MWMechanics::CreatureStats::mTalkedTo
private
MWWorld::TimeStamp MWMechanics::CreatureStats::mTimeOfDeath
private
int MWMechanics::CreatureStats::sActorId = 0
staticprivate

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