From 82389b7528aa61acca77dfc84147de84ca41b9ff Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Mon, 5 Sep 2022 17:26:50 -0400 Subject: [PATCH] lore items now state they only drop on first kill --- NPCs/AquaticScourge/AquaticScourgeHead.cs | 4 +- NPCs/AstrumAureus/AstrumAureus.cs | 2 +- NPCs/AstrumDeus/AstrumDeusHead.cs | 4 +- NPCs/BrimstoneElemental/BrimstoneElemental.cs | 2 +- NPCs/Bumblebirb/Bumblefuck.cs | 2 +- NPCs/Calamitas/CalamitasClone.cs | 2 +- NPCs/CalamityGlobalNPCLoot.cs | 60 +++++++++---------- NPCs/CeaselessVoid/CeaselessVoid.cs | 2 +- NPCs/Crabulon/Crabulon.cs | 2 +- NPCs/Cryogen/Cryogen.cs | 2 +- NPCs/DesertScourge/DesertScourgeHead.cs | 2 +- NPCs/DevourerofGods/DevourerofGodsHead.cs | 2 +- NPCs/ExoMechs/Ares/AresBody.cs | 2 +- NPCs/HiveMind/HiveMind.cs | 2 +- NPCs/Leviathan/Leviathan.cs | 4 +- NPCs/OldDuke/OldDuke.cs | 2 +- NPCs/Perforator/PerforatorHive.cs | 2 +- .../PlaguebringerGoliath.cs | 2 +- NPCs/Polterghast/Polterghast.cs | 2 +- .../ProfanedGuardianCommander.cs | 2 +- NPCs/Providence/Providence.cs | 2 +- NPCs/Ravager/RavagerBody.cs | 2 +- NPCs/Signus/Signus.cs | 2 +- NPCs/SlimeGod/SlimeGodCore.cs | 2 +- NPCs/StormWeaver/StormWeaverHead.cs | 2 +- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 2 +- NPCs/Yharon/Yharon.cs | 2 +- Utilities/DropHelper.cs | 19 ++++-- 28 files changed, 74 insertions(+), 63 deletions(-) diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index d8053d737a..3affe4d1cd 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -255,8 +255,8 @@ namespace CalamityMod.NPCs.AquaticScourge // Lore bool firstASKill() => !DownedBossSystem.downedAquaticScourge; - npcLoot.AddConditionalPerPlayer(firstASKill, ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(firstASKill, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(firstASKill, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(firstASKill, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 70147cc3d9..cfdbb4cf6f 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -365,7 +365,7 @@ namespace CalamityMod.NPCs.AstrumAureus npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedAstrumAureus, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedAstrumAureus, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index 7dd98aad0d..1abca70a99 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -334,8 +334,8 @@ namespace CalamityMod.NPCs.AstrumDeus // Lore bool firstDeusKill(DropAttemptInfo info) => !DownedBossSystem.downedAstrumDeus && !ShouldNotDropThings(info.npc); - npcLoot.AddConditionalPerPlayer(firstDeusKill, ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(firstDeusKill, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(firstDeusKill, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(firstDeusKill, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 5dd9aecf28..e5a1195c88 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -213,7 +213,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedBrimstoneElemental, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedBrimstoneElemental, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index e6045f4e46..7a8b1707e6 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -442,7 +442,7 @@ namespace CalamityMod.NPCs.Bumblebirb npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/Calamitas/CalamitasClone.cs b/NPCs/Calamitas/CalamitasClone.cs index 4fbf9796dd..b99961f14a 100644 --- a/NPCs/Calamitas/CalamitasClone.cs +++ b/NPCs/Calamitas/CalamitasClone.cs @@ -216,7 +216,7 @@ namespace CalamityMod.NPCs.Calamitas npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCalamitas, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCalamitas, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 7ce307f946..92b0c73b59 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -829,7 +829,7 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedSlimeKing, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedSlimeKing, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.EyeofCthulhu: @@ -846,7 +846,7 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedBoss1, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedBoss1, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.EaterofWorldsHead: @@ -862,15 +862,15 @@ namespace CalamityMod.NPCs npcLoot.Add(RevEoW); // Corruption World OR Drunk World: Corruption Lore - LeadingConditionRule eowCorruptionLore = new(DropHelper.If((info) => info.npc.boss && (!WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2)); - eowCorruptionLore.Add(ModContent.ItemType()); - eowCorruptionLore.Add(ModContent.ItemType()); + LeadingConditionRule eowCorruptionLore = new(DropHelper.If((info) => info.npc.boss && (!WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2, desc: DropHelper.FirstKillText)); + eowCorruptionLore.Add(ModContent.ItemType(), hideLootReport: WorldGen.crimson && !WorldGen.drunkWorldGen); + eowCorruptionLore.Add(ModContent.ItemType(), hideLootReport: WorldGen.crimson && !WorldGen.drunkWorldGen); npcLoot.Add(eowCorruptionLore); // Crimson World OR Drunk World: Crimson Lore - LeadingConditionRule eowCrimsonLore = new(DropHelper.If((info) => info.npc.boss && (WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2)); - eowCrimsonLore.Add(ModContent.ItemType()); - eowCrimsonLore.Add(ModContent.ItemType()); + LeadingConditionRule eowCrimsonLore = new(DropHelper.If((info) => info.npc.boss && (WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2, desc: DropHelper.FirstKillText)); + eowCrimsonLore.Add(ModContent.ItemType(), hideLootReport: !WorldGen.crimson && !WorldGen.drunkWorldGen); + eowCrimsonLore.Add(ModContent.ItemType(), hideLootReport: !WorldGen.crimson && !WorldGen.drunkWorldGen); npcLoot.Add(eowCrimsonLore); break; @@ -884,15 +884,15 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Corruption World OR Drunk World: Corruption Lore - LeadingConditionRule bocCorruptionLore = new(DropHelper.If(() => (!WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2)); - bocCorruptionLore.Add(ModContent.ItemType()); - bocCorruptionLore.Add(ModContent.ItemType()); + LeadingConditionRule bocCorruptionLore = new(DropHelper.If(() => (!WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2, desc: DropHelper.FirstKillText)); + bocCorruptionLore.Add(ModContent.ItemType(), hideLootReport: WorldGen.crimson && !WorldGen.drunkWorldGen); + bocCorruptionLore.Add(ModContent.ItemType(), hideLootReport: WorldGen.crimson && !WorldGen.drunkWorldGen); npcLoot.Add(bocCorruptionLore); // Crimson World OR Drunk World: Crimson Lore - LeadingConditionRule bocCrimsonLore = new(DropHelper.If(() => (WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2)); - bocCrimsonLore.Add(ModContent.ItemType()); - bocCrimsonLore.Add(ModContent.ItemType()); + LeadingConditionRule bocCrimsonLore = new(DropHelper.If(() => (WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2, desc: DropHelper.FirstKillText)); + bocCrimsonLore.Add(ModContent.ItemType(), hideLootReport: !WorldGen.crimson && !WorldGen.drunkWorldGen); + bocCrimsonLore.Add(ModContent.ItemType(), hideLootReport: !WorldGen.crimson && !WorldGen.drunkWorldGen); npcLoot.Add(bocCrimsonLore); break; @@ -954,7 +954,7 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedQueenBee, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedQueenBee, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.SkeletronHead: @@ -979,7 +979,7 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedBoss3, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedBoss3, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.WallofFlesh: @@ -1059,8 +1059,8 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - LeadingConditionRule wofLore = npcLoot.AddConditionalPerPlayer(() => !Main.hardMode, ModContent.ItemType()); - wofLore.Add(DropHelper.PerPlayer(ModContent.ItemType())); + npcLoot.AddConditionalPerPlayer(() => !Main.hardMode, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(() => !Main.hardMode, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.QueenSlimeBoss: @@ -1094,8 +1094,8 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedMechBoss1, ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedMechBoss1, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType(), desc: DropHelper.MechBossText); break; case NPCID.Retinazer: @@ -1130,8 +1130,8 @@ namespace CalamityMod.NPCs npcLoot.AddIf((info) => !Main.masterMode && CalamityWorld.revenge && IsLastTwinStanding(info), ItemID.TwinsPetItem, 4); // Lore - npcLoot.AddConditionalPerPlayer((info) => !NPC.downedMechBoss2 && IsLastTwinStanding(info), ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer((info) => !NPC.downedMechBoss2 && IsLastTwinStanding(info), ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType(), desc: DropHelper.MechBossText); break; case NPCID.SkeletronPrime: @@ -1150,8 +1150,8 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedMechBoss3, ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedMechBoss3, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType(), desc: DropHelper.MechBossText); break; case NPCID.Plantera: @@ -1211,7 +1211,7 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedPlantBoss, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedPlantBoss, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.Golem: @@ -1266,7 +1266,7 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedGolemBoss, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedGolemBoss, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.DD2Betsy: @@ -1344,7 +1344,7 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedFishron, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedFishron, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.HallowBoss: @@ -1399,10 +1399,10 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedAncientCultist, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedAncientCultist, ModContent.ItemType(), desc: DropHelper.FirstKillText); // Special Blood Moon Lore - npcLoot.AddConditionalPerPlayer(() => Main.bloodMoon, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => Main.bloodMoon, ModContent.ItemType(), desc: DropHelper.BloodMoonText); break; case NPCID.MoonLordCore: @@ -1449,7 +1449,7 @@ namespace CalamityMod.NPCs npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedMoonlord, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedMoonlord, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; default: diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 72043baf3c..2f9a34c99e 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -229,7 +229,7 @@ namespace CalamityMod.NPCs.CeaselessVoid npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType(), desc: DropHelper.SentinelText); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index fb6ddd012f..f1757703d7 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -839,7 +839,7 @@ namespace CalamityMod.NPCs.Crabulon npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCrabulon, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCrabulon, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 3f71baf0b4..81ba1ae4b9 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -1188,7 +1188,7 @@ namespace CalamityMod.NPCs.Cryogen npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCryogen, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCryogen, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 46a0efc0dc..bc8bd987a6 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -731,7 +731,7 @@ namespace CalamityMod.NPCs.DesertScourge npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDesertScourge, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDesertScourge, ModContent.ItemType(), desc: DropHelper.FirstKillText); } #endregion diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 4973104760..ba609006ab 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2405,7 +2405,7 @@ namespace CalamityMod.NPCs.DevourerofGods npcLoot.Add(ModContent.ItemType(), 10); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDoG, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDoG, ModContent.ItemType(), desc: DropHelper.FirstKillText); } // Can only hit the target if within certain distance diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 8825a3ddc7..782476cb70 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -1350,7 +1350,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(() => Main.masterMode || CalamityWorld.revenge), ModContent.ItemType())); // Lore item - mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(() => !DownedBossSystem.downedExoMechs), ModContent.ItemType())); + mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(() => !DownedBossSystem.downedExoMechs, desc: DropHelper.FirstKillText), ModContent.ItemType())); // Treasure bag npcLoot.Add(ItemDropRule.BossBagByCondition(DropHelper.If(CanDropLoot), ModContent.ItemType())); diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index f144c320c2..222b3e4a98 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -1167,7 +1167,7 @@ namespace CalamityMod.NPCs.HiveMind npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedHiveMind, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedHiveMind, ModContent.ItemType(), desc: DropHelper.FirstKillText); } } } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index c1f20802c3..4e0a449d4e 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -805,8 +805,8 @@ namespace CalamityMod.NPCs.Leviathan // Lore bool shouldDropLore(DropAttemptInfo info) => !DownedBossSystem.downedLeviathan && LastAnLStanding(); - npcLoot.AddConditionalPerPlayer(shouldDropLore, ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(shouldDropLore, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(shouldDropLore, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(shouldDropLore, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 7727f29285..6e9c7e2d18 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -451,7 +451,7 @@ namespace CalamityMod.NPCs.OldDuke npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedBoomerDuke, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedBoomerDuke, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 645cc91499..eb388e5827 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -545,7 +545,7 @@ namespace CalamityMod.NPCs.Perforator npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPerforator, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPerforator, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 16c62034b2..9dd293ca71 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -1283,7 +1283,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPlaguebringer, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPlaguebringer, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 956402f34f..239a4d9d93 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -1052,7 +1052,7 @@ namespace CalamityMod.NPCs.Polterghast npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 98d0e20255..d938a37e95 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -516,7 +516,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedGuardians, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedGuardians, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index a12dbe83d3..ea0f438ad3 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1607,7 +1607,7 @@ namespace CalamityMod.NPCs.Providence npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedProvidence, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedProvidence, ModContent.ItemType(), desc: DropHelper.FirstKillText); } private void SpawnLootBox() diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index f3b611baf3..6fdcd42460 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -885,7 +885,7 @@ namespace CalamityMod.NPCs.Ravager npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedRavager, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedRavager, ModContent.ItemType(), desc: DropHelper.FirstKillText); } } } diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 2e2a7cc3ee..83060ed057 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -809,7 +809,7 @@ namespace CalamityMod.NPCs.Signus npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType(), desc: DropHelper.SentinelText); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index a57f819291..5bdd1b0778 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -608,7 +608,7 @@ namespace CalamityMod.NPCs.SlimeGod npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSlimeGod, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSlimeGod, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index bd5e5317c8..42aeb1b217 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -984,7 +984,7 @@ namespace CalamityMod.NPCs.StormWeaver npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType(), desc: DropHelper.SentinelText); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index e302530c2c..a51d55df9e 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2590,7 +2590,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSCal, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSCal, ModContent.ItemType(), desc: DropHelper.FirstKillText); } #endregion diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 33f8c9e58b..9c7b5b4f02 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2844,7 +2844,7 @@ namespace CalamityMod.NPCs.Yharon npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedYharon, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedYharon, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void BossLoot(ref string name, ref int potionType) diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index f3620e5e1b..6082c44180 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -110,6 +110,13 @@ namespace CalamityMod public static readonly Fraction BagWeaponDropRateFraction = new(1, BagWeaponDropRateInt); #endregion + #region Bestiary Text + public static string FirstKillText = "Drops only on the first kill"; + public static string BloodMoonText = "Drops during the Blood Moon"; + public static string MechBossText = "Drops on the first kill of the final Mechanical Boss"; + public static string SentinelText = "Drops on the first kill of the final Sentinel of the Devourer"; + #endregion + #region Block Drops private static int[] AllLoadedItemIDs = null; @@ -222,10 +229,12 @@ namespace CalamityMod /// The ILoot interface for the loot table. /// A lambda which evaluates in real-time to the condition that needs to be checked. /// The item ID to drop. + /// Whether drops registered with this condition appear in the Bestiary. Defaults to true. + /// The description of this condition in the Bestiary. Defaults to null. /// A LeadingConditionRule which you can attach more PerPlayer or other rules to as you want. - public static LeadingConditionRule AddConditionalPerPlayer(this ILoot loot, Func lambda, int itemID) + public static LeadingConditionRule AddConditionalPerPlayer(this ILoot loot, Func lambda, int itemID, bool ui = true, string desc = null) { - LeadingConditionRule lcr = new(If(lambda)); + LeadingConditionRule lcr = new(If(lambda, ui, desc)); lcr.Add(PerPlayer(itemID)); loot.Add(lcr); return lcr; @@ -238,10 +247,12 @@ namespace CalamityMod /// The ILoot interface for the loot table. /// A lambda which evaluates in real-time to the condition that needs to be checked. /// The item ID to drop. + /// Whether drops registered with this condition appear in the Bestiary. Defaults to true. + /// The description of this condition in the Bestiary. Defaults to null. /// A LeadingConditionRule which you can attach more PerPlayer or other rules to as you want. - public static LeadingConditionRule AddConditionalPerPlayer(this ILoot loot, Func lambda, int itemID) + public static LeadingConditionRule AddConditionalPerPlayer(this ILoot loot, Func lambda, int itemID, bool ui = true, string desc = null) { - LeadingConditionRule lcr = new(If(lambda)); + LeadingConditionRule lcr = new(If(lambda, ui, desc)); lcr.Add(PerPlayer(itemID)); loot.Add(lcr); return lcr;