Pol  Revision:cb584c9
Pol::Core::UCorpse Class Reference

#include <corpse.h>

+ Inheritance diagram for Pol::Core::UCorpse:

Public Member Functions

virtual ~UCorpse ()
 
virtual void add (Item *item) POL_OVERRIDE
 
virtual size_t estimatedSize () const POL_OVERRIDE
 
virtual u16 get_senditem_amount () const POL_OVERRIDE
 
Items::ItemGetItemOnLayer (unsigned idx) const
 
virtual void on_insert_add_item (Mobile::Character *mob, MoveType move, Items::Item *new_item) POL_OVERRIDE
 
virtual void remove (iterator itr) POL_OVERRIDE
 
bool take_contents_to_grave () const
 
void take_contents_to_grave (bool newvalue)
 
- Public Member Functions inherited from Pol::Core::UContainer
virtual ~UContainer ()
 
void add_at_random_location (Items::Item *item)
 
virtual void add_bulk (int item_count_delta, int weight_delta)
 
void add_bulk (const Items::Item *item)
 
iterator begin ()
 
const_iterator begin () const
 
virtual void builtin_on_use (Network::Client *client) POL_OVERRIDE
 
virtual bool can_add (const Items::Item &item) const
 
virtual bool can_add (unsigned short more_weight) const
 
bool can_add_bulk (int tli_diff, int item_count_diff, int weight_diff) const
 
bool can_add_to_slot (u8 &slotIndex)
 
bool can_insert_add_item (Mobile::Character *mob, MoveType move, Items::Item *new_item)
 
bool can_insert_increase_stack (Mobile::Character *mob, MoveType move, Items::Item *existing_item, unsigned short amt_to_add, Items::Item *adding_item)
 
bool can_swap (const UContainer &cont) const
 
bool check_can_remove_script (Mobile::Character *chr, Items::Item *item, MoveType move=MT_PLAYER)
 
virtual Items::Itemclone () const POL_OVERRIDE
 
void consume_sumof_objtype_noninuse (u32 objtype, unsigned int amount)
 
unsigned count () const
 
bool default_no_drop_exception () const
 
const Items::ContainerDescdescriptor () const
 
virtual void destroy () POL_OVERRIDE
 
void destroy_contents ()
 
 DYN_PROPERTY (max_items_mod, s16, Core::PROP_MAX_ITEMS_MOD, 0)
 
 DYN_PROPERTY (max_slots_mod, s8, Core::PROP_MAX_SLOTS_MOD, 0)
 
 DYN_PROPERTY (max_weight_mod, s16, Core::PROP_MAX_WEIGHT_MOD, 0)
 
iterator end ()
 
const_iterator end () const
 
void enumerate_contents (Bscript::ObjArray *arr, int flags)
 
void extract (Contents &cnt)
 
Items::Itemfind (u32 serial) const
 
Items::Itemfind_addable_stack (const Items::Item *adding_item) const
 
UContainerfind_container (u32 serial) const
 
bool find_empty_slot (u8 &slotIndex)
 
Items::Itemfind_objtype (u32 objtype, int flags) const
 
Items::Itemfind_objtype_noninuse (u32 objtype) const
 
unsigned int find_sumof_objtype_noninuse (u32 objtype) const
 
unsigned int find_sumof_objtype_noninuse (u32 objtype, u32 amtToGet, Contents &saveItemsTo, int flags) const
 
Items::Itemfind_toplevel (u32 serial) const
 
Items::Itemfind_toplevel_objtype (u32 objtype) const
 
Items::Itemfind_toplevel_objtype (u32 objtype, unsigned short maxamount) const
 
Items::Itemfind_toplevel_objtype_noninuse (u32 objtype) const
 
Items::Itemfind_toplevel_objtype_noninuse (u32 objtype, unsigned short maxamount) const
 
Items::Itemfind_toplevel_polclass (unsigned int polclass) const
 
virtual void for_each_item (void(*f)(Item *item, void *a), void *arg)
 
virtual Mobile::Characterget_chr_owner ()
 
