OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
creature.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWCLASS_CREATURE_H
2 #define GAME_MWCLASS_CREATURE_H
3 
4 #include "actor.hpp"
5 
6 namespace ESM
7 {
8  struct GameSetting;
9 }
10 
11 namespace MWClass
12 {
13  class Creature : public Actor
14  {
15  void ensureCustomData (const MWWorld::Ptr& ptr) const;
16 
17  virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
18 
19  static int getSndGenTypeFromName(const MWWorld::Ptr &ptr, const std::string &name);
20 
21  // cached GMSTs
22  struct GMST
23  {
37  };
38 
39  static const GMST& getGmst();
40 
41  public:
42 
43  virtual void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const;
45 
46  virtual std::string getName (const MWWorld::ConstPtr& ptr) const;
49 
50  virtual bool hasToolTip(const MWWorld::ConstPtr& ptr) const;
52 
53  virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::ConstPtr& ptr, int count) const;
55 
56  virtual MWMechanics::CreatureStats& getCreatureStats (const MWWorld::Ptr& ptr) const;
58 
59  virtual void hit(const MWWorld::Ptr& ptr, float attackStrength, int type) const;
60 
61  virtual void onHit(const MWWorld::Ptr &ptr, float damage, bool ishealth, const MWWorld::Ptr &object, const MWWorld::Ptr &attacker, const osg::Vec3f &hitPosition, bool successful) const;
62 
63  virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
64  const MWWorld::Ptr& actor) const;
66 
68  const MWWorld::Ptr& ptr) const;
70 
71  virtual MWWorld::InventoryStore& getInventoryStore (const MWWorld::Ptr& ptr) const;
73 
74  virtual bool hasInventoryStore (const MWWorld::Ptr &ptr) const;
75 
76  virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
78 
79  virtual float getCapacity (const MWWorld::Ptr& ptr) const;
82 
83  virtual float getArmorRating (const MWWorld::Ptr& ptr) const;
85 
86  virtual bool isEssential (const MWWorld::ConstPtr& ptr) const;
88 
89  virtual int getServices (const MWWorld::ConstPtr& actor) const;
90 
91  virtual bool isPersistent (const MWWorld::ConstPtr& ptr) const;
92 
93  virtual std::string getSoundIdFromSndGen(const MWWorld::Ptr &ptr, const std::string &name) const;
94 
95  virtual MWMechanics::Movement& getMovementSettings (const MWWorld::Ptr& ptr) const;
97 
98  float getSpeed (const MWWorld::Ptr& ptr) const;
99 
100  static void registerSelf();
101 
102  virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
103 
104  virtual void getModelsToPreload(const MWWorld::Ptr& ptr, std::vector<std::string>& models) const;
106 
107  virtual bool isBipedal (const MWWorld::ConstPtr &ptr) const;
108  virtual bool canFly (const MWWorld::ConstPtr &ptr) const;
109  virtual bool canSwim (const MWWorld::ConstPtr &ptr) const;
110  virtual bool canWalk (const MWWorld::ConstPtr &ptr) const;
111 
112  virtual int getSkill(const MWWorld::Ptr &ptr, int skill) const;
113 
115  virtual int getBloodTexture (const MWWorld::ConstPtr& ptr) const;
116 
117  virtual void readAdditionalState (const MWWorld::Ptr& ptr, const ESM::ObjectState& state) const;
119 
120  virtual void writeAdditionalState (const MWWorld::ConstPtr& ptr, ESM::ObjectState& state) const;
122 
123  virtual int getBaseGold(const MWWorld::ConstPtr& ptr) const;
124 
125  virtual void respawn (const MWWorld::Ptr& ptr) const;
126 
127  virtual void restock (const MWWorld::Ptr &ptr) const;
128 
129  virtual int getBaseFightRating(const MWWorld::ConstPtr &ptr) const;
130 
131  virtual void adjustScale(const MWWorld::ConstPtr& ptr, osg::Vec3f& scale, bool rendering) const;
133  };
134 }
135 
136 #endif
static int getSndGenTypeFromName(const MWWorld::Ptr &ptr, const std::string &name)
Definition: creature.cpp:637
virtual bool hasToolTip(const MWWorld::ConstPtr &ptr) const
Definition: creature.cpp:529
Definition: tooltips.hpp:18
virtual int getServices(const MWWorld::ConstPtr &actor) const
Definition: creature.cpp:565
virtual void getModelsToPreload(const MWWorld::Ptr &ptr, std::vector< std::string > &models) const
Get a list of models to preload that this object may use (directly or indirectly). default implementation: list getModel().
Definition: creature.cpp:188
virtual void adjustScale(const MWWorld::ConstPtr &ptr, osg::Vec3f &scale, bool rendering) const
Definition: creature.cpp:805
const ESM::GameSetting * fMinFlySpeed
Definition: creature.hpp:30
virtual void respawn(const MWWorld::Ptr &ptr) const
Definition: creature.cpp:760
static const GMST & getGmst()
Definition: creature.cpp:81
virtual MWWorld::ContainerStore & getContainerStore(const MWWorld::Ptr &ptr) const
Return container store.
Definition: creature.cpp:432
Common creature stats.
Definition: creaturestats.hpp:25
virtual std::string getScript(const MWWorld::ConstPtr &ptr) const
Return name of the script attached to ptr.
Definition: creature.cpp:452
Definition: inventorystore.hpp:40
const ESM::GameSetting * fSwimRunAthleticsMult
Definition: creature.hpp:33
const ESM::GameSetting * fEncumberedMoveEffect
Definition: creature.hpp:26
Class holding functionality common to Creature and NPC.
Definition: actor.hpp:14
Definition: renderinginterface.hpp:9
const ESM::GameSetting * iKnockDownOddsBase
Definition: creature.hpp:36
virtual int getBaseGold(const MWWorld::ConstPtr &ptr) const
Definition: creature.cpp:755
Definition: loadgmst.hpp:19
virtual bool isPersistent(const MWWorld::ConstPtr &ptr) const
Definition: creature.cpp:574
float getSpeed(const MWWorld::Ptr &ptr) const
Return movement speed.
Definition: creature.cpp:471
const ESM::GameSetting * fMaxWalkSpeedCreature
Definition: creature.hpp:25
const ESM::GameSetting * fSwimRunBase
Definition: creature.hpp:32
const ESM::GameSetting * fMaxFlySpeed
Definition: creature.hpp:31
virtual bool isEssential(const MWWorld::ConstPtr &ptr) const
Is ptr essential? (i.e. may losing ptr make the game unwinnable)
Definition: creature.cpp:459
virtual std::string getSoundIdFromSndGen(const MWWorld::Ptr &ptr, const std::string &name) const
Returns the sound ID for ptr of the given soundgen type.
Definition: creature.cpp:580
virtual bool canFly(const MWWorld::ConstPtr &ptr) const
Definition: creature.cpp:622
void ensureCustomData(const MWWorld::Ptr &ptr) const
Definition: creature.cpp:107
const ESM::GameSetting * fKnockDownMult
Definition: creature.hpp:34
virtual bool isBipedal(const MWWorld::ConstPtr &ptr) const
Definition: creature.cpp:617
const ESM::GameSetting * fBaseRunMultiplier
Definition: creature.hpp:29
<
Definition: objectstate.hpp:19
virtual void onHit(const MWWorld::Ptr &ptr, float damage, bool ishealth, const MWWorld::Ptr &object, const MWWorld::Ptr &attacker, const osg::Vec3f &hitPosition, bool successful) const
Definition: creature.cpp:326
virtual MWGui::ToolTipInfo getToolTipInfo(const MWWorld::ConstPtr &ptr, int count) const
Definition: creature.cpp:538
Desired movement for an actor.
Definition: movement.hpp:9
Mutable state of a cell.
Definition: cellstore.hpp:53
virtual std::string getName(const MWWorld::ConstPtr &ptr) const
Definition: creature.cpp:211
Pointer to a const LiveCellRef.
Definition: ptr.hpp:90
const ESM::GameSetting * fMinWalkSpeedCreature
Definition: creature.hpp:24
virtual float getArmorRating(const MWWorld::Ptr &ptr) const
Definition: creature.cpp:553
Definition: containerstore.hpp:41
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
Definition: creature.cpp:610
Definition: creature.hpp:22
virtual bool hasInventoryStore(const MWWorld::Ptr &ptr) const
Does this object have an inventory store, i.e. equipment slots? (default implementation: false) ...
Definition: creature.cpp:447
virtual int getSkill(const MWWorld::Ptr &ptr, int skill) const
Definition: creature.cpp:675
virtual MWMechanics::CreatureStats & getCreatureStats(const MWWorld::Ptr &ptr) const
Return creature stats.
Definition: creature.cpp:218
const ESM::GameSetting * iKnockDownOddsMult
Definition: creature.hpp:35
virtual void hit(const MWWorld::Ptr &ptr, float attackStrength, int type) const
Definition: creature.cpp:226
static void registerSelf()
Definition: creature.cpp:464
const ESM::GameSetting * fAthleticsRunBonus
Definition: creature.hpp:28
virtual bool canSwim(const MWWorld::ConstPtr &ptr) const
Definition: creature.cpp:627
virtual void writeAdditionalState(const MWWorld::ConstPtr &ptr, ESM::ObjectState &state) const
Write additional state from ptr into state.
Definition: creature.cpp:738
virtual MWWorld::InventoryStore & getInventoryStore(const MWWorld::Ptr &ptr) const
Return inventory store.
Definition: creature.cpp:439
virtual void restock(const MWWorld::Ptr &ptr) const
Definition: creature.cpp:791
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
Definition: creature.hpp:13
virtual void insertObjectRendering(const MWWorld::Ptr &ptr, const std::string &model, MWRender::RenderingInterface &renderingInterface) const
Add reference into a cell for rendering.
Definition: creature.cpp:171
virtual int getBloodTexture(const MWWorld::ConstPtr &ptr) const
Get a blood texture suitable for ptr (see Blood Texture 0-2 in Morrowind.ini)
Definition: creature.cpp:695
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const
Definition: creature.cpp:177
virtual bool canWalk(const MWWorld::ConstPtr &ptr) const
Definition: creature.cpp:632
virtual MWMechanics::Movement & getMovementSettings(const MWWorld::Ptr &ptr) const
Return desired movement.
Definition: creature.cpp:522
virtual boost::shared_ptr< MWWorld::Action > activate(const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const
Generate action for activation.
Definition: creature.cpp:411
virtual float getCapacity(const MWWorld::Ptr &ptr) const
Definition: creature.cpp:559
virtual void readAdditionalState(const MWWorld::Ptr &ptr, const ESM::ObjectState &state) const
Read additional state from state into ptr.
Definition: creature.cpp:706
const ESM::GameSetting * fSneakSpeedMultiplier
Definition: creature.hpp:27
const char * name
Definition: crashcatcher.cpp:59
virtual int getBaseFightRating(const MWWorld::ConstPtr &ptr) const
Definition: creature.cpp:799