From 5db6213f34318031ece7e2a6765f69564b671891 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 8 Oct 2013 19:20:49 +0100 Subject: Initial Metadata Commit [SEE DESC] + Pigs, Minecarts, Sheep, Skeletons, Slimes, Villagers, Wolves, and Horses have metadata + Base code on taming wolves, shearing sheep, and taming horses + Sheep and horses have different colours when spawned --- source/Entities/Entity.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'source/Entities/Entity.h') diff --git a/source/Entities/Entity.h b/source/Entities/Entity.h index a2c99d2a0..764c5a64b 100644 --- a/source/Entities/Entity.h +++ b/source/Entities/Entity.h @@ -71,6 +71,13 @@ public: ENTITY_STATUS_WOLF_SHAKING = 8, ENTITY_STATUS_EATING_ACCEPTED = 9, ENTITY_STATUS_SHEEP_EATING = 10, + ENTITY_STATUS_GOLEM_ROSING = 11, + ENTITY_STATUS_VILLAGER_HEARTS = 12, + ENTITY_STATUS_VILLAGER_ANGRY = 13, + ENTITY_STATUS_VILLAGER_HAPPY = 14, + ENTITY_STATUS_WITCH_MAGICKING = 15, + // It seems 16 (zombie conversion) is now done with metadata + ENTITY_STATUS_FIREWORK_EXPLODE= 17, } ; enum @@ -333,6 +340,62 @@ public: virtual bool IsRiding (void) const {return false; } virtual bool IsSprinting(void) const {return false; } virtual bool IsRclking (void) const {return false; } + virtual bool IsInvisible(void) const {return false; } + + // Ageables + Tameables + virtual bool IsBabby (void) const {return false; } + virtual bool IsSitting (void) const {return false; } + virtual bool IsTame (void) const {return false; } + + // Creepers + virtual bool IsCharged (void) const {return false; } + virtual bool IsBlowing (void) const {return false; } + + // Furnace Minecarts & Minecarts + virtual int LastDamage (void) const {return 0; } + virtual bool IsFueled (void) const {return false; } + + // Bat + virtual bool IsHanging (void) const {return false; } + + // Pig + virtual bool IsSaddled (void) const {return false; } + + // TESTIFICATE + virtual int GetVilType(void) const {return 0; } + + // Zombie + virtual bool IsVillager(void) const {return false; } + virtual bool IsConvert (void) const {return false; } + + // Ghast + virtual bool IsCharging(void) const {return false; } + + // Arrow + virtual bool IsCritical(void) const {return false; } + + // Wolf + virtual bool IsAngry (void) const {return false; } + virtual bool IsBegging (void) const {return false; } + virtual int GetCollar (void) const {return 0; } + + // Sheep + virtual int GetFurColor(void) const {return 0; } + virtual bool IsSheared (void) const {return false; } + + // Enderman + virtual BLOCKTYPE CarriedBlock (void) const {return E_BLOCK_AIR; } + virtual NIBBLETYPE CarriedMeta (void) const {return 0; } + virtual bool IsScream (void) const {return false; } + + // Skeleton || Wither Skeleton + virtual bool IsWither (void) const {return false; } + + // Witch + virtual bool IsNosey (void) const {return false; } + + // Slimes and Magma cubes + virtual int GetSize (void) const {return 1; } // tolua_end -- cgit v1.2.3 From 7401fc000dca2a3ff3ce61776f84e5c2d8eb1868 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 8 Oct 2013 22:21:55 +0100 Subject: Initial round of fixes * Fixed intentional misspelling of baby! :D * Better chested horse bool name * Fixed some weird continuity issues with my recent changes not being pushed up initially * Fixed derpy hexadecimal values --- source/Entities/Entity.h | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'source/Entities/Entity.h') diff --git a/source/Entities/Entity.h b/source/Entities/Entity.h index 764c5a64b..fdc047cf9 100644 --- a/source/Entities/Entity.h +++ b/source/Entities/Entity.h @@ -343,7 +343,7 @@ public: virtual bool IsInvisible(void) const {return false; } // Ageables + Tameables - virtual bool IsBabby (void) const {return false; } + virtual bool IsBaby (void) const {return false; } virtual bool IsSitting (void) const {return false; } virtual bool IsTame (void) const {return false; } @@ -356,46 +356,56 @@ public: virtual bool IsFueled (void) const {return false; } // Bat - virtual bool IsHanging (void) const {return false; } + virtual bool IsHanging (void) const {return false; } // Pig - virtual bool IsSaddled (void) const {return false; } + virtual bool IsSaddled (void) const {return false; } // TESTIFICATE - virtual int GetVilType(void) const {return 0; } + virtual int GetVilType (void) const {return 0; } // Zombie - virtual bool IsVillager(void) const {return false; } - virtual bool IsConvert (void) const {return false; } + virtual bool IsVillZomb (void) const {return false; } + virtual bool IsConvert (void) const {return false; } // Ghast - virtual bool IsCharging(void) const {return false; } + virtual bool IsCharging (void) const {return false; } // Arrow - virtual bool IsCritical(void) const {return false; } + virtual bool IsCritical (void) const {return false; } // Wolf - virtual bool IsAngry (void) const {return false; } - virtual bool IsBegging (void) const {return false; } - virtual int GetCollar (void) const {return 0; } + virtual bool IsAngry (void) const {return false; } + virtual bool IsBegging (void) const {return false; } + virtual int GetCollar (void) const {return 0; } // Sheep - virtual int GetFurColor(void) const {return 0; } - virtual bool IsSheared (void) const {return false; } + virtual int GetFurColor (void) const {return 0; } + virtual bool IsSheared (void) const {return false; } // Enderman virtual BLOCKTYPE CarriedBlock (void) const {return E_BLOCK_AIR; } virtual NIBBLETYPE CarriedMeta (void) const {return 0; } - virtual bool IsScream (void) const {return false; } + virtual bool IsScream (void) const {return false; } // Skeleton || Wither Skeleton - virtual bool IsWither (void) const {return false; } + virtual bool IsWither (void) const {return false; } // Witch - virtual bool IsNosey (void) const {return false; } + virtual bool IsNosey (void) const {return false; } // Slimes and Magma cubes - virtual int GetSize (void) const {return 1; } + virtual int GetSize (void) const {return 1; } + + // Horsheys + virtual bool IsChested (void) const {return false; } + virtual bool IsEating (void) const {return false; } + virtual bool IsRearing (void) const {return false; } + virtual bool IsMthOpen (void) const {return false; } + virtual int GetHType (void) const {return 0; } + virtual int GetHColor (void) const {return 0; } + virtual int GetHStyle (void) const {return 0; } + virtual int GetHArmour (void) const {return 0; } // tolua_end -- cgit v1.2.3 From fe6fa23a97421af3d02b9faf92b8df2f73abb556 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 9 Oct 2013 21:02:59 +0100 Subject: Second round of fixes * Implemented suggestions --- source/Entities/Entity.h | 67 +----------------------------------------------- 1 file changed, 1 insertion(+), 66 deletions(-) (limited to 'source/Entities/Entity.h') diff --git a/source/Entities/Entity.h b/source/Entities/Entity.h index fdc047cf9..07bc84937 100644 --- a/source/Entities/Entity.h +++ b/source/Entities/Entity.h @@ -334,78 +334,13 @@ public: // tolua_begin - // Metadata flags; descendants may override the defaults: + // COMMON metadata flags; descendants may override the defaults: virtual bool IsOnFire (void) const {return (m_TicksLeftBurning > 0); } virtual bool IsCrouched (void) const {return false; } virtual bool IsRiding (void) const {return false; } virtual bool IsSprinting(void) const {return false; } virtual bool IsRclking (void) const {return false; } virtual bool IsInvisible(void) const {return false; } - - // Ageables + Tameables - virtual bool IsBaby (void) const {return false; } - virtual bool IsSitting (void) const {return false; } - virtual bool IsTame (void) const {return false; } - - // Creepers - virtual bool IsCharged (void) const {return false; } - virtual bool IsBlowing (void) const {return false; } - - // Furnace Minecarts & Minecarts - virtual int LastDamage (void) const {return 0; } - virtual bool IsFueled (void) const {return false; } - - // Bat - virtual bool IsHanging (void) const {return false; } - - // Pig - virtual bool IsSaddled (void) const {return false; } - - // TESTIFICATE - virtual int GetVilType (void) const {return 0; } - - // Zombie - virtual bool IsVillZomb (void) const {return false; } - virtual bool IsConvert (void) const {return false; } - - // Ghast - virtual bool IsCharging (void) const {return false; } - - // Arrow - virtual bool IsCritical (void) const {return false; } - - // Wolf - virtual bool IsAngry (void) const {return false; } - virtual bool IsBegging (void) const {return false; } - virtual int GetCollar (void) const {return 0; } - - // Sheep - virtual int GetFurColor (void) const {return 0; } - virtual bool IsSheared (void) const {return false; } - - // Enderman - virtual BLOCKTYPE CarriedBlock (void) const {return E_BLOCK_AIR; } - virtual NIBBLETYPE CarriedMeta (void) const {return 0; } - virtual bool IsScream (void) const {return false; } - - // Skeleton || Wither Skeleton - virtual bool IsWither (void) const {return false; } - - // Witch - virtual bool IsNosey (void) const {return false; } - - // Slimes and Magma cubes - virtual int GetSize (void) const {return 1; } - - // Horsheys - virtual bool IsChested (void) const {return false; } - virtual bool IsEating (void) const {return false; } - virtual bool IsRearing (void) const {return false; } - virtual bool IsMthOpen (void) const {return false; } - virtual int GetHType (void) const {return 0; } - virtual int GetHColor (void) const {return 0; } - virtual int GetHStyle (void) const {return 0; } - virtual int GetHArmour (void) const {return 0; } // tolua_end -- cgit v1.2.3 From d8d2f35e9dd354fba14f8d6512e818d18d2066c2 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 13 Oct 2013 12:47:55 +0100 Subject: Eight round of fixes * Changed IsA() to *long if statement* - Removed deprecated values in Entity.h - to blazes with the plugins! * Renamed villager type enumerations to be LESS SHOUTY and more vt-y + Use vtMax for World.cpp testificate spawning --- source/Entities/Entity.h | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'source/Entities/Entity.h') diff --git a/source/Entities/Entity.h b/source/Entities/Entity.h index 07bc84937..064275c06 100644 --- a/source/Entities/Entity.h +++ b/source/Entities/Entity.h @@ -102,13 +102,6 @@ public: etBoat, etTNT, etProjectile, - - // DEPRECATED older constants, left over for compatibility reasons (plugins) - etMob = etMonster, // DEPRECATED, use etMonster instead! - eEntityType_Entity = etEntity, - eEntityType_Player = etPlayer, - eEntityType_Pickup = etPickup, - eEntityType_Mob = etMob, } ; // tolua_end @@ -123,12 +116,14 @@ public: eEntityType GetEntityType(void) const { return m_EntityType; } - bool IsPlayer (void) const { return (m_EntityType == etPlayer); } - bool IsPickup (void) const { return (m_EntityType == etPickup); } - bool IsMob (void) const { return (m_EntityType == etMob); } - bool IsMinecart(void) const { return (m_EntityType == etMinecart); } - bool IsBoat (void) const { return (m_EntityType == etBoat); } - bool IsTNT (void) const { return (m_EntityType == etTNT); } + bool IsPlayer (void) const { return (m_EntityType == etPlayer); } + bool IsPickup (void) const { return (m_EntityType == etPickup); } + bool IsMob (void) const { return (m_EntityType == etMonster); } + bool IsFallingBlock(void) const { return (m_EntityType == etFallingBlock); } + bool IsMinecart (void) const { return (m_EntityType == etMinecart); } + bool IsBoat (void) const { return (m_EntityType == etBoat); } + bool IsTNT (void) const { return (m_EntityType == etTNT); } + bool IsProjectile (void) const { return (m_EntityType == etProjectile); } /// Returns true if the entity is of the specified class or a subclass (cPawn's IsA("cEntity") returns true) virtual bool IsA(const char * a_ClassName) const; -- cgit v1.2.3