From 342b2d4e6f59d9fbbdc9c69a7e057a47abc48d30 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 10 Jun 2022 18:53:39 -0400 Subject: [PATCH] Fixed Giant Clam dropping HM weapons PHM. --- NPCs/SunkenSea/GiantClam.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 395a5f041b..ceb3cba35e 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -15,6 +15,7 @@ using System; using System.IO; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; @@ -75,10 +76,10 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) { bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { - //BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SunkenSea, + //BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SunkenSea, - // Will move to localization whenever that is cleaned up. - new FlavorTextBestiaryInfoElement("This oversized clam is large enough to entrap a person or two whole. Thankfully, it has only taken turf in the lowest regions of the sunken sea.") + // Will move to localization whenever that is cleaned up. + new FlavorTextBestiaryInfoElement("This oversized clam is large enough to entrap a person or two whole. Thankfully, it has only taken turf in the lowest regions of the sunken sea.") }); } @@ -448,9 +449,12 @@ namespace CalamityMod.NPCs.SunkenSea public override void ModifyNPCLoot(NPCLoot npcLoot) { + var hardmode = npcLoot.DefineConditionalDropSet(new Conditions.IsHardmode()); + var postDesertScourge = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedDesertScourge); + // Materials npcLoot.Add(ModContent.ItemType(), 1, 25, 35); - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 1, 6, 11); + hardmode.Add(ModContent.ItemType(), 1, 6, 11); // Weapons int[] weapons = new int[] @@ -460,11 +464,14 @@ namespace CalamityMod.NPCs.SunkenSea ModContent.ItemType(), ModContent.ItemType(), }; - npcLoot.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); + hardmode.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); // Equipment - npcLoot.AddIf(() => DownedBossSystem.downedDesertScourge, ModContent.ItemType(), 3); - npcLoot.AddIf(() => DownedBossSystem.downedDesertScourge, ModContent.ItemType(), 3); + postDesertScourge.Add(ModContent.ItemType(), 3); + postDesertScourge.Add(ModContent.ItemType(), 3); + + npcLoot.Add(postDesertScourge); + npcLoot.Add(hardmode); } } }