xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Engines::Jade::Creature Class Reference

#include <creature.h>

Inheritance diagram for Engines::Jade::Creature:
Inheritance graph
[legend]
Collaboration diagram for Engines::Jade::Creature:
Collaboration graph
[legend]

Public Member Functions

 Creature ()
 Create a dummy creature instance. More...
 
 Creature (const Aurora::GFF3Struct &creature)
 Load from a creature instance. More...
 
 ~Creature ()
 
void createFakePC ()
 Create a fake player character creature for testing purposes. More...
 
void show ()
 Show the creature's model. More...
 
void hide ()
 Hide the creature's model. More...
 
bool isPC () const
 Is the creature a player character? More...
 
int32 getAutoBalance () const
 
void setPosition (float x, float y, float z)
 Set the creature's position. More...
 
void setOrientation (float x, float y, float z, float angle)
 Set the creature's orientation. More...
 
void enter ()
 The cursor entered the creature. More...
 
void leave ()
 The cursor left the creature. More...
 
virtual void highlight (bool enabled)
 (Un)Highlight the creature. More...
 
- Public Member Functions inherited from Engines::Jade::Object
 Object (ObjectType type=kObjectTypeInvalid)
 
virtual ~Object ()
 
ObjectType getType () const
 Return the exact type of the object. More...
 
virtual void loadModel ()
 Load the object's model(s). More...
 
virtual void unloadModel ()
 Unload the object's model(s). More...
 
const std::list< uint32 > & getIDs () const
 Return the object's model IDs. More...
 
const Common::UStringgetName () const
 Return the object's name. More...
 
const Common::UStringgetDescription () const
 Return the object's description. More...
 
const Common::UStringgetConversation () const
 Return the object's default conversation (DLG). More...
 
Aurora::NWScript::ObjectgetPCSpeaker () const
 Return the PC currently speaking with this object. More...
 
void setPCSpeaker (Aurora::NWScript::Object *pc)
 Set the PC currently speaking with this object. More...
 
bool isStatic () const
 Is the object static (not manipulable at all)? More...
 
bool isUsable () const
 Can the object be used by the PC? More...
 
bool isActive () const
 Is the object currently active/available/visible? More...
 
bool isNoCollide () const
 Is collision checking disabled? More...
 
void setNoCollide (bool noCollide)
 Enable or disable collision checking. More...
 
bool isClickable () const
 Can the player click the object? More...
 
AreagetArea () const
 Return the area this object is currently in. More...
 
void setArea (Area *)
 Set the area this object is currently in. More...
 
virtual void getPosition (float &x, float &y, float &z) const
 Return the object's position within its area. More...
 
virtual void getOrientation (float &x, float &y, float &z, float &angle) const
 Return the object's orientation. More...
 
Location getLocation () const
 Create a Location out of the object's area, position and orientation. More...
 
virtual bool click (Object *triggerer=0)
 The object was clicked. More...
 
ObjectgetLastTriggerer () const
 Return the object that last triggered this object. More...
 
void speakString (int32 resref)
 Speak the specified string. More...
 
virtual void playAnimation (const Common::UString &animation="", bool restart=true, int32 loopCount=0)
 Play an object animation. More...
 
virtual void playAnimation (Animation animation)
 Play a default object animation. More...
 
- Public Member Functions inherited from Aurora::NWScript::Object
 Object ()
 
uint32 getID () const
 
const Common::UStringgetTag () const
 
- Public Member Functions inherited from Aurora::NWScript::VariableContainer
 VariableContainer ()
 
virtual ~VariableContainer ()
 
bool hasVariable (const Common::UString &var) const
 
VariablegetVariable (const Common::UString &var, Type type=kTypeVoid)
 
const VariablegetVariable (const Common::UString &var) const
 
void setVariable (const Common::UString &var, const Variable &value)
 
void removeVariable (const Common::UString &var)
 
void clearVariables ()
 
- Public Member Functions inherited from Engines::Jade::ScriptContainer
 ScriptContainer ()
 
 ~ScriptContainer ()
 