void get_random_location (u16 *px, u16 *py) const
 
u16 gump () const
 
bool is_legal_posn (const Items::Item *item, u16 x, u16 y) const
 
bool is_slot_empty (u8 &slotIndex)
 
virtual unsigned int item_count () const POL_OVERRIDE
 
unsigned short max_items () const
 
u8 max_slots () const
 
unsigned short max_weight () const
 
bool no_drop_exception () const
 
void no_drop_exception (bool newvalue)
 
void on_insert_increase_stack (Mobile::Character *mob, MoveType move, Items::Item *existing_item, unsigned short amt_added)
 
void on_remove (Mobile::Character *chr, Items::Item *item, MoveType move=MT_PLAYER)
 
virtual Items::Itemremove (u32 serial, UContainer **found_in=nullptr)
 
virtual void remove (Items::Item *item)
 
void remove_bulk (const Items::Item *item)
 
virtual Bscript::BObjectImpset_script_member (const char *membername, int value) POL_OVERRIDE
 id test More...
 
virtual Bscript::BObjectImpset_script_member_id (const int id, int value) POL_OVERRIDE
 id test More...
 
void swap (UContainer &cont)
 
Items::Itemsystem_find (u32 serial) const
 
virtual unsigned int weight () const POL_OVERRIDE
 
- Public Member Functions inherited from Pol::Core::ULockable
bool locked () const
 
- Public Member Functions inherited from Pol::Items::Item
virtual ~Item ()
 
void add_to_self (Item *&item)
 
bool amount_to_remove_is_partial (u16 amount_to_remove) const
 
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 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)
 
void extricate ()
 
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)
 
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
 
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 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_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_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)
 
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)
 
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)
 
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 printOnDebug (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)
 

Public Attributes

u16 corpsetype
 
u32 ownerserial
 
- Public Attributes inherited from Pol::Items::Item
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

 UCorpse (const Items::ContainerDesc &desc)
 
virtual Bscript::BObjectImpget_script_member (const char *membername) const POL_OVERRIDE
 
virtual Bscript::BObjectImpget_script_member_id (const int id) const POL_OVERRIDE
 
virtual void printProperties (Clib::StreamWriter &sw) const POL_OVERRIDE
 
void PutItemOnLayer (Items::Item *item)
 
virtual void readProperties (Clib::ConfigElem &elem) POL_OVERRIDE
 
void RemoveItemFromLayer (Items::Item *item)
 
virtual bool script_isa (unsigned isatype) const POL_OVERRIDE
 id test More...
 
virtual void spill_contents (Multi::UMulti *supporting_multi) POL_OVERRIDE
 
- Protected Member Functions inherited from Pol::Core::UContainer
 UContainer (const Items::ContainerDesc &descriptor)
 
 UContainer (u32 objtype, UOBJ_CLASS pol_class)
 
Items::Itemfind (u32 serial, iterator &where_in_container)
 
Items::Itemoperator[] (unsigned idx) const
 
void printContents (Clib::StreamWriter &sw) const
 
virtual void printOn (Clib::StreamWriter &sw) const POL_OVERRIDE
 
virtual void printSelfOn (Clib::StreamWriter &sw) const POL_OVERRIDE
 
- Protected Member Functions inherited from Pol::Core::ULockable
 ULockable (const Items::ItemDesc &itemdesc, UOBJ_CLASS uobj_class)
 
virtual ~ULockable ()
 
void locked (bool newvalue)
 
- Protected Member Functions inherited from Pol::Items::Item
 Item (const ItemDesc &itemdesc, Core::UOBJ_CLASS uobj_class)
 
