From 548c836ce4826209d3c3cbfa1abdfd5ce94b5316 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 4 Aug 2022 21:47:12 -0400 Subject: [PATCH] Minor fixes and catches for Iban's loot porting (thanks!) --- Items/Fishing/AstralCatches/AstralCrate.cs | 30 +++++------ .../BrimstoneCragCatches/BrimstoneCrate.cs | 12 ++--- Items/Fishing/GlimmeringGemfish.cs | 13 +++-- Items/Fishing/StuffedFish.cs | 34 +++++++------ Items/Fishing/SulphurCatches/AbyssalCrate.cs | 44 ++++++++-------- Items/Fishing/SunkenSeaCatches/SunkenCrate.cs | 29 ++++++----- Items/TreasureBags/OldDukeBag.cs | 1 - NPCs/Astral/Nova.cs | 7 +-- Utilities/DropHelper.cs | 50 +++++++++++-------- 9 files changed, 116 insertions(+), 104 deletions(-) diff --git a/Items/Fishing/AstralCatches/AstralCrate.cs b/Items/Fishing/AstralCatches/AstralCrate.cs index aecedeb250..c1ec8b970a 100644 --- a/Items/Fishing/AstralCatches/AstralCrate.cs +++ b/Items/Fishing/AstralCatches/AstralCrate.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Accessories; -using CalamityMod.Items.Materials; using CalamityMod.Items.Critters; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Potions; @@ -11,10 +11,9 @@ using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Tiles.Astral; using Terraria; -using Terraria.ID; using Terraria.GameContent.ItemDropRules; +using Terraria.ID; using Terraria.ModLoader; -using System; namespace CalamityMod.Items.Fishing.AstralCatches { @@ -49,7 +48,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches var postAstrumAureus = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAstrumAureus); var postAstrumDeus = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAstrumDeus); - //Materials + // Materials itemLoot.Add(ModContent.ItemType(), 1, 5, 10); itemLoot.Add(ItemID.FallenStar, 1, 5, 10); itemLoot.Add(ItemID.Meteorite, 5, 10, 20); @@ -60,31 +59,32 @@ namespace CalamityMod.Items.Fishing.AstralCatches postAstrumDeus.Add(ModContent.ItemType(), 10, 1, 3); postAstrumDeus.Add(ModContent.ItemType(), 4, 5, 10); - //Weapons - postAstrumAureus.Add(new OneFromOptionsNotScaledWithLuckDropRule(10, 1, - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), + // Weapons (and Starburster Core) + postAstrumAureus.Add(new OneFromOptionsDropRule(10, 1, ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType())); + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + )); - //Pet + // Pet itemLoot.Add(ModContent.ItemType(), 10); - //Bait + // Bait itemLoot.Add(ModContent.ItemType(), 5, 1, 3); itemLoot.Add(ItemID.EnchantedNightcrawler, 5, 1, 3); itemLoot.Add(ModContent.ItemType(), 5, 1, 3); itemLoot.Add(ItemID.Firefly, 3, 1, 3); - //Potions + // Potions postAstrumAureus.Add(ModContent.ItemType(), 10, 1, 3); postAstrumAureus.Add(ModContent.ItemType(), 10, 1, 3); itemLoot.AddCratePotionRules(); - //Money + // Money itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); } diff --git a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs index 06034f4e65..30a68f7cca 100644 --- a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs +++ b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs @@ -35,28 +35,26 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - //Vanilla materials + // Materials itemLoot.Add(ItemID.Obsidian, 1, 2, 5); itemLoot.Add(ItemID.Hellstone, 4, 2, 5); itemLoot.Add(ItemID.HellstoneBar, 10, 1, 3); - - //Modded materials itemLoot.Add(ModContent.ItemType(), 1, 1, 4); itemLoot.AddIf(() => DownedBossSystem.downedBrimstoneElemental, ModContent.ItemType(), 10, 1, 3); - itemLoot.AddIf(() => DownedBossSystem.downedProvidence && DownedBossSystem.downedPolterghast, ModContent.ItemType(), 10, 1, 3); + itemLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType(), 10, 1, 3); // Weapons (none) - //Bait + // Bait itemLoot.Add(ItemID.MasterBait, 10, 1, 2); itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); - //Potions + // Potions itemLoot.Add(ItemID.InfernoPotion, 10, 1, 3); itemLoot.AddCratePotionRules(); - //Money + // Money itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); } diff --git a/Items/Fishing/GlimmeringGemfish.cs b/Items/Fishing/GlimmeringGemfish.cs index a6554c4647..3c1e134cc3 100644 --- a/Items/Fishing/GlimmeringGemfish.cs +++ b/Items/Fishing/GlimmeringGemfish.cs @@ -28,17 +28,16 @@ namespace CalamityMod.Items.Fishing { int gemMin = 1; int gemMax = 3; - itemLoot.Add(ItemID.Amethyst, 2, gemMin, gemMax); - itemLoot.Add(ItemID.Topaz, new Fraction(4, 10), gemMin, gemMax); - itemLoot.Add(ItemID.Sapphire, new Fraction(3, 10), gemMin, gemMax); - itemLoot.Add(ItemID.Emerald, 5, gemMin, gemMax); - itemLoot.Add(ItemID.Ruby, new Fraction(15, 100), gemMin, gemMax); + itemLoot.Add(ItemID.Topaz, 2, gemMin, gemMax); + itemLoot.Add(ItemID.Sapphire, 4, gemMin, gemMax); + itemLoot.Add(ItemID.Emerald, 4, gemMin, gemMax); + itemLoot.Add(ItemID.Ruby, 8, gemMin, gemMax); itemLoot.Add(ItemID.Diamond, 10, gemMin, gemMax); - itemLoot.Add(ItemID.Amber, 4, gemMin, gemMax); + itemLoot.Add(ItemID.Amber, 8, gemMin, gemMax); Mod thorium = CalamityMod.Instance.thorium; - if (thorium != null) + if (thorium is not null) { itemLoot.Add(thorium.Find("Pearl").Type, 4, gemMin, gemMax); itemLoot.Add(thorium.Find("Opal").Type, 4, gemMin, gemMax); diff --git a/Items/Fishing/StuffedFish.cs b/Items/Fishing/StuffedFish.cs index 726d1174b4..9f98ba40a1 100644 --- a/Items/Fishing/StuffedFish.cs +++ b/Items/Fishing/StuffedFish.cs @@ -31,40 +31,44 @@ namespace CalamityMod.Items.Fishing int seedMin = 2; int seedMax = 5; - //Herbs + // Herbs itemLoot.Add(ItemID.Daybloom, 4, herbMin, herbMax); - itemLoot.Add(ItemID.Moonglow, 4, herbMin, herbMax); - itemLoot.Add(ItemID.Waterleaf, 4, herbMin, herbMax); - itemLoot.Add(ItemID.Deathweed, 4, herbMin, herbMax); - itemLoot.Add(ItemID.Shiverthorn, 4, herbMin, herbMax); - itemLoot.Add(ItemID.Fireblossom, 4, herbMin, herbMax); itemLoot.Add(ItemID.Blinkroot, 4, herbMin, herbMax); - //Herb seeds + itemLoot.Add(ItemID.Waterleaf, 4, herbMin, herbMax); + itemLoot.Add(ItemID.Shiverthorn, 4, herbMin, herbMax); + itemLoot.Add(ItemID.Moonglow, 4, herbMin, herbMax); + itemLoot.Add(ItemID.Deathweed, 4, herbMin, herbMax); + itemLoot.Add(ItemID.Fireblossom, 4, herbMin, herbMax); + + // Herb seeds itemLoot.Add(ItemID.DaybloomSeeds, 5, seedMin, seedMax); - itemLoot.Add(ItemID.MoonglowSeeds, 5, seedMin, seedMax); + itemLoot.Add(ItemID.BlinkrootSeeds, 5, seedMin, seedMax); itemLoot.Add(ItemID.WaterleafSeeds, 5, seedMin, seedMax); itemLoot.Add(ItemID.ShiverthornSeeds, 5, seedMin, seedMax); + itemLoot.Add(ItemID.MoonglowSeeds, 5, seedMin, seedMax); + itemLoot.Add(ItemID.DeathweedSeeds, 5, herbMin, herbMax); itemLoot.Add(ItemID.FireblossomSeeds, 5, seedMin, seedMax); - itemLoot.Add(ItemID.BlinkrootSeeds, 5, seedMin, seedMax); - //Misc seeds + + // Miscellaneous seeds itemLoot.Add(ItemID.GrassSeeds, 10, seedMin, seedMax); itemLoot.Add(ItemID.JungleGrassSeeds, 10, seedMin, seedMax); itemLoot.Add(ItemID.MushroomGrassSeeds, 10, seedMin, seedMax); itemLoot.Add(ItemID.PumpkinSeed, 20, seedMin, seedMax); - //Spreadin biome seeds + + // Biome grass seeds itemLoot.AddIf(() => !WorldGen.crimson , ItemID.CorruptSeeds, 20, seedMin, seedMax); itemLoot.AddIf(() => WorldGen.crimson , ItemID.CrimsonSeeds, 20, seedMin, seedMax); itemLoot.AddIf(() => Main.hardMode , ItemID.HallowedSeeds, 20, seedMin, seedMax); Mod thorium = CalamityMod.Instance.thorium; - if (thorium != null) + if (thorium is not null) { itemLoot.Add(thorium.Find("MarineKelp").Type, 4, herbMin, herbMax); itemLoot.Add(thorium.Find("MarineKelpSeeds").Type, 10, seedMin, seedMax); } Mod soa = CalamityMod.Instance.soa; - if (soa != null) + if (soa is not null) { itemLoot.Add(soa.Find("Welkinbell").Type, 4, herbMin, herbMax); itemLoot.Add(soa.Find("WelkinbellSeeds").Type, 10, seedMin, seedMax); @@ -74,8 +78,8 @@ namespace CalamityMod.Items.Fishing // TODO -- There is no way to determine if SoA's Abaddon is dead without reflection. // Dan Yami has confirmed that downed calls will be added to SoA eventually. - //DropHelper.DropItemCondition(s, player, shadowsOfAbaddon.ItemType("Enduflora"), SacredTools.ModdedWorld.downedAbaddon, 0.25f, herbMin, herbMax); - //DropHelper.DropItemCondition(s, player, shadowsOfAbaddon.ItemType("EndufloraSeeds"), SacredTools.ModdedWorld.downedAbaddon, 0.1f, seedMin, seedMax); + //itemLoot.AddIf(() => SacredTools.ModdedWorld.downedAbaddon, soa.Find("Enduflora").Type, 4, herbMin, herbMax); + //itemLoot.AddIf(() => SacredTools.ModdedWorld.downedAbaddon, soa.Find("EndufloraSeeds").Type, 10, seedMin, seedMax); } } } diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.cs b/Items/Fishing/SulphurCatches/AbyssalCrate.cs index 0396948390..0a79db1761 100644 --- a/Items/Fishing/SulphurCatches/AbyssalCrate.cs +++ b/Items/Fishing/SulphurCatches/AbyssalCrate.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - //LCRs. + // The contents of this crate depend massively on progression, so it uses a large number of LeadingConditionRules. var tier1AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedSlimeGod || Main.hardMode); var tier2AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); var scoriaAvailable = itemLoot.DefineConditionalDropSet(() => NPC.downedGolemBoss); @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches var tier2AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAquaticScourgeAcidRain); var tier3AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast && DownedBossSystem.downedBoomerDuke); - //Materials + // Materials itemLoot.Add(ModContent.ItemType(), 1, 5, 10); itemLoot.Add(ModContent.ItemType(), 1, 5, 10); itemLoot.Add(ModContent.ItemType(), 1, 5, 10); @@ -71,41 +71,45 @@ namespace CalamityMod.Items.Fishing.SulphurCatches scoriaAvailable.Add(ModContent.ItemType(), new Fraction(15, 100), 4, 7); tier3AcidRain.Add(ModContent.ItemType(), 10, 1, 5); - // Weapons - tier1AbyssAvailable.Add(new OneFromOptionsNotScaledWithLuckDropRule(10, 1, - ModContent.ItemType(), + // Pre-HM Abyss Weapons + tier1AbyssAvailable.Add(new OneFromOptionsDropRule(10, 1, ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType())); + ModContent.ItemType() + )); - lcrT2AcidRain.Add(new OneFromOptionsNotScaledWithLuckDropRule(10, 1, - ModContent.ItemType(), - ModContent.ItemType(), + // Post-AS Acid Rain Weapons (and Nuclear Rod) + tier2AcidRain.Add(new OneFromOptionsDropRule(10, 1, ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType())); + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + )); - // Equipment - tier1AbyssAvailable.Add(new OneFromOptionsNotScaledWithLuckDropRule(4, 1, - ModContent.ItemType(), + // Pre-HM Abyss Equipment (and Torrential Tear) + tier1AbyssAvailable.Add(new OneFromOptionsDropRule(4, 1, + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType())); + ModContent.ItemType(), + ModContent.ItemType() + )); - //Bait + // Bait itemLoot.Add(ItemID.MasterBait, 10, 1, 2); itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); - //Potions + // Potions itemLoot.Add(ModContent.ItemType(), 10, 1, 3); itemLoot.AddCratePotionRules(); - //Money + // Money itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); } diff --git a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs index b81907e698..30e08c4704 100644 --- a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs @@ -1,16 +1,14 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Critters; +using CalamityMod.Items.Critters; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; -using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.Tiles.SunkenSea; using Terraria; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; -using Terraria.GameContent.ItemDropRules; namespace CalamityMod.Items.Fishing.SunkenSeaCatches { @@ -31,7 +29,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches Item.height = 32; Item.rare = ItemRarityID.Green; Item.value = Item.sellPrice(gold: 1); - Item.createTile = ModContent.TileType(); + Item.createTile = ModContent.TileType(); Item.useTurn = true; Item.autoReuse = true; Item.useAnimation = 15; @@ -45,30 +43,31 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches var postDesertScourge = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCLAMHardMode); var postHardmodeClam = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCLAMHardMode); - - itemLoot.Add(ModContent.ItemType(), 1, 10, 30); - itemLoot.Add(ModContent.ItemType(), 1, 10, 30); + // Materials + itemLoot.Add(ModContent.ItemType(), 1, 10, 30); + itemLoot.Add(ModContent.ItemType(), 1, 10, 30); postDesertScourge.Add(ModContent.ItemType(), 1, 5, 10); - postDesertScourge.Add(ModContent.ItemType(), 5, 2, 5); + postDesertScourge.Add(ModContent.ItemType(), 5, 2, 5); postHardmodeClam.Add(ModContent.ItemType(), new Fraction(12, 100), 2, 5); // Weapons postHardmodeClam.Add(new OneFromOptionsNotScaledWithLuckDropRule(7, 100, - ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType())); + ModContent.ItemType() + )); - //Bait + // Bait itemLoot.Add(ItemID.MasterBait, 10, 1, 2); itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); itemLoot.Add(ModContent.ItemType(), 5, 1, 3); itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); - //Potions + // Potions itemLoot.AddCratePotionRules(); - //Money + // Money itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); } diff --git a/Items/TreasureBags/OldDukeBag.cs b/Items/TreasureBags/OldDukeBag.cs index 58701b71a4..7200420b94 100644 --- a/Items/TreasureBags/OldDukeBag.cs +++ b/Items/TreasureBags/OldDukeBag.cs @@ -53,7 +53,6 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType(), ModContent.ItemType() })); - itemLoot.Add(ModContent.ItemType(), 10); // Equipment diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index bc9e121deb..c9c062c46e 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -271,11 +271,12 @@ namespace CalamityMod.NPCs.Astral public override void ModifyNPCLoot(NPCLoot npcLoot) { var exploded = npcLoot.DefineConditionalDropSet((info) => info.npc.ai[3] <= -10000f); - var notExploded = npcLoot.DefineConditionalDropSet((info) => info.npc.ai[3] > -10000f); - notExploded.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 2, 3, 3, 4)); - notExploded.Add(ItemDropRule.ByCondition(DropHelper.If(() => DownedBossSystem.downedAstrumAureus), ModContent.ItemType(), 7)); + // 2-3 Stardust (3-4 Expert+) + exploded.OnFailedConditions(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 2, 3, 3, 4)); + exploded.OnFailedConditions(ItemDropRule.ByCondition(DropHelper.If(() => DownedBossSystem.downedAstrumAureus), ModContent.ItemType(), 7)); + // If exploded, then have a chance to drop Glorious End and nothing else exploded.Add(ModContent.ItemType(), 7); } diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index 0023331f8a..67714e92ac 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -253,15 +253,19 @@ namespace CalamityMod return new DropBasedOnExpertMode(normalRule, expertRule); } - public static LeadingConditionRule GetRevBagAccessoryRule() + /// + /// Adds the Revengeance Mode bag accessories to the given loot table. + /// + /// The ILoot interface for the loot table. + public static void AddRevBagAccessories(this ILoot loot) { var lcr = new LeadingConditionRule(If(() => CalamityWorld.revenge)); - lcr.Add(new OneFromOptionsNotScaledWithLuckDropRule(20, 1, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType())); - return lcr; + lcr.Add(new OneFromOptionsDropRule(20, 1, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType())); + loot.Add(lcr); } /// - /// Adds all the common potions from fishing crates, alongside scaling mana & regen potions + /// Adds all the common potions for fishing crates, alongside scaling mana and regen potions /// /// The ILoot interface for the loot table. public static void AddCratePotionRules(this ILoot loot) @@ -273,26 +277,30 @@ namespace CalamityMod loot.Add(ItemID.ShinePotion, 10, 1, 3); loot.Add(ItemID.MiningPotion, 10, 1, 3); loot.Add(ItemID.HeartreachPotion, 10, 1, 3); - loot.Add(ItemID.TrapsightPotion, 10, 1, 3); //Dangersense Potion + loot.Add(ItemID.TrapsightPotion, 10, 1, 3); // Dangersense Potion - //This is quite ugly - var lcrSupremePotion = new LeadingConditionRule(If(() => DownedBossSystem.downedDoG)); - var lcrSuperPotion = new LeadingConditionRule(If(() => !DownedBossSystem.downedDoG && DownedBossSystem.downedProvidence)); - var lcrGreaterPotion = new LeadingConditionRule(If(() => !DownedBossSystem.downedDoG && !DownedBossSystem.downedProvidence && NPC.downedMechBossAny)); - var lcrRegularPotion = new LeadingConditionRule(If(() => !DownedBossSystem.downedDoG && !DownedBossSystem.downedProvidence && !NPC.downedMechBossAny && NPC.downedBoss3)); - var lcrLesserPotion = new LeadingConditionRule(If(() => !DownedBossSystem.downedDoG && !DownedBossSystem.downedProvidence && !NPC.downedMechBossAny && !NPC.downedBoss3)); + // Define all the loot rules for the potion types + var supremePots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ModContent.ItemType(), ModContent.ItemType()); + var superPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.SuperHealingPotion, ItemID.SuperManaPotion); + var greaterPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.GreaterHealingPotion, ItemID.GreaterManaPotion); + var regularPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.HealingPotion, ItemID.ManaPotion); + var lesserPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.LesserHealingPotion, ItemID.LesserManaPotion); - lcrSupremePotion.Add(new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ModContent.ItemType(), ModContent.ItemType())); - lcrSuperPotion.Add(new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.SuperHealingPotion, ItemID.SuperManaPotion)); - lcrGreaterPotion.Add(new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.GreaterHealingPotion, ItemID.GreaterManaPotion)); - lcrRegularPotion.Add(new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.HealingPotion, ItemID.ManaPotion)); - lcrLesserPotion.Add(new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.LesserHealingPotion, ItemID.LesserManaPotion)); + // Chained LeadingConditionRules achieve the equivalent of "if killed X, else if killed Y, else if killed Z, else..." + var lcrSupremePotion = loot.DefineConditionalDropSet(() => DownedBossSystem.downedDoG); + var lcrSuperPotion = new LeadingConditionRule(If(() => DownedBossSystem.downedProvidence)); + var lcrGreaterPotion = new LeadingConditionRule(If(() => NPC.downedMechBossAny)); + var lcrRegularPotion = new LeadingConditionRule(If(() => NPC.downedBoss3)); - loot.Add(lcrSupremePotion); - loot.Add(lcrSuperPotion); - loot.Add(lcrGreaterPotion); - loot.Add(lcrRegularPotion); - loot.Add(lcrLesserPotion); + // Actually chain all the LCRs together + lcrSupremePotion.Add(supremePots); + lcrSupremePotion.OnFailedConditions(lcrSuperPotion); + lcrSuperPotion.Add(superPots); + lcrSuperPotion.OnFailedConditions(lcrGreaterPotion); + lcrGreaterPotion.Add(greaterPots); + lcrGreaterPotion.OnFailedConditions(lcrRegularPotion); + lcrRegularPotion.Add(regularPots); + lcrRegularPotion.OnFailedConditions(lesserPots); } #endregion