Pol  Rev 533
UWeapon Class Reference

#include <weapon.h>

+ Inheritance diagram for UWeapon:
+ Collaboration diagram for UWeapon:

List of all members.

Public Member Functions

UACTION anim () const
const Attributeattribute () const
virtual Itemclone () const
bool consume_projectile (UContainer *cont) const
unsigned short delay () const
const WeaponDescdescriptor () const
unsigned short get_random_damage () const
const ScriptDefhit_script () const
unsigned short hit_sound () const
bool in_range (const Character *wielder, const Character *target) const
bool is_intrinsic () const
bool is_projectile () const
unsigned short miss_sound () const
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

Protected Member Functions

 UWeapon (const WeaponDesc &descriptor, const WeaponDesc *permanent_descriptor)
 ~UWeapon ()
virtual BObjectImpget_script_member (const char *membername) const
virtual BObjectImpget_script_member_id (const int id) const
virtual void printProperties (std::ostream &os) const
virtual void readProperties (ConfigElem &elem)
virtual bool script_isa (unsigned isatype) const
virtual BObjectImpset_script_member (const char *membername, const std::string &value)
 id test
virtual BObjectImpset_script_member (const char *membername, int value)
 id test
virtual BObjectImpset_script_member_double (const char *membername, double value)
virtual BObjectImpset_script_member_id (const int id, const std::string &value)
virtual BObjectImpset_script_member_id (const int id, int value)
 id test
virtual BObjectImpset_script_member_id_double (const int id, double value)

Private Types

typedef Equipment base

Private Attributes

short dmg_mod_
ScriptDef hit_script_
const WeaponDesctmpl

Friends

UWeaponcreate_intrinsic_weapon (const char *name, ConfigElem &elem, const Package *pkg)
class Item
void load_data ()
void load_intrinsic_weapons ()
void load_weapon_templates ()

Detailed Description

Definition at line 31 of file weapon.h.


Member Typedef Documentation

typedef Equipment UWeapon::base [private]

Reimplemented from Equipment.

Definition at line 33 of file weapon.h.


Constructor & Destructor Documentation

UWeapon::UWeapon ( const WeaponDesc descriptor,
const WeaponDesc permanent_descriptor 
) [protected]

Definition at line 406 of file weapon.cpp.

UWeapon::~UWeapon ( ) [protected]

Definition at line 415 of file weapon.cpp.

References extobj, is_intrinsic(), ItemDesc::objtype, tmpl, ItemDesc::unload_scripts(), and ExternalObject::wrestling.

+ Here is the call graph for this function:


Member Function Documentation

Definition at line 486 of file weapon.cpp.

References WeaponDesc::anim, and tmpl.

Referenced by Character::weapon_anim().

+ Here is the caller graph for this function:

const Attribute & UWeapon::attribute ( ) const

Definition at line 441 of file weapon.cpp.

References WeaponDesc::pAttr, and tmpl.

Referenced by get_script_member_id(), and Character::weapon_attribute().

+ Here is the caller graph for this function:

Item * UWeapon::clone ( ) const [virtual]

Reimplemented from Equipment.

Definition at line 540 of file weapon.cpp.

References Equipment::clone(), dmg_mod_, and hit_script_.

+ Here is the call graph for this function:

bool UWeapon::consume_projectile ( UContainer cont) const

Definition at line 511 of file weapon.cpp.

References UContainer::find_objtype_noninuse(), WeaponDesc::projectile_type, subtract_amount_from_item(), and tmpl.

Referenced by Character::attack().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned short UWeapon::delay ( ) const

Definition at line 436 of file weapon.cpp.

References WeaponDesc::delay, and tmpl.

Referenced by Character::schedule_attack().

+ Here is the caller graph for this function:

const WeaponDesc & UWeapon::descriptor ( ) const

Definition at line 506 of file weapon.cpp.

References tmpl.

Referenced by Character::equippable(), Character::max_weapon_damage(), and Character::min_weapon_damage().

+ Here is the caller graph for this function:

unsigned short UWeapon::get_random_damage ( ) const

Definition at line 447 of file weapon.cpp.

References dmg_mod_, WeaponDesc::get_random_damage(), Equipment::hp_, Equipment::maxhp(), and tmpl.

Referenced by Character::random_weapon_damage().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BObjectImp * UWeapon::get_script_member ( const char *  membername) const [protected, virtual]

Reimplemented from Equipment.

Definition at line 3186 of file uoscrobj.cpp.

References get_script_member_id(), getKnownObjMember(), and ObjMember::id.

+ Here is the call graph for this function:

BObjectImp * UWeapon::get_script_member_id ( const int  id) const [protected, virtual]

Reimplemented from Equipment.

Definition at line 3171 of file uoscrobj.cpp.

References attribute(), dmg_mod_, hit_script_, is_intrinsic(), MBR_ATTRIBUTE, MBR_DMG_MOD, MBR_HITSCRIPT, MBR_INTRINSIC, Item::name(), ItemDesc::pkg, ScriptDef::relativename(), and tmpl.

Referenced by get_script_member().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const ScriptDef & UWeapon::hit_script ( ) const [inline]

Definition at line 101 of file weapon.h.

References hit_script_.

Referenced by Character::attack(), and Character::run_hit_script().

+ Here is the caller graph for this function:

unsigned short UWeapon::hit_sound ( ) const

Definition at line 496 of file weapon.cpp.

References WeaponDesc::hit_sound, and tmpl.

Referenced by Character::do_hit_success_effects().

+ Here is the caller graph for this function:

bool UWeapon::in_range ( const Character wielder,
const Character target 
) const

Definition at line 525 of file weapon.cpp.

