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

#include <item.h>

Inheritance diagram for Item:
Collaboration diagram for Item:

Public Member Functions

 CLASSNAME (Item)
 
 CLASSOBJECT (Item)
 
 Item ()
 
virtual void actions (Hero *hero, std::vector< std::string > &actions)
 
virtual bool doPickUp (Hero *hero)
 
virtual void doDrop (Hero *hero)
 
virtual void doThrow (Hero *hero)
 
virtual std::string toString ()
 
virtual std::string Name ()
 
std::string trueName ()
 
int Image ()
 
Itemdetach (Bag *container)
 
ItemdetachAll (Bag *container)
 
virtual ItemSprite::Glowingglowing ()
 
virtual void storeInBundle (Bundle *bundle)
 
virtual void restoreFromBundle (Bundle *bundle)
 
virtual bool isUpgradable ()
 
virtual bool isIdentified ()
 
virtual bool isEquipped (Hero *hero)
 
virtual int effectiveLevel ()
 
virtual std::string info ()
 
virtual std::string desc ()
 
virtual int price ()
 
int Quantity ()
 
void Quantity (int value)
 
virtual void execute (Hero *hero, std::string action)
 
virtual void cast (Hero *user, int dst)
 
virtual void getBroken ()
 
bool isBroken ()
 
virtual void fix ()
 
virtual int maxDurability (int lvl)
 
int maxDurability ()
 
int visiblyUpgraded ()
 
virtual Itemidentify ()
 
virtual Itemrandom ()
 
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
 

Static Public Member Functions

static void evoke (Hero *hero)
 
static ItemVirtual (const std::string &cl)
 

Public Attributes

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
 

Static Public Attributes

static HerocurUser
 
static ItemcurItem
 

Protected Member Functions

virtual void onThrow (int cell)
 
virtual void onDetach ()
 

Static Protected Attributes

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()
 

Constructor & Destructor Documentation

◆ Item()

Item::Item ( )

Member Function Documentation

◆ actions()

void Item::actions ( Hero * hero,
std::vector< std::string > & actions )
virtual

Reimplemented in Amulet, Armor, DewVial, Food, Gold, Honeypot, KindOfWeapon, MissileWeapon, Plant::Seed, Potion, Ring, Scroll, ShortSword, Wand, and WandOfMagicMissile.

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

◆ cast()

void Item::cast ( Hero * user,
int dst )
virtual

Reimplemented in Boomerang, and EquipableItem.

Here is the caller graph for this function:

◆ CLASSNAME()

Item::CLASSNAME ( Item )
Here is the call graph for this function:

◆ CLASSOBJECT()

Item::CLASSOBJECT ( Item )
Here is the call graph for this function:

◆ collect()

boolean Item::collect ( Bag * container)
virtual

Reimplemented in IronKey, Rotberry::Seed, and Wand.

Here is the caller graph for this function:

◆ considerState()

int Item::considerState ( int price)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ degrade() [1/2]

virtual Item * Item::degrade ( )
inlinevirtual

Reimplemented in Armor, MeleeWeapon, and Wand.

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

◆ degrade() [2/2]

Item * Item::degrade ( int n)
inline
Here is the call graph for this function:

◆ desc()

◆ detach()

Item * Item::detach ( Bag * container)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ detachAll()

Item * Item::detachAll ( Bag * container)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ doDrop()

void Item::doDrop ( Hero * hero)
virtual

Reimplemented in EquipableItem.

Here is the caller graph for this function:

◆ doPickUp()

bool Item::doPickUp ( Hero * hero)
virtual

Reimplemented in Amulet, Dewdrop, Gold, RingOfHaggler, and RingOfThorns.

Here is the caller graph for this function:

◆ doThrow()

void Item::doThrow ( Hero * hero)
virtual

Reimplemented in Potion.

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

◆ effectiveLevel()

int Item::effectiveLevel ( )
virtual

Reimplemented in Ring.

Here is the caller graph for this function:

◆ evoke()

void Item::evoke ( Hero * hero)
static
Here is the call graph for this function:

◆ execute()

void Item::execute ( Hero * hero,
std::string action )
virtual

Reimplemented in Amulet, DewVial, EquipableItem, Honeypot, Plant::Seed, Potion, Scroll, and ShortSword.

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

◆ fix()

void Item::fix ( )
virtual

Reimplemented in Ring.

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

◆ getBroken()

virtual void Item::getBroken ( )
inlinevirtual

Reimplemented in Ring.

Here is the caller graph for this function:

◆ glowing()

virtual ItemSprite::Glowing * Item::glowing ( )
inlinevirtual

Reimplemented in Armor, DewVial, and Weapon.

Here is the caller graph for this function:

◆ identify()

Item * Item::identify ( )
virtual

Reimplemented in Potion, Ring, Scroll, and Wand.

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

◆ Image()

int Item::Image ( )
Here is the caller graph for this function:

◆ info()

virtual std::string Item::info ( )
inlinevirtual

