Pol  Revision:cb584c9
Pol::Items::Item Class Reference

#include <item.h>

+ Inheritance diagram for Pol::Items::Item:

Public Member Functions

virtual ~Item ()
 
void add_to_self (Item *&item)
 
bool amount_to_remove_is_partial (u16 amount_to_remove) const
 
virtual void builtin_on_use (Network::Client *client)
 
u32 buyprice () const
 
void buyprice (u32)
 
Bscript::BObject call_custom_method (const char *methodname, Bscript::BObjectImpRefVec &pmore)
 
Bscript::BObject call_custom_method (const char *methodname)
 
bool can_add_to_self (unsigned short amount, bool force_stacking) const
 
bool can_add_to_self (const Item &item, bool force_stacking) const
 
bool can_decay () const
 
bool check_equip_script (Mobile::Character *chr, bool startup)
 
bool check_equiptest_scripts (Mobile::Character *chr, bool startup=false)
 
bool check_test_scripts (Mobile::Character *chr, const std::string &script_ecl, bool startup)
 
bool check_unequip_script ()
 
bool check_unequiptest_scripts (Mobile::Character *chr)
 
bool check_unequiptest_scripts ()
 
virtual const char * classname () const POL_OVERRIDE
 
virtual Itemclone () const
 
virtual Bscript::BObjectImpcustom_script_method (const char *methodname, Bscript::Executor &ex) POL_OVERRIDE
 
bool default_insured () const
 
bool default_invisible () const
 
bool default_movable () const
 
bool default_newbie () const
 
bool default_no_drop () const
 
virtual std::string description () const POL_OVERRIDE
 
void disable_decay ()
 
virtual void double_click (Network::Client *client)
 
 DYN_PROPERTY (maxhp_mod, s16, Core::PROP_MAXHP_MOD, 0)
 
 DYN_PROPERTY (name_suffix, std::string, Core::PROP_NAME_SUFFIX,"")
 
 DYN_PROPERTY_POINTER (gotten_by, Mobile::Character *, Core::PROP_GOTTEN_BY)
 
 DYN_PROPERTY_POINTER (process, Module::UOExecutorModule *, Core::PROP_PROCESS)
 
 DYN_PROPERTY_POINTER (house, Multi::UHouse *, Core::PROP_HOUSE)
 
virtual size_t estimatedSize () const POL_OVERRIDE
 
void extricate ()
 
virtual Bscript::BObjectImpget_script_member (const char *membername) const POL_OVERRIDE
 
virtual Bscript::BObjectImpget_script_member_id (const int id) const POL_OVERRIDE
 
virtual u16 get_senditem_amount () const
 
std::string get_use_script_name () const
 
u16 getamount () const
 
bool getbuyprice (u32 &buyprice) const
 
Mobile::CharacterGetCharacterOwner ()
 
virtual double getQuality () const
 
bool has_equip_script () const
 
bool has_only_default_cprops (const ItemDesc *compare=nullptr) const
 
bool insured () const
 
void insured (bool newvalue)
 
bool inuse () const
 
void inuse (bool newvalue)
 
bool invisible () const
 
void invisible (bool newvalue)
 
virtual unsigned int item_count () const
 
const ItemDescitemdesc () const
 
virtual Bscript::BObjectImpmake_ref () POL_OVERRIDE
 
unsigned short maxhp () const
 
std::string merchant_description () const
 
bool movable () const
 
void movable (bool newvalue)
 
virtual std::string name () const POL_OVERRIDE
 
bool newbie () const
 
void newbie (bool newvalue)
 
bool no_drop () const
 
void no_drop (bool newvalue)
 
virtual void on_color_changed () POL_OVERRIDE
 
virtual void on_facing_changed () POL_OVERRIDE
 
void on_invisible_changed ()
 
void on_movable_changed ()
 
virtual UObjectowner () POL_OVERRIDE
 
virtual const UObjectowner () const POL_OVERRIDE
 
virtual void readProperties (Clib::ConfigElem &elem) POL_OVERRIDE
 
Itemremove_part_of_stack (u16 amount_to_remove)
 
void reset_slot ()
 
void restart_decay_timer ()
 
Bscript::BObjectImprun_equip_script (Mobile::Character *chr, bool startup)
 
Bscript::BObjectImprun_unequip_script (Mobile::Character *who)
 
virtual bool script_isa (unsigned isatype) const POL_OVERRIDE
 
virtual Bscript::BObjectImpscript_method (const char *methodname, Bscript::Executor &ex) POL_OVERRIDE
 
