Added various boss spawn canceling items
This commit is contained in:
1 parent
863256f266
commit
e33b20ddb7
13 files changed
+184
-16
No files matched your search
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 612 B |
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 623 B |
@@ -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<LivingShard>(), 2);
|
||||
recipe.AddIngredient(ItemID.Silk, 5);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 698 B |
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 834 B |
@@ -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
|
||||
|
||||
|
||||
@@ -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<HiveCyst>()) || NPC.AnyNPCs(ModContent.NPCType<HiveMind>()) || NPC.AnyNPCs(ModContent.NPCType<HiveMindP2>()) ||
|
||||
spawnInfo.playerSafe || !corrupt)
|
||||
{
|
||||
if (spawnInfo.player.Calamity().disableHiveCystSpawns)
|
||||
return 0f;
|
||||
}
|
||||
|
||||
bool anyBossElements = NPC.AnyNPCs(ModContent.NPCType<HiveCyst>()) || NPC.AnyNPCs(ModContent.NPCType<HiveMind>()) || NPC.AnyNPCs(ModContent.NPCType<HiveMindP2>());
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<PerforatorCyst>()) || NPC.AnyNPCs(ModContent.NPCType<PerforatorHive>()) || !crimson)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
if (NPC.downedBoss2 && !CalamityWorld.downedPerforator)
|
||||
{
|
||||
return 1.5f;
|
||||
}
|
||||
|
||||
return Main.hardMode ? 0.05f : 0.5f;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user