diff options
author | Masy98 <masy@antheruscraft.de> | 2014-12-20 10:31:34 +0100 |
---|---|---|
committer | Masy98 <masy@antheruscraft.de> | 2014-12-20 10:31:34 +0100 |
commit | 6e8e1c6d8da3d5a0f5ca39f6f18d88c2ca6c1e71 (patch) | |
tree | 0c7e7083444d2dc9c797c7a962fc05185c03eb1e /src/Mobs/Rabbit.cpp | |
parent | Merge pull request #1680 from Masy98/entities (diff) | |
download | cuberite-6e8e1c6d8da3d5a0f5ca39f6f18d88c2ca6c1e71.tar cuberite-6e8e1c6d8da3d5a0f5ca39f6f18d88c2ca6c1e71.tar.gz cuberite-6e8e1c6d8da3d5a0f5ca39f6f18d88c2ca6c1e71.tar.bz2 cuberite-6e8e1c6d8da3d5a0f5ca39f6f18d88c2ca6c1e71.tar.lz cuberite-6e8e1c6d8da3d5a0f5ca39f6f18d88c2ca6c1e71.tar.xz cuberite-6e8e1c6d8da3d5a0f5ca39f6f18d88c2ca6c1e71.tar.zst cuberite-6e8e1c6d8da3d5a0f5ca39f6f18d88c2ca6c1e71.zip |
Diffstat (limited to 'src/Mobs/Rabbit.cpp')
-rw-r--r-- | src/Mobs/Rabbit.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Mobs/Rabbit.cpp b/src/Mobs/Rabbit.cpp new file mode 100644 index 000000000..1c7d810b7 --- /dev/null +++ b/src/Mobs/Rabbit.cpp @@ -0,0 +1,38 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + +#include "Rabbit.h" +#include "../Entities/Player.h" +#include "../World.h" + + + + + +cRabbit::cRabbit(void) : + super("Rabbit", mtRabbit, "mob.rabbit.idle", "mob.rabbit.death", 0.9, 0.9) +{ +} + + + + + +void cRabbit::GetDrops(cItems & a_Drops, cEntity * a_Killer) +{ + int LootingLevel = 0; + if (a_Killer != nullptr) + { + LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting); + } + AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, IsOnFire() ? E_ITEM_COOKED_RABBIT : E_ITEM_RAW_RABBIT); + AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_RABBIT_HIDE); + cItems RareDrops; + RareDrops.Add(cItem(E_ITEM_RABBITS_FOOT)); + AddRandomRareDropItem(a_Drops, RareDrops, LootingLevel); +} + + + + + |