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

Additional stats for NPCs. More...

#include <npcstats.hpp>

Inheritance diagram for MWMechanics::NpcStats:
Collaboration diagram for MWMechanics::NpcStats:

Public Member Functions

 NpcStats ()
 
int getBaseDisposition () const
 
void setBaseDisposition (int disposition)
 
int getReputation () const
 
void setReputation (int reputation)
 
int getCrimeId () const
 
void setCrimeId (int id)
 
const SkillValuegetSkill (int index) const
 
SkillValuegetSkill (int index)
 
void setSkill (int index, const SkillValue &value)
 
const std::map< std::string,
int > & 
getFactionRanks () const
 
void raiseRank (const std::string &faction)
 Increase the rank in this faction by 1, if such a rank exists. More...
 
void lowerRank (const std::string &faction)
 Lower the rank in this faction by 1, if such a rank exists. More...
 
void joinFaction (const std::string &faction)
 Join this faction, setting the initial rank to 0. More...
 
const std::set< std::string > & getExpelled () const
 
bool getExpelled (const std::string &factionID) const
 
void expell (const std::string &factionID)
 
void clearExpelled (const std::string &factionID)
 
bool isInFaction (const std::string &faction) const
 
float getSkillProgressRequirement (int skillIndex, const ESM::Class &class_) const
 
void useSkill (int skillIndex, const ESM::Class &class_, int usageType=-1, float extraFactor=1.f)
 Increase skill by usage. More...
 
void increaseSkill (int skillIndex, const ESM::Class &class_, bool preserveProgress, bool readBook=false)
 
int getLevelProgress () const
 
int getLevelupAttributeMultiplier (int attribute) const
 
int getSkillIncreasesForSpecialization (int spec) const
 
void levelUp ()
 
void updateHealth ()
 
void flagAsUsed (const std::string &id)
 
bool hasBeenUsed (const std::string &id) const
 
int getBounty () const
 
void setBounty (int bounty)
 
int getFactionReputation (const std::string &faction) const
 
void setFactionReputation (const std::string &faction, int value)
 
bool hasSkillsForRank (const std::string &factionId, int rank) const
 
bool isWerewolf () const
 
void setWerewolf (bool set)
 
int getWerewolfKills () const
 
void addWerewolfKill ()
 Increments mWerewolfKills by 1. More...
 
float getTimeToStartDrowning () const
 
void setTimeToStartDrowning (float time)
 
void writeState (ESM::NpcStats &state) const
 
void readState (const ESM::NpcStats &state)
 
- Public Member Functions inherited from MWMechanics::CreatureStats
 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
 

Private Attributes

int mDisposition
 
SkillValue mSkill [ESM::Skill::Length]
 
int mReputation
 
int mCrimeId
 
int mBounty
 
int mWerewolfKills
 
std::map< std::string, intmFactionRank
 Used for the player only; NPCs have maximum one faction defined in their NPC record. More...
 
std::set< std::string > mExpelled
 
std::map< std::string, intmFactionReputation
 
int mLevelProgress
 
std::vector< intmSkillIncreases
 
std::vector< intmSpecIncreases
 
std::set< std::string > mUsedIds
 
float mTimeToStartDrowning
 Countdown to getting damage while underwater. More...
 
bool mIsWerewolf
 

Additional Inherited Members

- Public Types inherited from MWMechanics::CreatureStats
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
 
- Static Public Member Functions inherited from MWMechanics::CreatureStats
static void writeActorIdCounter (ESM::ESMWriter &esm)
 
static void readActorIdCounter (ESM::ESMReader &esm)
 
static void cleanup ()
 
- Public Attributes inherited from MWMechanics::CreatureStats
std::set< intmBoundItems
 
- Protected Attributes inherited from MWMechanics::CreatureStats
int mLevel
 

Detailed Description

Additional stats for NPCs.

Constructor & Destructor Documentation

MWMechanics::NpcStats::NpcStats ( )

Member Function Documentation

void MWMechanics::NpcStats::addWerewolfKill ( )

Increments mWerewolfKills by 1.

Here is the caller graph for this function:

void MWMechanics::NpcStats::clearExpelled ( const std::string &  factionID)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::NpcStats::expell ( const std::string &  factionID)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::NpcStats::flagAsUsed ( const std::string &  id)
Note
Id must be lower-case

Here is the caller graph for this function:

int MWMechanics::NpcStats::getBaseDisposition ( ) const

Here is the caller graph for this function:

int MWMechanics::NpcStats::getBounty ( ) const

Here is the caller graph for this function:

int MWMechanics::NpcStats::getCrimeId ( ) const

Here is the caller graph for this function:

const std::set<std::string>& MWMechanics::NpcStats::getExpelled ( ) const
inline

Here is the caller graph for this function:

