diff options
Diffstat (limited to 'src/Mobs')
-rw-r--r-- | src/Mobs/Bat.h | 4 | ||||
-rw-r--r-- | src/Mobs/Blaze.h | 4 | ||||
-rw-r--r-- | src/Mobs/CaveSpider.h | 2 | ||||
-rw-r--r-- | src/Mobs/Chicken.h | 2 | ||||
-rw-r--r-- | src/Mobs/Cow.h | 2 | ||||
-rw-r--r-- | src/Mobs/Creeper.h | 2 | ||||
-rw-r--r-- | src/Mobs/EnderDragon.h | 4 | ||||
-rw-r--r-- | src/Mobs/Ghast.h | 2 | ||||
-rw-r--r-- | src/Mobs/Giant.h | 4 | ||||
-rw-r--r-- | src/Mobs/Guardian.h | 4 | ||||
-rw-r--r-- | src/Mobs/IronGolem.h | 4 | ||||
-rw-r--r-- | src/Mobs/MagmaCube.h | 4 | ||||
-rw-r--r-- | src/Mobs/MonsterTypes.h | 2 | ||||
-rw-r--r-- | src/Mobs/Mooshroom.h | 2 | ||||
-rw-r--r-- | src/Mobs/Ocelot.h | 2 | ||||
-rw-r--r-- | src/Mobs/Path.cpp | 26 | ||||
-rw-r--r-- | src/Mobs/Pig.h | 4 | ||||
-rw-r--r-- | src/Mobs/Rabbit.h | 2 | ||||
-rw-r--r-- | src/Mobs/Sheep.h | 2 | ||||
-rw-r--r-- | src/Mobs/Silverfish.h | 2 | ||||
-rw-r--r-- | src/Mobs/Slime.cpp | 2 | ||||
-rw-r--r-- | src/Mobs/Slime.h | 6 | ||||
-rw-r--r-- | src/Mobs/Squid.h | 4 | ||||
-rw-r--r-- | src/Mobs/Villager.h | 2 | ||||
-rw-r--r-- | src/Mobs/Witch.h | 2 | ||||
-rw-r--r-- | src/Mobs/Wither.h | 6 | ||||
-rw-r--r-- | src/Mobs/ZombiePigman.cpp | 2 | ||||
-rw-r--r-- | src/Mobs/ZombiePigman.h | 4 |
28 files changed, 56 insertions, 52 deletions
diff --git a/src/Mobs/Bat.h b/src/Mobs/Bat.h index 6b06aeb4f..2da2dc3f2 100644 --- a/src/Mobs/Bat.h +++ b/src/Mobs/Bat.h @@ -11,12 +11,12 @@ class cBat : public cPassiveMonster { typedef cPassiveMonster super; - + public: cBat(void); CLASS_PROTODEF(cBat) - + bool IsHanging(void) const {return false; } } ; diff --git a/src/Mobs/Blaze.h b/src/Mobs/Blaze.h index 8265deffa..ca755b626 100644 --- a/src/Mobs/Blaze.h +++ b/src/Mobs/Blaze.h @@ -11,12 +11,12 @@ class cBlaze : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: cBlaze(void); CLASS_PROTODEF(cBlaze) - + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; virtual bool Attack(std::chrono::milliseconds a_Dt) override; } ; diff --git a/src/Mobs/CaveSpider.h b/src/Mobs/CaveSpider.h index 7fbafeb54..cf4b8e17c 100644 --- a/src/Mobs/CaveSpider.h +++ b/src/Mobs/CaveSpider.h @@ -10,7 +10,7 @@ class cCaveSpider : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: cCaveSpider(void); diff --git a/src/Mobs/Chicken.h b/src/Mobs/Chicken.h index ca70657b4..3be338b15 100644 --- a/src/Mobs/Chicken.h +++ b/src/Mobs/Chicken.h @@ -10,7 +10,7 @@ class cChicken : public cPassiveMonster { typedef cPassiveMonster super; - + public: cChicken(void); diff --git a/src/Mobs/Cow.h b/src/Mobs/Cow.h index 6ce51e806..569c6e619 100644 --- a/src/Mobs/Cow.h +++ b/src/Mobs/Cow.h @@ -11,7 +11,7 @@ class cCow : public cPassiveMonster { typedef cPassiveMonster super; - + public: cCow(); diff --git a/src/Mobs/Creeper.h b/src/Mobs/Creeper.h index ac8b7cf35..73243d11e 100644 --- a/src/Mobs/Creeper.h +++ b/src/Mobs/Creeper.h @@ -11,7 +11,7 @@ class cCreeper : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: cCreeper(void); diff --git a/src/Mobs/EnderDragon.h b/src/Mobs/EnderDragon.h index e4ca9dcf9..43acdcd54 100644 --- a/src/Mobs/EnderDragon.h +++ b/src/Mobs/EnderDragon.h @@ -11,12 +11,12 @@ class cEnderDragon : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: cEnderDragon(void); CLASS_PROTODEF(cEnderDragon) - + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; } ; diff --git a/src/Mobs/Ghast.h b/src/Mobs/Ghast.h index f74150169..a41a72ddc 100644 --- a/src/Mobs/Ghast.h +++ b/src/Mobs/Ghast.h @@ -11,7 +11,7 @@ class cGhast : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: cGhast(void); diff --git a/src/Mobs/Giant.h b/src/Mobs/Giant.h index 8d3060940..70e93894c 100644 --- a/src/Mobs/Giant.h +++ b/src/Mobs/Giant.h @@ -11,12 +11,12 @@ class cGiant : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: cGiant(void); CLASS_PROTODEF(cGiant) - + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; } ; diff --git a/src/Mobs/Guardian.h b/src/Mobs/Guardian.h index 6bc17947c..289654f57 100644 --- a/src/Mobs/Guardian.h +++ b/src/Mobs/Guardian.h @@ -11,14 +11,14 @@ class cGuardian : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: cGuardian(); virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; CLASS_PROTODEF(cGuardian) - + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; // Guardians do not drown (or float) diff --git a/src/Mobs/IronGolem.h b/src/Mobs/IronGolem.h index 721ca2701..7d35686e7 100644 --- a/src/Mobs/IronGolem.h +++ b/src/Mobs/IronGolem.h @@ -11,12 +11,12 @@ class cIronGolem : public cPassiveAggressiveMonster { typedef cPassiveAggressiveMonster super; - + public: cIronGolem(void); CLASS_PROTODEF(cIronGolem) - + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; // Iron golems do not drown nor float diff --git a/src/Mobs/MagmaCube.h b/src/Mobs/MagmaCube.h index 3cd77f3e3..5fc8105ba 100644 --- a/src/Mobs/MagmaCube.h +++ b/src/Mobs/MagmaCube.h @@ -10,7 +10,7 @@ class cMagmaCube : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: /** Creates a MagmaCube of the specified size; with 1 being the smallest */ cMagmaCube(int a_Size); @@ -23,7 +23,7 @@ public: /** Returns the text describing the slime's size, as used by the client's resource subsystem for sounds. Returns either "big" or "small". */ static AString GetSizeName(int a_Size); - + protected: /** Size of the MagmaCube, with 1 being the smallest */ diff --git a/src/Mobs/MonsterTypes.h b/src/Mobs/MonsterTypes.h index d48005d2e..96b4d0df0 100644 --- a/src/Mobs/MonsterTypes.h +++ b/src/Mobs/MonsterTypes.h @@ -10,7 +10,7 @@ enum eMonsterType { mtInvalidType = -1, - + mtBat = E_META_SPAWN_EGG_BAT, mtBlaze = E_META_SPAWN_EGG_BLAZE, mtCaveSpider = E_META_SPAWN_EGG_CAVE_SPIDER, diff --git a/src/Mobs/Mooshroom.h b/src/Mobs/Mooshroom.h index 61cbfc083..625963190 100644 --- a/src/Mobs/Mooshroom.h +++ b/src/Mobs/Mooshroom.h @@ -11,7 +11,7 @@ class cMooshroom : public cPassiveMonster { typedef cPassiveMonster super; - + public: cMooshroom(void); diff --git a/src/Mobs/Ocelot.h b/src/Mobs/Ocelot.h index 796af2050..1f513a6d6 100644 --- a/src/Mobs/Ocelot.h +++ b/src/Mobs/Ocelot.h @@ -11,7 +11,7 @@ class cOcelot : public cPassiveMonster { typedef cPassiveMonster super; - + public: cOcelot(void) : super("Ocelot", mtOcelot, "mob.cat.hitt", "mob.cat.hitt", 0.6, 0.8) diff --git a/src/Mobs/Path.cpp b/src/Mobs/Path.cpp index 4db93050e..18090587e 100644 --- a/src/Mobs/Path.cpp +++ b/src/Mobs/Path.cpp @@ -508,9 +508,9 @@ void cPath::FillCellAttributes(cPathCell & a_Cell) a_Cell.m_IsSpecial = true; a_Cell.m_IsSolid = true; // Specials are solids only from a certain direction. But their m_IsSolid is always true } - else if ((a_Cell.m_BlockType == E_BLOCK_AIR) && IsBlockFence(GetCell(Location + Vector3i(0, -1, 0))->m_BlockType)) + else if ((!cBlockInfo::IsSolid(a_Cell.m_BlockType)) && IsBlockFence(GetCell(Location + Vector3i(0, -1, 0))->m_BlockType)) { - // Air blocks with fences below them are consider Special Solids. That is, they sometimes behave as solids. + // Nonsolid blocks with fences below them are consider Special Solids. That is, they sometimes behave as solids. a_Cell.m_IsSpecial = true; a_Cell.m_IsSolid = true; } @@ -631,25 +631,29 @@ bool cPath::SpecialIsSolidFromThisDirection(BLOCKTYPE a_Type, NIBBLETYPE a_Meta, } - - switch (a_Type) + // If there is a nonsolid above a fence + if (!cBlockInfo::IsSolid(a_Type)) { - // Air is special only when above a fence - case E_BLOCK_AIR: - { - // Treat the air block as solid if the mob is going upward and trying to climb a fence + // If we're coming from below if (a_Direction.y > 0) { - return true; + return true; // treat the nonsolid as solid } else { - return false; + return false; // Treat it as a nonsolid because we are not coming from below } + } + + /* switch (a_Type) + { + case E_BLOCK_ETC: + { + Decide if solid from this direction and return either true or false. } // TODO Fill this with the other specials after physics is fixed - } + } */ diff --git a/src/Mobs/Pig.h b/src/Mobs/Pig.h index 56c9f7ed6..ed0685e5f 100644 --- a/src/Mobs/Pig.h +++ b/src/Mobs/Pig.h @@ -11,7 +11,7 @@ class cPig : public cPassiveMonster { typedef cPassiveMonster super; - + public: cPig(void); @@ -19,7 +19,7 @@ public: // cEntity overrides virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override; - + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; virtual void OnRightClicked(cPlayer & a_Player) override; virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; diff --git a/src/Mobs/Rabbit.h b/src/Mobs/Rabbit.h index 79a9afe15..aafd979d1 100644 --- a/src/Mobs/Rabbit.h +++ b/src/Mobs/Rabbit.h @@ -26,7 +26,7 @@ class cRabbit : public cPassiveMonster { typedef cPassiveMonster super; - + public: cRabbit(); cRabbit(eRabbitType Type, int MoreCarrotTicks = 0); diff --git a/src/Mobs/Sheep.h b/src/Mobs/Sheep.h index 97f481bec..02aa888f1 100644 --- a/src/Mobs/Sheep.h +++ b/src/Mobs/Sheep.h @@ -11,7 +11,7 @@ class cSheep : public cPassiveMonster { typedef cPassiveMonster super; - + public: /** The number is the color of the sheep. diff --git a/src/Mobs/Silverfish.h b/src/Mobs/Silverfish.h index 2df333dbc..be325a7aa 100644 --- a/src/Mobs/Silverfish.h +++ b/src/Mobs/Silverfish.h @@ -11,7 +11,7 @@ class cSilverfish : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: cSilverfish(void) : super("Silverfish", mtSilverfish, "mob.silverfish.hit", "mob.silverfish.kill", 0.3, 0.7) diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp index d7ea50dda..316f68523 100644 --- a/src/Mobs/Slime.cpp +++ b/src/Mobs/Slime.cpp @@ -53,7 +53,7 @@ bool cSlime::Attack(std::chrono::milliseconds a_Dt) // Only slimes larger than size 1 attack a player. return super::Attack(a_Dt); } - + return false; } diff --git a/src/Mobs/Slime.h b/src/Mobs/Slime.h index c03a82bf4..c78461a02 100644 --- a/src/Mobs/Slime.h +++ b/src/Mobs/Slime.h @@ -11,7 +11,7 @@ class cSlime : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: /** Creates a slime of the specified size; size can be 1, 2 or 4, with 1 is the smallest and 4 is the tallest. */ cSlime(int a_Size); @@ -24,11 +24,11 @@ public: virtual void KilledBy(TakeDamageInfo & a_TDI) override; int GetSize(void) const { return m_Size; } - + /** Returns the text describing the slime's size, as used by the client's resource subsystem for sounds. Returns either "big" or "small". */ static AString GetSizeName(int a_Size); - + protected: /** Size of the slime, with 1 being the smallest. diff --git a/src/Mobs/Squid.h b/src/Mobs/Squid.h index 7e944a17e..590c50495 100644 --- a/src/Mobs/Squid.h +++ b/src/Mobs/Squid.h @@ -11,14 +11,14 @@ class cSquid : public cPassiveMonster { typedef cPassiveMonster super; - + public: cSquid(); virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; CLASS_PROTODEF(cSquid) - + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; // Squids do not drown (or float) diff --git a/src/Mobs/Villager.h b/src/Mobs/Villager.h index dc356b4a6..6f3e7b4e8 100644 --- a/src/Mobs/Villager.h +++ b/src/Mobs/Villager.h @@ -11,7 +11,7 @@ class cVillager : public cPassiveMonster { typedef cPassiveMonster super; - + public: enum eVillagerType diff --git a/src/Mobs/Witch.h b/src/Mobs/Witch.h index 8230e1f98..706fcd9b3 100644 --- a/src/Mobs/Witch.h +++ b/src/Mobs/Witch.h @@ -11,7 +11,7 @@ class cWitch : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: cWitch(); diff --git a/src/Mobs/Wither.h b/src/Mobs/Wither.h index 9e333c7fa..b430588c9 100644 --- a/src/Mobs/Wither.h +++ b/src/Mobs/Wither.h @@ -11,7 +11,7 @@ class cWither : public cAggressiveMonster { typedef cAggressiveMonster super; - + public: cWither(void); @@ -23,14 +23,14 @@ public: /** Returns whether the wither is invulnerable to arrows. */ bool IsArmored(void) const; - + // cEntity overrides virtual bool Initialize(cWorld & a_World) override; virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override; virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; virtual void KilledBy(TakeDamageInfo & a_TDI) override; - + virtual bool IsUndead(void) override { return true; } private: diff --git a/src/Mobs/ZombiePigman.cpp b/src/Mobs/ZombiePigman.cpp index 96d587287..73ad81b36 100644 --- a/src/Mobs/ZombiePigman.cpp +++ b/src/Mobs/ZombiePigman.cpp @@ -25,7 +25,7 @@ void cZombiePigman::GetDrops(cItems & a_Drops, cEntity * a_Killer) } AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_ROTTEN_FLESH); AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_GOLD_NUGGET); - + cItems RareDrops; RareDrops.Add(cItem(E_ITEM_GOLD)); AddRandomRareDropItem(a_Drops, RareDrops, LootingLevel); diff --git a/src/Mobs/ZombiePigman.h b/src/Mobs/ZombiePigman.h index d8b886ca4..c8f6753a4 100644 --- a/src/Mobs/ZombiePigman.h +++ b/src/Mobs/ZombiePigman.h @@ -10,7 +10,7 @@ class cZombiePigman : public cPassiveAggressiveMonster { typedef cPassiveAggressiveMonster super; - + public: cZombiePigman(void); @@ -18,7 +18,7 @@ public: virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override; virtual void KilledBy(TakeDamageInfo & a_TDI) override; - + virtual bool IsUndead(void) override { return true; } } ; |