diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index b1ecc51cad..f2dfe94aba 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -5,6 +5,7 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.StatDebuffs; @@ -485,10 +486,13 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => DownedBossSystem.downedPolterghast, ModContent.ItemType(), 10); - npcLoot.AddIf(() => DownedBossSystem.downedPolterghast, ModContent.ItemType(), 10); - npcLoot.AddIf(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType()); - npcLoot.AddIf(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType()); + // If post-Polter, the drop rates are 10%. Otherwise they're 100%. + // This is accomplished by adding rules if the CONDITION "Post-Polter" fails. + LeadingConditionRule postPolter = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast); + postPolter.Add(ModContent.ItemType(), 10); + postPolter.Add(ModContent.ItemType(), 10); + postPolter.OnFailedConditions(ItemDropRule.Common(ModContent.ItemType())); + postPolter.OnFailedConditions(ItemDropRule.Common(ModContent.ItemType())); } } } diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index ffb4313955..991529f44a 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -123,8 +123,7 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 2, 1, 2); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 1, 3); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 1, 3)); npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType(), 7); } } diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index f3fca3d60a..c9bf3d4a7d 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -284,8 +284,7 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 2, 1, 2); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 1, 3); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 1, 3)); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index 0c6dd3b64b..1f56d8ba20 100644 --- a/NPCs/Astral/AstralSlime.cs +++ b/NPCs/Astral/AstralSlime.cs @@ -81,11 +81,11 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 2, 1, 3); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 1, 3); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 1, 3)); npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType(), 7); - npcLoot.AddIf(() => DownedBossSystem.downedAstrumDeus && !Main.expertMode, ModContent.ItemType(), 1, 8, 12); - npcLoot.AddIf(() => DownedBossSystem.downedAstrumDeus && Main.expertMode, ModContent.ItemType(), 1, 11, 16); + + var postDeus = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAstrumDeus); + postDeus.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 8, 12, 11, 16)); } } } diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index a87a892bf2..5c85e7d70c 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -642,8 +642,7 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType()); - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 1, 6, 8); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 7, 9); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 6, 8, 7, 9)); npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType(), 7); } } diff --git a/NPCs/Astral/BigSightseer.cs b/NPCs/Astral/BigSightseer.cs index 9448b02b2e..5daa2a2b43 100644 --- a/NPCs/Astral/BigSightseer.cs +++ b/NPCs/Astral/BigSightseer.cs @@ -171,8 +171,7 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 2, 2, 3); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 1, 4); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 2, 3, 3, 4)); } } diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index 0a97094845..d5b6cb069a 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -134,8 +134,7 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 2, 2, 3); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 3, 4); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 2, 3, 3, 4)); } } } diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 23ff3fb357..0e826b8c09 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -208,8 +208,7 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 2, 1, 3); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 1, 4); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 1, 3, 1, 4)); npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType(), 2, 2, 3); } } diff --git a/NPCs/Astral/Hive.cs b/NPCs/Astral/Hive.cs index 0565474315..84cbde6352 100644 --- a/NPCs/Astral/Hive.cs +++ b/NPCs/Astral/Hive.cs @@ -142,8 +142,7 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 2, 1, 3); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 1, 4); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 1, 3, 1, 4)); npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType(), 7); } } diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index 99abc1db59..c94c12078d 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -239,8 +239,7 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 2, 1, 2); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 1, 3); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 1, 2, 1, 3)); npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType(), 7); } } diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 4ea5a39104..98685fa05d 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -259,10 +259,10 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => NPC.ai[3] <= -10000f && !Main.expertMode, ModContent.ItemType(), 1, 2, 3); - npcLoot.AddIf(() => NPC.ai[3] <= -10000f && Main.expertMode, ModContent.ItemType(), 1, 3, 4); - npcLoot.AddIf(() => NPC.ai[3] <= -10000f, ModContent.ItemType(), 7); - npcLoot.AddIf(() => NPC.ai[3] <= -10000f, ModContent.ItemType(), 7); + var exploded = npcLoot.DefineConditionalDropSet((info) => info.npc.ai[3] <= -10000f); + exploded.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 2, 3, 3, 4); + exploded.Add(ModContent.ItemType(), 7); + exploded.Add(ModContent.ItemType(), 7); } public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/Astral/SmallSightseer.cs b/NPCs/Astral/SmallSightseer.cs index dfbf1ef103..11d0b8da41 100644 --- a/NPCs/Astral/SmallSightseer.cs +++ b/NPCs/Astral/SmallSightseer.cs @@ -139,8 +139,7 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 2, 1, 2); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 1, 3); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 1, 2, 1, 3)); } } } diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index 480e5b6bcd..a1bd04346d 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -125,8 +125,7 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType(), 2, 1, 2); - npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType(), 1, 1, 3); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 1, 2, 1, 3)); npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType(), 7); } }