Planeshift
Public Member Functions | Public Attributes

psItemStats Class Reference

This huge class stores all the properties of any object a player can have in the game. More...

#include <psitemstats.h>

List of all members.

Public Member Functions

psItemAmmoStatsAmmunition ()
psItemArmorStatsArmor ()
double CalcFunction (MathEnvironment *env, const char *functionName, const double *params)
 Needed for iScriptableVar.
bool FitsInSlots (PSITEMSTATS_SLOTLIST slotmask)
csString FlagsToText ()
PSITEMSTATS_AMMOTYPE GetAmmoType ()
void GetArmorVsWeaponType (csString &buff)
int GetAttackAnimID (unsigned int skill_level)
bool GetBuyPersonalise ()
bool GetCanTransform ()
psItemCategoryGetCategory ()
const csString & GetConsumeScriptName ()
unsigned short GetContainerMaxSize ()
int GetContainerMaxSlots ()
 Gets the slots available in this item (only containers) which means also the maximum amount of items which can be stored in this container.
PSITEMSTATS_CREATIVETYPE GetCreative ()
const csString & GetCreativeBackgroundImg ()
 Returns the background image assigned to the creative item.
psXMLString getCreativeXML ()
 Used to get the creative definition so psitem can make it's own copy of it.
PID GetCreator (PSITEMSTATS_CREATORSTATUS &creatorStatus)
float GetDecayRate ()
const char * GetDescription () const
const csString GetDownCaseName ()
ApplicativeScriptGetEquipScript ()
PSITEMSTATS_FLAGS GetFlags ()
const char * GetImageName ()
 Get the Image Name for the item.
bool GetIsAmmo ()
bool GetIsArmor ()
bool GetIsBothHandsWeapon ()
bool GetIsConstructible ()
bool GetIsConsumable ()
bool GetIsContainer ()
bool GetIsEquipStackable ()
bool GetIsGlyph ()
bool GetIsMeleeWeapon ()
bool GetIsRangeWeapon ()
bool GetIsReadable ()
bool GetIsRenameable ()
bool GetIsShield ()
bool GetIsStackable ()
bool GetIsTrap ()
bool GetIsWriteable ()
csString GetItemCommand ()
 returns the special command assigned to this item
const csString & GetLiteratureText (void)
int GetMaxCharges () const
const char * GetMeshName ()
 Get the Mesh Name for the item.
const csString & GetMusicalSheet (void)
 return creative contents
const char * GetName () const
const char * GetPartMeshName ()
 Get the Part Mesh Name for the item.
const char * GetPartName ()
 Get the Part Name for the item.
psMoneyGetPrice ()
double GetProperty (MathEnvironment *env, const char *ptr)
 Returns the requested variable stored in this item stats.
float GetQuality () const
bool GetRandom ()
float GetRange () const
csArray< ItemRequirement > & GetRequirements ()
 Gets the list of requirements of this item, used by psitem to check them over a player.
float GetSize ()
const csString & GetSketch (void)
csString GetSlotRemovedMesh (int slot, csString meshName="")
 Gets the list of mesh to remove when this item is equipped in the specified slot.
const csArray
< INVENTORY_SLOT_NUMBER > & 
GetSlots () const
const char * GetSound ()
const char * GetTextureName ()
 Get the Texture Name for the item.
uint32 GetUID ()
const char * GetUIDStr ()
bool GetUnique ()
bool GetUnmovable ()
bool GetUsesAmmo ()
PSITEMSTATS_SLOTLIST GetValidSlots ()
float GetVisibleDistance ()
float GetWeight ()
bool HasCharges () const
 Return true if this item was equipted with charges.
psItemInstantiateBasicItem (bool transient=false)
 Called to create an instance of an item using basic item stats.
bool IsMoney ()
bool IsRechargeable () const
bool IsSpawnable ()
 Gets if the item should be allowed to be spawned.
bool IsThisTheCreator (PID)
void operator delete (void *)
 The delete operator is overriden to call PoolAllocator template functions.
void * operator new (size_t)
 The new operator is overriden to call PoolAllocator template functions.
 psItemStats ()
bool ReadItemStats (iResultRow &row)
bool Save ()
void SaveDescription (void)
void SaveName (void)
void SetArmorVsWeaponType (const char *v)
bool SetAttribute (const csString &op, const csString &attrName, float modifier)
void SetCategory (psItemCategory *category)
bool SetCreation (PSITEMSTATS_CREATIVETYPE, const csString &, csString)
 Write creative stuff such as lit text (eg book) or map data.
