Mana
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
ItemInfo Class Reference

Defines a class for storing generic item infos. More...

#include <iteminfo.h>

Public Member Functions

 ItemInfo ()=default
 
 ItemInfo (const ItemInfo &)=delete
 
ItemInfooperator= (const ItemInfo &)=delete
 
const std::string & getSprite (Gender gender, int race) const
 
const std::string & getSound (EquipmentSoundEvent event) const
 

Public Attributes

int id = 0
 Item ID.
 
std::string name
 
SpriteDisplay display
 Display info (like icon)
 
std::string description
 Short description.
 
std::vector< std::string > effect
 Description of effects.
 
int weight = 0
 Weight in grams.
 
std::string missileParticleFile
 Effects to be shown when weapon attacks - see also effects.xml.
 
int hitEffectId = 0
 
int criticalHitEffectId = 0
 
std::string attackAction = SpriteAction::INVALID
 Attack type, in case of weapon.
 
int attackRange = 0
 Attack range, will be equal to ATTACK_RANGE_NOT_SET if no weapon.
 
bool equippable = false
 Whether this item can be equipped.
 
bool activatable = false
 Whether this item can be activated.
 
ItemType type = ITEM_UNUSABLE
 Item type.
 
std::vector< Replacementreplacements
 

Private Member Functions

void setSprite (const std::string &animationFile, Gender gender, int race)
 
void addSound (EquipmentSoundEvent event, const std::string &filename)
 

Private Attributes

int mView = 0
 Item ID of how this item looks.
 
std::map< int, std::string > mAnimationFiles
 Maps gender to sprite filenames.
 
std::map< EquipmentSoundEvent, std::vector< std::string > > mSounds
 Stores the names of sounds to be played at certain event.
 

Friends

class ItemDB
 
class TmwAthena::TaItemDB
 
class ManaServ::ManaServItemDB
 

Detailed Description

Defines a class for storing generic item infos.

Definition at line 99 of file iteminfo.h.

Constructor & Destructor Documentation

◆ ItemInfo() [1/2]

ItemInfo::ItemInfo ( )
default

◆ ItemInfo() [2/2]

ItemInfo::ItemInfo ( const ItemInfo )
delete

Member Function Documentation

◆ addSound()

void ItemInfo::addSound ( EquipmentSoundEvent  event,
const std::string &  filename 
)
private

Definition at line 45 of file iteminfo.cpp.

◆ getSound()

const std::string & ItemInfo::getSound ( EquipmentSoundEvent  event) const

Definition at line 50 of file iteminfo.cpp.

◆ getSprite()

const std::string & ItemInfo::getSprite ( Gender  gender,
int  race 
) const

Definition at line 27 of file iteminfo.cpp.

◆ operator=()

ItemInfo & ItemInfo::operator= ( const ItemInfo )
delete

◆ setSprite()

void ItemInfo::setSprite ( const std::string &  animationFile,
Gender  gender,
int  race 
)
private

Definition at line 57 of file iteminfo.cpp.

Friends And Related Symbol Documentation

◆ ItemDB

friend class ItemDB
friend

Definition at line 101 of file iteminfo.h.

◆ ManaServ::ManaServItemDB

friend class ManaServ::ManaServItemDB
friend

Definition at line 103 of file iteminfo.h.

◆ TmwAthena::TaItemDB

friend class TmwAthena::TaItemDB
friend

Definition at line 102 of file iteminfo.h.

Member Data Documentation

◆ activatable

bool ItemInfo::activatable = false

Whether this item can be activated.

Definition at line 134 of file iteminfo.h.

◆ attackAction

std::string ItemInfo::attackAction = SpriteAction::INVALID

Attack type, in case of weapon.

See SpriteAction in spritedef.h for more info. Attack action sub-types (bow, sword, ...) are defined in items.xml.

Definition at line 128 of file iteminfo.h.

◆ attackRange

int ItemInfo::attackRange = 0

Attack range, will be equal to ATTACK_RANGE_NOT_SET if no weapon.

Definition at line 131 of file iteminfo.h.

◆ criticalHitEffectId

int ItemInfo::criticalHitEffectId = 0

Definition at line 122 of file iteminfo.h.

◆ description

std::string ItemInfo::description

Short description.

Definition at line 115 of file iteminfo.h.

◆ display

SpriteDisplay ItemInfo::display

Display info (like icon)

Definition at line 114 of file iteminfo.h.

◆ effect

std::vector<std::string> ItemInfo::effect

Description of effects.

Definition at line 116 of file iteminfo.h.

◆ equippable

bool ItemInfo::equippable = false

Whether this item can be equipped.

Definition at line 133 of file iteminfo.h.

◆ hitEffectId

int ItemInfo::hitEffectId = 0

Definition at line 121 of file iteminfo.h.

◆ id

int ItemInfo::id = 0

Item ID.

Definition at line 112 of file iteminfo.h.

◆ mAnimationFiles

std::map<int, std::string> ItemInfo::mAnimationFiles
private

Maps gender to sprite filenames.

Definition at line 150 of file iteminfo.h.

◆ missileParticleFile

std::string ItemInfo::missileParticleFile

Effects to be shown when weapon attacks - see also effects.xml.

Definition at line 120 of file iteminfo.h.

◆ mSounds

std::map<EquipmentSoundEvent, std::vector<std::string> > ItemInfo::mSounds
private

Stores the names of sounds to be played at certain event.

Definition at line 153 of file iteminfo.h.

◆ mView

int ItemInfo::mView = 0
private

Item ID of how this item looks.

Definition at line 147 of file iteminfo.h.

◆ name

std::string ItemInfo::name

Definition at line 113 of file iteminfo.h.

◆ replacements

std::vector<Replacement> ItemInfo::replacements

Definition at line 138 of file iteminfo.h.

◆ type

ItemType ItemInfo::type = ITEM_UNUSABLE

Item type.

Definition at line 136 of file iteminfo.h.

◆ weight

int ItemInfo::weight = 0

Weight in grams.

Definition at line 117 of file iteminfo.h.


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