2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
|
|
|
#include "Witch.h"
|
2018-08-28 20:51:25 -04:00
|
|
|
#include "../FastRandom.h"
|
2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cWitch::cWitch(void) :
|
2020-03-22 11:50:34 -04:00
|
|
|
super("Witch", mtWitch, "entity.witch.hurt", "entity.witch.death", "entity.witch.ambient", 0.6, 1.8)
|
2013-07-29 07:13:03 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cWitch::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
|
|
|
{
|
2015-05-19 14:32:10 -04:00
|
|
|
unsigned int LootingLevel = 0;
|
2014-10-20 16:55:07 -04:00
|
|
|
if (a_Killer != nullptr)
|
2014-02-23 13:44:58 -05:00
|
|
|
{
|
|
|
|
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
|
|
|
|
}
|
2017-06-13 15:35:30 -04:00
|
|
|
auto & r1 = GetRandomProvider();
|
|
|
|
int DropTypeCount = r1.RandInt(1, 3);
|
2014-02-23 13:44:58 -05:00
|
|
|
for (int i = 0; i < DropTypeCount; i++)
|
|
|
|
{
|
2017-06-13 15:35:30 -04:00
|
|
|
int DropType = r1.RandInt(6);
|
2014-02-23 13:44:58 -05:00
|
|
|
switch (DropType)
|
|
|
|
{
|
|
|
|
case 0: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GLASS_BOTTLE); break;
|
|
|
|
case 1: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GLOWSTONE_DUST); break;
|
|
|
|
case 2: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER); break;
|
|
|
|
case 3: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_REDSTONE_DUST); break;
|
|
|
|
case 4: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SPIDER_EYE); break;
|
|
|
|
case 5: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STICK); break;
|
|
|
|
case 6: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SUGAR); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AddRandomWeaponDropItem(a_Drops, LootingLevel);
|
2013-07-29 07:13:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|