diff options
author | Mattes D <github@xoft.cz> | 2014-12-21 15:18:42 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-12-21 15:18:42 +0100 |
commit | d4c9daddb89cc8066f3fe36939447acbcf6c7400 (patch) | |
tree | af1a179ba5ac87c652b6e271c99628dee1ceb920 /src/Mobs/Rabbit.cpp | |
parent | Merge branch 'master' of https://github.com/mc-server/MCServer (diff) | |
parent | Fixed damn empty line with no use (diff) | |
download | cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar.gz cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar.bz2 cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar.lz cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar.xz cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.tar.zst cuberite-d4c9daddb89cc8066f3fe36939447acbcf6c7400.zip |
Diffstat (limited to 'src/Mobs/Rabbit.cpp')
-rw-r--r-- | src/Mobs/Rabbit.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Mobs/Rabbit.cpp b/src/Mobs/Rabbit.cpp new file mode 100644 index 000000000..cf49d2744 --- /dev/null +++ b/src/Mobs/Rabbit.cpp @@ -0,0 +1,34 @@ + +#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.82, 0.68) +{ +} + + + + + +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); +} + |