From e99e2e68a401ccc66d4e9c102336438fac181285 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 29 Jan 2020 22:53:57 -0500 Subject: [PATCH] added config for selling vanilla boss summons --- Configs.cs | 5 +++++ NPCs/CalamityGlobalNPC.cs | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Configs.cs b/Configs.cs index 6f70107a24..c9cffdee9e 100644 --- a/Configs.cs +++ b/Configs.cs @@ -125,6 +125,11 @@ namespace CalamityMod [Tooltip("Enables the small text below the health bar\nThis displays the exact health amount or remaining boss parts")] public bool DrawSmallText { get; set; } + [DefaultValue(true)] + [Label("Selling Vanilla Boss Summons")] + [Tooltip("Enables certain town NPCs to sell boss summoning items after the defeat of their respective boss\nThis does not affect Calamity's boss summoning items, which are always sold")] + public bool SellBossSummons { get; set; } + [DefaultValue(false)] [Label("Mining Speed Boost")] [Tooltip("Boosts the player's mining speed by 75%")] diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 3a292d3c0e..0533f27cbc 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4519,11 +4519,11 @@ namespace CalamityMod.NPCs { SetShopItem(ref shop, ref nextSlot, ItemID.JungleRose, price: Item.buyPrice(0, 2)); SetShopItem(ref shop, ref nextSlot, ItemID.NaturesGift, price: Item.buyPrice(0, 10)); - SetShopItem(ref shop, ref nextSlot, ItemID.SlimeCrown, NPC.downedSlimeKing, Item.buyPrice(0, 2)); - SetShopItem(ref shop, ref nextSlot, ItemID.SuspiciousLookingEye, NPC.downedBoss1, Item.buyPrice(0, 3)); + SetShopItem(ref shop, ref nextSlot, ItemID.SlimeCrown, NPC.downedSlimeKing && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 2)); + SetShopItem(ref shop, ref nextSlot, ItemID.SuspiciousLookingEye, NPC.downedBoss1 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 3)); SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedCrabulon, Item.buyPrice(0, 4)); - SetShopItem(ref shop, ref nextSlot, ItemID.BloodySpine, NPC.downedBoss2, Item.buyPrice(0, 6)); - SetShopItem(ref shop, ref nextSlot, ItemID.WormFood, NPC.downedBoss2, Item.buyPrice(0, 6)); + SetShopItem(ref shop, ref nextSlot, ItemID.BloodySpine, NPC.downedBoss2 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 6)); + SetShopItem(ref shop, ref nextSlot, ItemID.WormFood, NPC.downedBoss2 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 6)); SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.BandofStarpower : ItemID.PanicNecklace, WorldGen.shadowOrbSmashed || NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.WormScarf : ItemID.BrainOfConfusion, Main.expertMode && NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedPerforator, Item.buyPrice(0, 10)); @@ -4568,9 +4568,9 @@ namespace CalamityMod.NPCs if (type == NPCID.Steampunker) { - SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalWorm, NPC.downedMechBoss1, Item.buyPrice(0, 20)); - SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalEye, NPC.downedMechBoss2, Item.buyPrice(0, 20)); - SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalSkull, NPC.downedMechBoss3, Item.buyPrice(0, 20)); + SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalWorm, NPC.downedMechBoss1 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); + SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalEye, NPC.downedMechBoss2 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); + SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalSkull, NPC.downedMechBoss3 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), Main.hardMode, Item.buyPrice(0, 0, 5)); } @@ -4582,16 +4582,16 @@ namespace CalamityMod.NPCs SetShopItem(ref shop, ref nextSlot, ItemID.SpectreStaff, NPC.downedGolemBoss, Item.buyPrice(0, 25)); SetShopItem(ref shop, ref nextSlot, ItemID.InfernoFork, NPC.downedGolemBoss, Item.buyPrice(0, 25)); SetShopItem(ref shop, ref nextSlot, ItemID.ShadowbeamStaff, NPC.downedGolemBoss, Item.buyPrice(0, 25)); - SetShopItem(ref shop, ref nextSlot, ItemID.CelestialSigil, NPC.downedMoonlord, Item.buyPrice(3)); + SetShopItem(ref shop, ref nextSlot, ItemID.CelestialSigil, NPC.downedMoonlord && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(3)); SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedGuardians, Item.buyPrice(10)); } if (type == NPCID.WitchDoctor) { - SetShopItem(ref shop, ref nextSlot, ItemID.Abeemination, price: Item.buyPrice(0, 8)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), NPC.downedPlantBoss, Item.buyPrice(0, 20)); + SetShopItem(ref shop, ref nextSlot, ItemID.Abeemination, CalamityMod.CalamityConfig.SellBossSummons, price: Item.buyPrice(0, 8)); + SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), NPC.downedPlantBoss && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); SetShopItem(ref shop, ref nextSlot, ItemID.SolarTablet, NPC.downedGolemBoss, Item.buyPrice(0, 25)); - SetShopItem(ref shop, ref nextSlot, ItemID.LihzahrdPowerCell, NPC.downedGolemBoss, Item.buyPrice(0, 30)); + SetShopItem(ref shop, ref nextSlot, ItemID.LihzahrdPowerCell, NPC.downedGolemBoss && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 30)); SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), NPC.downedGolemBoss, Item.buyPrice(0, 10)); SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedScavenger, Item.buyPrice(0, 50)); SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedPlaguebringer, Item.buyPrice(0, 50));