You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3mp/apps/openmw/mwmechanics/npcstats.hpp

77 lines
2.0 KiB
C++

15 years ago
#ifndef GAME_MWMECHANICS_NPCSTATS_H
#define GAME_MWMECHANICS_NPCSTATS_H
#include <map>
#include <set>
#include <string>
15 years ago
#include "stat.hpp"
#include "drawstate.hpp"
namespace ESM
{
struct Class;
}
15 years ago
namespace MWMechanics
{
/// \brief Additional stats for NPCs
///
/// For non-NPC-specific stats, see the CreatureStats struct.
///
/// \note For technical reasons the spell list and the currently selected spell is also handled by
/// CreatureStats, even though they are actually NPC stats.
15 years ago
class NpcStats
15 years ago
{
public:
enum Flag
{
Flag_ForceRun = 1,
Flag_ForceSneak = 2,
Flag_Run = 4,
Flag_Sneak = 8
};
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.
/// \note the faction key must be in lowercase
std::map<std::string, int> mFactionRank;
14 years ago
DrawState_ mDrawState;
unsigned int mMovementFlags;
Stat<float> mSkill[27];
public:
14 years ago
NpcStats();
DrawState_ getDrawState() const;
void setDrawState (DrawState_ state);
bool getMovementFlag (Flag flag) const;
void setMovementFlag (Flag flag, bool state);
const Stat<float>& getSkill (int index) const;
Stat<float>& getSkill (int index);
std::map<std::string, int>& getFactionRanks();
const std::map<std::string, int>& getFactionRanks() const;
float getSkillGain (int skillIndex, const ESM::Class& class_, int usageType = -1,
int level = -1) const;
///< \param usageType: Usage specific factor, specified in the respective skill record;
/// -1: use a factor of 1.0 instead.
/// \param level Level to base calculation on; -1: use current level.
15 years ago
};
}
#endif