From 3cc587ab8df80d42d9dab1a73a37701f565a3499 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Sun, 15 Jun 2025 17:35:06 -0300 Subject: more work on `operate.cc` --- src/objects.hh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/objects.hh') diff --git a/src/objects.hh b/src/objects.hh index 3d312ac..05b094d 100644 --- a/src/objects.hh +++ b/src/objects.hh @@ -62,6 +62,17 @@ struct ObjectType { || this->getFlag(WAND); } + bool isCloseWeapon(void){ + if(!this->getFlag(WEAPON)){ + return false; + } + + int WeaponType = this->getAttribute(WEAPONTYPE); + return WeaponType == WEAPON_SWORD + || WeaponType == WEAPON_CLUB + || WeaponType == WEAPON_AXE; + } + ObjectType getDisguise(void){ if(this->getFlag(DISGUISE)){ return (int)this->getAttribute(DISGUISETARGET); -- cgit v1.2.3