aboutsummaryrefslogtreecommitdiff
path: root/src/objects.hh
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-06-08 19:54:40 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-06-08 19:54:40 -0300
commiteaa3536c027a4f7c1b879b78ab0ecdefcdb4833d (patch)
tree03f851e558656f8fc36fdb982c28fbc09cef8dac /src/objects.hh
parentab9f606371a1df23e9cacbffa0811db7a9e50100 (diff)
downloadgame-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.hh22
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;
}