const Common::UStringgetScript (Script script) const
 
bool hasScript (Script script) const
 
bool runScript (Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 

Private Member Functions

void load (const Aurora::GFF3Struct &creature)
 
void loadBlueprint (const Aurora::GFF3Struct &gff)
 
void loadInstance (const Aurora::GFF3Struct &gff)
 
void loadAppearance ()
 
void loadBody ()
 
void loadHead ()
 

Private Attributes

bool _isPC
 Is the creature a PC? More...
 
int32 _autoBalance
 
uint32 _appearance
 The creature's general appearance. More...
 
uint32 _headType
 The creature's type of head if separate from the model. More...
 
Common::ScopedPtr< Graphics::Aurora::Model_model
 The creature's model. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Engines::Jade::ScriptContainer
static bool runScript (const Common::UString &script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
static bool runScript (const Common::UString &script, const Aurora::NWScript::ScriptState &state, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
- Protected Member Functions inherited from Engines::Jade::Object
void loadPositional (const Aurora::GFF3Struct &gff)
 Load the object's positional gff struct which contains the position and orientation. More...
 
- Protected Member Functions inherited from Engines::Jade::ScriptContainer
void clearScripts ()
 
void readScripts (const Aurora::GFF3Struct &gff)
 
void readScripts (const ScriptContainer &container)
 
- Protected Attributes inherited from Engines::Jade::Object
ObjectType _type
 The object's type. More...
 
Common::UString _name
 The object's display name. More...
 
Common::UString _description
 The object's description. More...
 
Common::UString _conversation
 The object's default conversation. More...
 
bool _static
 Is the object static? More...
 
bool _usable
 Is the object usable? More...
 
bool _active
 Is the object currently active/available/visible? More...
 
bool _noCollide
 Is collision checking for the object disabled? More...
 
std::list< uint32_ids
 The object's model IDs. More...
 
Aurora::NWScript::Object_pcSpeaker
 The current PC speaking with the object. More...
 
Area_area
 The area the object is currently in. More...
 
Object_lastTriggerer
 The object that last used this object. More...
 
float _position [3]
 The object's position. More...
 
float _orientation [4]
 The object's orientation. More...
 
- Protected Attributes inherited from Aurora::NWScript::Object
uint32 _id
 
Common::UString _tag
 

Detailed Description

Definition at line 42 of file creature.h.

Constructor & Destructor Documentation

◆ Creature() [1/2]

Engines::Jade::Creature::Creature ( )

Create a dummy creature instance.

Not playable as it is.

Definition at line 53 of file creature.cpp.

◆ Creature() [2/2]

Engines::Jade::Creature::Creature ( const Aurora::GFF3Struct creature)

Load from a creature instance.

Definition at line 47 of file creature.cpp.

References load().

Here is the call graph for this function:

◆ ~Creature()

Engines::Jade::Creature::~Creature ( )

Definition at line 57 of file creature.cpp.

Member Function Documentation

◆ createFakePC()

void Engines::Jade::Creature::createFakePC ( )

Create a fake player character creature for testing purposes.

Definition at line 195 of file creature.cpp.

References _isPC, Engines::Jade::Object::_name, Aurora::NWScript::Object::_tag, Common::UString::c_str(), and Common::UString::format().

Here is the call graph for this function:

◆ enter()

void Engines::Jade::Creature::enter ( )
virtual

The cursor entered the creature.

Reimplemented from Engines::Jade::Object.

Definition at line 202 of file creature.cpp.

References highlight().

Here is the call graph for this function:

◆ getAutoBalance()

int32 Engines::Jade::Creature::getAutoBalance ( ) const

Definition at line 74 of file creature.cpp.

References _autoBalance.

Referenced by Engines::Jade::Functions::getAutoBalance().

Here is the caller graph for this function:

◆ hide()

void Engines::Jade::Creature::hide ( )
virtual

Hide the creature's model.

Reimplemented from Engines::Jade::Object.

Definition at line 65 of file creature.cpp.

References _model.

◆ highlight()

void Engines::Jade::Creature::highlight ( bool  enabled)
virtual

(Un)Highlight the creature.

Reimplemented from Engines::Jade::Object.

Definition at line 210 of file creature.cpp.

References _model.

Referenced by enter(), and leave().

Here is the caller graph for this function:

◆ isPC()

bool Engines::Jade::Creature::isPC ( ) const

Is the creature a player character?

Definition at line 70 of file creature.cpp.

References _isPC.

Referenced by Engines::Jade::ObjectContainer::toPC().

Here is the caller graph for this function:

◆ leave()

void Engines::Jade::Creature::leave ( )
virtual

The cursor left the creature.

Reimplemented from Engines::Jade::Object.

Definition at line 206 of file creature.cpp.

References highlight().

Here is the call graph for this function:

◆ load()

void Engines::Jade::Creature::load ( const Aurora::GFF3Struct creature)
private

◆ loadAppearance()

void Engines::Jade::Creature::loadAppearance ( )
private

Definition at line 158 of file creature.cpp.

References loadBody(), and loadHead().

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadBlueprint()

void Engines::Jade::Creature::loadBlueprint ( const Aurora::GFF3Struct gff)
private

◆ loadBody()

void Engines::Jade::Creature::loadBody ( )
private

◆ loadHead()

void Engines::Jade::Creature::loadHead ( )
private

Definition at line 178 of file creature.cpp.

References _headType, _model, Aurora::TwoDARow::getString(), Engines::loadModelObject(), and TwoDAReg.

Referenced by loadAppearance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadInstance()

void Engines::Jade::Creature::loadInstance ( const Aurora::GFF3Struct gff)
private

Definition at line 150 of file creature.cpp.

References Engines::Jade::Object::_active, Aurora::GFF3Struct::getBool(), and Engines::Jade::Object::loadPositional().

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOrientation()

void Engines::Jade::Creature::setOrientation ( float  x,
float  y,
float  z,
float  angle 
)
virtual

Set the creature's orientation.

Reimplemented from Engines::Jade::Object.

Definition at line 86 of file creature.cpp.

References _model, Engines::Jade::Object::getOrientation(), and Engines::Jade::Object::setOrientation().

Here is the call graph for this function:

◆ setPosition()

void Engines::Jade::Creature::setPosition ( float  x,
float  y,
float  z 
)
virtual

Set the creature's position.

Reimplemented from Engines::Jade::Object.

Definition at line 78 of file creature.cpp.

References _model, Engines::Jade::Object::getPosition(), and Engines::Jade::Object::setPosition().

Here is the call graph for this function:

◆ show()

void Engines::Jade::Creature::show ( )
virtual

Show the creature's model.

Reimplemented from Engines::Jade::Object.

Definition at line 60 of file creature.cpp.

References _model.

Member Data Documentation

◆ _appearance

uint32 Engines::Jade::Creature::_appearance
private

The creature's general appearance.

Definition at line 84 of file creature.h.

Referenced by load(), loadBlueprint(), and loadBody().

◆ _autoBalance

int32 Engines::Jade::Creature::_autoBalance
private

Definition at line 82 of file creature.h.

Referenced by getAutoBalance(), and loadBlueprint().

◆ _headType

uint32 Engines::Jade::Creature::_headType
private

The creature's type of head if separate from the model.

Definition at line 85 of file creature.h.

Referenced by loadBlueprint(), and loadHead().

◆ _isPC

bool Engines::Jade::Creature::_isPC
private

Is the creature a PC?

Definition at line 80 of file creature.h.

Referenced by createFakePC(), and isPC().

◆ _model

Common::ScopedPtr<Graphics::Aurora::Model> Engines::Jade::Creature::_model
private

The creature's model.

Definition at line 87 of file creature.h.

Referenced by hide(), highlight(), loadBody(), loadHead(), setOrientation(), setPosition(), and show().


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