From 287f14adb092c8ca5e4fe0994a2354191ffef72d Mon Sep 17 00:00:00 2001 From: Amber Sienna Date: Sat, 14 Mar 2020 17:57:22 +0000 Subject: [PATCH] Armoured Digger drop tweaks --- NPCs/NormalNPCs/ArmoredDiggerHead.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index bf3bb9f585..675d768def 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -411,17 +411,21 @@ namespace CalamityMod.NPCs.NormalNPCs } } + public override bool SpecialNPCLoot() + { + int closestSegmentID = DropHelper.FindClosestWormSegment(npc, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType()); + npc.position = Main.npc[closestSegmentID].position; + return false; + } + public override void NPCLoot() { - if (Main.rand.NextBool(40)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } - if (Main.rand.NextBool(3)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType(), Main.rand.Next(2, 5)); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 40); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); + DropHelper.DropItem(npc, ModContent.ItemType(), Main.rand.Next(2, 5)); } } }