Reimplemented in Amulet, Armor, Bomb, ChargrilledMeat, Dewdrop, DewVial, Food, FrozenCarpaccio, Gold, GoldenKey, Honeypot, IronKey, MeleeWeapon, MissileWeapon, MysteryMeat, Pasty, Plant::Seed, Potion, Ring, Scroll, SeedPouch, SkeletonKey, and Wand.

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

◆ isBroken()

bool Item::isBroken ( )
inline
Here is the caller graph for this function:

◆ isEquipped()

virtual bool Item::isEquipped ( Hero * hero)
inlinevirtual

Reimplemented in Armor, KindOfWeapon, and Ring.

Here is the caller graph for this function:

◆ isIdentified()

virtual bool Item::isIdentified ( )
inlinevirtual

Reimplemented in Amulet, Bomb, DewVial, Food, Gold, Honeypot, Key, MissileWeapon, Plant::Seed, Potion, Ring, Scroll, and Wand.

Here is the caller graph for this function:

◆ isUpgradable()

virtual bool Item::isUpgradable ( )
inlinevirtual

◆ Level() [1/2]

int Item::Level ( )
inline
Here is the caller graph for this function:

◆ Level() [2/2]

virtual void Item::Level ( int value)
inlinevirtual
Here is the caller graph for this function:

◆ maxDurability() [1/2]

int Item::maxDurability ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ maxDurability() [2/2]

virtual int Item::maxDurability ( int lvl)
inlinevirtual

Reimplemented in Armor, Boomerang, Ring, Wand, and Weapon.

◆ Name()

std::string Item::Name ( )
virtual

Reimplemented in Armor, Potion, Ring, Scroll, Wand, and Weapon.

Here is the caller graph for this function:

◆ onDetach()

virtual void Item::onDetach ( )
inlineprotectedvirtual

Reimplemented in IronKey, and Wand.

Here is the caller graph for this function:

◆ onThrow()

void Item::onThrow ( int cell)
protectedvirtual

Reimplemented in Bomb, IncendiaryDart, MissileWeapon, Plant::Seed, and Potion.

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

◆ polish()

void Item::polish ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ price()

◆ Quantity() [1/2]

int Item::Quantity ( )
inline
Here is the caller graph for this function:

◆ Quantity() [2/2]

void Item::Quantity ( int value)
inline

◆ random()

virtual Item * Item::random ( )
inlinevirtual

Reimplemented in Armor, Bomb, CurareDart, Dart, Gold, IncendiaryDart, Javelin, MeleeWeapon, MissileWeapon, Ring, RingOfHaggler, RingOfThorns, Shuriken, Tamahawk, Wand, and Weapon.

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

◆ restoreFromBundle()

void Item::restoreFromBundle ( Bundle * bundle)
virtual

Reimplemented in Armor, Bag, DewVial, Gold, Key, Ring, Wand, and Weapon.

Here is the caller graph for this function:

◆ status()

std::string Item::status ( )

◆ storeInBundle()

void Item::storeInBundle ( Bundle * bundle)
virtual

Reimplemented in Armor, Bag, DewVial, Gold, Key, Ring, Wand, and Weapon.

Here is the caller graph for this function:

◆ toString()

std::string Item::toString ( )
virtual

Reimplemented in Armor, IronKey, Ring, Wand, and Weapon.

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

◆ trueName()

std::string Item::trueName ( )
inline

◆ updateQuickslot()

void Item::updateQuickslot ( )
Here is the caller graph for this function:

◆ upgrade()

virtual Item * Item::upgrade ( )
inlinevirtual

Reimplemented in Armor, Boomerang, MeleeWeapon, and Wand.

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

◆ use()

void Item::use ( )
Here is the caller graph for this function:

◆ Virtual()

Item * Item::Virtual ( const std::string & cl)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ visiblyUpgraded()

int Item::visiblyUpgraded ( )
inline
Here is the caller graph for this function:

Member Data Documentation

◆ AC_DROP

const std::string Item::AC_DROP = "lang.item_drop"
staticprotected

◆ AC_THROW

const std::string Item::AC_THROW = "lang.item_throw"
staticprotected

◆ curItem

Item * Item::curItem
static

◆ cursed

bool Item::cursed

◆ cursedKnown

bool Item::cursedKnown

◆ curUser

Hero * Item::curUser
static

◆ defaultAction

std::string Item::defaultAction

◆ image

int Item::image = 0

◆ levelKnown

bool Item::levelKnown = false

◆ name

std::string Item::name = "smth"

◆ quantity

int Item::quantity

◆ stackable

bool Item::stackable = false

◆ thrower

CellSelector::Listener * Item::thrower = new CellSelectorListenerNew()
staticprotected

◆ TIME_TO_DROP

const float Item::TIME_TO_DROP = 0.5f
staticprotected

◆ TIME_TO_PICK_UP

const float Item::TIME_TO_PICK_UP = 1.0f
staticprotected

◆ TIME_TO_THROW

const float Item::TIME_TO_THROW = 1.0f
staticprotected

◆ unique

bool Item::unique = false

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