bool MWMechanics::NpcStats::getExpelled ( const std::string &  factionID) const

Here is the call graph for this function:

const std::map< std::string, int > & MWMechanics::NpcStats::getFactionRanks ( ) const

Here is the caller graph for this function:

int MWMechanics::NpcStats::getFactionReputation ( const std::string &  faction) const

Here is the call graph for this function:

Here is the caller graph for this function:

int MWMechanics::NpcStats::getLevelProgress ( ) const

Here is the caller graph for this function:

int MWMechanics::NpcStats::getLevelupAttributeMultiplier ( int  attribute) const

Here is the call graph for this function:

Here is the caller graph for this function:

int MWMechanics::NpcStats::getReputation ( ) const

Here is the caller graph for this function:

const MWMechanics::SkillValue & MWMechanics::NpcStats::getSkill ( int  index) const

Here is the caller graph for this function:

MWMechanics::SkillValue & MWMechanics::NpcStats::getSkill ( int  index)
int MWMechanics::NpcStats::getSkillIncreasesForSpecialization ( int  spec) const

Here is the caller graph for this function:

float MWMechanics::NpcStats::getSkillProgressRequirement ( int  skillIndex,
const ESM::Class class_ 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

float MWMechanics::NpcStats::getTimeToStartDrowning ( ) const

Here is the caller graph for this function:

int MWMechanics::NpcStats::getWerewolfKills ( ) const

Here is the caller graph for this function:

bool MWMechanics::NpcStats::hasBeenUsed ( const std::string &  id) const
Note
Id must be lower-case

Here is the caller graph for this function:

bool MWMechanics::NpcStats::hasSkillsForRank ( const std::string &  factionId,
int  rank 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::NpcStats::increaseSkill ( int  skillIndex,
const ESM::Class class_,
bool  preserveProgress,
bool  readBook = false 
)
Todo:
check if character is the player, if levelling is ever implemented for NPCs

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::NpcStats::isInFaction ( const std::string &  faction) const

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWMechanics::NpcStats::isWerewolf ( ) const

Here is the caller graph for this function:

void MWMechanics::NpcStats::joinFaction ( const std::string &  faction)

Join this faction, setting the initial rank to 0.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::NpcStats::levelUp ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::NpcStats::lowerRank ( const std::string &  faction)

Lower the rank in this faction by 1, if such a rank exists.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::NpcStats::raiseRank ( const std::string &  faction)

Increase the rank in this faction by 1, if such a rank exists.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::NpcStats::setBaseDisposition ( int  disposition)

Here is the caller graph for this function:

void MWMechanics::NpcStats::setBounty ( int  bounty)

Here is the caller graph for this function:

void MWMechanics::NpcStats::setCrimeId ( int  id)

Here is the caller graph for this function:

void MWMechanics::NpcStats::setFactionReputation ( const std::string &  faction,
int  value 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::NpcStats::setReputation ( int  reputation)

Here is the caller graph for this function:

void MWMechanics::NpcStats::setSkill ( int  index,
const SkillValue value 
)

Here is the caller graph for this function:

void MWMechanics::NpcStats::setTimeToStartDrowning ( float  time)

Sets time left for the creature to drown if it stays underwater.

Parameters
timevalue from [0,20]

Here is the caller graph for this function:

void MWMechanics::NpcStats::setWerewolf ( bool  set)

Here is the caller graph for this function:

void MWMechanics::NpcStats::updateHealth ( )

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

Here is the caller graph for this function:

void MWMechanics::NpcStats::useSkill ( int  skillIndex,
const ESM::Class class_,
int  usageType = -1,
float  extraFactor = 1.f 
)

Increase skill by usage.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

int MWMechanics::NpcStats::mBounty
private
int MWMechanics::NpcStats::mCrimeId
private
int MWMechanics::NpcStats::mDisposition
private
std::set<std::string> MWMechanics::NpcStats::mExpelled
private
std::map<std::string, int> MWMechanics::NpcStats::mFactionRank
private

Used for the player only; NPCs have maximum one faction defined in their NPC record.

std::map<std::string, int> MWMechanics::NpcStats::mFactionReputation
private
bool MWMechanics::NpcStats::mIsWerewolf
private
int MWMechanics::NpcStats::mLevelProgress
private
int MWMechanics::NpcStats::mReputation
private
SkillValue MWMechanics::NpcStats::mSkill[ESM::Skill::Length]
private
std::vector<int> MWMechanics::NpcStats::mSkillIncreases
private
std::vector<int> MWMechanics::NpcStats::mSpecIncreases
private
float MWMechanics::NpcStats::mTimeToStartDrowning
private

Countdown to getting damage while underwater.

std::set<std::string> MWMechanics::NpcStats::mUsedIds
private
int MWMechanics::NpcStats::mWerewolfKills
private

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