virtual Bscript::BObjectImpscript_method_id (const int id, Bscript::Executor &ex) POL_OVERRIDE
 
u32 sellprice () const
 
void sellprice (u32)
 
void set_decay_after (unsigned int seconds)
 
virtual Bscript::BObjectImpset_script_member (const char *membername, const std::string &value) POL_OVERRIDE
 id test More...
 
virtual Bscript::BObjectImpset_script_member (const char *membername, int value) POL_OVERRIDE
 
virtual Bscript::BObjectImpset_script_member_double (const char *membername, double value) POL_OVERRIDE
 id test More...
 
virtual Bscript::BObjectImpset_script_member_id (const int id, const std::string &value) POL_OVERRIDE
 
virtual Bscript::BObjectImpset_script_member_id (const int id, int value) POL_OVERRIDE
 id test More...
 
virtual Bscript::BObjectImpset_script_member_id_double (const int id, double value) POL_OVERRIDE
 
void set_use_script (const std::string &scriptname)
 
void setamount (u16 amount)
 
virtual bool setcolor (u16 newcolor) POL_OVERRIDE
 
virtual void setfacing (u8 newfacing) POL_OVERRIDE
 
virtual bool setgraphic (u16 newobjtype) POL_OVERRIDE
 
bool setlayer (unsigned char layer)
 
virtual void setQuality (double value)
 
bool should_decay (unsigned int gameclock) const
 
Itemslice_stacked_item (u16 this_item_new_amount)
 
u8 slot_index () const
 
bool slot_index (u8 newvalue)
 
virtual void spill_contents (Multi::UMulti *supporting_multi)
 
bool stackable () const
 
void subamount (u16 amount_subtract)
 
virtual const char * target_tag () const POL_OVERRIDE
 
virtual UObjecttoplevel_owner () POL_OVERRIDE
 
virtual const UObjecttoplevel_owner () const POL_OVERRIDE
 
bool use_insurance ()
 Returns current insurance value and resets it to false. More...
 
virtual void walk_on (Mobile::Character *chr)
 
virtual unsigned int weight () const POL_OVERRIDE
 
unsigned int weight_of (unsigned short amount) const
 
- Public Member Functions inherited from Pol::Core::UObject
ref_countedas_ref_counted ()
 
void clear_dirty () const
 
void copyprops (const UObject &obj)
 
void copyprops (const PropertyList &proplist)
 
virtual void destroy ()
 
