OpenMW
|
Additional stats for NPCs. More...
#include <npcstats.hpp>
Public Types | |
enum | Flag { Flag_ForceRun = 1, Flag_ForceSneak = 2, Flag_Run = 4, Flag_Sneak = 8 } |
Public Member Functions | |
NpcStats () | |
int | getProfit () const |
for mercenary companions. starts out as 0, and changes when items are added or removed through the UI. | |
void | modifyProfit (int diff) |
DrawState_ | getDrawState () const |
void | setDrawState (DrawState_ state) |
float | getAttackStrength () const |
When attacking, stores how strong the attack should be (0 = weakest, 1 = strongest) | |
void | setAttackStrength (float value) |
int | getBaseDisposition () const |
void | setBaseDisposition (int disposition) |
int | getReputation () const |
void | setReputation (int reputation) |
bool | getMovementFlag (Flag flag) const |
void | setMovementFlag (Flag flag, bool state) |
const Stat< float > & | getSkill (int index) const |
Stat< float > & | getSkill (int index) |
const std::map< std::string, int > & | getFactionRanks () const |
std::map< std::string, int > & | getFactionRanks () |
const std::set< std::string > & | getExpelled () const |
std::set< std::string > & | getExpelled () |
bool | isSameFaction (const NpcStats &npcStats) const |
Do *this and npcStats share a faction? | |
float | getSkillGain (int skillIndex, const ESM::Class &class_, int usageType=-1, int level=-1) const |
void | useSkill (int skillIndex, const ESM::Class &class_, int usageType=-1) |
Increase skill by usage. | |
void | increaseSkill (int skillIndex, const ESM::Class &class_, bool preserveProgress) |
int | getLevelProgress () const |
int | getLevelupAttributeMultiplier (int attribute) const |
void | levelUp () |
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 | isVampire () const |
void | setVampire (bool set) |
bool | hasSkillsForRank (const std::string &factionId, int rank) const |
bool | isWerewolf () const |
void | setWerewolf (bool set) |
int | getWerewolfKills () const |
float | getTimeToStartDrowning () const |
void | setTimeToStartDrowning (float time) |
Private Attributes | |
std::map< std::string, int > | mFactionRank |
DrawState_ | mDrawState |
int | mDisposition |
unsigned int | mMovementFlags |
Stat< float > | mSkill [27] |
Stat< float > | mWerewolfSkill [27] |
int | mBounty |
std::set< std::string > | mExpelled |
std::map< std::string, int > | mFactionReputation |
bool | mVampire |
int | mReputation |
int | mWerewolfKills |
int | mProfit |
float | mAttackStrength |
int | mLevelProgress |
std::vector< int > | mSkillIncreases |
std::set< std::string > | mUsedIds |
float | mTimeToStartDrowning |
Countdown to getting damage while underwater. | |
float | mLastDrowningHit |
time since last hit from drowning |
Additional stats for NPCs.
void MWMechanics::NpcStats::flagAsUsed | ( | const std::string & | id | ) |
float MWMechanics::NpcStats::getAttackStrength | ( | ) | const |
When attacking, stores how strong the attack should be (0 = weakest, 1 = strongest)
int MWMechanics::NpcStats::getBaseDisposition | ( | ) | const |
int MWMechanics::NpcStats::getBounty | ( | ) | const |
const std::set< std::string > & MWMechanics::NpcStats::getExpelled | ( | ) | const |
std::set< std::string > & MWMechanics::NpcStats::getExpelled | ( | ) |
const std::map< std::string, int > & MWMechanics::NpcStats::getFactionRanks | ( | ) | const |
std::map< std::string, int > & MWMechanics::NpcStats::getFactionRanks | ( | ) |
int MWMechanics::NpcStats::getFactionReputation | ( | const std::string & | faction | ) | const |
int MWMechanics::NpcStats::getLevelProgress | ( | ) | const |
int MWMechanics::NpcStats::getLevelupAttributeMultiplier | ( | int | attribute | ) | const |
bool MWMechanics::NpcStats::getMovementFlag | ( | Flag | flag | ) | const |
int MWMechanics::NpcStats::getProfit | ( | ) | const |
for mercenary companions. starts out as 0, and changes when items are added or removed through the UI.
int MWMechanics::NpcStats::getReputation | ( | ) | const |
const MWMechanics::Stat< float > & MWMechanics::NpcStats::getSkill | ( | int | index | ) | const |
MWMechanics::Stat< float > & MWMechanics::NpcStats::getSkill | ( | int | index | ) |
float MWMechanics::NpcStats::getSkillGain | ( | int | skillIndex, |
const ESM::Class & | class_, | ||
int | usageType = -1 , |
||
int | level = -1 |
||
) | const |
usageType,: | Usage specific factor, specified in the respective skill record; -1: use a factor of 1.0 instead. |
level | Level to base calculation on; -1: use current level. |
float MWMechanics::NpcStats::getTimeToStartDrowning | ( | ) | const |
int MWMechanics::NpcStats::getWerewolfKills | ( | ) | const |
bool MWMechanics::NpcStats::hasBeenUsed | ( | const std::string & | id | ) | const |
bool MWMechanics::NpcStats::hasSkillsForRank | ( | const std::string & | factionId, |
int | rank | ||
) | const |
void MWMechanics::NpcStats::increaseSkill | ( | int | skillIndex, |
const ESM::Class & | class_, | ||
bool | preserveProgress | ||
) |
bool MWMechanics::NpcStats::isSameFaction | ( | const NpcStats & | npcStats | ) | const |
Do *this and npcStats share a faction?
bool MWMechanics::NpcStats::isVampire | ( | ) | const |
bool MWMechanics::NpcStats::isWerewolf | ( | ) | const |
void MWMechanics::NpcStats::levelUp | ( | ) |
Reimplemented from MWMechanics::CreatureStats.
void MWMechanics::NpcStats::modifyProfit | ( | int | diff | ) |
void MWMechanics::NpcStats::setAttackStrength | ( | float | value | ) |
void MWMechanics::NpcStats::setBaseDisposition | ( | int | disposition | ) |
void MWMechanics::NpcStats::setBounty | ( | int | bounty | ) |
void MWMechanics::NpcStats::setDrawState | ( | DrawState_ | state | ) |
void MWMechanics::NpcStats::setFactionReputation | ( | const std::string & | faction, |
int | value | ||
) |
void MWMechanics::NpcStats::setMovementFlag | ( | Flag | flag, |
bool | state | ||
) |
void MWMechanics::NpcStats::setReputation | ( | int | reputation | ) |
void MWMechanics::NpcStats::setTimeToStartDrowning | ( | float | time | ) |
Sets time left for the creature to drown if it stays underwater.
time | value from [0,20] |
void MWMechanics::NpcStats::setVampire | ( | bool | set | ) |
void MWMechanics::NpcStats::setWerewolf | ( | bool | set | ) |
void MWMechanics::NpcStats::useSkill | ( | int | skillIndex, |
const ESM::Class & | class_, | ||
int | usageType = -1 |
||
) |
Increase skill by usage.
float MWMechanics::NpcStats::mAttackStrength [private] |
int MWMechanics::NpcStats::mBounty [private] |
int MWMechanics::NpcStats::mDisposition [private] |
DrawState_ MWMechanics::NpcStats::mDrawState [private] |
std::set<std::string> MWMechanics::NpcStats::mExpelled [private] |
std::map<std::string, int> MWMechanics::NpcStats::mFactionRank [private] |
NPCs other than the player can only have one faction. But for the sake of consistency we use the same data structure for the PC and the NPCs.
std::map<std::string, int> MWMechanics::NpcStats::mFactionReputation [private] |
float MWMechanics::NpcStats::mLastDrowningHit [private] |
time since last hit from drowning
int MWMechanics::NpcStats::mLevelProgress [private] |
unsigned int MWMechanics::NpcStats::mMovementFlags [private] |
int MWMechanics::NpcStats::mProfit [private] |
int MWMechanics::NpcStats::mReputation [private] |
Stat<float> MWMechanics::NpcStats::mSkill[27] [private] |
std::vector<int> MWMechanics::NpcStats::mSkillIncreases [private] |
float MWMechanics::NpcStats::mTimeToStartDrowning [private] |
Countdown to getting damage while underwater.
std::set<std::string> MWMechanics::NpcStats::mUsedIds [private] |
bool MWMechanics::NpcStats::mVampire [private] |
int MWMechanics::NpcStats::mWerewolfKills [private] |
Stat<float> MWMechanics::NpcStats::mWerewolfSkill[27] [private] |