xoreos
0.0.5
|
#include <item.h>
Public Types | |
enum | Color { kColorMetal1 = 0, kColorMetal2, kColorLeather1, kColorLeather2, kColorCloth1, kColorCloth2, kColorMAX } |
Public Member Functions | |
Item (const Aurora::GFF3Struct &item) | |
~Item () | |
void | loadModel () |
Load the item's model. More... | |
void | unloadModel () |
Unload the item's model. More... | |
void | show () |
Show the item's model. More... | |
void | hide () |
Hide the item's model. More... | |
bool | isArmor () const |
uint32 | getColor (Color color) const |
uint32 | getArmorPart (size_t index) const |
Public Member Functions inherited from Engines::NWN::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 & | getName () const |
Return the object's name. More... | |
const Common::UString & | getDescription () const |
Return the object's description. More... | |
const Common::UString & | getPortrait () const |
Return the object's portrait. More... | |
const Common::UString & | getConversation () const |
Return the object's default conversation (DLG). More... | |
const Aurora::SSFFile * | getSSF () |
Return the object's sound set. 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... | |
Aurora::NWScript::Object * | getPCSpeaker () 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... | |
Area * | getArea () const |
Return the area this object is currently in. More... | |
virtual 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... | |
virtual void | setPosition (float x, float y, float z) |
Set the object's position within its area. More... | |
virtual void | setOrientation (float x, float y, float z, float angle) |
Set the object's orientation. More... | |
Location | getLocation () const |
Create a Location out of the object's area, position and orientation. More... | |
virtual void | enter () |
The cursor entered the object. More... | |
virtual void | leave () |
The cursor left the object. More... | |
virtual void | highlight (bool enabled) |
(Un)Highlight the object. More... | |
virtual bool | click (Object *triggerer=0) |
The object was clicked. More... | |
virtual void | speakString (const Common::UString &string, uint32 volume) |
Speak the specified string. More... | |
void | speakOneLiner (Common::UString conv, Object *tokenTarget=0) |
Speak an one-liner from the specified conversation file. More... | |
void | stopSound () |
Stop the current object sound. More... | |
void | playSound (const Common::UString &sound, bool pitchVariance=false) |
Play an object sound. More... | |
virtual void | playAnimation (const Common::UString &animation="", bool restart=true, float length=0.0f, float speed=1.0f) |
Play an object animation. More... | |
virtual void | playAnimation (Animation animation, bool restart=true, float length=0.0f, float speed=1.0f) |
Play a default object animation. 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::NWN::ScriptContainer | |
ScriptContainer () | |
~ScriptContainer () | |
const Common::UString & | getScript (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 &item) |
void | load (const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint) |
void | loadProperties (const Aurora::GFF3Struct &gff) |
void | loadPortrait (const Aurora::GFF3Struct &gff) |
void | loadArmorParts (const Aurora::GFF3Struct &gff) |
Private Attributes | |
Common::UString | _modelName |
The model's resource name. More... | |
uint32 | _baseItem |
The index within the baseitem 2DA. More... | |
uint32 | _colors [kColorMAX] |
The item's colors. More... | |
uint32 | _armorParts [kArmorPartMAX] |
The item's armor parts. More... | |
Common::ScopedPtr< Graphics::Aurora::Model > | _model |
The item's model. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Engines::NWN::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::NWN::Object | |
void | loadSSF () |
Load the object's sound set. More... | |
bool | beginConversation (Object *triggerer) |
Begin a conversation between the triggerer and this object. More... | |
virtual bool | createTooltip (Tooltip::Type type) |
Create an empty tooltip. More... | |
bool | createFeedbackTooltip () |
Create a tooltip with the name and/or portrait of the object. More... | |
bool | createSpeechTooltip (const Common::UString &line) |
Create a tooltip with a line the object should speak. More... | |
void | destroyTooltip () |
Destroy all tooltips on this object. More... | |
bool | showFeedbackTooltip () |
Create and show a tooltip with the name and/or portrait of the object. More... | |
bool | showSpeechTooltip (const Common::UString &line) |
Create and show a tooltip with a line the object speaks. More... | |
void | hideTooltip () |
Hide the tooltip again. More... | |
Protected Member Functions inherited from Engines::NWN::ScriptContainer | |
void | clearScripts () |
void | readScripts (const Aurora::GFF3Struct &gff) |
void | readScripts (const ScriptContainer &container) |
Protected Attributes inherited from Engines::NWN::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 | _portrait |
The object's portrait. More... | |
Common::UString | _conversation |
The object's default conversation. More... | |
uint32 | _soundSet |
The object's sound set, as an index into soundset.2da. More... | |
Common::ScopedPtr< Aurora::SSFFile > | _ssf |
The object's sound set. More... | |
bool | _static |
Is the object static? More... | |
bool | _usable |
Is the object usable? 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... | |
float | _position [3] |
The object's position. More... | |
float | _orientation [4] |
The object's orientation. More... | |
Sound::ChannelHandle | _sound |
The currently playing object sound. More... | |
Common::ScopedPtr< Tooltip > | _tooltip |
The tooltip displayed over the object. More... | |
Protected Attributes inherited from Aurora::NWScript::Object | |
uint32 | _id |
Common::UString | _tag |
|
private |
Parts of an armor set.
Engines::NWN::Item::Item | ( | const Aurora::GFF3Struct & | item | ) |
Definition at line 44 of file item.cpp.
References _armorParts, _colors, kArmorPartMAX, kColorMAX, Aurora::kFieldIDInvalid, and load().
uint32 Engines::NWN::Item::getArmorPart | ( | size_t | index | ) | const |
Definition at line 212 of file item.cpp.
References _armorParts, and kArmorPartMAX.
Referenced by Engines::NWN::Creature::getArmorModels().
Definition at line 206 of file item.cpp.
References _colors, and kColorMAX.
Referenced by Engines::NWN::Creature::getArmorModels().
|
virtual |
Hide the item's model.
Reimplemented from Engines::NWN::Object.
Definition at line 113 of file item.cpp.
References _model.
Referenced by unloadModel().
bool Engines::NWN::Item::isArmor | ( | ) | const |
Definition at line 200 of file item.cpp.
References _armorParts, kArmorPartTorso, and Aurora::kFieldIDInvalid.
Referenced by Engines::NWN::Creature::getArmorModels().
|
private |
Definition at line 58 of file item.cpp.
References Common::UString::empty(), Aurora::GFF3Struct::getString(), Aurora::kFileTypeUTI, Engines::loadOptionalGFF3(), MKTAG, and Common::ScopedPtrBase< T, Deallocator >::reset().
Referenced by Item().
|
private |
Definition at line 118 of file item.cpp.
References loadProperties().
|
private |
Definition at line 180 of file item.cpp.
References _armorParts, Aurora::GFF3Struct::getUint(), and kArmorPartMAX.
Referenced by loadProperties().
|
virtual |
Load the item's model.
Reimplemented from Engines::NWN::Object.
Definition at line 70 of file item.cpp.
References Engines::NWN::Object::_ids, _model, _modelName, Engines::NWN::Object::_name, Aurora::NWScript::Object::_tag, Common::UString::c_str(), Common::UString::empty(), Engines::NWN::Object::getOrientation(), Engines::NWN::Object::getPosition(), Engines::NWN::Object::isClickable(), Engines::loadModelObject(), Common::ScopedPtrBase< T, Deallocator >::reset(), Engines::NWN::Object::setOrientation(), Engines::NWN::Object::setPosition(), and warning().
|
private |
Definition at line 167 of file item.cpp.
References Engines::NWN::Object::_portrait, Common::UString::empty(), Aurora::TwoDAFile::getRow(), Aurora::TwoDARow::getString(), Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), and TwoDAReg.
Referenced by loadProperties().
|
private |
Definition at line 134 of file item.cpp.
References _baseItem, _colors, Engines::NWN::Object::_description, Engines::NWN::Object::_name, Aurora::NWScript::Object::_tag, Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), kColorMAX, loadArmorParts(), loadPortrait(), and Engines::NWN::ScriptContainer::readScripts().
Referenced by load().
|
virtual |
Show the item's model.
Reimplemented from Engines::NWN::Object.
Definition at line 108 of file item.cpp.
References _model.
|
virtual |
Unload the item's model.
Reimplemented from Engines::NWN::Object.
Definition at line 102 of file item.cpp.
References _model, hide(), and Common::ScopedPtrBase< T, Deallocator >::reset().
|
private |
The item's armor parts.
Definition at line 102 of file item.h.
Referenced by getArmorPart(), isArmor(), Item(), and loadArmorParts().
|
private |
The index within the baseitem 2DA.
Definition at line 99 of file item.h.
Referenced by loadProperties().
The item's colors.
Definition at line 101 of file item.h.
Referenced by getColor(), Item(), and loadProperties().
|
private |
The item's model.
Definition at line 104 of file item.h.
Referenced by hide(), loadModel(), show(), and unloadModel().
|
private |