bool dirty () const
 
 DYN_PROPERTY (maxhp_mod, s16, PROP_MAXHP_MOD, 0)
 
 DYN_PROPERTY (fire_resist, ValueModPack, PROP_RESIST_FIRE, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (cold_resist, ValueModPack, PROP_RESIST_COLD, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (energy_resist, ValueModPack, PROP_RESIST_ENERGY, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (poison_resist, ValueModPack, PROP_RESIST_POISON, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (physical_resist, ValueModPack, PROP_RESIST_PHYSICAL, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (fire_damage, ValueModPack, PROP_DAMAGE_FIRE, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (cold_damage, ValueModPack, PROP_DAMAGE_COLD, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (energy_damage, ValueModPack, PROP_DAMAGE_ENERGY, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (poison_damage, ValueModPack, PROP_DAMAGE_POISON, ValueModPack::DEFAULT)
 
 DYN_PROPERTY (physical_damage, ValueModPack, PROP_DAMAGE_PHYSICAL, ValueModPack::DEFAULT)
 
void eraseprop (const std::string &propname)
 
virtual void fixInvalidGraphic ()
 Fixes invalid graphic, moving here to allow it to be overridden in subclass (see Multi) More...
 
bool getprop (const std::string &propname, std::string &propvalue) const
 
void getpropnames (std::vector< std::string > &propnames) const
 
const PropertyListgetprops () const
 
void increv ()
 
virtual void printOn (Clib::StreamWriter &) const
 
virtual void printOnDebug (Clib::StreamWriter &sw) const
 
virtual void printSelfOn (Clib::StreamWriter &sw) const
 
void ref_counted_add_ref ()
 
unsigned ref_counted_count () const
 
void ref_counted_release ()
 
u32 rev () const
 
bool saveonexit () const
 
void saveonexit (bool newvalue)
 
virtual UObjectself_as_owner ()
 
virtual const UObjectself_as_owner () const
 
void set_dirty ()
 
void setname (const std::string &)
 
void setprop (const std::string &propname, const std::string &propvalue)
 
bool specific_name () const
 
- Public Member Functions inherited from Pol::Core::ULWObject
bool isa (UOBJ_CLASS uobj_class) const
 
bool isitem () const
 
bool ismobile () const
 
bool ismulti () const
 
u8 look_height () const
 
bool orphan () const
 
- Public Member Functions inherited from Pol::Core::DynamicPropsHolder
 DynamicPropsHolder ()
 
size_t estimateSizeDynProps () const
 
template<typename V >
bool getmember (DynPropTypes member, V *value) const
 
bool hasmember (DynPropTypes member) const
 
template<typename V >
void setmember (DynPropTypes member, const V &value, const V &defaultvalue)
 
template<typename V >
void setmemberPointer (DynPropTypes member, V value)
 

Static Public Member Functions

static Itemcreate (u32 objtype, u32 serial=0)
 
static Itemcreate (const ItemDesc &itemdesc, u32 serial=0)
 

Public Attributes

Core::UContainercontainer
 
unsigned short hp_
 
u8 layer
 
u8 tile_layer
 
- Public Attributes inherited from Pol::Core::UObject
u16 color
 
u8 facing
 
const u32 objtype_
 
u32 serial_ext
 
- Public Attributes inherited from Pol::Core::ULWObject
u16 graphic
 
u8 height
 
Realms::Realmrealm
 
u32 serial
 
u16 x
 
u16 y
 
s8 z
 

Protected Member Functions

 Item (const ItemDesc &itemdesc, Core::UOBJ_CLASS uobj_class)
 
virtual void printDebugProperties (Clib::StreamWriter &sw) const POL_OVERRIDE
 
virtual void printProperties (Clib::StreamWriter &sw) const POL_OVERRIDE
 
- Protected Member Functions inherited from Pol::Core::UObject
 UObject (u32 objtype, UOBJ_CLASS uobj_class)
 
virtual ~UObject ()
 
- Protected Member Functions inherited from ref_counted
 ref_counted ()
 
 ~ref_counted ()=default
 
unsigned int add_ref ()
 
unsigned int count () const
 
unsigned int release ()
 
- Protected Member Functions inherited from Pol::Core::ULWObject
 ULWObject (UOBJ_CLASS uobj_class)
 
 ULWObject (const ULWObject &)=delete
 
 ~ULWObject ()=default
 
ULWObjectoperator= (const ULWObject &)=delete
 
bool isa (UOBJ_CLASS uobj_class) const
 
bool isitem () const
 
bool ismobile () const
 
bool ismulti () const
 
u8 look_height () const
 
bool orphan () const
 
- Protected Member Functions inherited from Pol::Core::DynamicPropsHolder
 ~DynamicPropsHolder ()=default
 
 DynamicPropsHolder ()
 
size_t estimateSizeDynProps () const
 
template<typename V >
bool getmember (DynPropTypes member, V *value) const
 
bool hasmember (DynPropTypes member) const
 
template<typename V >
void setmember (DynPropTypes member, const V &value, const V &defaultvalue)
 
template<typename V >
void setmemberPointer (DynPropTypes member, V value)
 

Protected Attributes

const ItemDesc_itemdesc
 
u16 amount_
 
unsigned int decayat_gameclock_
 
boost_utils::script_name_flystring equip_script_
 
boost_utils::script_name_flystring on_use_script_
 
u8 slot_index_
 
boost_utils::script_name_flystring unequip_script_
 
- Protected Attributes inherited from Pol::Core::UObject
AttributeFlags< OBJ_FLAGSflags_
 
boost_utils::object_name_flystring name_
 
- Protected Attributes inherited from ref_counted
std::atomic< unsigned int > _count
 
- Protected Attributes inherited from Pol::Core::ULWObject
const UOBJ_CLASS uobj_class_
 
u16 graphic
 
u8 height
 
Realms::Realmrealm
 
u32 serial
 
u16 x
 
u16 y
 
s8 z
 

Static Protected Attributes

static const u32 BUYPRICE_DEFAULT = UINT_MAX
 
static const u32 SELLPRICE_DEFAULT = UINT_MAX
 

Private Types

typedef Core::UObject base
 

Private Member Functions

 DYN_PROPERTY (sellprice_, u32, Core::PROP_SELLPRICE, SELLPRICE_DEFAULT)
 sell and buyprice generated functions only private! (additional logic needed) More...
 
 DYN_PROPERTY (buyprice_, u32, Core::PROP_BUYPRICE, BUYPRICE_DEFAULT)
 
 DYN_PROPERTY (quality, double, Core::PROP_QUALITY, getItemdescQuality())
 equipment has a fixed member see get/setQuality More...
 
double getItemdescQuality () const
 

Additional Inherited Members

- Static Public Attributes inherited from Pol::Core::UObject
static std::atomic< unsigned int > clean_writes
 
static std::atomic< unsigned int > dirty_writes
 

Detailed Description

Warning
All derived classes should have protected constructors, and make Item a friend.

Definition at line 78 of file item.h.

Member Typedef Documentation

Definition at line 80 of file item.h.

Constructor & Destructor Documentation

Member Function Documentation

bool Pol::Items::Item::amount_to_remove_is_partial ( u16  amount_to_remove) const

Definition at line 768 of file item.cpp.

References amount_.

Referenced by Pol::Core::get_item(), Pol::Module::oldBuyHandler(), and Pol::Module::oldSellHandler().

void Pol::Items::Item::builtin_on_use ( Network::Client client)
virtual
u32 Pol::Items::Item::buyprice ( ) const

Definition at line 214 of file item.cpp.

References BUYPRICE_DEFAULT, itemdesc(), and Pol::Items::ItemDesc::vendor_buys_for.

Referenced by getbuyprice().

void Pol::Items::Item::buyprice ( u32  value)

Definition at line 222 of file item.cpp.

BObject Pol::Items::Item::call_custom_method ( const char *  methodname,
Bscript::BObjectImpRefVec pmore 
)
BObject Pol::Items::Item::call_custom_method ( const char *  methodname)

Definition at line 1599 of file uoscrobj.cpp.

bool Pol::Items::Item::can_decay ( ) const
bool Pol::Items::Item::check_equip_script ( Mobile::Character chr,
bool  startup 
)
bool Pol::Items::Item::check_equiptest_scripts ( Mobile::Character chr,
bool  startup = false 
)
bool Pol::Items::Item::check_test_scripts ( Mobile::Character chr,
const std::string &  script_ecl,
bool  startup 
)
bool Pol::Items::Item::check_unequiptest_scripts ( )
const char * Pol::Items::Item::classname ( ) const
virtual

Implements Pol::Core::UObject.

Reimplemented in Pol::Multi::UMulti.

Definition at line 270 of file item.cpp.

Referenced by Pol::Core::destroy_item().

Item * Pol::Items::Item::create ( const ItemDesc itemdesc,
u32  serial = 0 
)
static
BObjectImp * Pol::Items::Item::custom_script_method ( const char *  methodname,
Bscript::Executor ex 
)
virtual
bool Pol::Items::Item::default_insured ( ) const

Definition at line 293 of file item.cpp.

References Pol::Items::ItemDesc::insured, and itemdesc().

Referenced by printProperties(), and readProperties().

bool Pol::Items::Item::default_invisible ( ) const

Definition at line 283 of file item.cpp.

References Pol::Items::ItemDesc::invisible, and itemdesc().

Referenced by printProperties(), and readProperties().

bool Pol::Items::Item::default_newbie ( ) const

Definition at line 288 of file item.cpp.

References itemdesc(), and Pol::Items::ItemDesc::newbie.

Referenced by printProperties(), and readProperties().

bool Pol::Items::Item::default_no_drop ( ) const

Definition at line 320 of file item.cpp.

References itemdesc(), and Pol::Items::ItemDesc::no_drop.

Referenced by printProperties(), and readProperties().

std::string Pol::Items::Item::description ( ) const
virtual

there are four forms of 'name' in objinfo:

  • name (normal)
  • names (percent followed by plural-part, then null-term)
  • names% (percent followed by plural-part, then percent, then more)
  • wheat sheaves/f% ( '', plural part, '/', single part, '', rest )

Some examples:

  • piles/e% of hides
  • bananas%
  • feathers

Known bugs:

  • 1 gold coin displays as "gold coin". There must be a bit somewhere that I just don't understand yet.

Reimplemented from Pol::Core::UObject.

Definition at line 150 of file item.cpp.

References amount_, Pol::Core::format_description(), Pol::Core::ULWObject::graphic, itemdesc(), name(), Pol::Core::UObject::specific_name(), Pol::Core::tile_desc(), and Pol::Core::tile_flags().

Referenced by Pol::Core::destroy_item(), and Pol::Core::send_objdesc().

void Pol::Items::Item::disable_decay ( )
Pol::Items::Item::DYN_PROPERTY ( maxhp_mod  ,
s16  ,
Core::PROP_MAXHP_MOD  ,
 
)
Pol::Items::Item::DYN_PROPERTY ( name_suffix  ,
std::string  ,
Core::PROP_NAME_SUFFIX  ,
""   
)
Pol::Items::Item::DYN_PROPERTY ( sellprice_  ,
u32  ,
Core::PROP_SELLPRICE  ,
SELLPRICE_DEFAULT   
)
private

sell and buyprice generated functions only private! (additional logic needed)

Pol::Items::Item::DYN_PROPERTY ( buyprice_  ,
u32  ,
Core::PROP_BUYPRICE  ,
BUYPRICE_DEFAULT   
)
private
Pol::Items::Item::DYN_PROPERTY ( quality  ,
double  ,
Core::PROP_QUALITY  ,
getItemdescQuality()   
)
private

equipment has a fixed member see get/setQuality

Pol::Items::Item::DYN_PROPERTY_POINTER ( gotten_by  ,
Mobile::Character ,
Core::PROP_GOTTEN_BY   
)
Pol::Items::Item::DYN_PROPERTY_POINTER ( process  ,
Module::UOExecutorModule ,
Core::PROP_PROCESS   
)
Pol::Items::Item::DYN_PROPERTY_POINTER ( house  ,
Multi::UHouse ,
Core::PROP_HOUSE   
)

Tells of which house this item is a component, if any

BObjectImp * Pol::Items::Item::get_script_member_id ( const int  id) const
virtual

Reimplemented from Pol::Core::UObject.

Reimplemented in Pol::Multi::UBoat, Pol::Core::UContainer, Pol::Multi::UHouse, Pol::Items::UWeapon, Pol::Core::Map, Pol::Multi::UMulti, Pol::Core::UCorpse, Pol::Items::UArmor, Pol::Items::Equipment, Pol::Multi::UPlank, Pol::Core::UDoor, and Pol::Core::ULockable.

Definition at line 898 of file uoscrobj.cpp.

References Pol::Items::ItemDesc::doubleclick_range, Pol::Bscript::ExecutorModule::exec, Pol::Bscript::MBR_AMOUNT, Pol::Bscript::MBR_BUYPRICE, Pol::Bscript::MBR_COLD_DAMAGE, Pol::Bscript::MBR_COLD_DAMAGE_MOD, Pol::Bscript::MBR_COLD_RESIST, Pol::Bscript::MBR_COLD_RESIST_MOD, Pol::Bscript::MBR_CONTAINER, Pol::Bscript::MBR_DECAYAT, Pol::Bscript::MBR_DESC, Pol::Bscript::MBR_DOUBLECLICKRANGE, Pol::Bscript::MBR_ENERGY_DAMAGE, Pol::Bscript::MBR_ENERGY_DAMAGE_MOD, Pol::Bscript::MBR_ENERGY_RESIST, Pol::Bscript::MBR_ENERGY_RESIST_MOD, Pol::Bscript::MBR_EQUIPSCRIPT, Pol::Bscript::MBR_FIRE_DAMAGE, Pol::Bscript::MBR_FIRE_DAMAGE_MOD, Pol::Bscript::MBR_FIRE_RESIST, Pol::Bscript::MBR_FIRE_RESIST_MOD, Pol::Bscript::MBR_GETGOTTENBY, Pol::Bscript::MBR_HOUSE, Pol::Bscript::MBR_HP, Pol::Bscript::MBR_INSURED, Pol::Bscript::MBR_INVISIBLE, Pol::Bscript::MBR_ITEM_COUNT, Pol::Bscript::MBR_LAYER, Pol::Bscript::MBR_MAXHP, Pol::Bscript::MBR_MAXHP_MOD, Pol::Bscript::MBR_MOVABLE, Pol::Bscript::MBR_NAME_SUFFIX, Pol::Bscript::MBR_NEWBIE, Pol::Bscript::MBR_NO_DROP, Pol::Bscript::MBR_PHYSICAL_DAMAGE, Pol::Bscript::MBR_PHYSICAL_DAMAGE_MOD, Pol::Bscript::MBR_PHYSICAL_RESIST, Pol::Bscript::MBR_PHYSICAL_RESIST_MOD, Pol::Bscript::MBR_POISON_DAMAGE, Pol::Bscript::MBR_POISON_DAMAGE_MOD, Pol::Bscript::MBR_POISON_RESIST, Pol::Bscript::MBR_POISON_RESIST_MOD, Pol::Bscript::MBR_PROCESS, Pol::Bscript::MBR_QUALITY, Pol::Bscript::MBR_SAVEONEXIT, Pol::Bscript::MBR_SELLPRICE, Pol::Bscript::MBR_STACKABLE, Pol::Bscript::MBR_TILE_LAYER, Pol::Bscript::MBR_UNEQUIPSCRIPT, and Pol::Bscript::MBR_USESCRIPT.

Referenced by Pol::Core::ULockable::get_script_member_id(), Pol::Items::Equipment::get_script_member_id(), and Pol::Multi::UMulti::get_script_member_id().

std::string Pol::Items::Item::get_use_script_name ( ) const

Definition at line 172 of file item.cpp.

References on_use_script_.

Referenced by Pol::Module::UOExecutorModule::mf_UseItem().

bool Pol::Items::Item::getbuyprice ( u32 buyprice) const

Definition at line 227 of file item.cpp.

References buyprice().

Referenced by Pol::Module::oldSellHandler(), and Pol::Module::send_vendorsell().

double Pol::Items::Item::getItemdescQuality ( ) const
private

Definition at line 1191 of file item.cpp.

References itemdesc(), and Pol::Items::ItemDesc::quality.

Referenced by printProperties().

double Pol::Items::Item::getQuality ( ) const
virtual

Reimplemented in Pol::Items::Equipment.

Definition at line 1196 of file item.cpp.

Referenced by clone(), and printProperties().

bool Pol::Items::Item::has_equip_script ( ) const

Definition at line 996 of file item.cpp.

References equip_script_.

Referenced by check_equip_script(), and Pol::Module::UOExecutorModule::mf_EquipItem().

bool Pol::Items::Item::has_only_default_cprops ( const ItemDesc compare = nullptr) const
bool Pol::Items::Item::insured ( ) const
inline
void Pol::Items::Item::insured ( bool  newvalue)
inline

Definition at line 353 of file item.h.

References Pol::Core::INSURED.

void Pol::Items::Item::inuse ( bool  newvalue)
inline

Definition at line 319 of file item.h.

References Pol::Core::IN_USE.

void Pol::Items::Item::invisible ( bool  newvalue)
inline

Definition at line 329 of file item.h.

References Pol::Core::INVISIBLE.

unsigned int Pol::Items::Item::item_count ( ) const
virtual

Reimplemented in Pol::Core::UContainer.

Definition at line 944 of file item.cpp.

Referenced by Pol::Core::StorageAreaImp::get_member(), and Pol::Core::UContainer::item_count().

unsigned short Pol::Items::Item::maxhp ( ) const
void Pol::Items::Item::movable ( bool  newvalue)
inline

Definition at line 305 of file item.h.

References Pol::Core::MOVABLE.

std::string Pol::Items::Item::name ( ) const
virtual
void Pol::Items::Item::newbie ( bool  newvalue)
inline

Definition at line 343 of file item.h.

References Pol::Core::NEWBIE.

void Pol::Items::Item::on_color_changed ( )
virtual

Reimplemented from Pol::Core::UObject.

Reimplemented in Pol::Multi::UBoat.

Definition at line 873 of file item.cpp.

References Pol::Core::update_item_to_inrange().

Referenced by setcolor().

void Pol::Items::Item::on_facing_changed ( )
virtual

Reimplemented from Pol::Core::UObject.

Definition at line 901 of file item.cpp.

References Pol::Core::update_item_to_inrange().

Referenced by setfacing().

void Pol::Items::Item::on_invisible_changed ( )

Definition at line 883 of file item.cpp.

References Pol::Core::update_item_to_inrange().

void Pol::Items::Item::on_movable_changed ( )

Definition at line 878 of file item.cpp.

References Pol::Core::update_item_to_inrange().

Core::UObject * Pol::Items::Item::owner ( )
virtual

Reimplemented from Pol::Core::UObject.

Reimplemented in Pol::Core::WornItemsContainer.

Definition at line 236 of file item.cpp.

References container, and Pol::Core::UObject::self_as_owner().

const Core::UObject * Pol::Items::Item::owner ( ) const
virtual

Reimplemented from Pol::Core::UObject.

Reimplemented in Pol::Core::WornItemsContainer.

Definition at line 244 of file item.cpp.

References container, and Pol::Core::UObject::self_as_owner().

void Pol::Items::Item::printDebugProperties ( Clib::StreamWriter sw) const
protectedvirtual

Reimplemented from Pol::Core::UObject.

Definition at line 429 of file item.cpp.

References Pol::Core::UObject::printDebugProperties().

Item * Pol::Items::Item::remove_part_of_stack ( u16  amount_to_remove)

Definition at line 801 of file item.cpp.

References clone(), setamount(), and subamount().

Referenced by Pol::Module::oldBuyHandler().

void Pol::Items::Item::reset_slot ( )
inline

Definition at line 363 of file item.h.

Referenced by Pol::Core::drop_item_on_ground(), and Pol::Core::UContainer::remove().

Bscript::BObjectImp * Pol::Items::Item::run_equip_script ( Mobile::Character chr,
bool  startup 
)
Bscript::BObjectImp * Pol::Items::Item::run_unequip_script ( Mobile::Character who)
BObjectImp * Pol::Items::Item::script_method ( const char *  methodname,
Bscript::Executor ex 
)
virtual
void Pol::Items::Item::sellprice ( u32  value)

Definition at line 205 of file item.cpp.

void Pol::Items::Item::set_decay_after ( unsigned int  seconds)
BObjectImp * Pol::Items::Item::set_script_member ( const char *  membername,
const std::string &  value 
)
virtual

id test

Reimplemented from Pol::Core::UObject.

Reimplemented in Pol::Items::UWeapon, and Pol::Items::UArmor.

Definition at line 1112 of file uoscrobj.cpp.

References Pol::Bscript::getKnownObjMember(), and Pol::Bscript::ObjMember::id.

BObjectImp * Pol::Items::Item::set_script_member ( const char *  membername,
int  value 
)
virtual
BObjectImp * Pol::Items::Item::set_script_member_double ( const char *  membername,
double  value 
)
virtual

id test

Reimplemented from Pol::Core::UObject.

Reimplemented in Pol::Items::UWeapon, and Pol::Items::Equipment.

Definition at line 1316 of file uoscrobj.cpp.

References Pol::Bscript::getKnownObjMember(), and Pol::Bscript::ObjMember::id.

BObjectImp * Pol::Items::Item::set_script_member_id_double ( const int  id,
double  value 
)
virtual

Reimplemented from Pol::Core::UObject.

Reimplemented in Pol::Items::UWeapon, and Pol::Items::Equipment.

Definition at line 1301 of file uoscrobj.cpp.

References Pol::Bscript::MBR_QUALITY.

Referenced by Pol::Items::Equipment::set_script_member_id_double().

void Pol::Items::Item::set_use_script ( const std::string &  scriptname)

Definition at line 813 of file item.cpp.

References on_use_script_, and Pol::Core::UObject::set_dirty().

bool Pol::Items::Item::setcolor ( u16  newcolor)
virtual

return false if the color is invalid (high nibble set)

Reimplemented from Pol::Core::UObject.

Definition at line 853 of file item.cpp.

References Pol::Core::UObject::color, on_color_changed(), Pol::Core::UObject::set_dirty(), and Pol::Core::settingsManager.

void Pol::Items::Item::setfacing ( u8  newfacing)
virtual

allow 0-127 (all but MSB)

Implements Pol::Core::UObject.

Definition at line 888 of file item.cpp.

References Pol::Core::UObject::facing, and on_facing_changed().

Referenced by Item().

bool Pol::Items::Item::setgraphic ( u16  newobjtype)
virtual
bool Pol::Items::Item::setlayer ( unsigned char  layer)

Definition at line 557 of file item.cpp.

References Pol::Core::ULWObject::graphic, layer, and Pol::Core::tilelayer().

void Pol::Items::Item::setQuality ( double  value)
virtual

Reimplemented in Pol::Items::Equipment.

Definition at line 1200 of file item.cpp.

Referenced by clone(), and readProperties().

bool Pol::Items::Item::should_decay ( unsigned int  gameclock) const

Definition at line 969 of file item.cpp.

References can_decay(), and decayat_gameclock_.

Referenced by Pol::Core::decay_worldzone(), and restart_decay_timer().

Item * Pol::Items::Item::slice_stacked_item ( u16  this_item_new_amount)
Parameters
this_item_new_amountis the amount that this item will have.
Returns
A new item will be created, whos amount is the remainder. This is the returned item.

Slice_stacked_item

Used when a portion of a stack is dragged. Given ITEM1, with, for example, amount 75. If 25 units are dragged off, this function will get called with 25. What happens then:

  • ITEM2 is created, with Amount 50. It it placed where ITEM1 used to be.
  • ITEM1's Amount is set to 25.

In short, we go from: ITEM1 (Amount:75) TO ITEM1 (Amount:25) -under cursor, ITEM2(Amount:50) where ITEM1 was.

Definition at line 790 of file item.cpp.

References amount_, clone(), and setamount().

Referenced by Pol::Core::get_item(), and Pol::Module::oldSellHandler().

bool Pol::Items::Item::slot_index ( u8  newvalue)
inline

Definition at line 368 of file item.h.

References Pol::Core::settingsManager.

void Pol::Items::Item::spill_contents ( Multi::UMulti supporting_multi)
virtual

Reimplemented in Pol::Core::UContainer, and Pol::Core::UCorpse.

Definition at line 926 of file item.cpp.

Referenced by Pol::Core::decay_worldzone().

void Pol::Items::Item::subamount ( u16  amount_subtract)
const char * Pol::Items::Item::target_tag ( ) const
virtual

Reimplemented from Pol::Core::UObject.

Definition at line 1186 of file item.cpp.

const Core::UObject * Pol::Items::Item::toplevel_owner ( ) const
virtual

Reimplemented from Pol::Core::UObject.

Definition at line 261 of file item.cpp.

References container.

bool Pol::Items::Item::use_insurance ( )

Returns current insurance value and resets it to false.

Definition at line 299 of file item.cpp.

References insured(), and Pol::Core::UObject::set_dirty().

Referenced by Pol::Mobile::Character::die().

unsigned int Pol::Items::Item::weight ( ) const
virtual
unsigned int Pol::Items::Item::weight_of ( unsigned short  amount) const

Definition at line 928 of file item.cpp.

References itemdesc().

Referenced by can_add_to_self(), and weight().

Member Data Documentation

const ItemDesc* Pol::Items::Item::_itemdesc
mutableprotected

Definition at line 266 of file item.h.

Referenced by itemdesc().

const u32 Pol::Items::Item::BUYPRICE_DEFAULT = UINT_MAX
staticprotected

Definition at line 292 of file item.h.

Referenced by buyprice(), and readProperties().

Core::UContainer* Pol::Items::Item::container

Definition at line 256 of file item.h.

Referenced by Pol::Core::UContainer::add(), Pol::Core::UContainer::add_bulk(), Pol::Core::add_item_to_stack(), Pol::Core::UContainer::can_add_bulk(), can_add_to_self(), check_unequip_script(), check_unequiptest_scripts(), clone(), Pol::Core::destroy_item(), Pol::Mobile::Character::die(), Pol::Core::Spellbook::double_click(), Pol::Core::drop_item_on_ground(), Pol::Core::drop_item_on_mobile(), Pol::Core::equip_item(), extricate(), Pol::Core::find_toplevel_item(), Pol::Core::get_item(), Pol::Core::USpellScroll::get_senditem_amount(), Pol::Module::UOExecutorModule::internal_MoveItem(), Pol::Core::is_a_parent(), Pol::Module::ItemGivenEvent::ItemGivenEvent(), Pol::Module::UOExecutorModule::mf_MoveItemToContainer(), Pol::Module::UOExecutorModule::mf_MoveItemToSecureTradeWin(), Pol::Mobile::Character::mightsee(), Pol::Multi::UBoat::move_components(), Pol::Multi::UBoat::on_ship(), owner(), Pol::Core::place_item(), printProperties(), Pol::Core::WornItemsContainer::PutItemOnLayer(), Pol::Core::register_with_supporting_multi(), Pol::Core::UContainer::remove(), Pol::Core::remove_item_from_world(), Pol::Core::WornItemsContainer::RemoveItemFromLayer(), Pol::Core::return_traded_items(), Pol::Core::send_put_in_container(), Pol::Core::send_put_in_container_to_inrange(), setamount(), Pol::Core::UContainer::spill_contents(), toplevel_owner(), Pol::Multi::UBoat::transform_components(), Pol::Module::true_extricate(), Pol::Core::undo_get_item(), Pol::Mobile::Character::unequip(), Pol::Core::update_item_to_inrange(), and Pol::Module::ItemGivenEvent::~ItemGivenEvent().

unsigned int Pol::Items::Item::decayat_gameclock_
protected
boost_utils::script_name_flystring Pol::Items::Item::equip_script_
protected

Definition at line 264 of file item.h.

Referenced by clone(), has_equip_script(), Item(), printProperties(), readProperties(), and run_equip_script().

boost_utils::script_name_flystring Pol::Items::Item::on_use_script_
protected
const u32 Pol::Items::Item::SELLPRICE_DEFAULT = UINT_MAX
staticprotected

Definition at line 291 of file item.h.

Referenced by readProperties(), and sellprice().

u8 Pol::Items::Item::slot_index_
protected

Definition at line 261 of file item.h.

boost_utils::script_name_flystring Pol::Items::Item::unequip_script_
protected

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