void SetCreator (PID, PSITEMSTATS_CREATORSTATUS)
 creator (i.e.
void SetDescription (const char *v)
bool SetEquipScript (const csString &script)
 Sets a new equip script and saves it to the DB.
void SetImageName (const char *v)
void SetMaxCharges (int charges)
void SetMeshName (const char *v)
void SetName (const char *v)
void SetPartMeshName (const char *v)
void SetPartName (const char *v)
void SetPrice (int trias)
void SetQuality (float f)
void SetRandom ()
bool SetRequirement (const csString &statName, float statValue)
void SetSound (const char *v)
void SetTextureName (const char *v)
void SetUnique ()
const char * ToString ()
 Returns the name of the item.
bool UsesAmmoType (uint32_t id) const
psItemWeaponStatsWeapon ()
 ~psItemStats ()

Public Attributes

float weaponRange

Detailed Description

This huge class stores all the properties of any object a player can have in the game.

All stats, bonuses, maluses, magic stat alterations, combat properties, spell effects, and so forth are all stored here.

Definition at line 463 of file psitemstats.h.


Constructor & Destructor Documentation

psItemStats::psItemStats ( )
psItemStats::~psItemStats ( )

Member Function Documentation

psItemAmmoStats& psItemStats::Ammunition ( ) [inline]

Definition at line 626 of file psitemstats.h.

psItemArmorStats& psItemStats::Armor ( ) [inline]

Definition at line 618 of file psitemstats.h.

double psItemStats::CalcFunction ( MathEnvironment env,
const char *  functionName,
const double *  params 
) [virtual]

Needed for iScriptableVar.

Does nothing right now just returns 0 for anything passed.

Implements iScriptableVar.

bool psItemStats::FitsInSlots ( PSITEMSTATS_SLOTLIST  slotmask)
csString psItemStats::FlagsToText ( )
PSITEMSTATS_AMMOTYPE psItemStats::GetAmmoType ( )
void psItemStats::GetArmorVsWeaponType ( csString &  buff)
int psItemStats::GetAttackAnimID ( unsigned int  skill_level)
bool psItemStats::GetBuyPersonalise ( )
bool psItemStats::GetCanTransform ( )
psItemCategory* psItemStats::GetCategory ( )
const csString& psItemStats::GetConsumeScriptName ( ) [inline]

Definition at line 824 of file psitemstats.h.

unsigned short psItemStats::GetContainerMaxSize ( )
int psItemStats::GetContainerMaxSlots ( )

Gets the slots available in this item (only containers) which means also the maximum amount of items which can be stored in this container.

Returns:
The number of slots available in this container.
PSITEMSTATS_CREATIVETYPE psItemStats::GetCreative ( )
const csString& psItemStats::GetCreativeBackgroundImg ( )

Returns the background image assigned to the creative item.

Returns:
A csString containing the name of the background image assigned to the creative item.
psXMLString psItemStats::getCreativeXML ( ) [inline]

Used to get the creative definition so psitem can make it's own copy of it.

Returns:
psXMLString The creative definition xml data of this item.

Definition at line 740 of file psitemstats.h.

PID psItemStats::GetCreator ( PSITEMSTATS_CREATORSTATUS creatorStatus)
float psItemStats::GetDecayRate ( )
const char* psItemStats::GetDescription ( ) const
const csString psItemStats::GetDownCaseName ( )
ApplicativeScript* psItemStats::GetEquipScript ( ) [inline]

Definition at line 820 of file psitemstats.h.

PSITEMSTATS_FLAGS psItemStats::GetFlags ( ) [inline]

Definition at line 632 of file psitemstats.h.

const char* psItemStats::GetImageName ( )

Get the Image Name for the item.

Used in inventory and other location where item has to be presented by a 2D image.

bool psItemStats::GetIsAmmo ( )
bool psItemStats::GetIsArmor ( )
bool psItemStats::GetIsBothHandsWeapon ( )
bool psItemStats::GetIsConstructible ( )
bool psItemStats::GetIsConsumable ( )
bool psItemStats::GetIsContainer ( )
bool psItemStats::GetIsEquipStackable ( )
bool psItemStats::GetIsGlyph ( )
bool psItemStats::GetIsMeleeWeapon ( )
bool psItemStats::GetIsRangeWeapon ( )
bool psItemStats::GetIsReadable ( )
bool psItemStats::GetIsRenameable ( )
bool psItemStats::GetIsShield ( )
bool psItemStats::GetIsStackable ( )
bool psItemStats::GetIsTrap ( )
bool psItemStats::GetIsWriteable ( )
csString psItemStats::GetItemCommand ( ) [inline]

returns the special command assigned to this item

Definition at line 892 of file psitemstats.h.

const csString& psItemStats::GetLiteratureText ( void  ) [inline]

Definition at line 862 of file psitemstats.h.

int psItemStats::GetMaxCharges ( ) const
const char* psItemStats::GetMeshName ( )

Get the Mesh Name for the item.

Used for standalone or weilded mesh.

const csString& psItemStats::GetMusicalSheet ( void  ) [inline]

return creative contents

Definition at line 854 of file psitemstats.h.

const char* psItemStats::GetName ( ) const
const char* psItemStats::GetPartMeshName ( )

Get the Part Mesh Name for the item.

This is the new mesh to be attached to the location given by the pattern Part Name.

const char* psItemStats::GetPartName ( )

Get the Part Name for the item.

This is the name of the part that the texture should be attached to if no change of mesh.

psMoney& psItemStats::GetPrice ( )
double psItemStats::GetProperty ( MathEnvironment env,
const char *  ptr 
) [virtual]

Returns the requested variable stored in this item stats.

Note:
Needed for iScriptableVar.
Parameters:
envA math environment.
ptrA pointer to a char array stating the requested variable.
Returns:
A double with the value of the requested variable.

Implements iScriptableVar.

float psItemStats::GetQuality ( ) const [inline]

Definition at line 685 of file psitemstats.h.

bool psItemStats::GetRandom ( )
float psItemStats::GetRange ( ) const
csArray<ItemRequirement>& psItemStats::GetRequirements ( )

Gets the list of requirements of this item, used by psitem to check them over a player.

Returns:
A pointer to the start of the array of itemRequirement (they are 3 elements)
float psItemStats::GetSize ( )
const csString& psItemStats::GetSketch ( void  ) [inline]

Definition at line 858 of file psitemstats.h.

csString psItemStats::GetSlotRemovedMesh ( int  slot,
csString  meshName = "" 
)

Gets the list of mesh to remove when this item is equipped in the specified slot.

If the race specified is not found the race -1 (aka no race specific) will be searched too.

Parameters:
slotThe slot this item is being equipped into.
meshNameThe meshName we are sarching for the slot to remove for it.
Returns:
The list of meshes to remove when equipping this item.
const csArray<INVENTORY_SLOT_NUMBER>& psItemStats::GetSlots ( ) const [inline]

Definition at line 811 of file psitemstats.h.

const char* psItemStats::GetSound ( )
const char* psItemStats::GetTextureName ( )

Get the Texture Name for the item.

Used when worn and attached to the mesh given by part name.

uint32 psItemStats::GetUID ( )
const char* psItemStats::GetUIDStr ( )
bool psItemStats::GetUnique ( )
bool psItemStats::GetUnmovable ( )
bool psItemStats::GetUsesAmmo ( )
PSITEMSTATS_SLOTLIST psItemStats::GetValidSlots ( )
float psItemStats::GetVisibleDistance ( )
float psItemStats::GetWeight ( )
bool psItemStats::HasCharges ( ) const

Return true if this item was equipted with charges.

psItem* psItemStats::InstantiateBasicItem ( bool  transient = false)

Called to create an instance of an item using basic item stats.

The item instance can be modified by the caller after it's created (modifiers, uniqueness, etc) You MUST call Loaded() on the returned item once it is in a ready state, to allow saving.

bool psItemStats::IsMoney ( )
Returns:
True if the object is a money object.
bool psItemStats::IsRechargeable ( ) const
bool psItemStats::IsSpawnable ( )

Gets if the item should be allowed to be spawned.

Returns:
BOOL saying if the item can be spawned from the item command.
bool psItemStats::IsThisTheCreator ( PID  )
void psItemStats::operator delete ( void *  )

The delete operator is overriden to call PoolAllocator template functions.

void* psItemStats::operator new ( size_t  )

The new operator is overriden to call PoolAllocator template functions.

bool psItemStats::ReadItemStats ( iResultRow &  row)
bool psItemStats::Save ( )
void psItemStats::SaveDescription ( void  )
void psItemStats::SaveName ( void  )
void psItemStats::SetArmorVsWeaponType ( const char *  v)
bool psItemStats::SetAttribute ( const csString &  op,
const csString &  attrName,
float  modifier 
)
void psItemStats::SetCategory ( psItemCategory category)
bool psItemStats::SetCreation ( PSITEMSTATS_CREATIVETYPE  ,
const csString &  ,
csString   
)

Write creative stuff such as lit text (eg book) or map data.

void psItemStats::SetCreator ( PID  ,
PSITEMSTATS_CREATORSTATUS   
)

creator (i.e.

author, artist, etc) of creative things.

void psItemStats::SetDescription ( const char *  v)
bool psItemStats::SetEquipScript ( const csString &  script)

Sets a new equip script and saves it to the DB.

Mostly for the loot generator.

void psItemStats::SetImageName ( const char *  v)
void psItemStats::SetMaxCharges ( int  charges)
void psItemStats::SetMeshName ( const char *  v)
void psItemStats::SetName ( const char *  v)
void psItemStats::SetPartMeshName ( const char *  v)
void psItemStats::SetPartName ( const char *  v)
void psItemStats::SetPrice ( int  trias)
void psItemStats::SetQuality ( float  f) [inline]

Definition at line 689 of file psitemstats.h.

void psItemStats::SetRandom ( )
bool psItemStats::SetRequirement ( const csString &  statName,
float  statValue 
)
void psItemStats::SetSound ( const char *  v)
void psItemStats::SetTextureName ( const char *  v)
void psItemStats::SetUnique ( )
const char* psItemStats::ToString ( ) [inline, virtual]

Returns the name of the item.

Note:
Needed for iScriptableVar.
Returns:
the name of the item.

Implements iScriptableVar.

Definition at line 903 of file psitemstats.h.

bool psItemStats::UsesAmmoType ( uint32_t  id) const [inline]

Definition at line 667 of file psitemstats.h.

psItemWeaponStats& psItemStats::Weapon ( ) [inline]

Definition at line 622 of file psitemstats.h.


Member Data Documentation

Definition at line 672 of file psitemstats.h.


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