References dtrace, Realm::has_los(), WeaponDesc::maxrange, WeaponDesc::minrange, pol_distance(), UObject::realm, and tmpl.

Referenced by Character::is_attackable().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool UWeapon::is_intrinsic ( ) const

Definition at line 464 of file weapon.cpp.

References WeaponDesc::is_intrinsic, and tmpl.

Referenced by Character::damage_weapon(), Character::equippable(), get_script_member_id(), set_script_member_id(), set_script_member_id_double(), and ~UWeapon().

+ Here is the caller graph for this function:

bool UWeapon::is_projectile ( ) const

Definition at line 459 of file weapon.cpp.

References WeaponDesc::projectile, and tmpl.

Referenced by Character::attack(), Character::damage_weapon(), Character::do_attack_effects(), Character::face(), and Character::move().

+ Here is the caller graph for this function:

unsigned short UWeapon::miss_sound ( ) const

Definition at line 501 of file weapon.cpp.

References WeaponDesc::miss_sound, and tmpl.

Referenced by Character::do_hit_failure_effects().

+ Here is the caller graph for this function:

Definition at line 491 of file weapon.cpp.

References WeaponDesc::mounted_anim, and tmpl.

Referenced by Character::weapon_anim().

+ Here is the caller graph for this function:

void UWeapon::printProperties ( std::ostream &  os) const [protected, virtual]

Reimplemented from Equipment.

Definition at line 548 of file weapon.cpp.

References dmg_mod_, WeaponDesc::hit_script, hit_script_, pf_endl, ItemDesc::pkg, Equipment::printProperties(), ScriptDef::relativename(), and tmpl.

+ Here is the call graph for this function:

unsigned short UWeapon::projectile_anim ( ) const

Definition at line 474 of file weapon.cpp.

References WeaponDesc::projectile_anim, and tmpl.

Referenced by Character::do_attack_effects().

+ Here is the caller graph for this function:

unsigned short UWeapon::projectile_sound ( ) const

Definition at line 469 of file weapon.cpp.

References WeaponDesc::projectile_sound, and tmpl.

Referenced by Character::do_attack_effects().

+ Here is the caller graph for this function:

void UWeapon::readProperties ( ConfigElem elem) [protected, virtual]

Reimplemented from Equipment.

Definition at line 557 of file weapon.cpp.

References dmg_mod_, ConfigElem::has_prop(), Equipment::readProperties(), ConfigElem::remove_int(), ConfigElem::remove_string(), and set_hit_script().

+ Here is the call graph for this function:

bool UWeapon::script_isa ( unsigned  isatype) const [protected, virtual]

Reimplemented from Equipment.

Definition at line 3730 of file uoscrobj.cpp.

References POLCLASS_WEAPON, and Equipment::script_isa().

+ Here is the call graph for this function:

void UWeapon::set_hit_script ( const std::string &  scriptname)

Definition at line 568 of file weapon.cpp.

References ScriptDef::clear(), ScriptDef::config(), hit_script_, ItemDesc::pkg, and tmpl.

Referenced by readProperties(), and set_script_member_id().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BObjectImp * UWeapon::set_script_member ( const char *  membername,
const std::string &  value 
) [protected, virtual]

id test

Reimplemented from Item.

Definition at line 3207 of file uoscrobj.cpp.

References getKnownObjMember(), ObjMember::id, and set_script_member_id().

+ Here is the call graph for this function:

BObjectImp * UWeapon::set_script_member ( const char *  membername,
int  value 
) [protected, virtual]

id test

Reimplemented from Equipment.

Definition at line 3232 of file uoscrobj.cpp.

References getKnownObjMember(), ObjMember::id, and set_script_member_id().

+ Here is the call graph for this function:

BObjectImp * UWeapon::set_script_member_double ( const char *  membername,
double  value 
) [protected, virtual]

Reimplemented from Equipment.

Definition at line 3248 of file uoscrobj.cpp.

References getKnownObjMember(), ObjMember::id, Equipment::set_script_member_double(), and set_script_member_id_double().

+ Here is the call graph for this function:

BObjectImp * UWeapon::set_script_member_id ( const int  id,
const std::string &  value 
) [protected, virtual]

Reimplemented from Item.

Definition at line 3195 of file uoscrobj.cpp.

References MBR_HITSCRIPT, and set_hit_script().

Referenced by set_script_member(), and set_script_member_id().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BObjectImp * UWeapon::set_script_member_id ( const int  id,
int  value 
) [protected, virtual]

id test

Reimplemented from Equipment.

Definition at line 3216 of file uoscrobj.cpp.

References dmg_mod_, is_intrinsic(), MBR_DMG_MOD, and set_script_member_id().

+ Here is the call graph for this function:

BObjectImp * UWeapon::set_script_member_id_double ( const int  id,
double  value 
) [protected, virtual]

Reimplemented from Equipment.

Definition at line 3241 of file uoscrobj.cpp.

References is_intrinsic(), and Equipment::set_script_member_id_double().

Referenced by set_script_member_double().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned short UWeapon::speed ( ) const

Definition at line 431 of file weapon.cpp.

References WeaponDesc::speed, and tmpl.

Referenced by Character::schedule_attack().

+ Here is the caller graph for this function:


Friends And Related Function Documentation

UWeapon* create_intrinsic_weapon ( const char *  name,
ConfigElem elem,
const Package pkg 
) [friend]

Definition at line 247 of file weapon.cpp.

friend class Item [friend]

Definition at line 74 of file weapon.h.

void load_data ( ) [friend]

Definition at line 132 of file loadunld.cpp.

void load_intrinsic_weapons ( ) [friend]

Definition at line 274 of file weapon.cpp.

void load_weapon_templates ( ) [friend]

Definition at line 269 of file weapon.cpp.


Member Data Documentation


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