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::DragonAge2::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::DragonAge2::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 | getItemModel (uint32 variation, const Common::UString &prefix, uint8 *armorType=0) const |
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) |
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... | |
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::DragonAge2::Creature::Creature | ( | ) |
Create a dummy creature instance.
Not playable as it is.
Definition at line 66 of file creature.cpp.
References init().
Engines::DragonAge2::Creature::Creature | ( | const Aurora::GFF3Struct & | placeable | ) |
Load from a placeable instance.
Engines::DragonAge2::Creature::~Creature | ( | ) |
Definition at line 76 of file creature.cpp.
References hide().
|
virtual |
The creature was clicked.
Reimplemented from Engines::DragonAge2::Object.
Definition at line 144 of file creature.cpp.
References Engines::DragonAge2::kEventTypeClick, Engines::DragonAge2::kEventTypeConversation, and Engines::DragonAge2::ScriptContainer::runScript().
void Engines::DragonAge2::Creature::createFakePC | ( | ) |
Create a fake player character creature for testing purposes.
Definition at line 119 of file creature.cpp.
References _isPC, Engines::DragonAge2::Object::_name, Aurora::NWScript::Object::_tag, Common::UString::c_str(), Engines::DragonAge2::ScriptContainer::enableEvents(), Common::UString::format(), Aurora::LocString::getString(), LangMan, and Aurora::LocString::setString().
Referenced by Engines::DragonAge2::Game::runCampaigns().
|
staticprivate |
Definition at line 175 of file creature.cpp.
References Common::UString::empty(), Aurora::GDAFile::getString(), and Aurora::GDAFile::kInvalidRow.
Referenced by getItemModel(), and loadModelsHeadList().
|
staticprivate |
Definition at line 161 of file creature.cpp.
References 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::DragonAge2::Object.
Definition at line 128 of file creature.cpp.
References Engines::DragonAge2::Object::_description, Engines::DragonAge2::Object::_name, Aurora::NWScript::Object::_tag, Common::UString::c_str(), Aurora::LocString::getString(), highlight(), and status().
|
private |
Definition at line 376 of file creature.cpp.
References _items, Aurora::GDAFile::findRow(), getItemModel(), Engines::DragonAge2::getMGDA(), Aurora::kFileTypeUTI, Aurora::GDAFile::kInvalidRow, Engines::DragonAge2::kUTIID, and Engines::DragonAge2::kWorksheetItems.
Referenced by loadModelsHead(), and loadModelsParts().
|
private |
Definition at line 189 of file creature.cpp.
References createModelPart(), Common::UString::empty(), Aurora::GDAFile::findRow(), Aurora::GDAFile::getInt(), Engines::DragonAge2::getMGDA(), Aurora::GDAFile::kInvalidRow, and Engines::DragonAge2::kWorksheetItemVariations.
Referenced by findEquipModel(), and loadModelsParts().
|
virtual |
Hide the creature's model.
Reimplemented from Engines::DragonAge2::Object.
Definition at line 110 of file creature.cpp.
References _models.
Referenced by ~Creature().
|
virtual |
(Un)Highlight the creature.
Reimplemented from Engines::DragonAge2::Object.
Definition at line 139 of file creature.cpp.
References _models.
Referenced by enter(), and leave().
|
private |
Definition at line 80 of file creature.cpp.
References _appearanceID, _isPC, _partVariation, and kPartVariationCount.
Referenced by Creature().
bool Engines::DragonAge2::Creature::isPC | ( | ) | const |
|
virtual |
The cursor left the creature.
Reimplemented from Engines::DragonAge2::Object.
Definition at line 135 of file creature.cpp.
References highlight().
|
private |
|
private |
|
private |
Definition at line 226 of file creature.cpp.
References _headMorph, _models, createModelPrefix(), Common::UString::empty(), findEquipModel(), Aurora::GDAFile::getString(), Engines::DragonAge2::kInventorySlotHead, Engines::loadModelObject(), loadModelsHeadList(), and loadModelsHeadMorph().
|
private |
Definition at line 272 of file creature.cpp.
References _models, _partVariation, createModelPart(), createModelPrefix(), Aurora::GDAFile::findRow(), Aurora::GDAFile::getInt(), Engines::DragonAge2::getMGDA(), Aurora::GDAFile::kInvalidRow, kPartVariationCount, and Engines::loadModelObject().
Referenced by loadModelsHead(), and loadModelsParts().
|
private |
Definition at line 248 of file creature.cpp.
References _headMorph, _models, Common::debugTag(), Aurora::kFileTypeMOR, Aurora::GFF4FieldNamesEnum::kGFF4MorphParts, Engines::DragonAge2::kMORPID, Engines::DragonAge2::kVersion01, and Engines::loadModelObject().
Referenced by loadModelsHead(), and loadModelsParts().
|
private |
Definition at line 300 of file creature.cpp.
References _headMorph, _models, createModelPrefix(), Common::UString::empty(), findEquipModel(), Aurora::GDAFile::getInt(), getItemModel(), Aurora::GDAFile::getString(), Engines::DragonAge2::kInventorySlotBoots, Engines::DragonAge2::kInventorySlotChest, Engines::DragonAge2::kInventorySlotGloves, Engines::DragonAge2::kInventorySlotHead, Engines::loadModelObject(), loadModelsHeadList(), and loadModelsHeadMorph().
|
private |
Definition at line 210 of file creature.cpp.
References _models, Aurora::GDAFile::getString(), and Engines::loadModelObject().
|
private |
Definition at line 218 of file creature.cpp.
References _models, Aurora::GDAFile::getString(), and Engines::loadModelObject().
|
private |
|
virtual |
Set the creature's orientation.
Reimplemented from Engines::DragonAge2::Object.
Definition at line 97 of file creature.cpp.
References _models, Engines::DragonAge2::Object::getOrientation(), and Engines::DragonAge2::Object::setOrientation().
|
virtual |
Set the creature's position.
Reimplemented from Engines::DragonAge2::Object.
Definition at line 89 of file creature.cpp.
References _models, Engines::DragonAge2::Object::getPosition(), and Engines::DragonAge2::Object::setPosition().
Referenced by Engines::DragonAge2::Campaign::movePC().
|
virtual |
Show the creature's model.
Reimplemented from Engines::DragonAge2::Object.
Definition at line 105 of file creature.cpp.
References _models.
|
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 114 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 119 of file creature.h.
Referenced by findEquipModel().
|
private |
The models making up this creature.
Definition at line 122 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 116 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().