diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-06-08 19:54:40 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-06-08 19:54:40 -0300 |
| commit | eaa3536c027a4f7c1b879b78ab0ecdefcdb4833d (patch) | |
| tree | 03f851e558656f8fc36fdb982c28fbc09cef8dac /src/objects.hh | |
| parent | ab9f606371a1df23e9cacbffa0811db7a9e50100 (diff) | |
| download | game-eaa3536c027a4f7c1b879b78ab0ecdefcdb4833d.tar.gz game-eaa3536c027a4f7c1b879b78ab0ecdefcdb4833d.zip | |
impl `TCreature::Move` which was absolute hell + some tidying up
Diffstat (limited to 'src/objects.hh')
| -rw-r--r-- | src/objects.hh | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/objects.hh b/src/objects.hh index 39fa8aa..48dbedf 100644 --- a/src/objects.hh +++ b/src/objects.hh @@ -8,7 +8,7 @@ enum : int{ TYPEID_MAP_CONTAINER = 0, TYPEID_HEAD_CONTAINER = 1, TYPEID_NECK_CONTAINER = 2, - TYPEID_BACKPACK_CONTAINER = 3, + TYPEID_BAG_CONTAINER = 3, TYPEID_TORSO_CONTAINER = 4, TYPEID_RIGHTHAND_CONTAINER = 5, TYPEID_LEFTHAND_CONTAINER = 6, @@ -29,14 +29,14 @@ struct ObjectType { const char *getName(int Count); const char *getDescription(void); - bool isMapContainer(void) const { + bool isMapContainer(void){ return this->TypeID == TYPEID_MAP_CONTAINER; } - bool isBodyContainer(void) const { + bool isBodyContainer(void){ return this->TypeID == TYPEID_HEAD_CONTAINER || this->TypeID == TYPEID_NECK_CONTAINER - || this->TypeID == TYPEID_BACKPACK_CONTAINER + || this->TypeID == TYPEID_BAG_CONTAINER || this->TypeID == TYPEID_TORSO_CONTAINER || this->TypeID == TYPEID_RIGHTHAND_CONTAINER || this->TypeID == TYPEID_LEFTHAND_CONTAINER @@ -46,10 +46,22 @@ struct ObjectType { || this->TypeID == TYPEID_AMMO_CONTAINER; } - bool isCreatureContainer(void) const { + bool isCreatureContainer(void){ return this->TypeID == TYPEID_CREATURE_CONTAINER; } + bool isTwoHanded(void){ + return this->getFlag(CLOTHES) + && this->getAttribute(BODYPOSITION) == 0; + } + + bool isWeapon(void){ + return this->getFlag(WEAPON) + || this->getFlag(BOW) + || this->getFlag(THROW) + || this->getFlag(WAND); + } + bool operator==(const ObjectType &Other) const { return this->TypeID == Other.TypeID; } |