virtual void printDebugProperties (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

Contents layer_list_
 
- Protected Attributes inherited from Pol::Core::UContainer
Contents contents_
 
const Items::ContainerDescdesc
 
unsigned int held_item_count_
 
u16 held_weight_
 
- Protected Attributes inherited from Pol::Items::Item
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
 

Private Types

typedef UContainer base
 

Friends

Items::ItemItems::Item::create (const Items::ItemDesc &itemdesc, u32 serial)
 

Additional Inherited Members

- Public Types inherited from Pol::Core::UContainer
typedef ULockable base
 
typedef Contents::const_iterator const_iterator
 
typedef std::vector< Items::Item * > Contents
 
typedef Contents::iterator iterator
 
enum  MoveType { MT_PLAYER = 0, MT_CORE_MOVED = 1, MT_CORE_CREATED = 2 }
 
- Static Public Member Functions inherited from Pol::Items::Item
static Itemcreate (u32 objtype, u32 serial=0)
 
static Itemcreate (const ItemDesc &itemdesc, u32 serial=0)
 
- Static Public Attributes inherited from Pol::Core::UObject
static std::atomic< unsigned int > clean_writes
 
static std::atomic< unsigned int > dirty_writes
 
- Static Protected Attributes inherited from Pol::Items::Item
static const u32 BUYPRICE_DEFAULT = UINT_MAX
 
static const u32 SELLPRICE_DEFAULT = UINT_MAX
 

Detailed Description

Definition at line 41 of file corpse.h.

Member Typedef Documentation

Definition at line 43 of file corpse.h.

Constructor & Destructor Documentation

virtual Pol::Core::UCorpse::~UCorpse ( )
inlinevirtual

Definition at line 46 of file corpse.h.

References POL_OVERRIDE.

Pol::Core::UCorpse::UCorpse ( const Items::ContainerDesc desc)
explicitprotected

Member Function Documentation

void Pol::Core::UCorpse::add ( Item item)
virtual
size_t Pol::Core::UCorpse::estimatedSize ( ) const
virtual

Reimplemented from Pol::Core::UContainer.

Definition at line 147 of file corpse.cpp.

References Pol::Core::UContainer::estimatedSize(), and layer_list_.

BObjectImp * Pol::Core::UCorpse::get_script_member ( const char *  membername) const
protectedvirtual

Reimplemented from Pol::Core::UContainer.

Definition at line 3412 of file uoscrobj.cpp.

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

BObjectImp * Pol::Core::UCorpse::get_script_member_id ( const int  id) const
protectedvirtual

Reimplemented from Pol::Core::UContainer.

Definition at line 3393 of file uoscrobj.cpp.

References Pol::Bscript::MBR_CORPSETYPE, and Pol::Bscript::MBR_OWNERSERIAL.

u16 Pol::Core::UCorpse::get_senditem_amount ( ) const
virtual

Reimplemented from Pol::Items::Item.

Definition at line 73 of file corpse.cpp.

References corpsetype.

Items::Item * Pol::Core::UCorpse::GetItemOnLayer ( unsigned  idx) const
inline
void Pol::Core::UCorpse::on_insert_add_item ( Mobile::Character mob,
MoveType  move,
Items::Item new_item 
)
virtual
void Pol::Core::UCorpse::printProperties ( Clib::StreamWriter sw) const
protectedvirtual
void Pol::Core::UCorpse::PutItemOnLayer ( Items::Item item)
protected
void Pol::Core::UCorpse::RemoveItemFromLayer ( Items::Item item)
protected
bool Pol::Core::UCorpse::script_isa ( unsigned  isatype) const
protectedvirtual

id test

Reimplemented from Pol::Core::UContainer.

Definition at line 4581 of file uoscrobj.cpp.

References Pol::Core::POLCLASS_CORPSE.

Friends And Related Function Documentation

Items::Item* Items::Item::create ( const Items::ItemDesc itemdesc,
u32  serial 
)
friend

Member Data Documentation

u16 Pol::Core::UCorpse::corpsetype
Contents Pol::Core::UCorpse::layer_list_
protected

Definition at line 77 of file corpse.h.

Referenced by estimatedSize(), PutItemOnLayer(), RemoveItemFromLayer(), and UCorpse().

u32 Pol::Core::UCorpse::ownerserial

Definition at line 58 of file corpse.h.

Referenced by Pol::Mobile::Character::die(), printProperties(), and readProperties().


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