My Project
 
Loading...
Searching...
No Matches
Weapon Class Reference

#include <weapon.h>

Inheritance diagram for Weapon:
Collaboration diagram for Weapon:

Classes

class  Enchantment
 

Public Types

enum  Imbue { NONE , SPEED , ACCURACY }
 

Public Member Functions

 Weapon ()
 
virtual void proc (Char *attacker, Char *defender, int damage)
 
virtual std::string getClassName ()
 
virtual void storeInBundle (Bundle *bundle)
 
virtual void restoreFromBundle (Bundle *bundle)
 
virtual float acuracyFactor (Hero *hero)
 
virtual float speedFactor (Hero *hero)
 
virtual int damageRoll (Hero *owner)
 
Itemupgrade (boolean enchant)
 
virtual int maxDurability (int lvl)
 
virtual String toString ()
 
virtual String Name ()
 
virtual Itemrandom ()
 
Weaponenchant (Enchantment *ench)
 
Weaponenchant ()
 
boolean isEnchanted ()
 
virtual ItemSprite::Glowingglowing ()
 
- Public Member Functions inherited from KindOfWeapon
virtual void actions (Hero *hero, std::vector< std::string > &actions)
 
virtual bool isEquipped (Hero *hero)
 
virtual bool doEquip (Hero *hero)
 
virtual bool doUnequip (Hero *hero, bool collect, bool single)
 
virtual void activate (Hero *hero)
 
virtual int min ()=0
 
virtual int max ()=0
 
- Public Member Functions inherited from EquipableItem
virtual void execute (Hero *hero, std::string action)
 
virtual void doDrop (Hero *hero)
 
virtual void cast (Hero *user, int dst)
 
virtual bool doUnequip (Hero *hero, bool collect)
 
- Public Member Functions inherited from Item
 CLASSNAME (Item)
 
 CLASSOBJECT (Item)
 
 Item ()
 
virtual bool doPickUp (Hero *hero)
 
virtual void doThrow (Hero *hero)
 
std::string trueName ()
 
int Image ()
 
Itemdetach (Bag *container)
 
ItemdetachAll (Bag *container)
 
virtual bool isUpgradable ()
 
virtual bool isIdentified ()
 
virtual int effectiveLevel ()
 
virtual std::string info ()
 
virtual std::string desc ()
 
virtual int price ()
 
int Quantity ()
 
void Quantity (int value)
 
virtual void getBroken ()
 
bool isBroken ()
 
virtual void fix ()
 
int maxDurability ()
 
int visiblyUpgraded ()
 
virtual Itemidentify ()
 
virtual void Level (int value)
 
int Level ()
 
virtual boolean collect (Bag *container)
 
void use ()
 
void updateQuickslot ()
 
virtual Itemupgrade ()
 
virtual Itemdegrade ()
 
Itemdegrade (int n)
 
int considerState (int price)
 
void polish ()
 
std::string status ()
 
- Public Member Functions inherited from Object
virtual std::string getObject ()=0
 

Public Attributes

int STR
 
float ACU
 
float DLY
 
Imbue imbue
 
- Public Attributes inherited from Item
std::string defaultAction
 
std::string name = "smth"
 
int image = 0
 
bool stackable = false
 
bool levelKnown = false
 
bool cursed
 
bool cursedKnown
 
bool unique = false
 
int quantity
 

Protected Attributes

Enchantmentenchantment
 

Additional Inherited Members

- Static Public Member Functions inherited from Item
static void evoke (Hero *hero)
 
static ItemVirtual (const std::string &cl)
 
- Static Public Attributes inherited from EquipableItem
static const std::string AC_EQUIP = "EQUIP"
 
static const std::string AC_UNEQUIP = "UNEQUIP"
 
- Static Public Attributes inherited from Item
static HerocurUser
 
static ItemcurItem
 
- Protected Member Functions inherited from EquipableItem
virtual float time2equip (Hero *hero)
 
- Protected Member Functions inherited from Item
virtual void onThrow (int cell)
 
virtual void onDetach ()
 
- Static Protected Member Functions inherited from EquipableItem
static void equipCursed (Hero *hero)
 
- Static Protected Attributes inherited from KindOfWeapon
static const float TIME_TO_EQUIP = 1.0f
 
- Static Protected Attributes inherited from Item
static const float TIME_TO_THROW = 1.0f
 
static const float TIME_TO_PICK_UP = 1.0f
 
static const float TIME_TO_DROP = 0.5f
 
static const std::string AC_DROP = "lang.item_drop"
 
static const std::string AC_THROW = "lang.item_throw"
 
static CellSelector::Listenerthrower = new CellSelectorListenerNew()
 

Member Enumeration Documentation

◆ Imbue

Enumerator
NONE 
SPEED 
ACCURACY 

Constructor & Destructor Documentation

◆ Weapon()

Weapon::Weapon ( )
Here is the caller graph for this function:

Member Function Documentation

◆ acuracyFactor()

float Weapon::acuracyFactor ( Hero * hero)
virtual

Reimplemented from KindOfWeapon.

Here is the call graph for this function:

◆ damageRoll()

int Weapon::damageRoll ( Hero * owner)
virtual

Reimplemented from KindOfWeapon.

Here is the call graph for this function:

◆ enchant() [1/2]

Weapon * Weapon::enchant ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enchant() [2/2]

Weapon * Weapon::enchant ( Enchantment * ench)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClassName()

virtual std::string Weapon::getClassName ( )
inlinevirtual

Reimplemented in BattleAxe, Boomerang, CurareDart, Dagger, Dart, Glaive, IncendiaryDart, Javelin, Knuckles, Longsword, Mace, MeleeWeapon, Quarterstaff, ShortSword, Shuriken, Spear, Sword, Tamahawk, and WarHammer.

Here is the caller graph for this function:

◆ glowing()

ItemSprite::Glowing * Weapon::glowing ( )
virtual

Reimplemented from Item.

◆ isEnchanted()

boolean Weapon::isEnchanted ( )
inline

◆ maxDurability()

virtual int Weapon::maxDurability ( int lvl)
inlinevirtual

Reimplemented from Item.

Reimplemented in Boomerang.

◆ Name()

String Weapon::Name ( )
virtual

Reimplemented from Item.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ proc()

void Weapon::proc ( Char * attacker,
Char * defender,
int damage )
virtual

Reimplemented from KindOfWeapon.

Reimplemented in Boomerang, CurareDart, IncendiaryDart, Javelin, MissileWeapon, and Tamahawk.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ random()

Item * Weapon::random ( )
virtual

Reimplemented from Item.

Reimplemented in CurareDart, Dart, IncendiaryDart, Javelin, MeleeWeapon, MissileWeapon, Shuriken, and Tamahawk.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restoreFromBundle()

void Weapon::restoreFromBundle ( Bundle * bundle)
virtual

Reimplemented from Item.

Here is the call graph for this function:

◆ speedFactor()

float Weapon::speedFactor ( Hero * hero)
virtual

Reimplemented from KindOfWeapon.

Here is the call graph for this function:

◆ storeInBundle()

void Weapon::storeInBundle ( Bundle * bundle)
virtual

Reimplemented from Item.

Here is the call graph for this function:

◆ toString()

String Weapon::toString ( )
virtual

Reimplemented from Item.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ upgrade()

Item * Weapon::upgrade ( boolean enchant)
Here is the call graph for this function:

Member Data Documentation

◆ ACU

float Weapon::ACU

◆ DLY

float Weapon::DLY

◆ enchantment

Enchantment* Weapon::enchantment
protected

◆ imbue

Imbue Weapon::imbue

◆ STR

int Weapon::STR

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