2010-07-26 10:52:32 +00:00
|
|
|
#ifndef GAME_MWMECHANICS_CREATURESTATS_H
|
|
|
|
#define GAME_MWMECHANICS_CREATURESTATS_H
|
|
|
|
|
2010-09-30 12:28:01 +00:00
|
|
|
#include <set>
|
|
|
|
#include <string>
|
2012-07-22 14:29:54 +00:00
|
|
|
#include <stdexcept>
|
2010-09-30 12:28:01 +00:00
|
|
|
|
2010-07-26 10:52:32 +00:00
|
|
|
#include "stat.hpp"
|
2010-09-30 13:42:28 +00:00
|
|
|
#include "magiceffects.hpp"
|
2012-04-11 17:03:36 +00:00
|
|
|
#include "spells.hpp"
|
2012-05-19 13:01:07 +00:00
|
|
|
#include "activespells.hpp"
|
2012-09-04 11:32:35 +00:00
|
|
|
#include "aisequence.hpp"
|
2010-07-26 10:52:32 +00:00
|
|
|
|
|
|
|
namespace MWMechanics
|
|
|
|
{
|
2012-07-22 14:29:54 +00:00
|
|
|
/// \brief Common creature stats
|
|
|
|
///
|
|
|
|
///
|
|
|
|
class CreatureStats
|
2010-07-26 10:52:32 +00:00
|
|
|
{
|
|
|
|
Stat<int> mAttributes[8];
|
2012-09-15 15:12:42 +00:00
|
|
|
DynamicStat<float> mDynamic[3]; // health, magicka, fatigue
|
2010-09-15 13:32:35 +00:00
|
|
|
int mLevel;
|
2012-04-11 17:03:36 +00:00
|
|
|
Spells mSpells;
|
2012-05-19 13:01:07 +00:00
|
|
|
ActiveSpells mActiveSpells;
|
2010-09-30 13:42:28 +00:00
|
|
|
MagicEffects mMagicEffects;
|
2012-11-10 10:38:37 +00:00
|
|
|
int mAiSettings[4];
|
2012-09-04 11:32:35 +00:00
|
|
|
AiSequence mAiSequence;
|
2012-09-15 15:12:42 +00:00
|
|
|
float mLevelHealthBonus;
|
2012-11-10 12:20:41 +00:00
|
|
|
bool mDead;
|
2013-03-18 09:46:45 +00:00
|
|
|
bool mDied;
|
2012-11-10 12:20:41 +00:00
|
|
|
int mFriendlyHits;
|
|
|
|
bool mTalkedTo;
|
2012-11-15 19:00:27 +00:00
|
|
|
bool mAlarmed;
|
|
|
|
bool mAttacked;
|
|
|
|
bool mHostile;
|
2012-09-15 15:12:42 +00:00
|
|
|
|
2012-07-22 14:29:54 +00:00
|
|
|
public:
|
2012-09-15 15:12:42 +00:00
|
|
|
CreatureStats();
|
2012-07-22 14:29:54 +00:00
|
|
|
|
|
|
|
const Stat<int> & getAttribute(int index) const;
|
|
|
|
|
2012-09-15 15:12:42 +00:00
|
|
|
const DynamicStat<float> & getHealth() const;
|
2012-07-22 14:29:54 +00:00
|
|
|
|
2012-09-15 15:12:42 +00:00
|
|
|
const DynamicStat<float> & getMagicka() const;
|
2012-07-22 14:29:54 +00:00
|
|
|
|
2012-09-15 15:12:42 +00:00
|
|
|
const DynamicStat<float> & getFatigue() const;
|
2012-07-22 14:29:54 +00:00
|
|
|
|
2012-10-19 11:10:06 +00:00
|
|
|
const DynamicStat<float> & getDynamic (int index) const;
|
|
|
|
|
2012-07-22 14:29:54 +00:00
|
|
|
const Spells & getSpells() const;
|
|
|
|
|
|
|
|
const ActiveSpells & getActiveSpells() const;
|
|
|
|
|
|
|
|
const MagicEffects & getMagicEffects() const;
|
|
|
|
|
|
|
|
int getLevel() const;
|
|
|
|
|
2012-11-10 10:38:37 +00:00
|
|
|
int getAiSetting (int index) const;
|
|
|
|
///< 0: hello, 1 fight, 2 flee, 3 alarm
|
2012-07-22 14:29:54 +00:00
|
|
|
|
|
|
|
Stat<int> & getAttribute(int index);
|
|
|
|
|
|
|
|
Spells & getSpells();
|
|
|
|
|
|
|
|
ActiveSpells & getActiveSpells();
|
|
|
|
|
|
|
|
MagicEffects & getMagicEffects();
|
|
|
|
|
|
|
|
void setAttribute(int index, const Stat<int> &value);
|
|
|
|
|
2012-09-15 15:12:42 +00:00
|
|
|
void setHealth(const DynamicStat<float> &value);
|
2012-07-22 14:29:54 +00:00
|
|
|
|
2012-09-15 15:12:42 +00:00
|
|
|
void setMagicka(const DynamicStat<float> &value);
|
2012-07-22 14:29:54 +00:00
|
|
|
|
2012-09-15 15:12:42 +00:00
|
|
|
void setFatigue(const DynamicStat<float> &value);
|
2012-07-22 14:29:54 +00:00
|
|
|
|
2012-10-19 11:10:06 +00:00
|
|
|
void setDynamic (int index, const DynamicStat<float> &value);
|
|
|
|
|
2012-07-22 14:29:54 +00:00
|
|
|
void setSpells(const Spells &spells);
|
|
|
|
|
|
|
|
void setActiveSpells(const ActiveSpells &active);
|
|
|
|
|
|
|
|
void setMagicEffects(const MagicEffects &effects);
|
|
|
|
|
|
|
|
void setLevel(int level);
|
|
|
|
|
2012-11-10 10:38:37 +00:00
|
|
|
void setAiSetting (int index, int value);
|
|
|
|
///< 0: hello, 1 fight, 2 flee, 3 alarm
|
2012-11-15 19:00:27 +00:00
|
|
|
|
2012-09-04 11:32:35 +00:00
|
|
|
const AiSequence& getAiSequence() const;
|
2012-11-15 19:00:27 +00:00
|
|
|
|
2012-09-04 11:32:35 +00:00
|
|
|
AiSequence& getAiSequence();
|
2012-11-15 19:00:27 +00:00
|
|
|
|
2012-09-13 08:45:32 +00:00
|
|
|
float getFatigueTerm() const;
|
|
|
|
///< Return effective fatigue
|
2012-09-15 15:12:42 +00:00
|
|
|
|
|
|
|
// small hack to allow the fact that Health permanently increases by 10% of endurance on each level up
|
|
|
|
void increaseLevelHealthBonus(float value);
|
|
|
|
float getLevelHealthBonus() const;
|
2012-10-19 16:56:22 +00:00
|
|
|
|
|
|
|
bool isDead() const;
|
2012-11-15 19:00:27 +00:00
|
|
|
|
2013-03-18 09:46:45 +00:00
|
|
|
bool hasDied() const;
|
|
|
|
|
|
|
|
void clearHasDied();
|
|
|
|
|
2012-10-19 16:56:22 +00:00
|
|
|
void resurrect();
|
2012-11-15 19:00:27 +00:00
|
|
|
|
2012-11-09 17:16:29 +00:00
|
|
|
bool hasCommonDisease() const;
|
|
|
|
|
2012-11-10 12:20:41 +00:00
|
|
|
bool hasBlightDisease() const;
|
2012-11-15 19:00:27 +00:00
|
|
|
|
2012-11-10 12:20:41 +00:00
|
|
|
int getFriendlyHits() const;
|
|
|
|
///< Number of friendly hits received.
|
2012-11-15 19:00:27 +00:00
|
|
|
|
2012-11-10 12:20:41 +00:00
|
|
|
void friendlyHit();
|
|
|
|
///< Increase number of friendly hits by one.
|
2012-11-15 19:00:27 +00:00
|
|
|
|
2012-11-10 12:20:41 +00:00
|
|
|
bool hasTalkedToPlayer() const;
|
|
|
|
///< Has this creature talked with the player before?
|
2012-11-15 19:00:27 +00:00
|
|
|
|
2012-11-10 12:20:41 +00:00
|
|
|
void talkedToPlayer();
|
2012-11-15 19:00:27 +00:00
|
|
|
|
|
|
|
bool isAlarmed() const;
|
|
|
|
|
|
|
|
void setAlarmed (bool alarmed);
|
|
|
|
|
|
|
|
bool getAttacked() const;
|
|
|
|
|
|
|
|
void setAttacked (bool attacked);
|
|
|
|
|
|
|
|
bool isHostile() const;
|
|
|
|
|
|
|
|
void setHostile (bool hostile);
|
|
|
|
|
|
|
|
bool getCreatureTargetted() const;
|
2010-07-26 10:52:32 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|