22 #ifndef ULTIMA_SHARED_CORE_CHARACTER_H 23 #define ULTIMA_SHARED_CORE_CHARACTER_H 25 #include "common/array.h" 26 #include "common/str.h" 27 #include "common/serializer.h" 28 #include "ultima/shared/core/named_item.h" 33 enum Sex { SEX_MALE = 0, SEX_FEMALE = 1, SEX_OTHER = 2, SEX_YES_PLEASE = 2 };
56 s.syncAsUint16LE(_quantity);
63 _quantity = (uint)
CLIP((
int)_quantity + delta, 0, 9999);
74 bool empty()
const {
return _quantity == 0; }
122 for (uint idx = 1; idx < this->size(); ++idx) {
123 if (!(*
this)[idx]->empty())
134 return itemsCount() == 0;
168 Character() : _strength(0), _agility(0), _stamina(0), _charisma(0), _wisdom(0), _intelligence(0),
169 _hitPoints(0), _experience(0), _food(0), _coins(0), _equippedWeapon(0), _equippedArmour(0), _equippedSpell(0),
170 _race(0), _sex(SEX_MALE), _class(0) {}
225 uint
getLevel()
const {
return (_experience / 1000) + 1; }
Definition: character.h:38
virtual void changeQuantity(int delta)
Definition: character.h:62
Itemized()
Definition: character.h:45
void removeSpell()
Definition: character.h:220
void removeWeapon()
Definition: character.h:210
Spell * equippedSpell() const
Definition: character.h:205
Weapon()
Definition: character.h:96
Definition: character.h:114
uint getLevel() const
Definition: character.h:225
virtual ~Itemized()
Definition: character.h:50
bool isSpellEquipped() const
Definition: character.h:190
void synchronize(Common::Serializer &s)
Definition: character.h:55
size_t itemsCount() const
Definition: character.h:120
T CLIP(T v, T amin, T amax)
Definition: util.h:65
Definition: serializer.h:79
Weapon * equippedWeapon() const
Definition: character.h:195
bool decrQuantity()
Definition: character.h:79
Definition: detection.h:27
void removeArmour()
Definition: character.h:215
Character()
Definition: character.h:168
Definition: character.h:110
Armour * equippedArmour() const
Definition: character.h:200
bool empty() const
Definition: character.h:74
Definition: character.h:141
bool isWeaponEquipped() const
Definition: character.h:180
bool isArmourEquipped() const
Definition: character.h:185
Definition: character.h:88
Definition: named_item.h:33
Definition: character.h:102
void incrQuantity()
Definition: character.h:69
bool hasNothing() const
Definition: character.h:133