2014-12-20 04:31:34 -05:00
|
|
|
|
|
|
|
#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) :
|
2017-06-13 15:35:30 -04:00
|
|
|
cRabbit(static_cast<eRabbitType>(GetRandomProvider().RandInt<UInt8>(
|
|
|
|
static_cast<UInt8>(eRabbitType::SaltAndPepper) // Max possible Rabbit-Type
|
2015-07-16 19:09:06 -04:00
|
|
|
)), 0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cRabbit::cRabbit(eRabbitType Type, int MoreCarrotTicks) :
|
2017-02-15 00:05:24 -05:00
|
|
|
super("Rabbit", mtRabbit, "entity.rabbit.hurt", "entity.rabbit.death", 0.82, 0.68),
|
2015-07-16 19:09:06 -04:00
|
|
|
m_Type(Type),
|
|
|
|
m_MoreCarrotTicks(MoreCarrotTicks)
|
2014-12-20 04:31:34 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cRabbit::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
|
|
|
{
|
2017-10-21 12:55:46 -04:00
|
|
|
if (IsBaby())
|
|
|
|
{
|
|
|
|
return; // Babies don't drop items
|
|
|
|
}
|
|
|
|
|
2015-05-19 14:32:10 -04:00
|
|
|
unsigned int LootingLevel = 0;
|
2014-12-20 04:31:34 -05:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|