xoreos
0.0.5
|
#include <creature.h>
Classes | |
struct | EquipItem |
An item equipped by the creature. More... | |
Public Member Functions | |
Creature () | |
Create a dummy creature instance. More... | |
Creature (const Aurora::GFF3Struct &placeable) | |
Load from a placeable 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... | |
void | enter () |
The cursor entered the creature. More... | |
void | leave () |
The cursor left the creature. More... | |
void | highlight (bool enabled) |
(Un)Highlight the creature. More... | |
bool | click (Object *triggerer=0) |
The creature was clicked. More... | |
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... | |
Public Member Functions inherited from Engines::DragonAge::Object | |
Object (ObjectType type=kObjectTypeInvalid) | |
virtual | ~Object () |
ObjectType | getType () const |
Return the exact type of the object. More... | |
const std::list< uint32 > & | getIDs () const |
Return the object's model IDs. More... | |
const Common::UString & | getResRef () const |
Return the object's resource reference. More... | |
const Aurora::LocString & | getName () const |
Return the object's name. More... | |
const Aurora::LocString & | getDescription () const |
Return the object's description. More... | |
const Common::UString & | getConversation () const |
Return the object's default conversation (DLG). More... | |
const Common::UString & | getNonLocalizedName () const |
Return the object's non-localized name. More... | |
void | setNonLocalizedName (const Common::UString &name) |
Set the object's non-localized name. 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 | isClickable () const |
Can the player click the object? 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... | |
Public Member Functions inherited from Aurora::NWScript::Object | |
Object () | |
uint32 | getID () const |
const Common::UString & | getTag () const |
Public Member Functions inherited from Aurora::NWScript::VariableContainer | |
VariableContainer () | |
virtual | ~VariableContainer () |
bool | hasVariable (const Common::UString &var) const |
Variable & | getVariable (const Common::UString &var, Type type=kTypeVoid) |
const Variable & | getVariable (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::DragonAge::ScriptContainer | |
ScriptContainer () | |
~ScriptContainer () | |
const Common::UString & | getScript () const |
bool | hasScript () const |
void | enableEvent (EventType event, bool enabled) |
Enable/Disable the handling of a specific event. More... | |
void | enableEvents (bool enabled) |
Enable/Disable the handling of all events. More... | |
bool | runScript (EventType event, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference()) |
bool | runScript (Event &event) |
Private Types | |
typedef std::vector< EquipItem > | Items |
typedef Common::PtrList< Graphics::Aurora::Model > | Models |
Private Member Functions | |
void | init () |
void | load (const Aurora::GFF3Struct &placeable) |
void | load (const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint) |
void | loadProperties (const Aurora::GFF3Struct &gff) |
void | loadModelsSimple (const Aurora::GDAFile &gda, size_t row) |
void | loadModelsWelded (const Aurora::GDAFile &gda, size_t row) |
void | loadModelsHead (const Aurora::GDAFile &gda, size_t row) |
void | loadModelsParts (const Aurora::GDAFile &gda, size_t row) |
void | loadModelsHeadMorph (bool loadHair=true) |
void | loadModelsHeadList (const Aurora::GDAFile &gda, size_t row, bool loadHair=true) |
Common::UString | findEquipModel (InventorySlot slot, const Common::UString &prefix, uint8 *armorType=0) const |
Static Private Member Functions | |
static Common::UString | createModelPrefix (const Aurora::GDAFile &gda, size_t row, uint8 gender) |
static Common::UString | createModelPart (const Aurora::GDAFile &gda, size_t row, const Common::UString &prefix) |
Private Attributes | |
bool | _isPC |
Is the creature a PC? More... | |
uint32 | _appearanceID |
The creature's appearance; index into the Appearances MGDA. More... | |
uint8 | _appearanceGender |
The gender of the creature's model files. More... | |
Common::UString | _headMorph |
Name of the morph file describing the creature's head. More... | |
uint32 | _partVariation [kPartVariationCount] |
Indices into the MGDAs describing the creature's head model parts. More... | |
Items | _items |
All item the creature has currently equipped. More... | |
Models | _models |
The models making up this creature. More... | |
Static Private Attributes | |
static const size_t | kPartVariationCount = 4 |
Max number of model parts for a creature's head. More... | |
Definition at line 49 of file creature.h.
|
private |
Definition at line 103 of file creature.h.
|
private |
Definition at line 105 of file creature.h.
Engines::DragonAge::Creature::Creature | ( | ) |
Create a dummy creature instance.
Not playable as it is.
Definition at line 66 of file creature.cpp.
References init().
Engines::DragonAge::Creature::Creature | ( | const Aurora::GFF3Struct & | placeable | ) |
Load from a placeable instance.
Engines::DragonAge::Creature::~Creature | ( | ) |
Definition at line 76 of file creature.cpp.
References hide().
|
virtual |
The creature was clicked.
Reimplemented from Engines::DragonAge::Object.
Definition at line 145 of file creature.cpp.
References Engines::DragonAge::kEventTypeClick, Engines::DragonAge::kEventTypeDialogue, and Engines::DragonAge::ScriptContainer::runScript().
void Engines::DragonAge::Creature::createFakePC | ( | ) |
Create a fake player character creature for testing purposes.
Definition at line 120 of file creature.cpp.
References _isPC, Engines::DragonAge::Object::_name, Aurora::NWScript::Object::_tag, Common::UString::c_str(), Engines::DragonAge::ScriptContainer::enableEvents(), Common::UString::format(), Aurora::LocString::getString(), LangMan, and Aurora::LocString::setString().
Referenced by Engines::DragonAge::Game::runCampaigns().
|
staticprivate |
Definition at line 177 of file creature.cpp.
References Common::UString::empty(), Aurora::GDAFile::getString(), and Aurora::GDAFile::kInvalidRow.
Referenced by findEquipModel(), loadModelsHeadList(), and loadModelsParts().
|
staticprivate |
Definition at line 162 of file creature.cpp.
References ARRAYSIZE, Common::UString::empty(), Aurora::GDAFile::getString(), and Aurora::GDAFile::kInvalidRow.
Referenced by loadModelsHead(), loadModelsHeadList(), and loadModelsParts().
|
virtual |
The cursor entered the creature.
Reimplemented from Engines::DragonAge::Object.
Definition at line 129 of file creature.cpp.
References Engines::DragonAge::Object::_description, Engines::DragonAge::Object::_name, Aurora::NWScript::Object::_tag, Common::UString::c_str(), Aurora::LocString::getString(), highlight(), and status().
|
private |
Definition at line 347 of file creature.cpp.
References _items, createModelPart(), Aurora::GDAFile::findRow(), Aurora::GDAFile::getInt(), Engines::DragonAge::getMGDA(), Aurora::kFileTypeUTI, Aurora::GDAFile::kInvalidRow, Engines::DragonAge::kUTIID, and Engines::DragonAge::kWorksheetItems.
Referenced by loadModelsHead(), and loadModelsParts().
|
virtual |
Hide the creature's model.
Reimplemented from Engines::DragonAge::Object.
Definition at line 111 of file creature.cpp.
References _models.
Referenced by ~Creature().
|
virtual |
(Un)Highlight the creature.
Reimplemented from Engines::DragonAge::Object.
Definition at line 140 of file creature.cpp.
References _models.
Referenced by enter(), and leave().
|
private |
Definition at line 80 of file creature.cpp.
References _appearanceGender, _appearanceID, _isPC, _partVariation, and kPartVariationCount.
Referenced by Creature().
bool Engines::DragonAge::Creature::isPC | ( | ) | const |
|
virtual |
The cursor left the creature.
Reimplemented from Engines::DragonAge::Object.
Definition at line 136 of file creature.cpp.
References highlight().
|
private |
|
private |
|
private |
Definition at line 208 of file creature.cpp.
References _appearanceGender, _headMorph, _models, createModelPrefix(), Common::UString::empty(), findEquipModel(), Aurora::GDAFile::getString(), Engines::DragonAge::kInventorySlotHead, Engines::loadModelObject(), loadModelsHeadList(), and loadModelsHeadMorph().
|
private |
Definition at line 256 of file creature.cpp.
References _appearanceGender, _models, _partVariation, createModelPart(), createModelPrefix(), Aurora::GDAFile::findRow(), Aurora::GDAFile::getInt(), Engines::DragonAge::getMGDA(), Aurora::GDAFile::kInvalidRow, kPartVariationCount, and Engines::loadModelObject().
Referenced by loadModelsHead(), and loadModelsParts().
|
private |
Definition at line 232 of file creature.cpp.
References _headMorph, _models, Common::debugTag(), Aurora::kFileTypeMOR, Aurora::GFF4FieldNamesEnum::kGFF4MorphParts, Engines::DragonAge::kMORPID, Engines::DragonAge::kVersion01, and Engines::loadModelObject().
Referenced by loadModelsHead(), and loadModelsParts().
|
private |
Definition at line 284 of file creature.cpp.
References _appearanceGender, _headMorph, _models, createModelPart(), createModelPrefix(), Common::UString::empty(), findEquipModel(), Aurora::GDAFile::findRow(), Engines::DragonAge::getMGDA(), Aurora::GDAFile::getString(), Engines::DragonAge::kInventorySlotBoots, Engines::DragonAge::kInventorySlotChest, Engines::DragonAge::kInventorySlotGloves, Engines::DragonAge::kInventorySlotHead, Engines::DragonAge::kWorksheetNakedVariations, Engines::loadModelObject(), loadModelsHeadList(), and loadModelsHeadMorph().
|
private |
Definition at line 192 of file creature.cpp.
References _models, Aurora::GDAFile::getString(), and Engines::loadModelObject().
|
private |
Definition at line 200 of file creature.cpp.
References _models, Aurora::GDAFile::getString(), and Engines::loadModelObject().
|
private |
|
virtual |
Set the creature's orientation.
Reimplemented from Engines::DragonAge::Object.
Definition at line 98 of file creature.cpp.
References _models, Engines::DragonAge::Object::getOrientation(), and Engines::DragonAge::Object::setOrientation().
|
virtual |
Set the creature's position.
Reimplemented from Engines::DragonAge::Object.
Definition at line 90 of file creature.cpp.
References _models, Engines::DragonAge::Object::getPosition(), and Engines::DragonAge::Object::setPosition().
Referenced by Engines::DragonAge::Campaign::movePC().
|
virtual |
Show the creature's model.
Reimplemented from Engines::DragonAge::Object.
Definition at line 106 of file creature.cpp.
References _models.
|
private |
The gender of the creature's model files.
Definition at line 113 of file creature.h.
Referenced by init(), loadModelsHead(), loadModelsHeadList(), and loadModelsParts().
|
private |
The creature's appearance; index into the Appearances MGDA.
Definition at line 111 of file creature.h.
Referenced by init().
|
private |
Name of the morph file describing the creature's head.
Definition at line 116 of file creature.h.
Referenced by loadModelsHead(), loadModelsHeadMorph(), and loadModelsParts().
|
private |
Is the creature a PC?
Definition at line 108 of file creature.h.
Referenced by createFakePC(), init(), and isPC().
|
private |
All item the creature has currently equipped.
Definition at line 121 of file creature.h.
Referenced by findEquipModel().
|
private |
The models making up this creature.
Definition at line 124 of file creature.h.
Referenced by hide(), highlight(), loadModelsHead(), loadModelsHeadList(), loadModelsHeadMorph(), loadModelsParts(), loadModelsSimple(), loadModelsWelded(), setOrientation(), setPosition(), and show().
|
private |
Indices into the MGDAs describing the creature's head model parts.
Definition at line 118 of file creature.h.
Referenced by init(), and loadModelsHeadList().
|
staticprivate |
Max number of model parts for a creature's head.
Definition at line 90 of file creature.h.
Referenced by init(), and loadModelsHeadList().