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-06-16 14:17:42 +00:00
|
|
|
int mHello;
|
|
|
|
int mFight;
|
|
|
|
int mFlee;
|
|
|
|
int mAlarm;
|
2012-09-04 11:32:35 +00:00
|
|
|
AiSequence mAiSequence;
|
2012-09-15 15:12:42 +00:00
|
|
|
float mLevelHealthBonus;
|
2012-10-19 16:56:22 +00:00
|
|
|
bool mDead;
|
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;
|
|
|
|
|
|
|
|
int getHello() const;
|
|
|
|
|
|
|
|
int getFight() const;
|
|
|
|
|
|
|
|
int getFlee() const;
|
|
|
|
|
|
|
|
int getAlarm() const;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
void setHello(int value);
|
|
|
|
|
|
|
|
void setFight(int value);
|
|
|
|
|
|
|
|
void setFlee(int value);
|
|
|
|
|
|
|
|
void setAlarm(int value);
|
2012-09-04 11:32:35 +00:00
|
|
|
|
|
|
|
const AiSequence& getAiSequence() const;
|
|
|
|
|
|
|
|
AiSequence& getAiSequence();
|
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;
|
|
|
|
|
|
|
|
void resurrect();
|
2010-07-26 10:52:32 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|