diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a7246f2982..59e85a2593 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -413,6 +413,7 @@ namespace CalamityMod.CalPlayer public bool yharonLore = false; public bool SCalLore = false; public bool oceanLore = false; + public bool sulphSeaLore = false; public bool corruptionLore = false; public bool crimsonLore = false; public bool underworldLore = false; @@ -1561,6 +1562,7 @@ namespace CalamityMod.CalPlayer yharonLore = false; SCalLore = false; oceanLore = false; + sulphSeaLore = false; corruptionLore = false; crimsonLore = false; underworldLore = false; diff --git a/Items/LoreItems/KnowledgeOcean.cs b/Items/LoreItems/KnowledgeOcean.cs index 468b8ecf2c..41fa14f96d 100644 --- a/Items/LoreItems/KnowledgeOcean.cs +++ b/Items/LoreItems/KnowledgeOcean.cs @@ -25,10 +25,7 @@ namespace CalamityMod.Items.LoreItems item.consumable = false; } - public override bool CanUseItem(Player player) - { - return false; - } + public override bool CanUseItem(Player player) => false; public override void UpdateInventory(Player player) { diff --git a/Items/LoreItems/KnowledgeSulphurSea.cs b/Items/LoreItems/KnowledgeSulphurSea.cs index 22aad07afc..35bcd25092 100644 --- a/Items/LoreItems/KnowledgeSulphurSea.cs +++ b/Items/LoreItems/KnowledgeSulphurSea.cs @@ -1,3 +1,4 @@ +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; @@ -12,7 +13,8 @@ namespace CalamityMod.Items.LoreItems { DisplayName.SetDefault("Sulphur Sea"); Tooltip.SetDefault("I remember the serene waves and the clear breeze.\n" + - "The bitterness of my youth has long since subsided, but it is far too late. I must never repeat a mistake like this again."); + "The bitterness of my youth has long since subsided, but it is far too late. I must never repeat a mistake like this again.\n" + + "Favorite this item to prevent the Aquatic Scourge from naturally spawning."); } public override void SetDefaults() @@ -23,9 +25,13 @@ namespace CalamityMod.Items.LoreItems item.consumable = false; } - public override bool CanUseItem(Player player) + public override bool CanUseItem(Player player) => false; + + public override void UpdateInventory(Player player) { - return false; + CalamityPlayer modPlayer = player.Calamity(); + if (item.favorited) + modPlayer.sulphSeaLore = true; } public override void AddRecipes() diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index e663177122..173a41ec5f 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe) + if (spawnInfo.playerSafe || spawnInfo.player.Calamity().sulphSeaLore) { return 0f; }