diff options
author | TheJumper <maximilian.springer@web.de> | 2014-02-21 18:45:00 +0100 |
---|---|---|
committer | TheJumper <maximilian.springer@web.de> | 2014-02-21 18:45:00 +0100 |
commit | 1b32b005626e7dd7e466358910d461bf5fb11a64 (patch) | |
tree | 28d1261dc2a00dff85c6a03328c3d78c3c4d8937 /src/Mobs/Witch.cpp | |
parent | BlockBed.cpp: Fixed space at if statement (diff) | |
download | cuberite-1b32b005626e7dd7e466358910d461bf5fb11a64.tar cuberite-1b32b005626e7dd7e466358910d461bf5fb11a64.tar.gz cuberite-1b32b005626e7dd7e466358910d461bf5fb11a64.tar.bz2 cuberite-1b32b005626e7dd7e466358910d461bf5fb11a64.tar.lz cuberite-1b32b005626e7dd7e466358910d461bf5fb11a64.tar.xz cuberite-1b32b005626e7dd7e466358910d461bf5fb11a64.tar.zst cuberite-1b32b005626e7dd7e466358910d461bf5fb11a64.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Witch.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/Mobs/Witch.cpp b/src/Mobs/Witch.cpp index 25d27041f..88e8f4e50 100644 --- a/src/Mobs/Witch.cpp +++ b/src/Mobs/Witch.cpp @@ -18,13 +18,26 @@ cWitch::cWitch(void) : void cWitch::GetDrops(cItems & a_Drops, cEntity * a_Killer) { - AddRandomDropItem(a_Drops, 0, 6, E_ITEM_GLASS_BOTTLE); - AddRandomDropItem(a_Drops, 0, 6, E_ITEM_GLOWSTONE_DUST); - AddRandomDropItem(a_Drops, 0, 6, E_ITEM_GUNPOWDER); - AddRandomDropItem(a_Drops, 0, 6, E_ITEM_REDSTONE_DUST); - AddRandomDropItem(a_Drops, 0, 6, E_ITEM_SPIDER_EYE); - AddRandomDropItem(a_Drops, 0, 6, E_ITEM_STICK); - AddRandomDropItem(a_Drops, 0, 6, E_ITEM_SUGAR); + int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(21); + MTRand r1; + int DropTypeCount = (r1.randInt() % 3) + 1; + for (int i = 0; i < DropTypeCount; i++) + { + int DropType = r1.randInt() % 7; + switch (DropType) + { + case 0: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GLASS_BOTTLE); + case 1: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GLOWSTONE_DUST); + case 2: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER); + case 3: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_REDSTONE_DUST); + case 4: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SPIDER_EYE); + case 5: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STICK); + case 6: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SUGAR); + } + } + cItems RareDrops; + if (!GetEquippedWeapon().IsEmpty()) RareDrops.Add(GetEquippedWeapon()); + AddRandomRareDropItem(a_Drops, RareDrops, LootingLevel); } |