diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index dbe780937f..85e04744b5 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -114,6 +114,11 @@ namespace CalamityMod.CalPlayer public int defenseDamage = 0; public float rangedAmmoCost = 1f; public bool heldGaelsLastFrame = false; + + public bool disableVoodooSpawns = false; + public bool disablePerfCystSpawns = false; + public bool disableHiveCystSpawns = false; + public bool disableAnahitaSpawns = false; #endregion #region Tile Entity Trackers @@ -1941,6 +1946,11 @@ namespace CalamityMod.CalPlayer howlTrio = false; mountedScanner = false; + disableVoodooSpawns = false; + disablePerfCystSpawns = false; + disableHiveCystSpawns = false; + disableAnahitaSpawns = false; + abyssalDivingSuitPrevious = abyssalDivingSuit; abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; diff --git a/Items/AntiCystOintment.cs b/Items/AntiCystOintment.cs new file mode 100644 index 0000000000..82c90024f5 --- /dev/null +++ b/Items/AntiCystOintment.cs @@ -0,0 +1,38 @@ +using Terraria.ID; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items +{ + public class AntiCystOintment : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Anti-Cyst Ointment"); + Tooltip.SetDefault("Favorite this item to prevent perforator cysts from spawning near you"); + } + public override void SetDefaults() + { + item.width = 44; + item.height = 34; + item.value = CalamityGlobalItem.Rarity1BuyPrice; + item.rare = ItemRarityID.Blue; + } + + public override void UpdateInventory(Player player) + { + if (item.favorited) + player.Calamity().disablePerfCystSpawns = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CrimtaneBar, 5); + recipe.AddIngredient(ItemID.BottledWater); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AntiCystOintment.png b/Items/AntiCystOintment.png new file mode 100644 index 0000000000..59f42b5da3 Binary files /dev/null and b/Items/AntiCystOintment.png differ diff --git a/Items/AntiTumorOintment.cs b/Items/AntiTumorOintment.cs new file mode 100644 index 0000000000..d0a76378da --- /dev/null +++ b/Items/AntiTumorOintment.cs @@ -0,0 +1,38 @@ +using Terraria.ID; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items +{ + public class AntiTumorOintment : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Anti-Tumor Ointment"); + Tooltip.SetDefault("Favorite this item to prevent hive cysts from spawning near you"); + } + public override void SetDefaults() + { + item.width = 44; + item.height = 34; + item.value = CalamityGlobalItem.Rarity1BuyPrice; + item.rare = ItemRarityID.Blue; + } + + public override void UpdateInventory(Player player) + { + if (item.favorited) + player.Calamity().disableHiveCystSpawns = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DemoniteBar, 5); + recipe.AddIngredient(ItemID.BottledWater); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AntiTumorOintment.png b/Items/AntiTumorOintment.png new file mode 100644 index 0000000000..406f01c527 Binary files /dev/null and b/Items/AntiTumorOintment.png differ diff --git a/Items/SirenproofEarMuffs.cs b/Items/SirenproofEarMuffs.cs new file mode 100644 index 0000000000..08d020de02 --- /dev/null +++ b/Items/SirenproofEarMuffs.cs @@ -0,0 +1,39 @@ +using Terraria.ID; +using Terraria; +using Terraria.ModLoader; +using CalamityMod.Items.Materials; + +namespace CalamityMod.Items +{ + public class SirenproofEarMuffs : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sirenproof Earmuffs"); + Tooltip.SetDefault("Favorite this item to prevent Anahita from spawning near you"); + } + public override void SetDefaults() + { + item.width = 44; + item.height = 34; + item.value = CalamityGlobalItem.Rarity1BuyPrice; + item.rare = ItemRarityID.Blue; + } + + public override void UpdateInventory(Player player) + { + if (item.favorited) + player.Calamity().disableAnahitaSpawns = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SirenproofEarMuffs.png b/Items/SirenproofEarMuffs.png new file mode 100644 index 0000000000..d523a0b58e Binary files /dev/null and b/Items/SirenproofEarMuffs.png differ diff --git a/Items/VoodooDemonVoodooDoll.cs b/Items/VoodooDemonVoodooDoll.cs new file mode 100644 index 0000000000..cf14e05b19 --- /dev/null +++ b/Items/VoodooDemonVoodooDoll.cs @@ -0,0 +1,38 @@ +using Terraria.ID; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items +{ + public class VoodooDemonVoodooDoll : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Voodoo Demon Voodoo Doll"); + Tooltip.SetDefault("Favorite this item to prevent voodoo demons from spawning near you"); + } + public override void SetDefaults() + { + item.width = 44; + item.height = 34; + item.value = CalamityGlobalItem.Rarity1BuyPrice; + item.rare = ItemRarityID.Blue; + } + + public override void UpdateInventory(Player player) + { + if (item.favorited) + player.Calamity().disableVoodooSpawns = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HellstoneBar, 5); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/VoodooDemonVoodooDoll.png b/Items/VoodooDemonVoodooDoll.png new file mode 100644 index 0000000000..d7febbd1c7 Binary files /dev/null and b/Items/VoodooDemonVoodooDoll.png differ diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index d686ba610f..32dc5232ea 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4295,6 +4295,9 @@ namespace CalamityMod.NPCs if (!NPC.AnyNPCs(NPCID.VoodooDemon)) pool[NPCID.VoodooDemon] = SpawnCondition.Underworld.Chance * 0.75f; } + + if (spawnInfo.player.Calamity().disableVoodooSpawns && pool.ContainsKey(NPCID.VoodooDemon)) + pool.Remove(NPCID.VoodooDemon); } #endregion diff --git a/NPCs/HiveMind/HiveCyst.cs b/NPCs/HiveMind/HiveCyst.cs index 1977fd0662..48f29899a5 100644 --- a/NPCs/HiveMind/HiveCyst.cs +++ b/NPCs/HiveMind/HiveCyst.cs @@ -40,17 +40,17 @@ namespace CalamityMod.NPCs.HiveMind public override float SpawnChance(NPCSpawnInfo spawnInfo) { - bool corrupt = TileID.Sets.Corrupt[spawnInfo.spawnTileType] || spawnInfo.spawnTileType == TileID.Demonite && spawnInfo.player.ZoneCorrupt; - if (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || - spawnInfo.playerSafe || !corrupt) - { + if (spawnInfo.player.Calamity().disableHiveCystSpawns) return 0f; - } + bool anyBossElements = NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()); + bool corrupt = TileID.Sets.Corrupt[spawnInfo.spawnTileType] || spawnInfo.spawnTileType == TileID.Demonite && spawnInfo.player.ZoneCorrupt; + if (anyBossElements || spawnInfo.playerSafe || !corrupt) + return 0f; + if (NPC.downedBoss2 && !CalamityWorld.downedHiveMind) - { return 1.5f; - } + return Main.hardMode ? 0.05f : 0.5f; } diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 5956cff4c0..4a103a4132 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -106,6 +106,9 @@ namespace CalamityMod.NPCs.Leviathan public override float SpawnChance(NPCSpawnInfo spawnInfo) { + if (spawnInfo.player.Calamity().disableAnahitaSpawns) + return 0f; + if (spawnInfo.playerSafe || NPC.AnyNPCs(NPCID.DukeFishron) || NPC.AnyNPCs(npc.type) || @@ -115,14 +118,13 @@ namespace CalamityMod.NPCs.Leviathan { return 0f; } + if (!Main.hardMode) - { return SpawnCondition.OceanMonster.Chance * 0.025f; - } + if (!NPC.downedPlantBoss && !CalamityWorld.downedCalamitas) - { return SpawnCondition.OceanMonster.Chance * 0.1f; - } + return SpawnCondition.OceanMonster.Chance * 0.4f; } diff --git a/NPCs/Perforator/PerforatorCyst.cs b/NPCs/Perforator/PerforatorCyst.cs index 4f44fd48d9..f711a899d3 100644 --- a/NPCs/Perforator/PerforatorCyst.cs +++ b/NPCs/Perforator/PerforatorCyst.cs @@ -63,16 +63,16 @@ namespace CalamityMod.NPCs.Perforator public override float SpawnChance(NPCSpawnInfo spawnInfo) { - bool crimson = TileID.Sets.Crimson[spawnInfo.spawnTileType] || spawnInfo.spawnTileType == TileID.Crimtane && spawnInfo.player.ZoneCrimson; + if (spawnInfo.player.Calamity().disablePerfCystSpawns) + return 0f; + + bool crimson = TileID.Sets.Crimson[spawnInfo.spawnTileType] || spawnInfo.spawnTileType == TileID.Crimtane && spawnInfo.player.ZoneCrimson; if (spawnInfo.playerSafe || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || !crimson) - { return 0f; - } if (NPC.downedBoss2 && !CalamityWorld.downedPerforator) - { return 1.5f; - } + return Main.hardMode ? 0.05f : 0.5f; }