OpenMW
Public Types | Public Member Functions | Public Attributes | Protected Attributes | Private Attributes
MWMechanics::CreatureStats Class Reference

Common creature stats. More...

#include <creaturestats.hpp>

List of all members.

Public Types

enum  AttackType { AT_Slash, AT_Thrust, AT_Chop }

Public Member Functions

 CreatureStats ()
bool needToRecalcDynamicStats ()
void addToFallHeight (float height)
float land ()
bool canUsePower (const std::string &power) const
void usePower (const std::string &power)
const Stat< int > & 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 SpellsgetSpells () const
const ActiveSpellsgetActiveSpells () const
const MagicEffectsgetMagicEffects () const
bool getAttackingOrSpell () const
int getLevel () const
int getAiSetting (int index) const
 0: hello, 1 fight, 2 flee, 3 alarm
SpellsgetSpells ()
ActiveSpellsgetActiveSpells ()
MagicEffectsgetMagicEffects ()
void setAttribute (int index, const Stat< int > &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 setSpells (const Spells &spells)
void setActiveSpells (const ActiveSpells &active)
void setMagicEffects (const MagicEffects &effects)
void setAttackingOrSpell (bool attackingOrSpell)
void setAttackType (int attackType)
int getAttackType ()
void setLevel (int level)
void setAiSetting (int index, int value)
 0: hello, 1 fight, 2 flee, 3 alarm
const AiSequencegetAiSequence () const
AiSequencegetAiSequence ()
float getFatigueTerm () const
 Return effective fatigue.
float getLevelHealthBonus () const
void levelUp ()
void updateHealth ()
bool isDead () const
bool hasDied () const
void clearHasDied ()
void resurrect ()
bool hasCommonDisease () const
bool hasBlightDisease () const
int getFriendlyHits () const
 Number of friendly hits received.
void friendlyHit ()
 Increase number of friendly hits by one.
bool hasTalkedToPlayer () const
 Has this creature talked with the player before?
void talkedToPlayer ()
bool isAlarmed () const
void setAlarmed (bool alarmed)
bool getAttacked () const
void setAttacked (bool attacked)
bool isHostile () const
void setHostile (bool hostile)
bool getCreatureTargetted () const
float getEvasion () const
void setLastHitObject (const std::string &objectid)
const std::string & getLastHitObject () const

Public Attributes

std::set< int > mBoundItems
std::map< int, std::string > mSummonedCreatures

Protected Attributes

bool mIsWerewolf
Stat< int > mWerewolfAttributes [8]

Private Attributes

Stat< int > mAttributes [8]
DynamicStat< float > mDynamic [3]
int mLevel
Spells mSpells
ActiveSpells mActiveSpells
MagicEffects mMagicEffects
int mAiSettings [4]
AiSequence mAiSequence
float mLevelHealthBonus
bool mDead
bool mDied
int mFriendlyHits
bool mTalkedTo
bool mAlarmed
bool mAttacked
bool mHostile
bool mAttackingOrSpell
float mFallHeight
int mAttackType
std::string mLastHitObject
bool mRecalcDynamicStats
std::map< std::string,
MWWorld::TimeStamp
mUsedPowers

Detailed Description

Common creature stats.


Member Enumeration Documentation

Enumerator:
AT_Slash 
AT_Thrust 
AT_Chop 

Constructor & Destructor Documentation


Member Function Documentation

bool MWMechanics::CreatureStats::canUsePower ( const std::string &  power) const

Increase number of friendly hits by one.

int MWMechanics::CreatureStats::getAiSetting ( int  index) const

0: hello, 1 fight, 2 flee, 3 alarm

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

Return effective fatigue.

Number of friendly hits received.

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

Has this creature talked with the player before?

Reset the fall height

Returns:
total fall height

Reimplemented in MWMechanics::NpcStats.

void MWMechanics::CreatureStats::setAiSetting ( int  index,
int  value 
)

0: hello, 1 fight, 2 flee, 3 alarm

void MWMechanics::CreatureStats::setAttacked ( bool  attacked)
void MWMechanics::CreatureStats::setAttackingOrSpell ( bool  attackingOrSpell)
void MWMechanics::CreatureStats::setAttackType ( int  attackType) [inline]
void MWMechanics::CreatureStats::setAttribute ( int  index,
const Stat< int > &  value 
)
void MWMechanics::CreatureStats::setAttribute ( int  index,
int  base 
)
void MWMechanics::CreatureStats::setDynamic ( int  index,
const DynamicStat< float > &  value 
)
void MWMechanics::CreatureStats::setFatigue ( const DynamicStat< float > &  value)
void MWMechanics::CreatureStats::setHealth ( const DynamicStat< float > &  value)
void MWMechanics::CreatureStats::setLastHitObject ( const std::string &  objectid)
void MWMechanics::CreatureStats::setMagicka ( const DynamicStat< float > &  value)

Calculate health based on endurance and strength. Called at character creation and at level up.

void MWMechanics::CreatureStats::usePower ( const std::string &  power)

Member Data Documentation


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