2010-08-03 11:17:31 +00:00
|
|
|
#ifndef GAME_MWCLASS_NPC_H
|
|
|
|
#define GAME_MWCLASS_NPC_H
|
2010-08-03 11:03:08 +00:00
|
|
|
|
2010-08-03 11:17:31 +00:00
|
|
|
#include "../mwworld/class.hpp"
|
2010-08-03 11:03:08 +00:00
|
|
|
|
2013-02-15 09:27:57 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class GameSetting;
|
|
|
|
}
|
|
|
|
|
2010-08-03 11:17:31 +00:00
|
|
|
namespace MWClass
|
2010-08-03 11:03:08 +00:00
|
|
|
{
|
2010-08-03 11:17:31 +00:00
|
|
|
class Npc : public MWWorld::Class
|
2010-08-03 11:03:08 +00:00
|
|
|
{
|
2012-01-25 15:56:49 +00:00
|
|
|
void ensureCustomData (const MWWorld::Ptr& ptr) const;
|
|
|
|
|
2012-07-25 13:18:17 +00:00
|
|
|
virtual MWWorld::Ptr
|
2012-07-26 12:14:11 +00:00
|
|
|
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
2012-07-25 13:18:17 +00:00
|
|
|
|
2013-02-15 09:27:57 +00:00
|
|
|
static const ESM::GameSetting *fMinWalkSpeed;
|
|
|
|
static const ESM::GameSetting *fMaxWalkSpeed;
|
|
|
|
static const ESM::GameSetting *fEncumberedMoveEffect;
|
|
|
|
static const ESM::GameSetting *fSneakSpeedMultiplier;
|
|
|
|
static const ESM::GameSetting *fAthleticsRunBonus;
|
|
|
|
static const ESM::GameSetting *fBaseRunMultiplier;
|
|
|
|
static const ESM::GameSetting *fMinFlySpeed;
|
|
|
|
static const ESM::GameSetting *fMaxFlySpeed;
|
|
|
|
static const ESM::GameSetting *fSwimRunBase;
|
|
|
|
static const ESM::GameSetting *fSwimRunAthleticsMult;
|
2013-02-24 11:30:33 +00:00
|
|
|
static const ESM::GameSetting *fJumpEncumbranceBase;
|
|
|
|
static const ESM::GameSetting *fJumpEncumbranceMultiplier;
|
|
|
|
static const ESM::GameSetting *fJumpAcrobaticsBase;
|
|
|
|
static const ESM::GameSetting *fJumpAcroMultiplier;
|
|
|
|
static const ESM::GameSetting *fJumpRunMultiplier;
|
2013-02-15 09:27:57 +00:00
|
|
|
static const ESM::GameSetting *fWereWolfRunMult;
|
|
|
|
|
2010-08-03 11:03:08 +00:00
|
|
|
public:
|
2011-01-18 09:45:29 +00:00
|
|
|
|
2010-08-08 12:28:35 +00:00
|
|
|
virtual std::string getId (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Return ID of \a ptr
|
|
|
|
|
2011-11-12 04:01:12 +00:00
|
|
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
2010-08-14 08:02:54 +00:00
|
|
|
///< Add reference into a cell for rendering
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const;
|
2011-11-12 04:01:12 +00:00
|
|
|
|
2013-04-03 21:55:57 +00:00
|
|
|
virtual void adjustPosition(const MWWorld::Ptr& ptr) const;
|
|
|
|
|
2010-08-03 15:11:41 +00:00
|
|
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
|
|
|
/// can return an empty string.
|
|
|
|
|
2010-08-03 11:17:31 +00:00
|
|
|
virtual MWMechanics::CreatureStats& getCreatureStats (const MWWorld::Ptr& ptr) const;
|
2010-08-03 11:03:08 +00:00
|
|
|
///< Return creature stats
|
|
|
|
|
2010-08-19 10:49:13 +00:00
|
|
|
virtual MWMechanics::NpcStats& getNpcStats (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Return NPC stats
|
|
|
|
|
2012-01-28 10:45:55 +00:00
|
|
|
virtual MWWorld::ContainerStore& getContainerStore (const MWWorld::Ptr& ptr) const;
|
2010-08-04 12:37:23 +00:00
|
|
|
///< Return container store
|
|
|
|
|
2012-04-16 20:58:16 +00:00
|
|
|
virtual bool hasToolTip (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< @return true if this object has a tooltip when focused (default implementation: false)
|
|
|
|
|
2012-04-24 00:02:03 +00:00
|
|
|
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr& ptr) const;
|
2012-04-16 20:58:16 +00:00
|
|
|
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
|
|
|
|
2012-03-10 11:49:54 +00:00
|
|
|
virtual MWWorld::InventoryStore& getInventoryStore (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Return inventory store
|
|
|
|
|
2010-08-06 16:15:46 +00:00
|
|
|
virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
|
2012-04-23 13:27:03 +00:00
|
|
|
const MWWorld::Ptr& actor) const;
|
2010-08-06 16:15:46 +00:00
|
|
|
///< Generate action for activation
|
|
|
|
|
2010-08-05 13:40:03 +00:00
|
|
|
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Return name of the script attached to ptr
|
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
virtual void setForceStance (const MWWorld::Ptr& ptr, Stance stance, bool force) const;
|
2011-01-18 09:45:29 +00:00
|
|
|
///< Force or unforce a stance.
|
|
|
|
|
|
|
|
virtual void setStance (const MWWorld::Ptr& ptr, Stance stance, bool set) const;
|
|
|
|
///< Set or unset a stance.
|
|
|
|
|
|
|
|
virtual bool getStance (const MWWorld::Ptr& ptr, Stance stance, bool ignoreForce = false)
|
|
|
|
const;
|
2013-03-14 20:08:19 +00:00
|
|
|
///< Check if a stance is active or not.
|
2011-01-18 09:45:29 +00:00
|
|
|
|
|
|
|
virtual float getSpeed (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Return movement speed.
|
|
|
|
|
2013-02-24 11:30:33 +00:00
|
|
|
virtual float getJump(const MWWorld::Ptr &ptr) const;
|
|
|
|
///< Return jump velocity (not accounting for movement)
|
|
|
|
|
2011-02-03 10:37:17 +00:00
|
|
|
virtual MWMechanics::Movement& getMovementSettings (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Return desired movement.
|
|
|
|
|
|
|
|
virtual Ogre::Vector3 getMovementVector (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Return desired movement vector (determined based on movement settings,
|
|
|
|
/// stance and stats).
|
|
|
|
|
2013-03-31 08:29:24 +00:00
|
|
|
virtual Ogre::Vector3 getRotationVector (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Return desired rotations, as euler angles.
|
|
|
|
|
2012-05-15 20:31:52 +00:00
|
|
|
virtual float getCapacity (const MWWorld::Ptr& ptr) const;
|
2012-05-15 19:34:00 +00:00
|
|
|
///< Return total weight that fits into the object. Throws an exception, if the object can't
|
|
|
|
/// hold other objects.
|
|
|
|
|
|
|
|
virtual float getEncumbrance (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Returns total weight of objects inside this object (including modifications from magic
|
2012-05-15 19:17:00 +00:00
|
|
|
/// effects). Throws an exception, if the object can't hold other objects.
|
|
|
|
|
2013-03-17 21:29:12 +00:00
|
|
|
virtual float getArmorRating (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< @return combined armor rating of this actor
|
|
|
|
|
2012-07-13 07:16:27 +00:00
|
|
|
virtual bool apply (const MWWorld::Ptr& ptr, const std::string& id,
|
|
|
|
const MWWorld::Ptr& actor) const;
|
|
|
|
///< Apply \a id on \a ptr.
|
|
|
|
/// \param actor Actor that is resposible for the ID being applied to \a ptr.
|
|
|
|
/// \return Any effect?
|
|
|
|
|
2013-03-15 15:44:35 +00:00
|
|
|
virtual void adjustScale (const MWWorld::Ptr &ptr, float &scale) const;
|
|
|
|
|
2012-07-13 07:16:27 +00:00
|
|
|
virtual void skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType) const;
|
|
|
|
///< Inform actor \a ptr that a skill use has succeeded.
|
|
|
|
|
2012-07-10 09:15:46 +00:00
|
|
|
virtual void adjustRotation(const MWWorld::Ptr& ptr,float& x,float& y,float& z) const;
|
|
|
|
|
2012-10-27 11:33:54 +00:00
|
|
|
virtual bool isEssential (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Is \a ptr essential? (i.e. may losing \a ptr make the game unwinnable)
|
|
|
|
|
2010-08-03 11:03:08 +00:00
|
|
|
static void registerSelf();
|
2012-07-24 16:22:11 +00:00
|
|
|
|
|
|
|
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
2012-07-30 19:28:14 +00:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
isActor() const {
|
|
|
|
return true;
|
|
|
|
}
|
2010-08-03 11:03:08 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|