OpenMW
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes
MWClass::Npc Class Reference

#include <npc.hpp>

List of all members.

Public Member Functions

virtual std::string getId (const MWWorld::Ptr &ptr) const
 Return ID of ptr.
virtual void insertObjectRendering (const MWWorld::Ptr &ptr, MWRender::RenderingInterface &renderingInterface) const
 Add reference into a cell for rendering.
virtual void insertObject (const MWWorld::Ptr &ptr, MWWorld::PhysicsSystem &physics) const
 Add reference into a cell for rendering (default implementation: don't render anything).
virtual void adjustPosition (const MWWorld::Ptr &ptr) const
 Adjust position to stand on ground. Must be called post model load.
virtual std::string getName (const MWWorld::Ptr &ptr) const
virtual
MWMechanics::CreatureStats
getCreatureStats (const MWWorld::Ptr &ptr) const
 Return creature stats.
virtual MWMechanics::NpcStatsgetNpcStats (const MWWorld::Ptr &ptr) const
 Return NPC stats.
virtual MWWorld::ContainerStoregetContainerStore (const MWWorld::Ptr &ptr) const
 Return container store.
virtual bool hasToolTip (const MWWorld::Ptr &ptr) const
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr &ptr) const
virtual MWWorld::InventoryStoregetInventoryStore (const MWWorld::Ptr &ptr) const
 Return inventory store.
