|
Pol
Revision:cb584c9
|
#include <weapon.h>
Inheritance diagram for Pol::Items::UWeapon:Public Member Functions | |
| virtual | ~UWeapon () |
| Core::UACTION | anim () const |
| const Mobile::Attribute & | attribute () const |
| virtual Item * | clone () const POL_OVERRIDE |
| bool | consume_projectile (Core::UContainer *cont) const |
| unsigned short | delay () const |
| const WeaponDesc & | descriptor () const |
| DYN_PROPERTY (damage_mod, s16, Core::PROP_DMG_MOD, 0) | |
| DYN_PROPERTY (speed_mod, s16, Core::PROP_SPEED_MOD, 0) | |
| virtual size_t | estimatedSize () const POL_OVERRIDE |
| unsigned short | get_random_damage () const |
| const Core::ScriptDef & | hit_script () const |
| unsigned short | hit_sound () const |
| bool | in_range (const Mobile::Character *wielder, const Mobile::Character *target) const |
| bool | is_projectile () const |
| unsigned short | miss_sound () const |
| Core::UACTION | mounted_anim () const |
| unsigned short | projectile_anim () const |
| unsigned short | projectile_sound () const |
| void | set_hit_script (const std::string &scriptname) |
| unsigned short | speed () const |
Public Member Functions inherited from Pol::Items::Equipment | |
| virtual | ~Equipment () |
| virtual double | getQuality () const POL_OVERRIDE |
| bool | is_intrinsic () const |
| Tells eather an equipment is intrinsic or not Intrinsic equipment is, by example, NPCs "natural" weapon and shield or the PCs wrestling weapon. More... | |
| void | reduce_hp_from_hit () |
| virtual void | setQuality (double value) POL_OVERRIDE |
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 |
| 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 Bscript::BObjectImp * | custom_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 () |
| virtual u16 | get_senditem_amount () const |
| std::string | get_use_script_name () const |
| u16 | getamount () const |
| bool | getbuyprice (u32 &buyprice) const |
| Mobile::Character * | GetCharacterOwner () |
| 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 ItemDesc & | itemdesc () const |
| virtual Bscript::BObjectImp * | make_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 UObject * | owner () POL_OVERRIDE |
| virtual const UObject * | owner () const POL_OVERRIDE |
| Item * | remove_part_of_stack (u16 amount_to_remove) |
| void | reset_slot () |
| void | restart_decay_timer () |
| Bscript::BObjectImp * | run_equip_script (Mobile::Character *chr, bool startup) |
| Bscript::BObjectImp * | run_unequip_script (Mobile::Character *who) |
| virtual Bscript::BObjectImp * | script_method (const char *methodname, Bscript::Executor &ex) POL_OVERRIDE |
| virtual Bscript::BObjectImp * | script_method_id (const int id, Bscript::Executor &ex) POL_OVERRIDE |
| u32 | sellprice () const |
| void | sellprice (u32) |
| void | set_decay_after (unsigned int seconds) |
| 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) |
| bool | should_decay (unsigned int gameclock) const |
| Item * | slice_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 UObject * | toplevel_owner () POL_OVERRIDE |
| virtual const UObject * | toplevel_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_counted * | as_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 PropertyList & | getprops () 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 UObject * | self_as_owner () |
| virtual const UObject * | self_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) |
Protected Member Functions | |
| UWeapon (const WeaponDesc &descriptor, const WeaponDesc *permanent_descriptor) | |
| virtual Bscript::BObjectImp * | get_script_member (const char *membername) const POL_OVERRIDE |
| virtual Bscript::BObjectImp * | get_script_member_id (const int id) const POL_OVERRIDE |
| virtual void | printProperties (Clib::StreamWriter &sw) const POL_OVERRIDE |
| virtual void | readProperties (Clib::ConfigElem &elem) POL_OVERRIDE |
| virtual bool | script_isa (unsigned isatype) const POL_OVERRIDE |
| virtual Bscript::BObjectImp * | set_script_member (const char *membername, const std::string &value) POL_OVERRIDE |
| id test More... | |
| virtual Bscript::BObjectImp * | set_script_member (const char *membername, int value) POL_OVERRIDE |
| id test More... | |
| virtual Bscript::BObjectImp * | set_script_member_double (const char *membername, double value) POL_OVERRIDE |
| id test More... | |
| virtual Bscript::BObjectImp * | set_script_member_id (const int id, const std::string &value) POL_OVERRIDE |
| virtual Bscript::BObjectImp * | set_script_member_id (const int id, int value) POL_OVERRIDE |
| id test More... | |
| virtual Bscript::BObjectImp * | set_script_member_id_double (const int id, double value) POL_OVERRIDE |
Protected Member Functions inherited from Pol::Items::Equipment | |
| Equipment (const ItemDesc &itemdesc, Core::UOBJ_CLASS uobj_class, const Core::EquipDesc *permanent_descriptor) | |
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 | |
| ULWObject & | operator= (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) |
Private Types | |
| typedef Equipment | base |
Private Attributes | |
| Core::ScriptDef | hit_script_ |
Friends | |
| UWeapon * | create_intrinsic_weapon (const char *name, Clib::ConfigElem &elem, const Plib::Package *pkg) |
| Creates a new intrinsic weapon and returns it. More... | |
| class | Item |
| void | load_data () |
| void | load_intrinsic_weapons () |
| Creates the intrinsic wrestling weapon for PCs must be called at startup. More... | |
|
private |
|
inlinevirtual |
Definition at line 65 of file weapon.h.
References DYN_PROPERTY, POL_OVERRIDE, Pol::Core::PROP_DMG_MOD, and Pol::Core::PROP_SPEED_MOD.
|
protected |
Definition at line 332 of file weapon.cpp.
References Pol::Core::CLASS_WEAPON.
| Core::UACTION Pol::Items::UWeapon::anim | ( | ) | const |
Definition at line 402 of file weapon.cpp.
References passert, Pol::Items::Equipment::tmpl, and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::weapon_anim().
| const Mobile::Attribute & Pol::Items::UWeapon::attribute | ( | ) | const |
Definition at line 360 of file weapon.cpp.
References WEAPON_TMPL.
Referenced by Pol::Mobile::Character::weapon_attribute().
|
virtual |
This is a pretty good clone. Somewhat inefficient, but does work for derived classes that do not have data. (since it calls Item::create, virtual tables are copied)
Reimplemented from Pol::Items::Equipment.
Definition at line 462 of file weapon.cpp.
References Pol::Items::Equipment::clone(), and hit_script_.
| bool Pol::Items::UWeapon::consume_projectile | ( | Core::UContainer * | cont | ) | const |
Definition at line 432 of file weapon.cpp.
References Pol::Core::UContainer::find_objtype_noninuse(), passert, Pol::Core::subtract_amount_from_item(), Pol::Items::Equipment::tmpl, and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::attack().
| unsigned short Pol::Items::UWeapon::delay | ( | ) | const |
Definition at line 355 of file weapon.cpp.
References WEAPON_TMPL.
Referenced by Pol::Mobile::Character::schedule_attack().
| const WeaponDesc & Pol::Items::UWeapon::descriptor | ( | ) | const |
Definition at line 426 of file weapon.cpp.
References passert, Pol::Items::Equipment::tmpl, and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::equippable(), Pol::Mobile::Character::max_weapon_damage(), and Pol::Mobile::Character::min_weapon_damage().
| Pol::Items::UWeapon::DYN_PROPERTY | ( | damage_mod | , |
| s16 | , | ||
| Core::PROP_DMG_MOD | , | ||
| 0 | |||
| ) |
| Pol::Items::UWeapon::DYN_PROPERTY | ( | speed_mod | , |
| s16 | , | ||
| Core::PROP_SPEED_MOD | , | ||
| 0 | |||
| ) |
|
virtual |
Reimplemented from Pol::Items::Equipment.
Definition at line 338 of file weapon.cpp.
References Pol::Core::ScriptDef::estimatedSize(), Pol::Items::Equipment::estimatedSize(), and hit_script_.
| unsigned short Pol::Items::UWeapon::get_random_damage | ( | ) | const |
Definition at line 365 of file weapon.cpp.
References Pol::Items::Item::hp_, Pol::Items::Item::maxhp(), and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::random_weapon_damage().
|
protectedvirtual |
Reimplemented from Pol::Items::Equipment.
Definition at line 4069 of file uoscrobj.cpp.
References Pol::Bscript::getKnownObjMember(), and Pol::Bscript::ObjMember::id.
|
protectedvirtual |
Reimplemented from Pol::Items::Equipment.
Definition at line 4045 of file uoscrobj.cpp.
References Pol::Items::Equipment::get_script_member_id(), Pol::Bscript::MBR_ATTRIBUTE, Pol::Bscript::MBR_DMG_MOD, Pol::Bscript::MBR_HITSCRIPT, Pol::Bscript::MBR_SPEED_MOD, and name.
|
inline |
Definition at line 134 of file weapon.h.
References Pol::Items::create_intrinsic_weapon(), Pol::Items::create_intrinsic_weapon_from_npctemplate(), and Pol::Items::isa_weapon().
Referenced by Pol::Mobile::Character::attack(), and Pol::Mobile::Character::run_hit_script().
| unsigned short Pol::Items::UWeapon::hit_sound | ( | ) | const |
Definition at line 414 of file weapon.cpp.
References passert, Pol::Items::Equipment::tmpl, and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::do_hit_success_effects().
| bool Pol::Items::UWeapon::in_range | ( | const Mobile::Character * | wielder, |
| const Mobile::Character * | target | ||
| ) | const |
Definition at line 448 of file weapon.cpp.
References Pol::Realms::Realm::has_los(), INFO_PRINT_TRACE, Pol::Core::pol_distance(), Pol::Core::ULWObject::realm, Pol::Core::ULWObject::serial, and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::is_attackable().
| bool Pol::Items::UWeapon::is_projectile | ( | ) | const |
Definition at line 377 of file weapon.cpp.
References passert, Pol::Items::Equipment::tmpl, and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::attack(), Pol::Mobile::Character::damage_weapon(), Pol::Mobile::Character::do_attack_effects(), Pol::Mobile::Character::face(), and Pol::Mobile::Character::move().
| unsigned short Pol::Items::UWeapon::miss_sound | ( | ) | const |
Definition at line 420 of file weapon.cpp.
References passert, Pol::Items::Equipment::tmpl, and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::do_hit_failure_effects().
| Core::UACTION Pol::Items::UWeapon::mounted_anim | ( | ) | const |
Definition at line 408 of file weapon.cpp.
References passert, Pol::Items::Equipment::tmpl, and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::weapon_anim().
|
protectedvirtual |
Reimplemented from Pol::Items::Equipment.
Definition at line 472 of file weapon.cpp.
References hit_script_, pf_endl, Pol::Items::ItemDesc::pkg, Pol::Items::Equipment::printProperties(), Pol::Core::ScriptDef::relativename(), Pol::Items::Equipment::tmpl, and WEAPON_TMPL.
| unsigned short Pol::Items::UWeapon::projectile_anim | ( | ) | const |
Definition at line 389 of file weapon.cpp.
References passert, Pol::Items::Equipment::tmpl, and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::do_attack_effects().
| unsigned short Pol::Items::UWeapon::projectile_sound | ( | ) | const |
Definition at line 383 of file weapon.cpp.
References passert, Pol::Items::Equipment::tmpl, and WEAPON_TMPL.
Referenced by Pol::Mobile::Character::do_attack_effects().
|
protectedvirtual |
Reimplemented from Pol::Items::Equipment.
Definition at line 487 of file weapon.cpp.
References Pol::Clib::ConfigElem::has_prop(), Pol::Items::Equipment::readProperties(), Pol::Clib::ConfigElem::remove_int(), Pol::Clib::ConfigElem::remove_string(), and set_hit_script().
|
protectedvirtual |
Reimplemented from Pol::Items::Equipment.
Definition at line 4619 of file uoscrobj.cpp.
References Pol::Core::Mobile, and Pol::Core::POLCLASS_WEAPON.
| void Pol::Items::UWeapon::set_hit_script | ( | const std::string & | scriptname | ) |
Definition at line 499 of file weapon.cpp.
References Pol::Core::ScriptDef::clear(), Pol::Core::ScriptDef::config(), hit_script_, passert, Pol::Items::ItemDesc::pkg, and Pol::Items::Equipment::tmpl.
Referenced by readProperties().
|
protectedvirtual |
id test
Reimplemented from Pol::Items::Item.
Definition at line 4093 of file uoscrobj.cpp.
References Pol::Bscript::getKnownObjMember(), and Pol::Bscript::ObjMember::id.
|
protectedvirtual |
id test
Reimplemented from Pol::Items::Equipment.
Definition at line 4128 of file uoscrobj.cpp.
References Pol::Bscript::getKnownObjMember(), and Pol::Bscript::ObjMember::id.
|
protectedvirtual |
id test
Reimplemented from Pol::Items::Equipment.
Definition at line 4147 of file uoscrobj.cpp.
References Pol::Bscript::getKnownObjMember(), and Pol::Bscript::ObjMember::id.
|
protectedvirtual |
Reimplemented from Pol::Items::Item.
Definition at line 4078 of file uoscrobj.cpp.
References Pol::Bscript::MBR_HITSCRIPT, and Pol::Items::Item::set_script_member_id().
|
protectedvirtual |
id test
Reimplemented from Pol::Items::Equipment.
Definition at line 4102 of file uoscrobj.cpp.
References Pol::Bscript::MBR_DMG_MOD, Pol::Bscript::MBR_SPEED_MOD, and Pol::Items::Equipment::set_script_member_id().
|
protectedvirtual |
Reimplemented from Pol::Items::Equipment.
Definition at line 4137 of file uoscrobj.cpp.
| unsigned short Pol::Items::UWeapon::speed | ( | ) | const |
Definition at line 343 of file weapon.cpp.
References WEAPON_TMPL.
Referenced by Pol::Mobile::Character::schedule_attack().
|
friend |
Creates a new intrinsic weapon and returns it.
| name | the unique weapon's name |
| elem | the config element to create from |
| pkg | the package |
Definition at line 228 of file weapon.cpp.
|
friend |
Definition at line 152 of file loadunld.cpp.
|
friend |
Creates the intrinsic wrestling weapon for PCs must be called at startup.
Definition at line 244 of file weapon.cpp.
|
private |
Definition at line 131 of file weapon.h.
Referenced by clone(), estimatedSize(), printProperties(), and set_hit_script().