diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index cc8fb5cdbd..3efdda9a24 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -64,9 +64,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 10, 26); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 10, 26); } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index d0479d9a5c..6a5875b433 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -417,8 +417,6 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - // TODO -- Draedon's remote appears to not exist as of 1.4 porting. Is this intentional or did something go wrong? - // npcLoot.Add(ModContent.ItemType(), 3); npcLoot.Add(ModContent.ItemType(), 1, 2, 4); npcLoot.Add(ModContent.ItemType(), 1, 4, 8); npcLoot.Add(ModContent.ItemType(), 1, 4, 8); diff --git a/NPCs/NormalNPCs/BlightedEye.cs b/NPCs/NormalNPCs/BlightedEye.cs index 3ae6cba72a..a7b72f8f98 100644 --- a/NPCs/NormalNPCs/BlightedEye.cs +++ b/NPCs/NormalNPCs/BlightedEye.cs @@ -64,9 +64,6 @@ namespace CalamityMod.NPCs.NormalNPCs player.AddBuff(BuffID.Weak, 180, true); } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 2); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 2); } } diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index d9fe5c402f..146298df9a 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -65,9 +65,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 10, 26); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 10, 26); } } diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 50f4798720..644be6503e 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -294,9 +294,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 4); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 4); } } diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index d44a3b9208..69e81cd636 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -73,9 +73,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 10, 26); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 10, 26); } } diff --git a/NPCs/NormalNPCs/Cryocore.cs b/NPCs/NormalNPCs/Cryocore.cs index dec1da12d1..fd50bc0429 100644 --- a/NPCs/NormalNPCs/Cryocore.cs +++ b/NPCs/NormalNPCs/Cryocore.cs @@ -122,9 +122,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), new DropHelper.Fraction(1, 3)); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 3); } } diff --git a/NPCs/NormalNPCs/Cryocore2.cs b/NPCs/NormalNPCs/Cryocore2.cs index 12f1a4a796..4b8da4c04a 100644 --- a/NPCs/NormalNPCs/Cryocore2.cs +++ b/NPCs/NormalNPCs/Cryocore2.cs @@ -122,9 +122,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 2); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 2); } } diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index 13a94ddfd0..4e00745fbd 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -96,9 +96,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 2); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 2); } } diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 5e0be4ee9f..a9793fbb90 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -321,10 +322,20 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => EidolonWyrmHeadHuge.CanMinionsDropThings() && !NPC.LunarApocalypseIsUp, ModContent.ItemType(), 4); - npcLoot.AddIf(() => EidolonWyrmHeadHuge.CanMinionsDropThings() && DownedBossSystem.downedCalamitas && !Main.expertMode, ModContent.ItemType(), 1, 8, 10); - npcLoot.AddIf(() => EidolonWyrmHeadHuge.CanMinionsDropThings() && DownedBossSystem.downedCalamitas && Main.expertMode, ModContent.ItemType(), 1, 10, 14); - npcLoot.AddIf(() => EidolonWyrmHeadHuge.CanMinionsDropThings() && NPC.downedPlantBoss, ItemID.Ectoplasm, 1, 3, 5); + // Never drop anything if this Eidolon Wyrm is a minion during an AEW fight. + var aewMinionCondition = npcLoot.DefineConditionalDropSet(EidolonWyrmHeadHuge.CanMinionsDropThings); + + LeadingConditionRule notDuringCultistFight = new LeadingConditionRule(DropHelper.If(() => !NPC.LunarApocalypseIsUp)); + notDuringCultistFight.Add(ModContent.ItemType(), 4); + aewMinionCondition.Add(notDuringCultistFight); + + LeadingConditionRule postClone = new LeadingConditionRule(DropHelper.If(() => DownedBossSystem.downedCalamitas)); + postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 8, 10, 10, 14)); + aewMinionCondition.Add(postClone); + + LeadingConditionRule postPlant = new LeadingConditionRule(new Conditions.DownedPlantera()); + postPlant.Add(ItemID.Ectoplasm, 1, 3, 5); + aewMinionCondition.Add(postPlant); } } } diff --git a/NPCs/NormalNPCs/Frogfish.cs b/NPCs/NormalNPCs/Frogfish.cs index 7001eb45aa..69e68c4131 100644 --- a/NPCs/NormalNPCs/Frogfish.cs +++ b/NPCs/NormalNPCs/Frogfish.cs @@ -110,10 +110,7 @@ namespace CalamityMod.NPCs.NormalNPCs return SpawnCondition.OceanMonster.Chance * 0.2f; } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 2, 1, 1); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 2); public override void HitEffect(int hitDirection, double damage) { diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 3776c84ec8..1f95ebe6e1 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -83,10 +83,13 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, - ModContent.ItemType(), + var weapons = new int[] + { ModContent.ItemType(), - ModContent.ItemType())); + ModContent.ItemType(), + ModContent.ItemType(), + }; + npcLoot.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/IceMass.cs b/NPCs/NormalNPCs/IceMass.cs index d0f235f1d4..d3f42deb18 100644 --- a/NPCs/NormalNPCs/IceMass.cs +++ b/NPCs/NormalNPCs/IceMass.cs @@ -101,9 +101,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 4); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 4); } } diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index 4affe63a66..79ea0e29e6 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -104,10 +104,7 @@ namespace CalamityMod.NPCs.NormalNPCs return SpawnCondition.OceanMonster.Chance * 0.2f; } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.AddIf(() => NPC.downedPlantBoss, ModContent.ItemType(), 5); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.AddIf(() => NPC.downedPlantBoss, ModContent.ItemType(), 5); public override void HitEffect(int hitDirection, double damage) { diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index acfbdef710..6625babf21 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -65,9 +65,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 10, 26); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 10, 26); } } diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 1d8576f220..5c53b9e6f6 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -72,9 +72,6 @@ namespace CalamityMod.NPCs.NormalNPCs return new Color(200, 200, 200, 0); } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType()); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType()); } } diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index 5e06893b45..b65c15c654 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -122,9 +122,6 @@ namespace CalamityMod.NPCs.NormalNPCs return new Color(200, 200, 200, 0); } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 2, 4); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 2, 4); } } diff --git a/NPCs/NormalNPCs/PhantomSpiritM.cs b/NPCs/NormalNPCs/PhantomSpiritM.cs index 8ce37d1499..24287f06c7 100644 --- a/NPCs/NormalNPCs/PhantomSpiritM.cs +++ b/NPCs/NormalNPCs/PhantomSpiritM.cs @@ -81,9 +81,6 @@ namespace CalamityMod.NPCs.NormalNPCs return new Color(200, 200, 200, 0); } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 1, 3); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 1, 3); } } diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index 2bacff80b3..18507d7f8e 100644 --- a/NPCs/NormalNPCs/PhantomSpiritS.cs +++ b/NPCs/NormalNPCs/PhantomSpiritS.cs @@ -79,9 +79,6 @@ namespace CalamityMod.NPCs.NormalNPCs return new Color(200, 200, 200, 0); } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 1, 2); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 1, 2); } } diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 5d5cb49f06..f5568d8fa1 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -83,10 +83,7 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ItemID.Bacon); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ItemID.Bacon); public override void HitEffect(int hitDirection, double damage) { diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index 94a3038742..0a399a6a87 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -83,9 +83,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 2, 4); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 2, 4); } } diff --git a/NPCs/NormalNPCs/SandTortoise.cs b/NPCs/NormalNPCs/SandTortoise.cs index 383518f0f3..2c4aea9435 100644 --- a/NPCs/NormalNPCs/SandTortoise.cs +++ b/NPCs/NormalNPCs/SandTortoise.cs @@ -61,9 +61,6 @@ namespace CalamityMod.NPCs.NormalNPCs return SpawnCondition.DesertCave.Chance * 0.05f; } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ItemID.TurtleShell, 10); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ItemID.TurtleShell, 10); } } diff --git a/NPCs/NormalNPCs/SeaUrchin.cs b/NPCs/NormalNPCs/SeaUrchin.cs index ed8b2d361c..fa2d296b64 100644 --- a/NPCs/NormalNPCs/SeaUrchin.cs +++ b/NPCs/NormalNPCs/SeaUrchin.cs @@ -55,10 +55,7 @@ namespace CalamityMod.NPCs.NormalNPCs return SpawnCondition.OceanMonster.Chance * 0.2f; } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 15, 25); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 15, 25); public override void HitEffect(int hitDirection, double damage) { diff --git a/NPCs/NormalNPCs/SunBat.cs b/NPCs/NormalNPCs/SunBat.cs index 618ec977f0..9b029d1973 100644 --- a/NPCs/NormalNPCs/SunBat.cs +++ b/NPCs/NormalNPCs/SunBat.cs @@ -87,9 +87,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 3); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 3); } } diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index 252b352d28..61716b97b5 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -211,10 +211,7 @@ namespace CalamityMod.NPCs.NormalNPCs player.AddBuff(ModContent.BuffType(), 120, true); } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 3); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 3); public override void HitEffect(int hitDirection, double damage) { diff --git a/NPCs/NormalNPCs/WildBumblefuck.cs b/NPCs/NormalNPCs/WildBumblefuck.cs index d37bf29cd2..6982eed150 100644 --- a/NPCs/NormalNPCs/WildBumblefuck.cs +++ b/NPCs/NormalNPCs/WildBumblefuck.cs @@ -56,10 +56,7 @@ namespace CalamityMod.NPCs.NormalNPCs CalamityAI.Bumblebirb2AI(NPC, Mod, false); } - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ModContent.ItemType(), 1, 2, 4); - } + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 2, 4); public override void FindFrame(int frameHeight) { diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index e373b91f31..446e2b17fc 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -206,6 +206,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npcLoot.Add(ModContent.ItemType(), 1, 1, 3); npcLoot.Add(ModContent.ItemType(), new DropHelper.Fraction(7, 100)); + // TODO -- does this work? npcLoot.AddIf(() => Supercharged, ModContent.ItemType()); } } diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 003a25702a..3264cfedda 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -186,6 +186,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npcLoot.Add(ModContent.ItemType(), 1, 1, 2); npcLoot.Add(ModContent.ItemType(), new DropHelper.Fraction(7, 100)); + // TODO -- does this work? npcLoot.AddIf(() => Supercharged, ModContent.ItemType()); } } diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index 33903d3925..f9de8d948b 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -283,6 +283,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npcLoot.Add(ModContent.ItemType(), 1, 2, 3); npcLoot.Add(ModContent.ItemType(), new DropHelper.Fraction(7, 100)); + // TODO -- does this work? npcLoot.AddIf(() => Supercharged, ModContent.ItemType()); } } diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 7c9df8832b..4b930e6351 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -165,6 +165,7 @@ namespace CalamityMod.NPCs.NormalNPCs npcLoot.Add(ModContent.ItemType(), 1, 1, 2); npcLoot.Add(ModContent.ItemType(), 10); npcLoot.Add(ModContent.ItemType(), new DropHelper.Fraction(7, 100)); + // TODO -- does this work? npcLoot.AddIf(() => Supercharged, ModContent.ItemType()); } }