virtual void hit (const MWWorld::Ptr &ptr, int type) const
virtual void onHit (const MWWorld::Ptr &ptr, float damage, bool ishealth, const MWWorld::Ptr &object, const MWWorld::Ptr &attacker, bool successful) const
virtual void setActorHealth (const MWWorld::Ptr &ptr, float health, const MWWorld::Ptr &attacker) const
virtual boost::shared_ptr
< MWWorld::Action
activate (const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const
 Generate action for activation.
virtual std::string getScript (const MWWorld::Ptr &ptr) const
 Return name of the script attached to ptr.
virtual void setForceStance (const MWWorld::Ptr &ptr, Stance stance, bool force) const
 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
 Check if a stance is active or not.
virtual float getSpeed (const MWWorld::Ptr &ptr) const
 Return movement speed.
virtual float getJump (const MWWorld::Ptr &ptr) const
 Return jump velocity (not accounting for movement)
virtual float getFallDamage (const MWWorld::Ptr &ptr, float fallHeight) const
 Return amount of health points lost when falling.
virtual MWMechanics::MovementgetMovementSettings (const MWWorld::Ptr &ptr) const
 Return desired movement.
virtual Ogre::Vector3 getMovementVector (const MWWorld::Ptr &ptr) const
virtual Ogre::Vector3 getRotationVector (const MWWorld::Ptr &ptr) const
 Return desired rotations, as euler angles.
virtual float getCapacity (const MWWorld::Ptr &ptr) const
virtual float getEncumbrance (const MWWorld::Ptr &ptr) const
virtual float getArmorRating (const MWWorld::Ptr &ptr) const
virtual bool apply (const MWWorld::Ptr &ptr, const std::string &id, const MWWorld::Ptr &actor) const
virtual void adjustScale (const MWWorld::Ptr &ptr, float &scale) const
virtual void skillUsageSucceeded (const MWWorld::Ptr &ptr, int skill, int usageType) const
 Inform actor ptr that a skill use has succeeded.
virtual void adjustRotation (const MWWorld::Ptr &ptr, float &x, float &y, float &z) const
virtual bool isEssential (const MWWorld::Ptr &ptr) const
 Is ptr essential? (i.e. may losing ptr make the game unwinnable)
virtual int getServices (const MWWorld::Ptr &actor) const
virtual bool isPersistent (const MWWorld::Ptr &ptr) const
virtual std::string getSoundIdFromSndGen (const MWWorld::Ptr &ptr, const std::string &name) const
 Returns the sound ID for ptr of the given soundgen type.
virtual std::string getModel (const MWWorld::Ptr &ptr) const
virtual bool isActor () const
virtual bool isNpc () const

Static Public Member Functions

static void registerSelf ()

Private Member Functions

void ensureCustomData (const MWWorld::Ptr &ptr) const
virtual MWWorld::Ptr copyToCellImpl (const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const

Static Private Attributes

static const ESM::GameSettingfMinWalkSpeed
static const ESM::GameSettingfMaxWalkSpeed
static const ESM::GameSettingfEncumberedMoveEffect
static const ESM::GameSettingfSneakSpeedMultiplier
static const ESM::GameSettingfAthleticsRunBonus
static const ESM::GameSettingfBaseRunMultiplier
static const ESM::GameSettingfMinFlySpeed
static const ESM::GameSettingfMaxFlySpeed
static const ESM::GameSettingfSwimRunBase
static const ESM::GameSettingfSwimRunAthleticsMult
static const ESM::GameSettingfJumpEncumbranceBase
static const ESM::GameSettingfJumpEncumbranceMultiplier
static const ESM::GameSettingfJumpAcrobaticsBase
static const ESM::GameSettingfJumpAcroMultiplier
static const ESM::GameSettingfJumpRunMultiplier
static const ESM::GameSettingfWereWolfRunMult

Member Function Documentation

boost::shared_ptr< MWWorld::Action > MWClass::Npc::activate ( const MWWorld::Ptr ptr,
const MWWorld::Ptr actor 
) const [virtual]

Generate action for activation.

Reimplemented from MWWorld::Class.

void MWClass::Npc::adjustPosition ( const MWWorld::Ptr ptr) const [virtual]

Adjust position to stand on ground. Must be called post model load.

Reimplemented from MWWorld::Class.

void MWClass::Npc::adjustRotation ( const MWWorld::Ptr ptr,
float &  x,
float &  y,
float &  z 
) const [virtual]

Reimplemented from MWWorld::Class.

void MWClass::Npc::adjustScale ( const MWWorld::Ptr ptr,
float &  scale 
) const [virtual]

Reimplemented from MWWorld::Class.

bool MWClass::Npc::apply ( const MWWorld::Ptr ptr,
const std::string &  id,
const MWWorld::Ptr actor 
) const [virtual]

Apply id on ptr.

Parameters:
actorActor that is resposible for the ID being applied to ptr.
Returns:
Any effect?

Reimplemented from MWWorld::Class.

MWWorld::Ptr MWClass::Npc::copyToCellImpl ( const MWWorld::Ptr ptr,
MWWorld::CellStore cell 
) const [private, virtual]

Reimplemented from MWWorld::Class.

void MWClass::Npc::ensureCustomData ( const MWWorld::Ptr ptr) const [private]
float MWClass::Npc::getArmorRating ( const MWWorld::Ptr ptr) const [virtual]
Returns:
combined armor rating of this actor

Reimplemented from MWWorld::Class.

float MWClass::Npc::getCapacity ( const MWWorld::Ptr ptr) const [virtual]

Return total weight that fits into the object. Throws an exception, if the object can't hold other objects.

Reimplemented from MWWorld::Class.

Return container store.

Reimplemented from MWWorld::Class.

Return creature stats.

Reimplemented from MWWorld::Class.

float MWClass::Npc::getEncumbrance ( const MWWorld::Ptr ptr) const [virtual]

Returns total weight of objects inside this object (including modifications from magic effects). Throws an exception, if the object can't hold other objects.

Reimplemented from MWWorld::Class.

float MWClass::Npc::getFallDamage ( const MWWorld::Ptr ptr,
float  fallHeight 
) const [virtual]

Return amount of health points lost when falling.

Reimplemented from MWWorld::Class.

std::string MWClass::Npc::getId ( const MWWorld::Ptr ptr) const [virtual]

Return ID of ptr.

Reimplemented from MWWorld::Class.

Return inventory store.

Reimplemented from MWWorld::Class.

float MWClass::Npc::getJump ( const MWWorld::Ptr ptr) const [virtual]

Return jump velocity (not accounting for movement)

Reimplemented from MWWorld::Class.

std::string MWClass::Npc::getModel ( const MWWorld::Ptr ptr) const [virtual]

Reimplemented from MWWorld::Class.

Return desired movement.

Reimplemented from MWWorld::Class.

Ogre::Vector3 MWClass::Npc::getMovementVector ( const MWWorld::Ptr ptr) const [virtual]

Return desired movement vector (determined based on movement settings, stance and stats).

Reimplemented from MWWorld::Class.

std::string MWClass::Npc::getName ( const MWWorld::Ptr ptr) const [virtual]
Returns:
name (the one that is to be presented to the user; not the internal one); can return an empty string.

Implements MWWorld::Class.

MWMechanics::NpcStats & MWClass::Npc::getNpcStats ( const MWWorld::Ptr ptr) const [virtual]

Return NPC stats.

Reimplemented from MWWorld::Class.

Ogre::Vector3 MWClass::Npc::getRotationVector ( const MWWorld::Ptr ptr) const [virtual]

Return desired rotations, as euler angles.

Reimplemented from MWWorld::Class.

std::string MWClass::Npc::getScript ( const MWWorld::Ptr ptr) const [virtual]

Return name of the script attached to ptr.

Reimplemented from MWWorld::Class.

int MWClass::Npc::getServices ( const MWWorld::Ptr actor) const [virtual]

Reimplemented from MWWorld::Class.

std::string MWClass::Npc::getSoundIdFromSndGen ( const MWWorld::Ptr ptr,
const std::string &  type 
) const [virtual]

Returns the sound ID for ptr of the given soundgen type.

Reimplemented from MWWorld::Class.

float MWClass::Npc::getSpeed ( const MWWorld::Ptr ptr) const [virtual]

Return movement speed.

Reimplemented from MWWorld::Class.

bool MWClass::Npc::getStance ( const MWWorld::Ptr ptr,
Stance  stance,
bool  ignoreForce = false 
) const [virtual]

Check if a stance is active or not.

Reimplemented from MWWorld::Class.

Returns:
the content of the tool tip to be displayed. raises exception if the object has no tooltip.

Reimplemented from MWWorld::Class.

bool MWClass::Npc::hasToolTip ( const MWWorld::Ptr ptr) const [virtual]
Returns:
true if this object has a tooltip when focused (default implementation: false)
Todo:
We don't want tooltips for NPCs in combat mode.

Reimplemented from MWWorld::Class.

void MWClass::Npc::hit ( const MWWorld::Ptr ptr,
int  type 
) const [virtual]

Execute a melee hit, using the current weapon. This will check the relevant skills of the given attacker, and whoever is hit.

Parameters:
type- type of attack, one of the MWMechanics::CreatureStats::AttackType enums. ignored for creature attacks. (default implementation: throw an exceoption)

Reimplemented from MWWorld::Class.

void MWClass::Npc::insertObject ( const MWWorld::Ptr ptr,
MWWorld::PhysicsSystem physics 
) const [virtual]

Add reference into a cell for rendering (default implementation: don't render anything).

Reimplemented from MWWorld::Class.

void MWClass::Npc::insertObjectRendering ( const MWWorld::Ptr ptr,
MWRender::RenderingInterface renderingInterface 
) const [virtual]

Add reference into a cell for rendering.

Reimplemented from MWWorld::Class.

virtual bool MWClass::Npc::isActor ( ) const [inline, virtual]

Reimplemented from MWWorld::Class.

bool MWClass::Npc::isEssential ( const MWWorld::Ptr ptr) const [virtual]

Is ptr essential? (i.e. may losing ptr make the game unwinnable)

Reimplemented from MWWorld::Class.

virtual bool MWClass::Npc::isNpc ( ) const [inline, virtual]

Reimplemented from MWWorld::Class.

bool MWClass::Npc::isPersistent ( const MWWorld::Ptr ptr) const [virtual]

Reimplemented from MWWorld::Class.

void MWClass::Npc::onHit ( const MWWorld::Ptr ptr,
float  damage,
bool  ishealth,
const MWWorld::Ptr object,
const MWWorld::Ptr attacker,
bool  successful 
) const [virtual]

Alerts ptr that it's being hit for damage points to health if ishealth is true (else fatigue) by object (sword, arrow, etc). attacker specifies the actor responsible for the attack, and successful specifies if the hit is successful or not.

Reimplemented from MWWorld::Class.

void MWClass::Npc::registerSelf ( ) [static]
void MWClass::Npc::setActorHealth ( const MWWorld::Ptr ptr,
float  health,
const MWWorld::Ptr attacker 
) const [virtual]

Sets a new current health value for the actor, optionally specifying the object causing the change. Use this instead of using CreatureStats directly as this will make sure the correct dialog and actor states are properly handled when being hurt or healed. (default implementation: throw an exceoption)

Reimplemented from MWWorld::Class.

void MWClass::Npc::setForceStance ( const MWWorld::Ptr ptr,
Stance  stance,
bool  force 
) const [virtual]

Force or unforce a stance.

Reimplemented from MWWorld::Class.

void MWClass::Npc::setStance ( const MWWorld::Ptr ptr,
Stance  stance,
bool  set 
) const [virtual]

Set or unset a stance.

Reimplemented from MWWorld::Class.

void MWClass::Npc::skillUsageSucceeded ( const MWWorld::Ptr ptr,
int  skill,
int  usageType 
) const [virtual]

Inform actor ptr that a skill use has succeeded.

Reimplemented from MWWorld::Class.


Member Data Documentation

const ESM::GameSetting * MWClass::Npc::fMaxFlySpeed [static, private]
const ESM::GameSetting * MWClass::Npc::fMaxWalkSpeed [static, private]
const ESM::GameSetting * MWClass::Npc::fMinFlySpeed [static, private]
const ESM::GameSetting * MWClass::Npc::fMinWalkSpeed [static, private]
const ESM::GameSetting * MWClass::Npc::fSwimRunBase [static, private]

The documentation for this class was generated from the following files: