diff --git a/BiomeManagers/SulphurousSeaBiome.cs b/BiomeManagers/SulphurousSeaBiome.cs index 1a9b2da03c..9308c03583 100644 --- a/BiomeManagers/SulphurousSeaBiome.cs +++ b/BiomeManagers/SulphurousSeaBiome.cs @@ -11,8 +11,8 @@ namespace CalamityMod.BiomeManagers { public class SulphurousSeaBiome : ModBiome { - public override ModWaterStyle WaterStyle => CalamityMod.Instance.legendaryMode ? ModContent.Find("CalamityMod/PissWater") : ModContent.Find("CalamityMod/SulphuricWater"); - public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => CalamityMod.Instance.legendaryMode ?ModContent.Find("CalamityMod/PissSeaSurfaceBGStyle") : ModContent.Find("CalamityMod/SulphurSeaSurfaceBGStyle"); + public override ModWaterStyle WaterStyle => CalamityWorld.getFixedBoi ? ModContent.Find("CalamityMod/PissWater") : ModContent.Find("CalamityMod/SulphuricWater"); + public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => CalamityWorld.getFixedBoi ?ModContent.Find("CalamityMod/PissSeaSurfaceBGStyle") : ModContent.Find("CalamityMod/SulphurSeaSurfaceBGStyle"); public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; public override string BestiaryIcon => "CalamityMod/BiomeManagers/SulphurousSeaIcon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/SulphurBG"; diff --git a/Buffs/StatBuffs/ProfanedCrystalBuff.cs b/Buffs/StatBuffs/ProfanedCrystalBuff.cs index 9ea2fe5b81..0202dfc2a5 100644 --- a/Buffs/StatBuffs/ProfanedCrystalBuff.cs +++ b/Buffs/StatBuffs/ProfanedCrystalBuff.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Buffs.StatBuffs (enrage ? "\nYour weakened life force fuels your desperate attacks" : ""); } } - else if (DownedBossSystem.downedSCal && DownedBossSystem.downedExoMechs) + else if (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs) { tip = "Your profaned soul is constrained by your insufficient summoning powers"; } diff --git a/Buffs/Summon/ProfanedBabs.cs b/Buffs/Summon/ProfanedBabs.cs index 71e92fe041..34625ee473 100644 --- a/Buffs/Summon/ProfanedBabs.cs +++ b/Buffs/Summon/ProfanedBabs.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Buffs.Summon Player player = Main.player[Main.myPlayer]; bool offense = player.Calamity().gOffense; bool defense = player.Calamity().gDefense; - if (player.Calamity().profanedCrystal && (!player.Calamity().profanedCrystalBuffs && (!DownedBossSystem.downedSCal || !DownedBossSystem.downedExoMechs))) + if (player.Calamity().profanedCrystal && (!player.Calamity().profanedCrystalBuffs && (!DownedBossSystem.downedCalamitas || !DownedBossSystem.downedExoMechs))) { tip = "The Profaned Babs will accompany you!"; } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 2796c82184..c62c160576 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3455,7 +3455,7 @@ namespace CalamityMod.CalPlayer public override bool CanSellItem(NPC vendor, Item[] shopInventory, Item item) { if (item.type == ModContent.ItemType()) - return DownedBossSystem.downedSCal; //no easy moneycoins for post doggo/yhar + return DownedBossSystem.downedCalamitas; //no easy moneycoins for post doggo/yhar return base.CanSellItem(vendor, shopInventory, item); } @@ -6416,7 +6416,7 @@ namespace CalamityMod.CalPlayer price += Item.buyPrice(0, 1, 20, 0); else if (NPC.downedGolemBoss) price += Item.buyPrice(0, 0, 90, 0); - else if (NPC.downedPlantBoss || DownedBossSystem.downedCalamitas) + else if (NPC.downedPlantBoss || DownedBossSystem.downedCalamitasClone) price += Item.buyPrice(0, 0, 60, 0); else if (NPC.downedMechBossAny) price += Item.buyPrice(0, 0, 40, 0); diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index a7f8dff27b..44236bee8c 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -438,7 +438,7 @@ namespace CalamityMod.CalPlayer } } - if (Player.FindBuffIndex(BuffID.Gills) > -1 && DownedBossSystem.downedCalamitas && (attempt.legendary || (attempt.veryrare && Main.rand.NextBool()))) + if (Player.FindBuffIndex(BuffID.Gills) > -1 && DownedBossSystem.downedCalamitasClone && (attempt.legendary || (attempt.veryrare && Main.rand.NextBool()))) { itemDrop = ModContent.ItemType(); } diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index fbbade0319..8fe63eac1b 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -170,7 +170,7 @@ namespace CalamityMod.CalPlayer } float ASPoisonLevel = 0f; - if (CalamityGlobalNPC.aquaticScourge >= 0 && CalamityMod.Instance.legendaryMode) + if (CalamityGlobalNPC.aquaticScourge >= 0 && CalamityWorld.getFixedBoi) { NPC AS = Main.npc[CalamityGlobalNPC.aquaticScourge]; //if the player is 50 blocks or more away from the head diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ec7059200b..e3ffc9a2f0 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -937,7 +937,7 @@ namespace CalamityMod.CalPlayer Player.GetCritChance() += critUp; } - bool canProvideBuffs = profanedCrystalBuffs || (!profanedCrystal && pArtifact) || (profanedCrystal && DownedBossSystem.downedSCal && DownedBossSystem.downedExoMechs); + bool canProvideBuffs = profanedCrystalBuffs || (!profanedCrystal && pArtifact) || (profanedCrystal && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs); bool attack = Player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; // Guardian bonuses if not burnt out diff --git a/CalamityLists.cs b/CalamityLists.cs index f301aa06a8..bfb780ff57 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -25,7 +25,7 @@ using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Crags; diff --git a/CalamityMod.cs b/CalamityMod.cs index 1db37aaa79..47915945e0 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -27,7 +27,7 @@ using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Cryogen; @@ -109,9 +109,6 @@ namespace CalamityMod public const float velocityScaleMin = 0.5f; public const float bitingEnemeyVelocityScale = 0.8f; - // TODO -- Once the Zenith seed is available, replace all instance of this with Main.zenithWorld - internal bool legendaryMode => Main.getGoodWorld && Main.masterMode; - // Life steal cap public const int lifeStealCap = 10; diff --git a/DataStructures/NPCStats.cs b/DataStructures/NPCStats.cs index 417271a6e9..2062dbdd43 100644 --- a/DataStructures/NPCStats.cs +++ b/DataStructures/NPCStats.cs @@ -4,7 +4,7 @@ using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Cryogen; diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index e564365a11..7c693f1ba8 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -8,7 +8,7 @@ using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Cryogen; diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 1e24222919..f8cf140994 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Items.Accessories public override void ModifyTooltips(List tooltips) { - bool scal = DownedBossSystem.downedSCal; + bool scal = DownedBossSystem.downedCalamitas; bool draedon = DownedBossSystem.downedExoMechs; if (!scal || !draedon) { @@ -163,7 +163,7 @@ namespace CalamityMod.Items.Accessories internal static void DetermineTransformationEligibility(Player player) { - if (DownedBossSystem.downedSCal && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= 10 && !player.Calamity().profanedCrystalForce && player.HasBuff()) + if (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= 10 && !player.Calamity().profanedCrystalForce && player.HasBuff()) { player.Calamity().profanedCrystalBuffs = true; } diff --git a/Items/Accessories/TheCommunity.cs b/Items/Accessories/TheCommunity.cs index a3ea91fab6..a8d9dc3ec3 100644 --- a/Items/Accessories/TheCommunity.cs +++ b/Items/Accessories/TheCommunity.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Items.Accessories numBosses += NPC.downedMechBoss2.ToInt(); numBosses += DownedBossSystem.downedBrimstoneElemental.ToInt(); numBosses += NPC.downedMechBoss3.ToInt(); - numBosses += DownedBossSystem.downedCalamitas.ToInt(); + numBosses += DownedBossSystem.downedCalamitasClone.ToInt(); numBosses += NPC.downedPlantBoss.ToInt(); // 20 numBosses += DownedBossSystem.downedLeviathan.ToInt(); numBosses += DownedBossSystem.downedAstrumAureus.ToInt(); @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Accessories numBosses += DownedBossSystem.downedDoG.ToInt(); numBosses += DownedBossSystem.downedYharon.ToInt(); // 40 numBosses += DownedBossSystem.downedExoMechs.ToInt(); - numBosses += DownedBossSystem.downedSCal.ToInt(); + numBosses += DownedBossSystem.downedCalamitas.ToInt(); return numBosses / (float)TotalCountedBosses; } diff --git a/Items/Armor/DesertProwler/DesertProwlerSet.cs b/Items/Armor/DesertProwler/DesertProwlerSet.cs index 29b27e16f4..6f33f5b949 100644 --- a/Items/Armor/DesertProwler/DesertProwlerSet.cs +++ b/Items/Armor/DesertProwler/DesertProwlerSet.cs @@ -314,8 +314,7 @@ namespace CalamityMod.Items.Armor.DesertProwler public override void ModifyWeaponDamage(Item item, ref StatModifier damage) { - // Prismatic Breaker is a weird hybrid melee-ranged weapon so include it too. Why are you using desert prowler post-Yharon? don't ask me - if (desertProwlerSet && (item.CountsAsClass() || item.type == ModContent.ItemType()) && item.ammo == AmmoID.None) + if (desertProwlerSet && item.CountsAsClass() && item.ammo == AmmoID.None) damage.Flat += 1f; } diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.cs b/Items/Fishing/SulphurCatches/AbyssalCrate.cs index 23a9101b89..aac8b35b90 100644 --- a/Items/Fishing/SulphurCatches/AbyssalCrate.cs +++ b/Items/Fishing/SulphurCatches/AbyssalCrate.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches { // The contents of this crate depend massively on progression, so it uses a large number of LeadingConditionRules. var tier1AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedSlimeGod || Main.hardMode); - var tier2AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var tier2AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitasClone); var scoriaAvailable = itemLoot.DefineConditionalDropSet(() => NPC.downedGolemBoss); var tier1AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedEoCAcidRain); var tier2AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAquaticScourgeAcidRain); diff --git a/Items/LoreItems/LoreCalamitasClone.cs b/Items/LoreItems/LoreCalamitasClone.cs index 91e7edfa5e..71bf0780ab 100644 --- a/Items/LoreItems/LoreCalamitasClone.cs +++ b/Items/LoreItems/LoreCalamitasClone.cs @@ -32,7 +32,7 @@ I know not how it wields her brimstone magic. Perhaps some day one of us may fin public override void AddRecipes() { CreateRecipe(). - AddIngredient(). + AddIngredient(). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Materials/YharonSoulFragment.cs b/Items/Materials/YharonSoulFragment.cs index 8f57f064b5..653e31f524 100644 --- a/Items/Materials/YharonSoulFragment.cs +++ b/Items/Materials/YharonSoulFragment.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Materials ItemID.Sets.ItemNoGravity[Item.type] = true; DisplayName.SetDefault("Yharon Soul Fragment"); - Tooltip.SetDefault("A shard of a godly soul"); + Tooltip.SetDefault("A shard of a draconic Auric Soul"); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Placeables/Furniture/Trophies/CalamitasTrophy.cs b/Items/Placeables/Furniture/Trophies/CalamitasCloneTrophy.cs similarity index 70% rename from Items/Placeables/Furniture/Trophies/CalamitasTrophy.cs rename to Items/Placeables/Furniture/Trophies/CalamitasCloneTrophy.cs index 8c498e46a5..05c746b50d 100644 --- a/Items/Placeables/Furniture/Trophies/CalamitasTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/CalamitasCloneTrophy.cs @@ -1,15 +1,16 @@ -using CalamityMod.Tiles.Furniture.BossTrophies; +using CalamityMod.Tiles.Furniture.BossTrophies; using Terraria.ModLoader; using Terraria.ID; namespace CalamityMod.Items.Placeables.Furniture.Trophies { - public class CalamitasTrophy : ModItem + [LegacyName("CalamitasTrophy")] + public class CalamitasCloneTrophy : ModItem { public override void SetStaticDefaults() { SacrificeTotal = 1; - DisplayName.SetDefault("Calamitas Trophy"); + DisplayName.SetDefault("Calamitas Clone Trophy"); } public override void SetDefaults() @@ -25,7 +26,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies Item.consumable = true; Item.value = 50000; Item.rare = ItemRarityID.Blue; - Item.createTile = ModContent.TileType(); + Item.createTile = ModContent.TileType(); } } } diff --git a/Items/Placeables/Furniture/Trophies/CalamitasTrophy.png b/Items/Placeables/Furniture/Trophies/CalamitasCloneTrophy.png similarity index 100% rename from Items/Placeables/Furniture/Trophies/CalamitasTrophy.png rename to Items/Placeables/Furniture/Trophies/CalamitasCloneTrophy.png diff --git a/Items/Placeables/Furniture/Trophies/SupremeCalamitasTrophy.cs b/Items/Placeables/Furniture/Trophies/SupremeCalamitasTrophy.cs index 64444473ac..8b9ad71bd0 100644 --- a/Items/Placeables/Furniture/Trophies/SupremeCalamitasTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/SupremeCalamitasTrophy.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.Furniture.BossTrophies; +using CalamityMod.Tiles.Furniture.BossTrophies; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies @@ -8,7 +8,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies public override void SetStaticDefaults() { SacrificeTotal = 1; - DisplayName.SetDefault("Supreme Calamitas Trophy"); + DisplayName.SetDefault("Calamitas Trophy"); } public override void SetDefaults() diff --git a/Items/Potions/Fabsoup.cs b/Items/Potions/Fabsoup.cs index b8cf6eb86b..2e9a57aa1a 100644 --- a/Items/Potions/Fabsoup.cs +++ b/Items/Potions/Fabsoup.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +/*using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Rarities; using Terraria; using Terraria.Audio; @@ -56,4 +56,4 @@ namespace CalamityMod.Items.Potions } } } -} +}*/ diff --git a/Items/SummonItems/CeremonialUrn.cs b/Items/SummonItems/CeremonialUrn.cs index 346c80f17c..e947b58d2b 100644 --- a/Items/SummonItems/CeremonialUrn.cs +++ b/Items/SummonItems/CeremonialUrn.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.SummonItems { SacrificeTotal = 1; DisplayName.SetDefault("Ceremonial Urn"); - Tooltip.SetDefault("Use at the Altar of the Accursed to summon Supreme Calamitas\n" + "Not consumable"); + Tooltip.SetDefault("Use at the Altar of the Accursed to summon the Supreme Witch, Calamitas\n" + "Not consumable"); ItemID.Sets.SortingPriorityBossSpawns[Type] = 17; // Celestial Sigil } diff --git a/Items/SummonItems/CryoKey.cs b/Items/SummonItems/CryoKey.cs index 122d96725b..93e3c1578f 100644 --- a/Items/SummonItems/CryoKey.cs +++ b/Items/SummonItems/CryoKey.cs @@ -1,10 +1,11 @@ -using CalamityMod.Events; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.NPCs.Cryogen; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System.Linq; -using System.Collections.Generic; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -58,7 +59,7 @@ namespace CalamityMod.Items.SummonItems public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) { Texture2D texture = ModContent.Request("CalamityMod/Items/SummonItems/CryoKey").Value; - Color overlay = CalamityMod.Instance.legendaryMode ? Color.Red : Color.White; + Color overlay = CalamityWorld.getFixedBoi ? Color.Red : Color.White; spriteBatch.Draw(texture, position, null, overlay, 0f, origin, scale, 0, 0); return false; } @@ -66,7 +67,7 @@ namespace CalamityMod.Items.SummonItems public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { Texture2D texture = ModContent.Request("CalamityMod/Items/SummonItems/CryoKey").Value; - Color overlay = CalamityMod.Instance.legendaryMode ? Color.Red : lightColor; + Color overlay = CalamityWorld.getFixedBoi ? Color.Red : lightColor; spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, overlay, 0f, Vector2.Zero, 1f, 0, 0); return false; } @@ -77,7 +78,7 @@ namespace CalamityMod.Items.SummonItems TooltipLine name = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "ItemName"); TooltipLine line0 = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0"); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { name.Text = "Pyro Key"; line0.Text = "Summons Cryogen when used in the tundra...?"; diff --git a/Items/SummonItems/EyeofDesolation.cs b/Items/SummonItems/EyeofDesolation.cs index 2c4ea08628..6020e6077f 100644 --- a/Items/SummonItems/EyeofDesolation.cs +++ b/Items/SummonItems/EyeofDesolation.cs @@ -1,13 +1,14 @@ -using CalamityMod.Events; -using CalamityMod.Items.Materials; -using CalamityMod.NPCs.Calamitas; -using Microsoft.Xna.Framework; +using System.Collections.Generic; using System.Linq; -using System.Collections.Generic; +using CalamityMod.Events; +using CalamityMod.Items.Materials; +using CalamityMod.NPCs.CalClone; +using CalamityMod.World; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.Items.SummonItems { @@ -28,7 +29,7 @@ namespace CalamityMod.Items.SummonItems SacrificeTotal = 1; DisplayName.SetDefault("Eye of Desolation"); Tooltip.SetDefault("Tonight is going to be a horrific night...\n" + - "Summons Calamitas when used during nighttime\n" + + "Summons the Calamitas Clone when used during nighttime\n" + "Enrages during the day\n" + "Not consumable"); ItemID.Sets.SortingPriorityBossSpawns[Type] = 10; // Pirate Map @@ -63,7 +64,7 @@ namespace CalamityMod.Items.SummonItems else NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { safeBox.X = spawnX = spawnXReset = (int)(player.Center.X - 1250f); spawnX2 = spawnXReset2 = (int)(player.Center.X + 1250f); @@ -109,7 +110,7 @@ namespace CalamityMod.Items.SummonItems Player player = Main.LocalPlayer; TooltipLine line3 = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2"); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { line3.Text = "Creates a square arena of blocks, with you at its center\nEnrages during the day"; } diff --git a/Items/SummonItems/ProfanedShard.cs b/Items/SummonItems/ProfanedShard.cs index d3ccec9b22..10d57d4ffb 100644 --- a/Items/SummonItems/ProfanedShard.cs +++ b/Items/SummonItems/ProfanedShard.cs @@ -1,12 +1,13 @@ -using CalamityMod.Events; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.NPCs.ProfanedGuardians; -using System.Collections.Generic; -using System.Linq; +using CalamityMod.World; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.Items.SummonItems { @@ -41,7 +42,7 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return !NPC.AnyNPCs(ModContent.NPCType()) && (Main.dayTime || CalamityMod.Instance.legendaryMode) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; + return !NPC.AnyNPCs(ModContent.NPCType()) && (Main.dayTime || CalamityWorld.getFixedBoi) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) @@ -59,7 +60,7 @@ namespace CalamityMod.Items.SummonItems Player player = Main.LocalPlayer; TooltipLine line1 = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1"); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { line1.Text = "Summons the Profaned Guardians when used in the Hallow or Underworld"; } diff --git a/Items/SummonItems/SandstormsCore.cs b/Items/SummonItems/SandstormsCore.cs index bc0a0ed16c..1ac7984186 100644 --- a/Items/SummonItems/SandstormsCore.cs +++ b/Items/SummonItems/SandstormsCore.cs @@ -1,11 +1,12 @@ -using CalamityMod.Items.Materials; -using CalamityMod.NPCs.GreatSandShark; +using System.Collections.Generic; using System.Linq; -using System.Collections.Generic; +using CalamityMod.Items.Materials; +using CalamityMod.NPCs.GreatSandShark; +using CalamityMod.World; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.Items.SummonItems { @@ -38,7 +39,7 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return player.ZoneDesert && !(CalamityMod.Instance.legendaryMode && !player.Calamity().ZoneAstral) && !NPC.AnyNPCs(ModContent.NPCType()); + return player.ZoneDesert && !(CalamityWorld.getFixedBoi && !player.Calamity().ZoneAstral) && !NPC.AnyNPCs(ModContent.NPCType()); } public override bool? UseItem(Player player) @@ -57,7 +58,7 @@ namespace CalamityMod.Items.SummonItems Player player = Main.LocalPlayer; TooltipLine line0 = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0"); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { line0.Text = "Summons the Great Sand Shark when used in the astral desert"; } diff --git a/Items/SummonItems/Terminus.cs b/Items/SummonItems/Terminus.cs index 34ee63edf8..c71d6b2cc4 100644 --- a/Items/SummonItems/Terminus.cs +++ b/Items/SummonItems/Terminus.cs @@ -1,10 +1,10 @@ -using CalamityMod.Projectiles.Typeless; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Projectiles.Typeless; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System.Linq; -using System.Collections.Generic; using Terraria; -using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -24,8 +24,8 @@ namespace CalamityMod.Items.SummonItems public override void SetDefaults() { Item.rare = ItemRarityID.Blue; - Item.width = CalamityMod.Instance.legendaryMode ? 54 : 28; - Item.height = CalamityMod.Instance.legendaryMode ? 78 : 28; + Item.width = CalamityWorld.getFixedBoi ? 54 : 28; + Item.height = CalamityWorld.getFixedBoi ? 78 : 28; Item.useAnimation = 45; Item.useTime = 45; Item.channel = true; @@ -37,7 +37,7 @@ namespace CalamityMod.Items.SummonItems public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { Texture2D texture = ModContent.Request("CalamityMod/Items/SummonItems/Terminus_GFB").Value; Color overlay = Color.White; @@ -50,7 +50,7 @@ namespace CalamityMod.Items.SummonItems public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { Texture2D texture = ModContent.Request("CalamityMod/Items/SummonItems/Terminus_GFB").Value; spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, 0, 0); @@ -65,7 +65,7 @@ namespace CalamityMod.Items.SummonItems Player player = Main.LocalPlayer; TooltipLine name = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "ItemName"); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { name.Text = "Ogscule"; } diff --git a/Items/SummonItems/JungleDragonEgg.cs b/Items/SummonItems/YharonEgg.cs similarity index 69% rename from Items/SummonItems/JungleDragonEgg.cs rename to Items/SummonItems/YharonEgg.cs index 547849551c..ab342a862b 100644 --- a/Items/SummonItems/JungleDragonEgg.cs +++ b/Items/SummonItems/YharonEgg.cs @@ -9,18 +9,18 @@ using Terraria.ModLoader; namespace CalamityMod.Items.SummonItems { - [LegacyName("ChickenEgg")] - public class JungleDragonEgg : ModItem + [LegacyName("ChickenEgg", "JungleDragonEgg")] + public class YharonEgg : ModItem { public override void SetStaticDefaults() { SacrificeTotal = 1; - DisplayName.SetDefault("Jungle Dragon Egg"); - Tooltip.SetDefault("An imitation of the egg that bore the loyal guardian of the tyrant king\n" + - "Summons Jungle Dragon, Yharon when used in the Jungle\n" + + DisplayName.SetDefault("Blessed Phoenix Egg"); + Tooltip.SetDefault("An effigy of a Phoenix Dragon egg, used in worship\n" + + "Summons Yharon, Stalwart Defender\n" + "Enrages outside the fire walls\n" + "Not consumable"); - ItemID.Sets.SortingPriorityBossSpawns[Type] = 17; // Celestial Sigil + ItemID.Sets.SortingPriorityBossSpawns[Type] = 17; // Celestial Sigil } public override void SetDefaults() @@ -34,14 +34,14 @@ namespace CalamityMod.Items.SummonItems Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossItem; - } + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossItem; + } public override bool CanUseItem(Player player) { - return player.ZoneJungle && !NPC.AnyNPCs(ModContent.NPCType()) && !BossRushEvent.BossRushActive; + return !NPC.AnyNPCs(ModContent.NPCType()) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) diff --git a/Items/SummonItems/JungleDragonEgg.png b/Items/SummonItems/YharonEgg.png similarity index 100% rename from Items/SummonItems/JungleDragonEgg.png rename to Items/SummonItems/YharonEgg.png diff --git a/Items/TreasureBags/CalamitasBag.cs b/Items/TreasureBags/CalamitasCloneBag.cs similarity index 80% rename from Items/TreasureBags/CalamitasBag.cs rename to Items/TreasureBags/CalamitasCloneBag.cs index 55b7db282c..4a375f780c 100644 --- a/Items/TreasureBags/CalamitasBag.cs +++ b/Items/TreasureBags/CalamitasCloneBag.cs @@ -6,7 +6,7 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -16,14 +16,15 @@ using Terraria.ModLoader; namespace CalamityMod.Items.TreasureBags { - public class CalamitasBag : ModItem + [LegacyName("CalamitasBag")] + public class CalamitasCloneBag : ModItem { public override void SetStaticDefaults() { SacrificeTotal = 3; - DisplayName.SetDefault("Treasure Bag (Calamitas)"); + DisplayName.SetDefault("Treasure Bag (Calamitas Clone)"); Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Item.type] = true; } public override void SetDefaults() @@ -36,14 +37,14 @@ namespace CalamityMod.Items.TreasureBags Item.expert = true; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossBags; - } + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossBags; + } public override bool CanRightClick() => true; - public override Color? GetAlpha(Color lightColor) => Color.Lerp(lightColor, Color.White, 0.4f); + public override Color? GetAlpha(Color lightColor) => Color.Lerp(lightColor, Color.White, 0.4f); public override void PostUpdate() => Item.TreasureBagLightAndDust(); @@ -54,8 +55,8 @@ namespace CalamityMod.Items.TreasureBags public override void ModifyItemLoot(ItemLoot itemLoot) { - // Money - itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType())); + // Money + itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType())); // Materials itemLoot.Add(ModContent.ItemType(), 1, 30, 35); diff --git a/Items/TreasureBags/CalamitasBag.png b/Items/TreasureBags/CalamitasCloneBag.png similarity index 100% rename from Items/TreasureBags/CalamitasBag.png rename to Items/TreasureBags/CalamitasCloneBag.png diff --git a/Items/TreasureBags/SupremeCalamitasCoffer.cs b/Items/TreasureBags/CalamitasCoffer.cs similarity index 82% rename from Items/TreasureBags/SupremeCalamitasCoffer.cs rename to Items/TreasureBags/CalamitasCoffer.cs index 10b61598e1..56575b1b18 100644 --- a/Items/TreasureBags/SupremeCalamitasCoffer.cs +++ b/Items/TreasureBags/CalamitasCoffer.cs @@ -18,15 +18,15 @@ using Terraria.ModLoader; namespace CalamityMod.Items.TreasureBags { - [LegacyName("SCalBag")] - public class SupremeCalamitasCoffer : ModItem + [LegacyName("SCalBag", "SupremeCalamitasCoffer")] + public class CalamitasCoffer : ModItem { public override void SetStaticDefaults() { SacrificeTotal = 3; - DisplayName.SetDefault("Treasure Coffer (Supreme Calamitas)"); + DisplayName.SetDefault("Treasure Coffer (Calamitas)"); Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Item.type] = true; } public override void SetDefaults() @@ -39,14 +39,14 @@ namespace CalamityMod.Items.TreasureBags Item.expert = true; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossBags; - } + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossBags; + } public override bool CanRightClick() => true; - public override Color? GetAlpha(Color lightColor) => Color.Lerp(lightColor, Color.White, 0.4f); + public override Color? GetAlpha(Color lightColor) => Color.Lerp(lightColor, Color.White, 0.4f); public override void PostUpdate() => Item.TreasureBagLightAndDust(); @@ -57,8 +57,8 @@ namespace CalamityMod.Items.TreasureBags public override void ModifyItemLoot(ItemLoot itemLoot) { - // Money - itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType())); + // Money + itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType())); // Materials itemLoot.Add(ModContent.ItemType(), 1, 30, 40); diff --git a/Items/TreasureBags/SupremeCalamitasCoffer.png b/Items/TreasureBags/CalamitasCoffer.png similarity index 100% rename from Items/TreasureBags/SupremeCalamitasCoffer.png rename to Items/TreasureBags/CalamitasCoffer.png diff --git a/Items/Weapons/Magic/YharimsCrystal.cs b/Items/Weapons/Magic/YharimsCrystal.cs index a1826f8358..5fd507bbc6 100644 --- a/Items/Weapons/Magic/YharimsCrystal.cs +++ b/Items/Weapons/Magic/YharimsCrystal.cs @@ -1,8 +1,9 @@ -using CalamityMod.Projectiles.Magic; -using CalamityMod.Rarities; -using Microsoft.Xna.Framework; +using System.Collections.Generic; using System.Linq; -using System.Collections.Generic; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Rarities; +using CalamityMod.World; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -47,17 +48,17 @@ namespace CalamityMod.Items.Weapons.Magic public override void ModifyTooltips(List list) { TooltipLine name = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "ItemName"); - if (name != null && CalamityMod.Instance.legendaryMode) + if (name != null && CalamityWorld.getFixedBoi) name.Text = "yermes christal"; TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0"); - if (line != null && CalamityMod.Instance.legendaryMode) + if (line != null && CalamityWorld.getFixedBoi) line.Text = "...throughs a pice of dnimite"; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { Projectile.NewProjectile(source, player.Center, Vector2.Zero, ProjectileID.Dynamite, 250, 0, player.whoAmI); return false; diff --git a/Items/Weapons/Melee/Lacerator.cs b/Items/Weapons/Melee/Lacerator.cs index bb546e45f9..377db8c890 100644 --- a/Items/Weapons/Melee/Lacerator.cs +++ b/Items/Weapons/Melee/Lacerator.cs @@ -1,8 +1,9 @@ -using CalamityMod.Items.Materials; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee.Yoyos; using CalamityMod.Rarities; -using System.Collections.Generic; -using System.Linq; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -52,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee Player player = Main.LocalPlayer; TooltipLine line3 = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2"); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { line3.Text = "May be viable weapon against DoG..."; } diff --git a/Items/Weapons/Ranged/HalibutCannon.cs b/Items/Weapons/Ranged/HalibutCannon.cs index fee82ad2bb..f2c01a7dd5 100644 --- a/Items/Weapons/Ranged/HalibutCannon.cs +++ b/Items/Weapons/Ranged/HalibutCannon.cs @@ -1,7 +1,8 @@ -using CalamityMod.Rarities; -using Microsoft.Xna.Framework; +using System.Collections.Generic; using System.Linq; -using System.Collections.Generic; +using CalamityMod.Rarities; +using CalamityMod.World; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -46,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Ranged { TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0"); - if (line != null && CalamityMod.Instance.legendaryMode) + if (line != null && CalamityWorld.getFixedBoi) line.Text = "No, it sucks"; } @@ -55,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Ranged SoundEngine.PlaySound(SoundID.Item38, player.Center); // Really jammed in GFB - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) return Main.rand.NextBool(5); int bulletAmt = Main.rand.Next(25, 36); diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index e855623db4..407d2024af 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -121,14 +121,13 @@ namespace CalamityMod case "brimstone elemental": return DownedBossSystem.downedBrimstoneElemental; - case "calamitas": case "clone": case "calamitasclone": case "calamitas clone": case "clonelamitas": case "calamitasdoppelganger": case "calamitas doppelganger": - return DownedBossSystem.downedCalamitas; + return DownedBossSystem.downedCalamitasClone; case "gss": case "greatsandshark": @@ -287,10 +286,14 @@ namespace CalamityMod case "ares": return DownedBossSystem.downedExoMechs; + case "calamitas": case "scal": case "supremecalamitas": case "supreme calamitas": - return DownedBossSystem.downedSCal; + case "supremewitchcalamitas": + case "supreme witch calamitas": + case "supreme witch, calamitas": + return DownedBossSystem.downedCalamitas; case "adulteidolonwyrm": case "adult eidolon wyrm": diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 39c496af07..11b66329be 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -36,7 +36,7 @@ using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Cryogen; @@ -85,7 +85,7 @@ namespace CalamityMod { internal class Downed { - public static readonly Func NotDownedCalamitas = () => !DownedBossSystem.downedCalamitas; + public static readonly Func NotDownedCalClone = () => !DownedBossSystem.downedCalamitasClone; public static readonly Func DownedDesertScourge = () => DownedBossSystem.downedDesertScourge; public static readonly Func DownedGiantClam = () => DownedBossSystem.downedCLAM; public static readonly Func DownedCrabulon = () => DownedBossSystem.downedCrabulon; @@ -96,7 +96,7 @@ namespace CalamityMod public static readonly Func DownedBrimstoneElemental = () => DownedBossSystem.downedBrimstoneElemental; public static readonly Func DownedAquaticScourge = () => DownedBossSystem.downedAquaticScourge; public static readonly Func DownedCragmawMire = () => DownedBossSystem.downedCragmawMire; - public static readonly Func DownedCalamitas = () => DownedBossSystem.downedCalamitas; + public static readonly Func DownedCalClone = () => DownedBossSystem.downedCalamitasClone; public static readonly Func DownedGSS = () => DownedBossSystem.downedGSS; public static readonly Func DownedLeviathan = () => DownedBossSystem.downedLeviathan; public static readonly Func DownedAureus = () => DownedBossSystem.downedAstrumAureus; @@ -116,7 +116,7 @@ namespace CalamityMod public static readonly Func DownedDoG = () => DownedBossSystem.downedDoG; public static readonly Func DownedYharon = () => DownedBossSystem.downedYharon; public static readonly Func DownedExoMechs = () => DownedBossSystem.downedExoMechs; - public static readonly Func DownedSCal = () => DownedBossSystem.downedSCal; + public static readonly Func DownedSCal = () => DownedBossSystem.downedCalamitas; public static readonly Func DownedAdultEidolonWyrm = () => DownedBossSystem.downedAdultEidolonWyrm; public static readonly Func DownedAcidRainInitial = () => DownedBossSystem.downedEoCAcidRain; @@ -141,7 +141,7 @@ namespace CalamityMod { "AquaticScourge", 9.5f }, { "CragmawMire", 9.52f }, { "BrimstoneElemental", 10.5f }, - { "Calamitas", 11.7f }, + { "CalamitasClone", 11.7f }, { "GreatSandShark", 12.09f }, { "Leviathan", 12.8f }, { "AstrumAureus", 12.81f }, @@ -161,7 +161,7 @@ namespace CalamityMod { "DevourerOfGods", 21f }, { "Yharon", 22f }, { "ExoMechs", 22.5f }, - { "SupremeCalamitas", 23f }, + { "Calamitas", 23f }, { "AdultEidolonWyrm", 23.5f }, // { "Yharim", 24f }, // { "Noxus", 25f }, @@ -513,17 +513,15 @@ namespace CalamityMod AddBoss(bossChecklist, calamity, "Brimstone Elemental", order, type, DownedBrimstoneElemental, summon, collection, instructions, despawn, () => true); } - // Calamitas + // Calamitas Clone { - BossDifficulty.TryGetValue("Calamitas", out float order); + BossDifficulty.TryGetValue("CalamitasClone", out float order); int type = NPCType(); int summon = ItemType(); - List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}] at Night"; string despawn = CalamityUtils.ColorMessage("If you wanted a fight, you should've came more prepared.", new Color(0xFF, 0xA5, 0x00)); - //Func available = () => !DownedBossSystem.downedCalamitas; - AddBoss(bossChecklist, calamity, "The Calamitas Clone", order, type, DownedCalamitas, summon, collection, instructions, despawn, () => true); - //AddBoss(bossChecklist, calamity, "Calamitas", order, type, DownedCalamitas, summon, collection, instructions, despawn, available); + AddBoss(bossChecklist, calamity, "The Calamitas Clone", order, type, DownedCalClone, summon, collection, instructions, despawn, () => true); } // Great Sand Shark @@ -773,9 +771,9 @@ namespace CalamityMod { BossDifficulty.TryGetValue("Yharon", out float order); int type = NPCType(); - int summon = ItemType(); + int summon = ItemType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - string instructions = $"Use a [i:{summon}] in the Jungle Biome"; + string instructions = $"Use a [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Yharon found you too weak to stay near your gravestone.", new Color(0xFF, 0xA5, 0x00)); string bossLogTex = "CalamityMod/NPCs/Yharon/Yharon_Head_Boss"; AddBoss(bossChecklist, calamity, "Yharon", order, type, DownedYharon, summon, collection, instructions, despawn, () => true, null, bossLogTex); @@ -802,9 +800,9 @@ namespace CalamityMod AddBoss(bossChecklist, calamity, "Exo Mechs", order, bosses, DownedExoMechs, null, collection, instructions, despawn, () => true, portrait); } - // Supreme Calamitas + // Calamitas { - BossDifficulty.TryGetValue("SupremeCalamitas", out float order); + BossDifficulty.TryGetValue("Calamitas", out float order); int type = NPCType(); int summon1 = ItemType(); int summon2 = ItemType(); @@ -814,7 +812,7 @@ namespace CalamityMod string instructions = $"Use [i:{summon1}] or a [i:{summon2}] as offering at an [i:{altar}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); string bossHeadTex = "CalamityMod/NPCs/SupremeCalamitas/HoodedHeadIcon"; - AddBoss(bossChecklist, calamity, "Supreme Calamitas", order, type, DownedSCal, summons, collection, instructions, despawn, () => true, null, bossHeadTex); + AddBoss(bossChecklist, calamity, "Supreme Witch, Calamitas", order, type, DownedSCal, summons, collection, instructions, despawn, () => true, null, bossHeadTex); } } @@ -1085,7 +1083,7 @@ namespace CalamityMod censusMod.Call("TownNPCCondition", NPCType(), "Have a [i:" + ItemID.PlatinumCoin + "] in your inventory after defeating Skeletron"); censusMod.Call("TownNPCCondition", NPCType(), "Have [i:" + ItemType() + "] in your inventory in Hardmode"); censusMod.Call("TownNPCCondition", NPCType(), "Defeat Cryogen"); - censusMod.Call("TownNPCCondition", NPCType(), "Defeat Supreme Calamitas"); + censusMod.Call("TownNPCCondition", NPCType(), "Defeat Supreme Witch, Calamitas"); } } diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index 12a3bf6a95..49f8414d4c 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -4,6 +4,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.World; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -216,7 +217,7 @@ namespace CalamityMod.NPCs.Abyss Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Bloatfish3").Type, NPC.scale); } } - if (NPC.scale < 2f || CalamityMod.Instance.legendaryMode) + if (NPC.scale < 2f || CalamityWorld.getFixedBoi) { NPC.scale += 0.05f; } diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 6ad5c0673d..563056cb16 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -1,21 +1,22 @@ -using CalamityMod.BiomeManagers; +using System; +using System.IO; +using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Enemy; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; -using Terraria.Audio; namespace CalamityMod.NPCs.Abyss { @@ -346,7 +347,7 @@ namespace CalamityMod.NPCs.Abyss (Main.player[NPC.target].Center - NPC.Center).Length() < Main.player[NPC.target].Calamity().GetAbyssAggro(240f)) || NPC.justHit) { - if (CalamityMod.Instance.legendaryMode && Main.netMode != NetmodeID.MultiplayerClient && !clone && !hasBeenHit) + if (CalamityWorld.getFixedBoi && Main.netMode != NetmodeID.MultiplayerClient && !clone && !hasBeenHit) { // spawn some baby colossal squids in gfb for (int i = 0; i < 3; i++) @@ -634,7 +635,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode && clone) + if (CalamityWorld.getFixedBoi && clone) { typeName = "Tiny Squid"; } diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 73bd7c943c..371481a968 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -1,25 +1,26 @@ -using CalamityMod.BiomeManagers; +using System; +using System.IO; +using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.Sounds; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; -using Terraria.Audio; -using CalamityMod.NPCs.AdultEidolonWyrm; -using CalamityMod.Sounds; namespace CalamityMod.NPCs.Abyss { @@ -101,7 +102,7 @@ namespace CalamityMod.NPCs.Abyss public override void AI() { bool adultWyrmAlive = false; - SoundStyle roar = CalamityMod.Instance.legendaryMode ? Sunskater.DeathSound with { Pitch = Sunskater.DeathSound.Pitch - 0.5f } : CommonCalamitySounds.WyrmScreamSound; + SoundStyle roar = CalamityWorld.getFixedBoi ? Sunskater.DeathSound with { Pitch = Sunskater.DeathSound.Pitch - 0.5f } : CommonCalamitySounds.WyrmScreamSound; if (CalamityGlobalNPC.adultEidolonWyrmHead != -1) { if (Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active) diff --git a/NPCs/Abyss/ReaperShark.cs b/NPCs/Abyss/ReaperShark.cs index a7d2611fb4..0d31d184d6 100644 --- a/NPCs/Abyss/ReaperShark.cs +++ b/NPCs/Abyss/ReaperShark.cs @@ -1,19 +1,20 @@ -using CalamityMod.BiomeManagers; +using System; +using System.IO; +using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; -using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; -using Terraria.Audio; namespace CalamityMod.NPCs.Abyss { @@ -605,7 +606,7 @@ namespace CalamityMod.NPCs.Abyss NPC.netUpdate = true; return; } - if (CalamityMod.Instance.legendaryMode && Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[2] % 5 == 0) + if (CalamityWorld.getFixedBoi && Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[2] % 5 == 0) { Vector2 direction = vector - player.Center; direction.Normalize(); diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 20c1dc232e..0c8b679a9d 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -478,7 +478,7 @@ namespace CalamityMod.NPCs.AcidRain public override void OnKill() { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { Vector2 valueBoom = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)NPC.height * 0.5f); float spreadBoom = 15f * 0.0174f; diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index 48ba12cdda..d5638edcb9 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.AcidRain Walking = false; - if (CalamityMod.Instance.legendaryMode && !hasDoneDeathray && NPC.life <= NPC.lifeMax * 0.1f) + if (CalamityWorld.getFixedBoi && !hasDoneDeathray && NPC.life <= NPC.lifeMax * 0.1f) { DeathrayTime++; MasterSpark(); diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 3191593b96..23e3ef7887 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -1,15 +1,16 @@ -using CalamityMod.BiomeManagers; +using System; +using System.IO; +using CalamityMod.BiomeManagers; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Particles.Metaballs; using CalamityMod.Projectiles.Enemy; using CalamityMod.Projectiles.Magic; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; -using System.IO; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; @@ -206,7 +207,7 @@ namespace CalamityMod.NPCs.AcidRain // Prevent yeeting into the sky at the speed of light. NPC.velocity = Vector2.Clamp(NPC.velocity, new Vector2(-maxSpeed), new Vector2(maxSpeed)); - if (CalamityMod.Instance.legendaryMode && !(!NPC.wet && NPC.collideY)) + if (CalamityWorld.getFixedBoi && !(!NPC.wet && NPC.collideY)) { // Spread the wrath of the damned NPC.Calamity().newAI[0]++; diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index 0d9afb76df..e59b688c96 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -1,18 +1,20 @@ -using CalamityMod.BiomeManagers; +using System; +using CalamityMod.BiomeManagers; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Projectiles.Enemy; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.Audio; using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.NPCs.AcidRain { public class Trilobite : ModNPC @@ -168,7 +170,7 @@ namespace CalamityMod.NPCs.AcidRain projDamage = (int)Math.Round(projDamage * 0.8); Vector2 spikeVelocity = -NPC.velocity.RotatedByRandom(0.18f); - if (CalamityMod.Instance.legendaryMode) // more true to the original concept art. + if (CalamityWorld.getFixedBoi) // more true to the original concept art. { spikeVelocity = -projectile.velocity; spikeVelocity.Normalize(); diff --git a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBody.cs b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBody.cs index 67defb0c14..b7b5485b3c 100644 --- a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBody.cs +++ b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBody.cs @@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Jared"; } diff --git a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBodyAlt.cs b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBodyAlt.cs index 9360429a07..b0048eeb42 100644 --- a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBodyAlt.cs +++ b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBodyAlt.cs @@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Jared"; } diff --git a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs index b17acfd90c..1d810aab1c 100644 --- a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs +++ b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.defense = 999; NPC.DR_NERD(0.9f); @@ -1425,7 +1425,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm npcLoot.Add(ModContent.ItemType(), 1, 80, 100); npcLoot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitasClone); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 50, 108, 65, 135)); postClone.Add(ItemID.Ectoplasm, 1, 21, 32); } @@ -1458,7 +1458,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Jared"; } diff --git a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmTail.cs b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmTail.cs index d5d582f52b..d677ab84c4 100644 --- a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmTail.cs +++ b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmTail.cs @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Jared"; } diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index d39529ca0d..b471f5aa7b 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.AquaticScourge vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color color = NPC.GetAlpha(drawColor); - if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityMod.Instance.legendaryMode) + if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.getFixedBoi) { if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[3] > 300f) color = Color.Lerp(color, Color.SandyBrown, MathHelper.Clamp((Main.npc[(int)NPC.ai[2]].Calamity().newAI[3] - 300f) / 180f, 0f, 1f)); diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 699f656fbb..b3ae716c15 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -99,7 +99,7 @@ namespace CalamityMod.NPCs.AquaticScourge vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color color = NPC.GetAlpha(drawColor); - if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityMod.Instance.legendaryMode) + if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.getFixedBoi) { if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[3] > 300f) color = Color.Lerp(color, Color.SandyBrown, MathHelper.Clamp((Main.npc[(int)NPC.ai[2]].Calamity().newAI[3] - 300f) / 180f, 0f, 1f)); diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 3bdd500a67..e524ccda14 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.AquaticScourge vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color color = NPC.GetAlpha(drawColor); - if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityMod.Instance.legendaryMode) + if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.getFixedBoi) { if (NPC.Calamity().newAI[3] > 300f) color = Color.Lerp(color, Color.SandyBrown, MathHelper.Clamp((NPC.Calamity().newAI[3] - 300f) / 180f, 0f, 1f)); diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 0e25bffbb7..57007646e4 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -99,7 +99,7 @@ namespace CalamityMod.NPCs.AquaticScourge vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color color = NPC.GetAlpha(drawColor); - if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityMod.Instance.legendaryMode) + if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.getFixedBoi) { if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[3] > 300f) color = Color.Lerp(color, Color.SandyBrown, MathHelper.Clamp((Main.npc[(int)NPC.ai[2]].Calamity().newAI[3] - 300f) / 180f, 0f, 1f)); diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 890e4b9b27..bebb479699 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -279,7 +279,7 @@ namespace CalamityMod.NPCs.Astral swingYeet = false; - if (Main.rand.NextBool(1000) || CalamityMod.Instance.legendaryMode) //Launch the player very fast very rarely + if (Main.rand.NextBool(1000) || CalamityWorld.getFixedBoi) //Launch the player very fast very rarely { horMult = 12f; verMult = 2.3f; diff --git a/NPCs/Astral/HiveEnemy.cs b/NPCs/Astral/HiveEnemy.cs index 63c9a75035..872741746b 100644 --- a/NPCs/Astral/HiveEnemy.cs +++ b/NPCs/Astral/HiveEnemy.cs @@ -52,7 +52,7 @@ namespace CalamityMod.NPCs.Astral NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.scale = 3f; } diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index b3dfbca425..c1234cda7e 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.getGoodWorld) NPC.scale *= 0.8f; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) NPC.scale *= 1.5f; } @@ -231,7 +231,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - if (NPC.ai[0] == 0f || (slimePhaseHP && CalamityMod.Instance.legendaryMode)) + if (NPC.ai[0] == 0f || (slimePhaseHP && CalamityWorld.getFixedBoi)) { NPCTexture = TextureAssets.Npc[NPC.type].Value; GlowMaskTexture = ModContent.Request("CalamityMod/NPCs/AstrumAureus/AstrumAureusGlow").Value; @@ -284,7 +284,7 @@ namespace CalamityMod.NPCs.AstrumAureus float rotation = NPC.rotation; float offsetY = NPC.gfxOffY; Color color36 = Color.White; - if (CalamityMod.Instance.legendaryMode && slimePhaseHP) + if (CalamityWorld.getFixedBoi && slimePhaseHP) { color36 = slimePhase == 0 ? Color.Yellow : Color.Violet; } @@ -311,14 +311,14 @@ namespace CalamityMod.NPCs.AstrumAureus Vector2 vector43 = NPC.Center - screenPos; vector43 -= new Vector2(NPCTexture.Width, NPCTexture.Height / frameCount) * scale / 2f; vector43 += vector11 * scale + new Vector2(0f, 4f + offsetY); - Color toUse = CalamityMod.Instance.legendaryMode && slimePhaseHP ? color36 : drawColor; + Color toUse = CalamityWorld.getFixedBoi && slimePhaseHP ? color36 : drawColor; spriteBatch.Draw(NPCTexture, vector43, frame, NPC.GetAlpha(toUse), rotation, vector11, scale, spriteEffects, 0f); - if (NPC.ai[0] != 1 || (slimePhaseHP && CalamityMod.Instance.legendaryMode)) //draw only if not recharging + if (NPC.ai[0] != 1 || (slimePhaseHP && CalamityWorld.getFixedBoi)) //draw only if not recharging { Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Color.Gold); Color color40 = Color.Lerp(Color.White, color, 0.5f); - if (CalamityMod.Instance.legendaryMode && slimePhaseHP) + if (CalamityWorld.getFixedBoi && slimePhaseHP) { color40 = slimePhase == 0 ? Color.Violet : Color.Yellow; } diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 635d5bdf58..a1a8b4024a 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -374,7 +374,7 @@ namespace CalamityMod.NPCs.AstrumAureus public override void OnHitPlayer(Player player, int damage, bool crit) { - int debuffType = CalamityMod.Instance.legendaryMode ? ModContent.BuffType() : ModContent.BuffType(); + int debuffType = CalamityWorld.getFixedBoi ? ModContent.BuffType() : ModContent.BuffType(); player.AddBuff(debuffType, (int)(180 * NPC.scale), true); } } diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 1a269417cf..44122937af 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void HitEffect(int hitDirection, double damage) { - if (NPC.life <= 0 && CalamityMod.Instance.legendaryMode) // I value people's computers + if (NPC.life <= 0 && CalamityWorld.getFixedBoi) // I value people's computers { NPC.position.X = NPC.position.X + (NPC.width / 2); NPC.position.Y = NPC.position.Y + (NPC.height / 2); diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index 498cc4b204..de9aa95311 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { if (CalamityWorld.death) // killing 10 worms with half of the og's health is ridiculous NPC.lifeMax /= 3; @@ -217,7 +217,7 @@ namespace CalamityMod.NPCs.AstrumDeus { if (NPC.life <= 0) { - if (CalamityMod.Instance.legendaryMode && Main.rand.NextBool(5)) // I value people's computers + if (CalamityWorld.getFixedBoi && Main.rand.NextBool(5)) // I value people's computers { NPC.position.X = NPC.position.X + (NPC.width / 2); NPC.position.Y = NPC.position.Y + (NPC.height / 2); diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 727ccef3ef..c7287a6729 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void HitEffect(int hitDirection, double damage) { - if (NPC.life <= 0 && CalamityMod.Instance.legendaryMode) // I value people's computers + if (NPC.life <= 0 && CalamityWorld.getFixedBoi) // I value people's computers { NPC.position.X = NPC.position.X + (NPC.width / 2); NPC.position.Y = NPC.position.Y + (NPC.height / 2); diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index 43b1a8512c..a6a7ebfaad 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -52,7 +52,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) NPC.scale *= 0.7f; } diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 8063560f1b..272cb5fb87 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -307,7 +307,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); // Give brimmy an outline based on current elemental mode - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { Color baseColor = Color.Red; switch (currentMode) diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index f4a49c4fab..deb552ce68 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.Bumblebirb bool birbSpawn = NPC.ai[0] == 4f && NPC.ai[1] > 0f; // Animation goes nyoom - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.frameCounter += 4; } @@ -412,7 +412,7 @@ namespace CalamityMod.NPCs.Bumblebirb public override void BossLoot(ref string name, ref int potionType) { - name = CalamityMod.Instance.legendaryMode ? "A Bumblebirb" : "A Dragonfolly"; + name = CalamityWorld.getFixedBoi ? "A Bumblebirb" : "A Dragonfolly"; potionType = ItemID.SuperHealingPotion; } @@ -462,7 +462,7 @@ namespace CalamityMod.NPCs.Bumblebirb DownedBossSystem.downedDragonfolly = true; CalamityNetcode.SyncWorld(); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { int spacing = 40; int amt = 7; @@ -487,7 +487,7 @@ namespace CalamityMod.NPCs.Bumblebirb public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Bumblebirb"; } diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs index cd2d7ae5fd..b1aa11453f 100644 --- a/NPCs/Bumblebirb/Bumblefuck2.cs +++ b/NPCs/Bumblebirb/Bumblefuck2.cs @@ -1,5 +1,6 @@ using CalamityMod.Projectiles.Boss; using CalamityMod.Sounds; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -55,7 +56,7 @@ namespace CalamityMod.NPCs.Bumblebirb if (Main.rand.NextBool(4) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); for (int i = 0; i < 5; i++) @@ -72,7 +73,7 @@ namespace CalamityMod.NPCs.Bumblebirb public override void FindFrame(int frameHeight) { NPC.frameCounter += NPC.ai[0] == 2.1f ? 1.5 : 1D; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.frameCounter += 2D; } @@ -124,7 +125,7 @@ namespace CalamityMod.NPCs.Bumblebirb public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Bumblebirb"; } diff --git a/NPCs/Calamitas/CalScreenShaderData.cs b/NPCs/CalClone/CalScreenShaderData.cs similarity index 97% rename from NPCs/Calamitas/CalScreenShaderData.cs rename to NPCs/CalClone/CalScreenShaderData.cs index 06d67cc3d3..11ee4782e0 100644 --- a/NPCs/Calamitas/CalScreenShaderData.cs +++ b/NPCs/CalClone/CalScreenShaderData.cs @@ -5,7 +5,7 @@ using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; using Terraria.ModLoader; -namespace CalamityMod.NPCs.Calamitas +namespace CalamityMod.NPCs.CalClone { public class CalScreenShaderData : ScreenShaderData { diff --git a/NPCs/Calamitas/CalSky.cs b/NPCs/CalClone/CalSky.cs similarity index 98% rename from NPCs/Calamitas/CalSky.cs rename to NPCs/CalClone/CalSky.cs index 787e8dc8ac..e7d242d4d0 100644 --- a/NPCs/Calamitas/CalSky.cs +++ b/NPCs/CalClone/CalSky.cs @@ -6,7 +6,7 @@ using Terraria.GameContent; using Terraria.Graphics.Effects; using Terraria.ModLoader; -namespace CalamityMod.NPCs.Calamitas +namespace CalamityMod.NPCs.CalClone { public class CalSky : CustomSky { diff --git a/NPCs/Calamitas/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs similarity index 93% rename from NPCs/Calamitas/CalamitasClone.cs rename to NPCs/CalClone/CalamitasClone.cs index d4ac6ae44a..1ec856330b 100644 --- a/NPCs/Calamitas/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -27,14 +27,14 @@ using Terraria.Audio; using Terraria.GameContent.ItemDropRules; using CalamityMod.Sounds; -namespace CalamityMod.NPCs.Calamitas +namespace CalamityMod.NPCs.CalClone { [AutoloadBossHead] public class CalamitasClone : ModNPC { public override void SetStaticDefaults() { - DisplayName.SetDefault("Calamitas"); + DisplayName.SetDefault("Calamitas Clone"); Main.npcFrameCount[NPC.type] = 6; NPCID.Sets.TrailingMode[NPC.type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.Calamitas }; value.Position.Y -= 10f; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; - NPCID.Sets.MPAllowedEnemies[Type] = true; + NPCID.Sets.MPAllowedEnemies[Type] = true; } public override void SetDefaults() @@ -84,8 +84,8 @@ namespace CalamityMod.NPCs.Calamitas BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - // Will move to localization whenever that is cleaned up. - new FlavorTextBestiaryInfoElement("A mysterious burning form which only appears at night, wreathed in brimstone fire. It has a twisted mind and misplaced pride in its abilities.") + // Will move to localization whenever that is cleaned up. + new FlavorTextBestiaryInfoElement("A mysterious burning form which only appears at night, wreathed in brimstone fire. It has a twisted mind and misplaced pride in its abilities.") }); } @@ -156,9 +156,9 @@ namespace CalamityMod.NPCs.Calamitas npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, npcOffset, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - texture = ModContent.Request("CalamityMod/NPCs/Calamitas/CalamitasCloneGlow").Value; + texture = ModContent.Request("CalamityMod/NPCs/CalClone/CalamitasCloneGlow").Value; Color color = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { color = Color.CornflowerBlue; } @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.Calamitas public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); + npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); npcLoot.Add(ItemID.BrokenHeroSword); // Normal drops: Everything that would otherwise be in the bag @@ -217,26 +217,26 @@ namespace CalamityMod.NPCs.Calamitas normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); } - npcLoot.Add(ModContent.ItemType(), 10); + npcLoot.Add(ModContent.ItemType(), 10); // Relic npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCalamitas, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCalamitasClone, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() { CalamityGlobalNPC.SetNewBossJustDowned(NPC); - CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedCalamitas); + CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedCalamitasClone); // Abyss awakens after killing Calamitas string key = "Mods.CalamityMod.PlantBossText"; Color messageColor = Color.RoyalBlue; - if (!DownedBossSystem.downedCalamitas) + if (!DownedBossSystem.downedCalamitasClone) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) SoundEngine.PlaySound(CommonCalamitySounds.WyrmScreamSound, Main.player[Main.myPlayer].Center); @@ -244,8 +244,8 @@ namespace CalamityMod.NPCs.Calamitas CalamityUtils.DisplayLocalizedText(key, messageColor); } - // Mark Calamitas as dead - DownedBossSystem.downedCalamitas = true; + // Mark the Calamitas Clone as dead + DownedBossSystem.downedCalamitasClone = true; CalamityNetcode.SyncWorld(); } diff --git a/NPCs/Calamitas/CalamitasClone.png b/NPCs/CalClone/CalamitasClone.png similarity index 100% rename from NPCs/Calamitas/CalamitasClone.png rename to NPCs/CalClone/CalamitasClone.png diff --git a/NPCs/Calamitas/CalamitasCloneGlow.png b/NPCs/CalClone/CalamitasCloneGlow.png similarity index 100% rename from NPCs/Calamitas/CalamitasCloneGlow.png rename to NPCs/CalClone/CalamitasCloneGlow.png diff --git a/NPCs/Calamitas/CalamitasClone_Head_Boss.png b/NPCs/CalClone/CalamitasClone_Head_Boss.png similarity index 100% rename from NPCs/Calamitas/CalamitasClone_Head_Boss.png rename to NPCs/CalClone/CalamitasClone_Head_Boss.png diff --git a/NPCs/Calamitas/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs similarity index 99% rename from NPCs/Calamitas/Cataclysm.cs rename to NPCs/CalClone/Cataclysm.cs index 0dbee9e480..af14001c08 100644 --- a/NPCs/Calamitas/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -13,7 +13,7 @@ using Terraria.ID; using Terraria.ModLoader; using System.IO; -namespace CalamityMod.NPCs.Calamitas +namespace CalamityMod.NPCs.CalClone { [AutoloadBossHead] public class Cataclysm : ModNPC @@ -132,7 +132,7 @@ namespace CalamityMod.NPCs.Calamitas vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - texture2D15 = ModContent.Request("CalamityMod/NPCs/Calamitas/CataclysmGlow").Value; + texture2D15 = ModContent.Request("CalamityMod/NPCs/CalClone/CataclysmGlow").Value; Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); if (CalamityConfig.Instance.Afterimages) diff --git a/NPCs/Calamitas/Cataclysm.png b/NPCs/CalClone/Cataclysm.png similarity index 100% rename from NPCs/Calamitas/Cataclysm.png rename to NPCs/CalClone/Cataclysm.png diff --git a/NPCs/Calamitas/CataclysmGlow.png b/NPCs/CalClone/CataclysmGlow.png similarity index 100% rename from NPCs/Calamitas/CataclysmGlow.png rename to NPCs/CalClone/CataclysmGlow.png diff --git a/NPCs/Calamitas/Cataclysm_Head_Boss.png b/NPCs/CalClone/Cataclysm_Head_Boss.png similarity index 100% rename from NPCs/Calamitas/Cataclysm_Head_Boss.png rename to NPCs/CalClone/Cataclysm_Head_Boss.png diff --git a/NPCs/Calamitas/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs similarity index 99% rename from NPCs/Calamitas/Catastrophe.cs rename to NPCs/CalClone/Catastrophe.cs index 0d19e75495..68e5076599 100644 --- a/NPCs/Calamitas/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -13,7 +13,7 @@ using Terraria.ID; using Terraria.ModLoader; using System.IO; -namespace CalamityMod.NPCs.Calamitas +namespace CalamityMod.NPCs.CalClone { [AutoloadBossHead] public class Catastrophe : ModNPC @@ -132,7 +132,7 @@ namespace CalamityMod.NPCs.Calamitas vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); - texture2D15 = ModContent.Request("CalamityMod/NPCs/Calamitas/CatastropheGlow").Value; + texture2D15 = ModContent.Request("CalamityMod/NPCs/CalClone/CatastropheGlow").Value; Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); if (CalamityConfig.Instance.Afterimages) diff --git a/NPCs/Calamitas/Catastrophe.png b/NPCs/CalClone/Catastrophe.png similarity index 100% rename from NPCs/Calamitas/Catastrophe.png rename to NPCs/CalClone/Catastrophe.png diff --git a/NPCs/Calamitas/CatastropheGlow.png b/NPCs/CalClone/CatastropheGlow.png similarity index 100% rename from NPCs/Calamitas/CatastropheGlow.png rename to NPCs/CalClone/CatastropheGlow.png diff --git a/NPCs/Calamitas/Catastrophe_Head_Boss.png b/NPCs/CalClone/Catastrophe_Head_Boss.png similarity index 100% rename from NPCs/Calamitas/Catastrophe_Head_Boss.png rename to NPCs/CalClone/Catastrophe_Head_Boss.png diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/CalClone/SoulSeeker.cs similarity index 99% rename from NPCs/Calamitas/SoulSeeker.cs rename to NPCs/CalClone/SoulSeeker.cs index 0eb13b4e9c..6bafe656b1 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/CalClone/SoulSeeker.cs @@ -11,7 +11,7 @@ using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.Calamitas +namespace CalamityMod.NPCs.CalClone { public class SoulSeeker : ModNPC { @@ -209,7 +209,7 @@ namespace CalamityMod.NPCs.Calamitas drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - texture = ModContent.Request("CalamityMod/NPCs/Calamitas/SoulSeekerGlow").Value; + texture = ModContent.Request("CalamityMod/NPCs/CalClone/SoulSeekerGlow").Value; Color glow = Color.Lerp(Color.White, Color.Red, colorLerpAmt); if (CalamityConfig.Instance.Afterimages) diff --git a/NPCs/Calamitas/SoulSeeker.png b/NPCs/CalClone/SoulSeeker.png similarity index 100% rename from NPCs/Calamitas/SoulSeeker.png rename to NPCs/CalClone/SoulSeeker.png diff --git a/NPCs/Calamitas/SoulSeekerGlow.png b/NPCs/CalClone/SoulSeekerGlow.png similarity index 100% rename from NPCs/Calamitas/SoulSeekerGlow.png rename to NPCs/CalClone/SoulSeekerGlow.png diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 38464a7168..b29e970091 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -9,7 +9,7 @@ using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crags; using CalamityMod.NPCs.Leviathan; @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs bool revenge = CalamityWorld.revenge || bossRush; bool death = CalamityWorld.death || bossRush; - bool getFuckedAI = CalamityMod.Instance.legendaryMode; + bool getFuckedAI = CalamityWorld.getFixedBoi; if (head) CalamityGlobalNPC.aquaticScourge = npc.whoAmI; @@ -747,7 +747,7 @@ namespace CalamityMod.NPCs } } - if (CalamityMod.Instance.legendaryMode) // in gfb, Brimmy channels the power of the other elementals. + if (CalamityWorld.getFixedBoi) // in gfb, Brimmy channels the power of the other elementals. { int newMode; if (lifeRatio <= 0.8f && lifeRatio > 0.6f) @@ -896,7 +896,7 @@ namespace CalamityMod.NPCs if (npc.alpha >= 255) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { SoundEngine.PlaySound(SoundID.Item68, npc.Center); int type = ModContent.ProjectileType(); @@ -1181,7 +1181,7 @@ namespace CalamityMod.NPCs Projectile.NewProjectile(npc.GetSource_FromAI(), source, laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); if (Main.getGoodWorld) Projectile.NewProjectile(npc.GetSource_FromAI(), source, -laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { Projectile.NewProjectile(npc.GetSource_FromAI(), source, new Vector2(-laserVelocity2.X, laserVelocity2.Y), type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); Projectile.NewProjectile(npc.GetSource_FromAI(), source, new Vector2(laserVelocity2.X, -laserVelocity2.Y), type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); @@ -1222,7 +1222,7 @@ namespace CalamityMod.NPCs if (Main.getGoodWorld) Projectile.NewProjectile(npc.GetSource_FromAI(), source, -laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { Projectile.NewProjectile(npc.GetSource_FromAI(), source, new Vector2(-laserVelocity.X, laserVelocity.Y), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); Projectile.NewProjectile(npc.GetSource_FromAI(), source, new Vector2(laserVelocity.X, -laserVelocity.Y), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); @@ -1239,7 +1239,7 @@ namespace CalamityMod.NPCs Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, npc.localAI[0], npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); if (Main.getGoodWorld) Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, -npc.localAI[0], -npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, -npc.localAI[0], npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, npc.localAI[0], -npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); @@ -1579,7 +1579,7 @@ namespace CalamityMod.NPCs { int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { type = ModContent.ProjectileType(); } @@ -2129,7 +2129,7 @@ namespace CalamityMod.NPCs npc.velocity.Y = num872 * num873; npc.ai[1] = 2f; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { SoundEngine.PlaySound(SupremeCalamitas.SupremeCalamitas.BrimstoneShotSound, npc.Center); @@ -2431,7 +2431,7 @@ namespace CalamityMod.NPCs npc.velocity.Y = num872 * num873; npc.ai[1] = 2f; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { SoundEngine.PlaySound(SupremeCalamitas.SupremeCalamitas.BrimstoneShotSound, npc.Center); @@ -2618,7 +2618,7 @@ namespace CalamityMod.NPCs bool geldonPhase1 = lifeRatio > 0.6f && lifeRatio <= 0.7f; bool geldonPhase2 = lifeRatio <= 0.1f; - if (CalamityMod.Instance.legendaryMode && (geldonPhase1 || geldonPhase2)) + if (CalamityWorld.getFixedBoi && (geldonPhase1 || geldonPhase2)) { AstrumAureus.AstrumAureus astrumAureus = npc.ModNPC(); astrumAureus.slimeProjCounter++; @@ -3004,10 +3004,10 @@ namespace CalamityMod.NPCs if (npc.velocity.Y == 0f) { // Play stomp sound. Gotta specify the filepath to avoid confusion between the namespace and npc - SoundStyle soundToPlay = CalamityMod.Instance.legendaryMode ? NPCs.ExoMechs.Ares.AresGaussNuke.NukeExplosionSound : NPCs.AstrumAureus.AstrumAureus.StompSound; - SoundEngine.PlaySound(soundToPlay, npc.Center); + SoundStyle soundToPlay = CalamityWorld.getFixedBoi ? NPCs.ExoMechs.Ares.AresGaussNuke.NukeExplosionSound : NPCs.AstrumAureus.AstrumAureus.StompSound; + SoundEngine.PlaySound(soundToPlay, npc.position); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { float screenShakePower = 16 * Utils.GetLerpValue(1300f, 0f, npc.Distance(Main.LocalPlayer.Center), true); if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) @@ -3054,7 +3054,7 @@ namespace CalamityMod.NPCs SoundEngine.PlaySound(SoundID.Item33, npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); @@ -3473,7 +3473,7 @@ namespace CalamityMod.NPCs int phase1Length = death ? 80 : revenge ? 70 : expertMode ? 60 : 50; int phase2Length = phase1Length / 2; int gfbLength = phase1Length / 10; - int maxLength = CalamityMod.Instance.legendaryMode && doubleWormPhase ? gfbLength : doubleWormPhase ? phase2Length : phase1Length; + int maxLength = CalamityWorld.getFixedBoi && doubleWormPhase ? gfbLength : doubleWormPhase ? phase2Length : phase1Length; // Split into two worms if (head) @@ -3558,7 +3558,7 @@ namespace CalamityMod.NPCs // Do not spawn worms client side. The server handles this. if (Main.netMode != NetmodeID.MultiplayerClient) { - int wormamt = CalamityMod.Instance.legendaryMode ? 5 : 1; + int wormamt = CalamityWorld.getFixedBoi ? 5 : 1; for (int i = 0; i < wormamt; i++) { // Now that the original worm doesn't exist, startCount can be zero. @@ -3612,7 +3612,7 @@ namespace CalamityMod.NPCs } } - if (CalamityMod.Instance.legendaryMode && calamityGlobalNPC.newAI[1] < 10f) // desync the deuses + if (CalamityWorld.getFixedBoi && calamityGlobalNPC.newAI[1] < 10f) // desync the deuses { float pushForce = 0.25f; for (int k = 0; k < Main.maxNPCs; k++) @@ -3661,7 +3661,7 @@ namespace CalamityMod.NPCs npc.realLife = (int)npc.ai[2]; // Emit light - if (!CalamityMod.Instance.legendaryMode) + if (!CalamityWorld.getFixedBoi) Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); // Dust and alpha effects @@ -4869,10 +4869,10 @@ namespace CalamityMod.NPCs // Sound if (calamityGlobalNPC.newAI[1] == newPhaseTimer - 60f) { - float squawkpitch = CalamityMod.Instance.legendaryMode ? 1.3f : 0.25f; - SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, npc.Center); + float squawkpitch = CalamityWorld.getFixedBoi ? 1.3f : 0.25f; + SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, npc.position); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { int spacing = 20; int amt = 5; @@ -4907,10 +4907,10 @@ namespace CalamityMod.NPCs // Sound if (calamityGlobalNPC.newAI[0] == newPhaseTimer - 60f) { - float squawkpitch = CalamityMod.Instance.legendaryMode ? 1.3f : 0.25f; - SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, npc.Center); + float squawkpitch = CalamityWorld.getFixedBoi ? 1.3f : 0.25f; + SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, npc.position); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { int spacing = 20; int amt = 3; @@ -5404,10 +5404,10 @@ namespace CalamityMod.NPCs // Sound if (npc.ai[1] == birbSpawnPhaseTimer - 60f) { - float squawkpitch = CalamityMod.Instance.legendaryMode ? 1.3f : 0.25f; - SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, npc.Center); + float squawkpitch = CalamityWorld.getFixedBoi ? 1.3f : 0.25f; + SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, npc.position); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { int spacing = 30; int amt = 3; @@ -5471,7 +5471,7 @@ namespace CalamityMod.NPCs npc.netUpdate = true; } - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { int spacing = 30; int amt = 3; @@ -5577,7 +5577,7 @@ namespace CalamityMod.NPCs value44.Normalize(); value44 *= scaleFactor20; npc.velocity = (npc.velocity * (num1377 - 1f) + value44) / num1377; - if (Main.getGoodWorld && !CalamityMod.Instance.legendaryMode) + if (Main.getGoodWorld && !CalamityWorld.getFixedBoi) npc.velocity *= 1.15f; } else if (npc.velocity.Length() > 2f) @@ -5627,7 +5627,7 @@ namespace CalamityMod.NPCs value45.Normalize(); value45 *= scaleFactor21; npc.velocity = (npc.velocity * (num1378 - 1f) + value45) / num1378; - if (Main.getGoodWorld && !CalamityMod.Instance.legendaryMode) + if (Main.getGoodWorld && !CalamityWorld.getFixedBoi) npc.velocity *= 1.15f; npc.netSpam = 5; @@ -5656,7 +5656,7 @@ namespace CalamityMod.NPCs vector242.Normalize(); vector242 *= scaleFactor22; npc.velocity = (npc.velocity * (num1379 - 1f) + vector242) / num1379; - if (Main.getGoodWorld && !CalamityMod.Instance.legendaryMode) + if (Main.getGoodWorld && !CalamityWorld.getFixedBoi) npc.velocity *= 1.15f; if (npc.velocity.X < 0f) @@ -5672,7 +5672,7 @@ namespace CalamityMod.NPCs if (npc.ai[1] > 10f) { npc.velocity = vector242; - if (Main.getGoodWorld && !CalamityMod.Instance.legendaryMode) + if (Main.getGoodWorld && !CalamityWorld.getFixedBoi) npc.velocity *= 1.15f; if (npc.velocity.X < 0f) @@ -5850,7 +5850,7 @@ namespace CalamityMod.NPCs int num13 = maxToothBallBelches * toothBallSpinPhaseDivisor; float spinTime = num13 / 2f; float toothBallSpinToothBallVelocity = bossRush ? 14f : death ? 9.5f : 9f; - float scaleFactor4 = CalamityMod.Instance.legendaryMode ? 44f : 22f; + float scaleFactor4 = CalamityWorld.getFixedBoi ? 44f : 22f; float num15 = MathHelper.TwoPi / spinTime; int num16 = 75; @@ -5904,7 +5904,7 @@ namespace CalamityMod.NPCs if (calamityGlobalNPC.newAI[0] % 60f == 0f) SoundEngine.PlaySound(OldDuke.OldDuke.HuffSound, player.Center); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { float screenShakePower = 10 * Utils.GetLerpValue(800f, 0f, npc.Distance(Main.LocalPlayer.Center), true); if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) @@ -7437,7 +7437,7 @@ namespace CalamityMod.NPCs { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, -1f, 0, default, 1f); } - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { float screenShakePower = 2 * Utils.GetLerpValue(1300f, 0f, npc.Distance(Main.LocalPlayer.Center), true); if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index ea125122d2..4454d1af93 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -15,7 +15,7 @@ using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Crags; @@ -1310,7 +1310,7 @@ namespace CalamityMod.NPCs else if (CalamityLists.DestroyerIDs.Contains(npc.type)) { npc.lifeMax = (int)(npc.lifeMax * 1.25); - npc.scale *= CalamityMod.Instance.legendaryMode ? 2.5f : CalamityWorld.death ? 2f : 1.5f; + npc.scale *= CalamityWorld.getFixedBoi ? 2.5f : CalamityWorld.death ? 2f : 1.5f; npc.npcSlots = 10f; } else if (npc.type == NPCID.Probe) @@ -1318,7 +1318,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.death) npc.lifeMax = (int)(npc.lifeMax * 2.0); - npc.scale *= CalamityMod.Instance.legendaryMode ? 2f : CalamityWorld.death ? 1.5f : 1.2f; + npc.scale *= CalamityWorld.getFixedBoi ? 2f : CalamityWorld.death ? 1.5f : 1.2f; } else if (npc.type == NPCID.SkeletronPrime) { @@ -5822,7 +5822,7 @@ namespace CalamityMod.NPCs } } - if (CalamityMod.Instance.legendaryMode && NPC.AnyNPCs(NPCType())) + if (CalamityWorld.getFixedBoi && NPC.AnyNPCs(NPCType())) { Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix); @@ -6087,7 +6087,7 @@ namespace CalamityMod.NPCs } else if (type == NPCType()) { - return DownedBossSystem.downedCalamitas; + return DownedBossSystem.downedCalamitasClone; } else if (type == NPCType() || type == NPCType()) { @@ -6155,7 +6155,7 @@ namespace CalamityMod.NPCs } else if (type == NPCType()) { - return DownedBossSystem.downedSCal; + return DownedBossSystem.downedCalamitas; } else if (type == NPCType()) { diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index e15238e448..c4f07ce352 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1964,7 +1964,7 @@ namespace CalamityMod.NPCs } bool normalShark = npc.type == NPCID.SandShark || npc.type == NPCID.SandsharkHallow || npc.type == NPCID.SandsharkCorrupt || npc.type == NPCID.SandsharkCrimson; - if (NPC.downedPlantBoss && (normalShark || (npc.type == ModContent.NPCType() && CalamityMod.Instance.legendaryMode)) && !NPC.AnyNPCs(ModContent.NPCType())) + if (NPC.downedPlantBoss && (normalShark || (npc.type == ModContent.NPCType() && CalamityWorld.getFixedBoi)) && !NPC.AnyNPCs(ModContent.NPCType())) { CalamityMod.sharkKillCount++; if (CalamityMod.sharkKillCount == 4) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 976f6173f6..4825292c84 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1515,7 +1515,7 @@ namespace CalamityMod.NPCs damageMult += 0.6f; defense += 20; } - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) { damageMult += 0.6f; defense += 20; diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 62fcbb7340..0f9ff97990 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { NPC.soundDelay = 8; float pitchVar = 0; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { pitchVar = Main.rand.Next(-60, 41) * 0.01f; } diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 70ca667fe9..b6d5a345f6 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -276,8 +276,8 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void OnHitPlayer(Player player, int damage, bool crit) { - int debufftype = CalamityMod.Instance.legendaryMode ? BuffID.Obstructed : BuffID.VortexDebuff; - int duration = CalamityMod.Instance.legendaryMode ? 30 : 60; + int debufftype = CalamityWorld.getFixedBoi ? BuffID.Obstructed : BuffID.VortexDebuff; + int duration = CalamityWorld.getFixedBoi ? 30 : 60; if (damage > 0) player.AddBuff(debufftype, duration, true); } diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index 1818866f2e..750b101ef3 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -101,7 +101,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.rotation = NPC.velocity.X * 0.1f; } - public override Color? GetAlpha(Color drawColor) => CalamityMod.Instance.legendaryMode ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, NPC.alpha) : new Color(255, 255, 255, NPC.alpha); + public override Color? GetAlpha(Color drawColor) => CalamityWorld.getFixedBoi ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, NPC.alpha) : new Color(255, 255, 255, NPC.alpha); public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { @@ -111,10 +111,10 @@ namespace CalamityMod.NPCs.Crabulon Texture2D texture = TextureAssets.Npc[NPC.type].Value; Texture2D glow = ModContent.Request("CalamityMod/NPCs/Crabulon/CrabShroomGlow").Value; - Color colorToShift = CalamityMod.Instance.legendaryMode ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Color.Cyan; + Color colorToShift = CalamityWorld.getFixedBoi ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Color.Cyan; Color glowColor = Color.Lerp(Color.White, colorToShift, 0.5f); - int ClonesAroundShroom = CalamityMod.Instance.legendaryMode ? 4 : 0; + int ClonesAroundShroom = CalamityWorld.getFixedBoi ? 4 : 0; for (int c = 0; c < 1 + ClonesAroundShroom; c++) { Vector2 drawOrigin = new Vector2(texture.Width / 2, texture.Height / Main.npcFrameCount[NPC.type] / 2); diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index bcf520f78d..e9e724f953 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -538,7 +538,7 @@ namespace CalamityMod.NPCs.Crabulon int num624 = Dust.NewDust(new Vector2(NPC.position.X - 20f, NPC.position.Y + NPC.height), NPC.width + 20, 4, 56, 0f, 0f, 100, default, 1.5f); Main.dust[num624].velocity *= 0.2f; } - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { int x = num622 / 16; int y = (int)(NPC.position.Y + NPC.height) / 16; @@ -767,7 +767,7 @@ namespace CalamityMod.NPCs.Crabulon } } - public override Color? GetAlpha(Color drawColor) => CalamityMod.Instance.legendaryMode ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, NPC.alpha) : new Color(255, 255, 255, NPC.alpha); + public override Color? GetAlpha(Color drawColor) => CalamityWorld.getFixedBoi ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, NPC.alpha) : new Color(255, 255, 255, NPC.alpha); public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { @@ -781,10 +781,10 @@ namespace CalamityMod.NPCs.Crabulon Texture2D glowWalk = ModContent.Request("CalamityMod/NPCs/Crabulon/CrabulonAltGlow").Value; Texture2D textureAttack = ModContent.Request("CalamityMod/NPCs/Crabulon/CrabulonAttack").Value; Texture2D glowAttack = ModContent.Request("CalamityMod/NPCs/Crabulon/CrabulonAttackGlow").Value; - Color colorToShift = CalamityMod.Instance.legendaryMode ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Color.Cyan; + Color colorToShift = CalamityWorld.getFixedBoi ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Color.Cyan; Color glowColor = Color.Lerp(Color.White, colorToShift, 0.5f); - int ClonesOnEachSide = CalamityMod.Instance.legendaryMode ? 2 : 0; + int ClonesOnEachSide = CalamityWorld.getFixedBoi ? 2 : 0; for (int c = 0 - ClonesOnEachSide; c < 1 + ClonesOnEachSide; c++) { Vector2 drawOrigin = new Vector2(textureIdle.Width / 2, textureIdle.Height / Main.npcFrameCount[NPC.type] / 2); @@ -866,7 +866,7 @@ namespace CalamityMod.NPCs.Crabulon DownedBossSystem.downedCrabulon = true; CalamityNetcode.SyncWorld(); - if (CalamityMod.Instance.legendaryMode && Main.netMode != NetmodeID.MultiplayerClient) + if (CalamityWorld.getFixedBoi && Main.netMode != NetmodeID.MultiplayerClient) { for (int i = 0; i < Main.rand.Next(10, 23); i++) { diff --git a/NPCs/Crags/CultistAssassin.cs b/NPCs/Crags/CultistAssassin.cs index 23541a64ff..2f22f8b54a 100644 --- a/NPCs/Crags/CultistAssassin.cs +++ b/NPCs/Crags/CultistAssassin.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.World; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; @@ -82,7 +83,7 @@ namespace CalamityMod.NPCs.Crags } if (Main.netMode != NetmodeID.Server) { - int count = CalamityMod.Instance.legendaryMode ? 20 : 1; // remember that old oversight in the draedon update? + int count = CalamityWorld.getFixedBoi ? 20 : 1; // remember that old oversight in the draedon update? for (int g = 0; g < count; g++) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CultistAssassin").Type, NPC.scale); diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index f07c9ab374..d5db8770f7 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -102,7 +102,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.getGoodWorld) NPC.scale *= 0.8f; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Cryogen public override void BossHeadSlot(ref int index) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) index = pyroIconIndex; else index = cryoIconIndex; @@ -212,14 +212,14 @@ namespace CalamityMod.NPCs.Cryogen bool phase7 = lifeRatio < (death ? 0.25f : 0.15f) && revenge; // Projectile and sound variables - int iceBlast = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int iceBomb = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int iceRain = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int dustType = CalamityMod.Instance.legendaryMode ? 235 : 67; + int iceBlast = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int iceBomb = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int iceRain = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int dustType = CalamityWorld.getFixedBoi ? 235 : 67; - SoundStyle frostSound = CalamityMod.Instance.legendaryMode ? SoundID.Item20 : SoundID.Item28; - NPC.HitSound = CalamityMod.Instance.legendaryMode ? SoundID.NPCHit41 : HitSound; - NPC.DeathSound = CalamityMod.Instance.legendaryMode ? SoundID.NPCDeath14 : DeathSound; + SoundStyle frostSound = CalamityWorld.getFixedBoi ? SoundID.Item20 : SoundID.Item28; + NPC.HitSound = CalamityWorld.getFixedBoi ? SoundID.NPCHit41 : HitSound; + NPC.DeathSound = CalamityWorld.getFixedBoi ? SoundID.NPCDeath14 : DeathSound; // Reset damage NPC.damage = NPC.defDamage; @@ -890,13 +890,13 @@ namespace CalamityMod.NPCs.Cryogen int chance = 100; if (DateTime.Now.Month == 4 && DateTime.Now.Day == 1) chance = 20; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) chance = 1; if (Main.rand.NextBool(chance)) { - string key = CalamityMod.Instance.legendaryMode ? "Mods.CalamityMod.PyrogenBossText" : "Mods.CalamityMod.CryogenBossText"; - Color messageColor = CalamityMod.Instance.legendaryMode ? Color.Orange : Color.Cyan; + string key = CalamityWorld.getFixedBoi ? "Mods.CalamityMod.PyrogenBossText" : "Mods.CalamityMod.CryogenBossText"; + Color messageColor = CalamityWorld.getFixedBoi ? Color.Orange : Color.Cyan; CalamityUtils.DisplayLocalizedText(key, messageColor); } } @@ -924,7 +924,7 @@ namespace CalamityMod.NPCs.Cryogen float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = velocity - (velocity * (phase7 ? 0.25f : 0.5f) * i); float velocityX = 0f; - float ai = CalamityMod.Instance.legendaryMode ? 2f : NPC.target; + float ai = CalamityWorld.getFixedBoi ? 2f : NPC.target; if (i > 0) { double angleA = radians * (phase7 ? 0.25 : 0.5) * (totalSpreads - i); @@ -1106,9 +1106,9 @@ namespace CalamityMod.NPCs.Cryogen private void HandlePhaseTransition(int newPhase) { - SoundStyle sound = CalamityMod.Instance.legendaryMode ? SoundID.NPCDeath14 : TransitionSound; + SoundStyle sound = CalamityWorld.getFixedBoi ? SoundID.NPCDeath14 : TransitionSound; SoundEngine.PlaySound(sound, NPC.Center); - if (Main.netMode != NetmodeID.Server && !CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.Server && !CalamityWorld.getFixedBoi) { int chipGoreAmount = newPhase >= 5 ? 3 : newPhase >= 3 ? 2 : 1; for (int i = 1; i < chipGoreAmount; i++) @@ -1144,7 +1144,7 @@ namespace CalamityMod.NPCs.Cryogen public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { float compactness = NPC.width * 0.6f; if (compactness < 10f) @@ -1177,7 +1177,7 @@ namespace CalamityMod.NPCs.Cryogen Vector2 drawPos = NPC.Center - screenPos; drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); - Color overlay = CalamityMod.Instance.legendaryMode ? Color.Red : drawColor; + Color overlay = CalamityWorld.getFixedBoi ? Color.Red : drawColor; spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(overlay), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); return false; @@ -1191,7 +1191,7 @@ namespace CalamityMod.NPCs.Cryogen public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Pyrogen"; } @@ -1199,7 +1199,7 @@ namespace CalamityMod.NPCs.Cryogen public override void HitEffect(int hitDirection, double damage) { - int dusttype = CalamityMod.Instance.legendaryMode ? 235 : 67; + int dusttype = CalamityWorld.getFixedBoi ? 235 : 67; for (int k = 0; k < 3; k++) { Dust.NewDust(NPC.position, NPC.width, NPC.height, dusttype, hitDirection, -1f, 0, default, 1f); @@ -1224,7 +1224,7 @@ namespace CalamityMod.NPCs.Cryogen num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server && !CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.Server && !CalamityWorld.getFixedBoi) { float randomSpread = Main.rand.Next(-200, 201) / 100f; for (int i = 1; i < 4; i++) @@ -1334,7 +1334,7 @@ namespace CalamityMod.NPCs.Cryogen { if (damage > 0) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { player.AddBuff(ModContent.BuffType(), 240, true); player.AddBuff(ModContent.BuffType(), 120, true); diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index 3276436d6d..797b1d6a37 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Cryogen NPC.alpha = 255; NPC.HitSound = Cryogen.HitSound; NPC.DeathSound = BreakSound; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; @@ -58,8 +58,8 @@ namespace CalamityMod.NPCs.Cryogen public override void AI() { - NPC.HitSound = CalamityMod.Instance.legendaryMode ? SoundID.NPCHit41 : Cryogen.HitSound; - NPC.DeathSound = CalamityMod.Instance.legendaryMode ? SoundID.NPCDeath14 : BreakSound; + NPC.HitSound = CalamityWorld.getFixedBoi ? SoundID.NPCHit41 : Cryogen.HitSound; + NPC.DeathSound = CalamityWorld.getFixedBoi ? SoundID.NPCDeath14 : BreakSound; NPC.alpha -= 3; if (NPC.alpha < 0) @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.Cryogen { if (damage > 0) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { player.AddBuff(ModContent.BuffType(), 240, true); player.AddBuff(ModContent.BuffType(), 120, true); @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.Cryogen Vector2 drawPos = NPC.Center - screenPos; drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); - Color overlay = CalamityMod.Instance.legendaryMode ? Color.Red : drawColor; + Color overlay = CalamityWorld.getFixedBoi ? Color.Red : drawColor; spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(overlay), NPC.rotation, origin, NPC.scale, SpriteEffects.None, 0f); return false; } @@ -146,7 +146,7 @@ namespace CalamityMod.NPCs.Cryogen public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Pyrogen's Shield"; } @@ -154,7 +154,7 @@ namespace CalamityMod.NPCs.Cryogen public override void HitEffect(int hitDirection, double damage) { - int dusttype = CalamityMod.Instance.legendaryMode ? 235 : 67; + int dusttype = CalamityWorld.getFixedBoi ? 235 : 67; for (int k = 0; k < 3; k++) { Dust.NewDust(NPC.position, NPC.width, NPC.height, dusttype, hitDirection, -1f, 0, default, 1f); @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.Cryogen Main.dust[num624].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server && !CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.Server && !CalamityWorld.getFixedBoi) { int totalGores = 16; double radians = MathHelper.TwoPi / totalGores; diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index 00e26533fa..c42f8b7ded 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -1,4 +1,5 @@ using CalamityMod.Events; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -168,7 +169,7 @@ namespace CalamityMod.NPCs.DesertScourge public override Color? GetAlpha(Color drawColor) { Color lightColor = Color.Orange * drawColor.A; - Color newColor = CalamityMod.Instance.legendaryMode ? lightColor : new Color(255, 255, 255, drawColor.A); + Color newColor = CalamityWorld.getFixedBoi ? lightColor : new Color(255, 255, 255, drawColor.A); return newColor * NPC.Opacity; } } diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index 01b3838f8f..a40a428c9d 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -1,11 +1,12 @@ -using CalamityMod.Events; +using System; +using CalamityMod.Events; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.NPCs.DesertScourge { @@ -62,7 +63,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) NPC.scale *= 2; } @@ -454,7 +455,7 @@ namespace CalamityMod.NPCs.DesertScourge public override Color? GetAlpha(Color drawColor) { Color lightColor = Color.Orange * drawColor.A; - Color newColor = CalamityMod.Instance.legendaryMode ? lightColor : new Color(255, 255, 255, drawColor.A); + Color newColor = CalamityWorld.getFixedBoi ? lightColor : new Color(255, 255, 255, drawColor.A); return newColor * NPC.Opacity; } } diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index d7a6e32976..17c2def914 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -1,4 +1,5 @@ using CalamityMod.Events; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -165,7 +166,7 @@ namespace CalamityMod.NPCs.DesertScourge public override Color? GetAlpha(Color drawColor) { Color lightColor = Color.Orange * drawColor.A; - Color newColor = CalamityMod.Instance.legendaryMode ? lightColor : new Color(255, 255, 255, drawColor.A); + Color newColor = CalamityWorld.getFixedBoi ? lightColor : new Color(255, 255, 255, drawColor.A); return newColor * NPC.Opacity; } } diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index e4afab37ec..4f9846af03 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -172,7 +172,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) { // Sometimes "Deflect" projectiles in gfb into water blasts. - if (Main.rand.NextBool(20) && CalamityMod.Instance.legendaryMode) + if (Main.rand.NextBool(20) && CalamityWorld.getFixedBoi) { if (Main.netMode != NetmodeID.Server) { @@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.DesertScourge public override Color? GetAlpha(Color drawColor) { Color lightColor = Color.MediumBlue * drawColor.A; - Color newColor = CalamityMod.Instance.legendaryMode ? lightColor : new Color(255, 255, 255, drawColor.A); + Color newColor = CalamityWorld.getFixedBoi ? lightColor : new Color(255, 255, 255, drawColor.A); return newColor * NPC.Opacity; } } diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 4c3e40835f..d3dcb811db 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.DesertScourge if (Main.getGoodWorld) NPC.scale *= 0.4f; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) NPC.scale *= 4f; @@ -218,7 +218,7 @@ namespace CalamityMod.NPCs.DesertScourge if (Main.netMode != NetmodeID.MultiplayerClient) { // become moist if in an aquatic biome - if (CalamityMod.Instance.legendaryMode && (player.ZoneBeach || player.Calamity().ZoneAbyss || player.Calamity().ZoneSunkenSea || player.Calamity().ZoneSulphur) && NPC.CountNPCS(ModContent.NPCType()) < 1) + if (CalamityWorld.getFixedBoi && (player.ZoneBeach || player.Calamity().ZoneAbyss || player.Calamity().ZoneSunkenSea || player.Calamity().ZoneSulphur) && NPC.CountNPCS(ModContent.NPCType()) < 1) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType()); NPC.active = false; @@ -280,7 +280,7 @@ namespace CalamityMod.NPCs.DesertScourge { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 3f, perturbedSpeed, type2, damage, 0f, Main.myPlayer); } } @@ -797,7 +797,7 @@ namespace CalamityMod.NPCs.DesertScourge public override Color? GetAlpha(Color drawColor) { Color lightColor = Color.MediumBlue * drawColor.A; - Color newColor = CalamityMod.Instance.legendaryMode ? lightColor : new Color(255, 255, 255, drawColor.A); + Color newColor = CalamityWorld.getFixedBoi ? lightColor : new Color(255, 255, 255, drawColor.A); return newColor * NPC.Opacity; } } diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index e619033836..6e59d0d3d3 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.DesertScourge public override Color? GetAlpha(Color drawColor) { Color lightColor = Color.MediumBlue * drawColor.A; - Color newColor = CalamityMod.Instance.legendaryMode ? lightColor : new Color(255, 255, 255, drawColor.A); + Color newColor = CalamityWorld.getFixedBoi ? lightColor : new Color(255, 255, 255, drawColor.A); return newColor * NPC.Opacity; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index deb9f37698..15d3810cb6 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.height = 56; NPC.defense = 70; CalamityGlobalNPC global = NPC.Calamity(); - if (!CalamityMod.Instance.legendaryMode) + if (!CalamityWorld.getFixedBoi) { global.DR = 0.925f; global.unbreakableDR = true; @@ -432,7 +432,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { // viable???, done here since it's conditional - if (CalamityMod.Instance.legendaryMode && projectile.type == ModContent.ProjectileType()) + if (CalamityWorld.getFixedBoi && projectile.type == ModContent.ProjectileType()) { damage *= 40; } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 076a52be5b..3c9226501a 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -370,7 +370,7 @@ namespace CalamityMod.NPCs.DevourerofGods bool phase7 = lifeRatio < 0.15f; // Sound pitch - extrapitch = CalamityMod.Instance.legendaryMode ? 0.3f : 0f; + extrapitch = CalamityWorld.getFixedBoi ? 0.3f : 0f; // Velocity variables float fallSpeed = bossRush ? 19f : death ? 17.5f : 16f; @@ -1454,7 +1454,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (!tail && NPC.ai[0] == 0f) { int Previous = NPC.whoAmI; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { maxLength = 2; minLength = 1; @@ -2466,7 +2466,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { // viable???, done here since it's conditional - if (CalamityMod.Instance.legendaryMode && projectile.type == ModContent.ProjectileType()) + if (CalamityWorld.getFixedBoi && projectile.type == ModContent.ProjectileType()) { damage *= 40; } diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index e01750144e..89776ad721 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -1,18 +1,18 @@ -using CalamityMod.Buffs.DamageOverTime; +using System.IO; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Projectiles.Melee.Yoyos; +using CalamityMod.Sounds; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; -using Terraria.Audio; -using CalamityMod.Sounds; namespace CalamityMod.NPCs.DevourerofGods { @@ -366,7 +366,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.soundDelay == 0) { NPC.soundDelay = 8; - float extrapitch = CalamityMod.Instance.legendaryMode ? 0.3f : 0f; + float extrapitch = CalamityWorld.getFixedBoi ? 0.3f : 0f; SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound with { Pitch = CommonCalamitySounds.OtherwordlyHitSound.Pitch + extrapitch }, NPC.Center); } if (NPC.life <= 0) @@ -430,7 +430,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { // viable???, done here since it's conditional - if (CalamityMod.Instance.legendaryMode && projectile.type == ModContent.ProjectileType()) + if (CalamityWorld.getFixedBoi && projectile.type == ModContent.ProjectileType()) { damage *= 40; } diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 7c1db7b035..2d114e6201 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1199,7 +1199,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.netSpam -= 5; // Plasma bolts on charge - if (Main.netMode != NetmodeID.MultiplayerClient && !(CalamityMod.Instance.legendaryMode && !exoMechdusa)) // I'm not that evil + if (Main.netMode != NetmodeID.MultiplayerClient && !(CalamityWorld.getFixedBoi && !exoMechdusa)) // I'm not that evil { int totalProjectiles = bossRush ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; @@ -1287,7 +1287,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Reset phase and variables if (calamityGlobalNPC.newAI[2] >= maxCharges - 1) { - if (CalamityMod.Instance.legendaryMode && !exoMechdusa) + if (CalamityWorld.getFixedBoi && !exoMechdusa) { pickNewLocation = NPC.localAI[2] == 0f; calamityGlobalNPC.newAI[3] = 0f; diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index c5ce3826c9..d6bde7bf84 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -954,7 +954,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (calamityGlobalNPC.newAI[2] >= deathrayTelegraphDuration + deathrayDuration) { - if (!CalamityMod.Instance.legendaryMode || exoMechdusa) + if (!CalamityWorld.getFixedBoi || exoMechdusa) { AIState = (float)Phase.Normal; calamityGlobalNPC.newAI[2] = 0f; @@ -1536,7 +1536,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Cynosure: If SCal has been defeated and this is the first kill of the Exo Mechs, drop the special lore item mainDrops.Add(ItemDropRule.ByCondition( DropHelper.If( - () => !DownedBossSystem.downedExoMechs && DownedBossSystem.downedSCal, + () => !DownedBossSystem.downedExoMechs && DownedBossSystem.downedCalamitas, desc: DropHelper.CynosureText), ModContent.ItemType() )); @@ -1545,7 +1545,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares npcLoot.Add(ItemDropRule.BossBagByCondition(DropHelper.If(CanDropLoot), ModContent.ItemType())); // Legendary seed soup - mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(info => info.npc.type == ModContent.NPCType() && info.npc.ModNPC().exoMechdusa), ModContent.ItemType()), hideLootReport: true); + //mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(info => info.npc.type == ModContent.NPCType() && info.npc.ModNPC().exoMechdusa), ModContent.ItemType()), hideLootReport: true); // All other drops are contained in the bag, so they only drop directly on Normal if (!Main.expertMode) diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index d54c2494a7..f3128759e8 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -1086,7 +1086,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Reset phase and variables if (calamityGlobalNPC.newAI[2] >= deathrayTelegraphDuration + deathrayDuration) { - if (CalamityMod.Instance.legendaryMode && !exoMechdusa) + if (CalamityWorld.getFixedBoi && !exoMechdusa) { calamityGlobalNPC.newAI[3] = 0f; AIState = (float)Phase.Deathray; diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index b35b6a6d7a..605e95691d 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -206,7 +206,7 @@ namespace CalamityMod.NPCs.ExoMechs NPC.spriteDirection = (PlayerToFollow.Center.X < NPC.Center.X).ToDirectionInt(); // Exo Mechdusa bool setting - if (!exoMechdusa && CalamityWorld.DraedonMechdusa && CalamityMod.Instance.legendaryMode) + if (!exoMechdusa && CalamityWorld.DraedonMechdusa && CalamityWorld.getFixedBoi) { exoMechdusa = true; CalamityWorld.DraedonMechdusa = false; @@ -504,7 +504,7 @@ namespace CalamityMod.NPCs.ExoMechs TalkTimer++; - if (ExoMechIsPresent && CalamityMod.Instance.legendaryMode && GeneralTimer % 60 == 0 && !exoMechdusa) + if (ExoMechIsPresent && CalamityWorld.getFixedBoi && GeneralTimer % 60 == 0 && !exoMechdusa) { SoundEngine.PlaySound(SoundID.Item33, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) @@ -527,7 +527,7 @@ namespace CalamityMod.NPCs.ExoMechs // Define a hover destination offset if one hasn't been decided yet. if (Main.netMode != NetmodeID.MultiplayerClient && HoverDestinationOffset == Vector2.Zero) { - float factor = CalamityMod.Instance.legendaryMode && !exoMechdusa ? 300f : 700f; + float factor = CalamityWorld.getFixedBoi && !exoMechdusa ? 300f : 700f; HoverDestinationOffset = -Vector2.UnitY * factor; NPC.netUpdate = true; } @@ -545,8 +545,8 @@ namespace CalamityMod.NPCs.ExoMechs offsetDirection = Main.rand.NextVector2Unit(); while (Vector2.Dot(directionToTarget, offsetDirection) > 0.2f); - float factormin = CalamityMod.Instance.legendaryMode && !exoMechdusa ? 300f : 750f; - float factormax = CalamityMod.Instance.legendaryMode && !exoMechdusa ? 700f : 1100f; + float factormin = CalamityWorld.getFixedBoi && !exoMechdusa ? 300f : 750f; + float factormax = CalamityWorld.getFixedBoi && !exoMechdusa ? 700f : 1100f; HoverDestinationOffset = offsetDirection * Main.rand.NextFloat(factormin, factormax); NPC.netUpdate = true; } @@ -880,7 +880,7 @@ namespace CalamityMod.NPCs.ExoMechs spriteBatch.Draw(glowmask, drawPosition, frame, Color.White * NPC.Opacity, NPC.rotation, origin, NPC.scale, direction, 0f); } - if (CalamityMod.Instance.legendaryMode && !HasBeenKilled && HologramEffectTimer >= HologramFadeinTime && !exoMechdusa) + if (CalamityWorld.getFixedBoi && !HasBeenKilled && HologramEffectTimer >= HologramFadeinTime && !exoMechdusa) { CalamityUtils.EnterShaderRegion(spriteBatch); Color outlineColor = Color.Lerp(Color.Magenta, Color.White, 0.4f); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index af8ce6da0c..a8b0fc177a 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -229,7 +229,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } public float GetSlowdownAreaEdgeRadius(bool lastMechAlive) => - (BossRushEvent.BossRushActive ? 400f : CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.6f : 1f) * (CalamityMod.Instance.legendaryMode && !exoMechdusa ? 2 : Main.getGoodWorld ? 0.5f : 1f); + (BossRushEvent.BossRushActive ? 400f : CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.6f : 1f) * (CalamityWorld.getFixedBoi && !exoMechdusa ? 2 : Main.getGoodWorld ? 0.5f : 1f); public int CheckForOtherMechs(ref Player target, out bool exoPrimeAlive, out bool exoTwinsAlive) { @@ -915,7 +915,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (calamityGlobalNPC.newAI[2] >= deathrayTelegraphDuration + deathrayDuration) { - if (CalamityMod.Instance.legendaryMode && !exoMechdusa) + if (CalamityWorld.getFixedBoi && !exoMechdusa) { AIState = (float)Phase.Deathray; } diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 703a6c3794..24d911174d 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.GreatSandShark NPC.DeathSound = SoundID.NPCDeath1; NPC.timeLeft = NPC.activeTime * 30; NPC.rarity = 2; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; @@ -334,7 +334,7 @@ namespace CalamityMod.NPCs.GreatSandShark if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) { - int npcType = CalamityMod.Instance.legendaryMode ? ModContent.NPCType() : NPCID.SandShark; + int npcType = CalamityWorld.getFixedBoi ? ModContent.NPCType() : NPCID.SandShark; NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 50, npcType, 0, 0f, 0f, 0f, 0f, 255); SoundEngine.PlaySound(RoarSound, NPC.position); } @@ -448,7 +448,7 @@ namespace CalamityMod.NPCs.GreatSandShark Main.dust[num624].velocity.X *= 2f; } int spawnX = (int)(NPC.width / 2); - int projType = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int projType = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); for (int sand = 0; sand < 5; sand++) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X + (float)Main.rand.Next(-spawnX, spawnX), NPC.Center.Y, (float)Main.rand.Next(-3, 4), (float)Main.rand.Next(-12, -6), projType, 40, 0f, Main.myPlayer); @@ -548,7 +548,7 @@ namespace CalamityMod.NPCs.GreatSandShark NPC.rotation = MathHelper.Clamp(NPC.rotation, -0.1f, 0.1f); } - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.Calamity().newAI[0]++; if (NPC.Calamity().newAI[0] >= 120) @@ -590,7 +590,7 @@ namespace CalamityMod.NPCs.GreatSandShark } Color color24 = NPC.GetAlpha(drawColor); Color color25 = Lighting.GetColor((int)((double)NPC.position.X + (double)NPC.width * 0.5) / 16, (int)(((double)NPC.position.Y + (double)NPC.height * 0.5) / 16.0)); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { color24 = Color.Silver; color25 = Color.Orange; diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index 0930601a5e..59a1e78e2f 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -68,7 +68,7 @@ namespace CalamityMod.NPCs.HiveMind bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool getFuckedAI = CalamityMod.Instance.legendaryMode; + bool getFuckedAI = CalamityWorld.getFixedBoi; int num750 = CalamityGlobalNPC.hiveMind; if (num750 < 0 || !Main.npc[num750].active) diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs index c005ca4c3a..49aaceff99 100644 --- a/NPCs/HiveMind/HiveBlob2.cs +++ b/NPCs/HiveMind/HiveBlob2.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.HiveMind bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool getFuckedAI = CalamityMod.Instance.legendaryMode; + bool getFuckedAI = CalamityWorld.getFixedBoi; int num750 = CalamityGlobalNPC.hiveMind; if (num750 < 0 || !Main.npc[num750].active) @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.HiveMind { Dust.NewDust(NPC.position, NPC.width, NPC.height, 14, hitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { //Spawn even more blobs on death for (int i = 1; i < 3; i++) diff --git a/NPCs/HiveMind/HiveCyst.cs b/NPCs/HiveMind/HiveCyst.cs index d14e91cff5..9cf74067d9 100644 --- a/NPCs/HiveMind/HiveCyst.cs +++ b/NPCs/HiveMind/HiveCyst.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.World; +using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -58,7 +59,7 @@ namespace CalamityMod.NPCs.HiveMind { float timeToSpawn = 120f; - if (CalamityMod.Instance.legendaryMode && NPC.AnyNPCs(ModContent.NPCType())) + if (CalamityWorld.getFixedBoi && NPC.AnyNPCs(ModContent.NPCType())) { //Passively spawns random enemies NPC.ai[0]++; diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 4bf9178637..1ae32b584a 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -353,7 +353,7 @@ namespace CalamityMod.NPCs.HiveMind } //Spawn a Hive Cyst - if (CalamityMod.Instance.legendaryMode && NPC.CountNPCS(ModContent.NPCType()) < 3) + if (CalamityWorld.getFixedBoi && NPC.CountNPCS(ModContent.NPCType()) < 3) NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + Main.rand.Next(NPC.width), (int)NPC.position.Y + Main.rand.Next(NPC.height), ModContent.NPCType()); } @@ -513,7 +513,7 @@ namespace CalamityMod.NPCs.HiveMind int maxBlobs = death ? 15 : revenge ? 7 : expertMode ? 6 : 5; if (Main.getGoodWorld) maxBlobs *= 2; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) maxBlobs = 50; for (int i = 0; i < maxBlobs; i++) @@ -1053,7 +1053,7 @@ namespace CalamityMod.NPCs.HiveMind if (phase2) { - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode ? NPC.CountNPCS(ModContent.NPCType()) < 10 : (Main.rand.NextBool(15) && NPC.CountNPCS(ModContent.NPCType()) < 2)) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi ? NPC.CountNPCS(ModContent.NPCType()) < 10 : (Main.rand.NextBool(15) && NPC.CountNPCS(ModContent.NPCType()) < 2)) { Vector2 spawnAt = NPC.Center + new Vector2(0f, NPC.height / 2f); NPC.NewNPC(NPC.GetSource_FromThis(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index e89845b553..38a025d8fd 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -76,7 +76,7 @@ namespace CalamityMod.NPCs.Leviathan if (Main.getGoodWorld) NPC.scale *= 0.8f; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) NPC.scale *= 4f; } @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.Leviathan } // Play sound - float extrapitch = CalamityMod.Instance.legendaryMode ? -0.5f : 0; + float extrapitch = CalamityWorld.getFixedBoi ? -0.5f : 0; if (Main.rand.NextBool(300)) SoundEngine.PlaySound(SoundID.Zombie35 with { Pitch = SoundID.Zombie35.Pitch + extrapitch}, NPC.Center); @@ -578,7 +578,7 @@ namespace CalamityMod.NPCs.Leviathan { NPC.rotation = NPC.velocity.X * 0.02f; - float basey = CalamityMod.Instance.legendaryMode ? -100 : -350; + float basey = CalamityWorld.getFixedBoi ? -100 : -350; Vector2 targetVector = player.Center + new Vector2(0f, basey) * NPC.scale; float velocity = death ? 13.5f : 12f; velocity += 6f * enrageScale; diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index f984bc11b1..0378f9ac19 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -256,7 +256,7 @@ namespace CalamityMod.NPCs.Leviathan Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); // Explode into bubbles on gfb - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 9e6b184217..7e18912142 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.Leviathan if (Main.getGoodWorld) NPC.scale *= 1.3f; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) NPC.scale *= 0.3f; } @@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.Leviathan if (soundDelay > 0) soundDelay--; - extrapitch = CalamityMod.Instance.legendaryMode ? 0.3f : 0f; + extrapitch = CalamityWorld.getFixedBoi ? 0.3f : 0f; if (Main.rand.NextBool(600) && !spawnAnimation) SoundEngine.PlaySound(((sirenAlive && !death) ? soundChoice : soundChoiceRage) with { Pitch = soundChoice.Pitch + extrapitch }, vector); @@ -390,7 +390,7 @@ namespace CalamityMod.NPCs.Leviathan num416 *= num417; vector40.X += num415 * 4f; vector40.Y += num416 * 4f; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { type = ProjectileID.Boulder; vector40.Y -= 5; //Shoot a bit more up since boulders are affected by gravity @@ -507,7 +507,7 @@ namespace CalamityMod.NPCs.Leviathan return; } - float gfbchargeboost = CalamityMod.Instance.legendaryMode ? 1100 : 0; + float gfbchargeboost = CalamityWorld.getFixedBoi ? 1100 : 0; float chargeDistance = ((sirenAlive && !phase4) ? 1100f : 900f) * NPC.scale + gfbchargeboost; chargeDistance -= 50f * enrageScale; if (!sirenAlive || phase4) diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 17e12ed608..76544e180b 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.Leviathan if (!Main.hardMode) return SpawnCondition.OceanMonster.Chance * 0.025f; - if (!NPC.downedPlantBoss && !DownedBossSystem.downedCalamitas) + if (!NPC.downedPlantBoss && !DownedBossSystem.downedCalamitasClone) return SpawnCondition.OceanMonster.Chance * 0.1f; return SpawnCondition.OceanMonster.Chance * 0.4f; diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index 75eebb05b7..4b63bc35eb 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; +using CalamityMod.World; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -78,7 +79,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "YuH"; } diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index 824efd64f6..f73f2ed18c 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Projectiles.Boss; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using Terraria; @@ -66,7 +67,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (flag) { - if (!CalamityMod.Instance.legendaryMode) + if (!CalamityWorld.getFixedBoi) { NPC.life = 0; NPC.HitEffect(0, 10.0); @@ -113,7 +114,7 @@ namespace CalamityMod.NPCs.NormalNPCs num6 *= num8; num7 *= num8; int num9 = 30; - int num10 = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ProjectileID.SaucerScrap; + int num10 = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ProjectileID.SaucerScrap; vector.X += num6 * 5f; vector.Y += num7 * 5f; Projectile.NewProjectile(NPC.GetSource_FromAI(), vector.X, vector.Y, num6, num7, num10, num9, 0f, Main.myPlayer, 0f, 0f); @@ -180,7 +181,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Mechanized Serpent"; } @@ -191,7 +192,7 @@ namespace CalamityMod.NPCs.NormalNPCs // Every other body segment is pink while the rest are orange in gfb Color baseColor = NPC.whoAmI % 2 == 0 ? Color.Orange : Color.Pink; Color lightColor = baseColor * drawColor.A; - Color newColor = CalamityMod.Instance.legendaryMode ? lightColor : new Color(255, 255, 255, drawColor.A); + Color newColor = CalamityWorld.getFixedBoi ? lightColor : new Color(255, 255, 255, drawColor.A); return newColor * NPC.Opacity; } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 9e06632e01..084ab759bf 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.localAI[1] = 0f; } float num17 = death ? 13.5f : 10f; - if (Main.player[NPC.target].dead || (!CalamityMod.Instance.legendaryMode && (double)Main.player[NPC.target].position.Y < Main.rockLayer * 16.0)) + if (Main.player[NPC.target].dead || (!CalamityWorld.getFixedBoi && (double)Main.player[NPC.target].position.Y < Main.rockLayer * 16.0)) { flag2 = false; NPC.velocity.Y = NPC.velocity.Y + 1f; @@ -460,13 +460,13 @@ namespace CalamityMod.NPCs.NormalNPCs npcLoot.Add(ModContent.ItemType(), 1, 2, 4); npcLoot.Add(ModContent.ItemType(), 1, 4, 8); npcLoot.Add(ModContent.ItemType(), 1, 4, 8); - npcLoot.AddIf(() => CalamityMod.Instance.legendaryMode, ModContent.ItemType(), 1, 3, 6); - npcLoot.AddIf(() => CalamityMod.Instance.legendaryMode, ModContent.ItemType(), 10); + npcLoot.AddIf(() => CalamityWorld.getFixedBoi, ModContent.ItemType(), 1, 3, 6); + npcLoot.AddIf(() => CalamityWorld.getFixedBoi, ModContent.ItemType(), 10); } public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Mechanized Serpent"; } @@ -475,7 +475,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override Color? GetAlpha(Color drawColor) { Color lightColor = Color.Orange * drawColor.A; - Color newColor = CalamityMod.Instance.legendaryMode ? lightColor : new Color(255, 255, 255, drawColor.A); + Color newColor = CalamityWorld.getFixedBoi ? lightColor : new Color(255, 255, 255, drawColor.A); return newColor * NPC.Opacity; } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index 9df8c510df..4f060416c0 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerTail.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerTail.cs @@ -1,6 +1,7 @@ -using CalamityMod.Items.Placeables.Banners; +using System; +using CalamityMod.Items.Placeables.Banners; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -63,7 +64,7 @@ namespace CalamityMod.NPCs.NormalNPCs { flag = true; } - if (flag && !CalamityMod.Instance.legendaryMode) + if (flag && !CalamityWorld.getFixedBoi) { NPC.life = 0; NPC.HitEffect(0, 10.0); @@ -128,7 +129,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "Mechanized Serpent"; } @@ -137,7 +138,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override Color? GetAlpha(Color drawColor) { Color lightColor = Color.Orange * drawColor.A; - Color newColor = CalamityMod.Instance.legendaryMode ? lightColor : new Color(255, 255, 255, drawColor.A); + Color newColor = CalamityWorld.getFixedBoi ? lightColor : new Color(255, 255, 255, drawColor.A); return newColor * NPC.Opacity; } } diff --git a/NPCs/NormalNPCs/CosmicElemental.cs b/NPCs/NormalNPCs/CosmicElemental.cs index 3cb2637491..0e8c842b3f 100644 --- a/NPCs/NormalNPCs/CosmicElemental.cs +++ b/NPCs/NormalNPCs/CosmicElemental.cs @@ -1,11 +1,11 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent; using Terraria.GameContent.Bestiary; -using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - int debuffType = CalamityMod.Instance.legendaryMode ? ModContent.BuffType() : BuffID.Confused; + int debuffType = CalamityWorld.getFixedBoi ? ModContent.BuffType() : BuffID.Confused; if (damage > 0) player.AddBuff(debuffType, 180, true); } diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 9065e2b92f..855132acf8 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -1,17 +1,18 @@ -using CalamityMod.Buffs.StatDebuffs; +using System; +using System.IO; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Enemy; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; -using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; -using Terraria.Audio; namespace CalamityMod.NPCs.NormalNPCs { @@ -201,7 +202,7 @@ namespace CalamityMod.NPCs.NormalNPCs { if (NPC.ai[0] == 0f) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { SoundEngine.PlaySound(SoundID.ScaryScream, Main.player[NPC.target].Center); } diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index c7bfc2821b..5273ee5499 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.NormalNPCs else NPC.velocity.Y = 12f; } - if (!CalamityMod.Instance.legendaryMode) + if (!CalamityWorld.getFixedBoi) SoundEngine.PlaySound(JumpSound, NPC.Center); } NPC.netUpdate = true; diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index 161220d971..81ffe77520 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -1,16 +1,17 @@ -using CalamityMod.Buffs.DamageOverTime; +using System; +using System.IO; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.NPCs.ExoMechs.Ares; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; -using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; -using Terraria.Audio; namespace CalamityMod.NPCs.NormalNPCs { @@ -40,7 +41,7 @@ namespace CalamityMod.NPCs.NormalNPCs AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit50; - NPC.DeathSound = CalamityMod.Instance.legendaryMode ? AresGaussNuke.NukeExplosionSound : DeathSound; + NPC.DeathSound = CalamityWorld.getFixedBoi ? AresGaussNuke.NukeExplosionSound : DeathSound; NPC.knockBackResist = 0.7f; Banner = NPC.type; BannerItem = ModContent.ItemType(); @@ -243,7 +244,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, 64, hitDirection, -1f, 0, default, 1f); } - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { float screenShakePower = 16 * Utils.GetLerpValue(1300f, 0f, NPC.Distance(Main.LocalPlayer.Center), true); if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) diff --git a/NPCs/NormalNPCs/SuperDummyNPC.cs b/NPCs/NormalNPCs/SuperDummyNPC.cs index a6938eba8c..09e0394f0c 100644 --- a/NPCs/NormalNPCs/SuperDummyNPC.cs +++ b/NPCs/NormalNPCs/SuperDummyNPC.cs @@ -1,8 +1,9 @@ -using Microsoft.Xna.Framework; +using System.IO; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.IO; -using Terraria; namespace CalamityMod.NPCs.NormalNPCs { @@ -44,7 +45,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override bool PreAI() { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { deathCounter++; // If you don't attack the Dummy for a minute in gfb, it becomes sentient diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/ThiccWaifu.cs index e8aba6e577..94977b6d96 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/ThiccWaifu.cs @@ -1,18 +1,19 @@ -using CalamityMod.Items.Accessories; +using System; +using System.Collections.Generic; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Enemy; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; -using Terraria.Audio; namespace CalamityMod.NPCs.NormalNPCs { @@ -395,7 +396,7 @@ namespace CalamityMod.NPCs.NormalNPCs texture = ModContent.Request(Texture).Value; Main.EntitySpriteDraw(texture, NPC.Center - screenPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, direction, 0); } - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { // I ran out of ideas, so Cloud just gets a hat like how I wanted GSS to Texture2D hattexture = ModContent.Request("CalamityMod/Particles/WulfrumHat").Value; diff --git a/NPCs/NormalNPCs/WildBumblefuck.cs b/NPCs/NormalNPCs/WildBumblefuck.cs index f9b8158c5c..1ef28edff9 100644 --- a/NPCs/NormalNPCs/WildBumblefuck.cs +++ b/NPCs/NormalNPCs/WildBumblefuck.cs @@ -1,12 +1,13 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Boss; using CalamityMod.Sounds; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; -using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; @@ -78,7 +79,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 5, 7); public override void OnKill() { - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); for (int i = 0; i < 5; i++) @@ -95,7 +96,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += NPC.ai[0] == 2.1f ? 1.5 : 1D; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.frameCounter += 2D; } diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 625d031485..8d540aa1b9 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -1,14 +1,15 @@ -using CalamityMod.Items.Accessories; +using System; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Sounds; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; -using CalamityMod.Sounds; namespace CalamityMod.NPCs.NormalNPCs { @@ -79,7 +80,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter++; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.frameCounter += 1; } diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index cd506a211f..020935d87e 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.OldDuke public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { typeName = "The Boomer Duke"; } diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index cbf4fafe82..3f03282aa2 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.OldDuke } } - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 767f01e1f8..b79b9f2b5a 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -200,7 +200,7 @@ namespace CalamityMod.NPCs.Perforator if (Main.rand.NextBool(4) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 833d1ded15..a7eb47ee07 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -308,7 +308,7 @@ namespace CalamityMod.NPCs.Perforator int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) NPC.Calamity().newAI[3]++; if (NPC.Calamity().newAI[3] > 180f) //Effectively 10 seconds but give a little headstart in case players kill it too fast diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index ba6d90a86b..4679cf2016 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -470,7 +470,7 @@ namespace CalamityMod.NPCs.Perforator if (Main.rand.NextBool(4) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 011df1e19c..c7be664939 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -274,7 +274,7 @@ namespace CalamityMod.NPCs.Perforator } } - if (CalamityMod.Instance.legendaryMode && CalamityGlobalNPC.perfHive >= 0) + if (CalamityWorld.getFixedBoi && CalamityGlobalNPC.perfHive >= 0) NPC.ai[0]++; //GFB movement diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index b2394a52e7..ae75dbe7ec 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.Perforator if (Main.rand.NextBool(4) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index ab75a495e2..ac60e0cb88 100644 --- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs +++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.PlagueEnemies BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.scale = 2f; } diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index d946f8a84d..2e2c810552 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -218,7 +218,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath SoundEngine.PlaySound(SoundID.Item14, NPC.Center); NPC.position.X = NPC.position.X + (float)(NPC.width / 2); NPC.position.Y = NPC.position.Y + (float)(NPC.height / 2); - NPC.width = NPC.height = CalamityMod.Instance.legendaryMode ? 300 : 216; + NPC.width = NPC.height = CalamityWorld.getFixedBoi ? 300 : 216; NPC.position.X = NPC.position.X - (float)(NPC.width / 2); NPC.position.Y = NPC.position.Y - (float)(NPC.height / 2); for (int num621 = 0; num621 < 15; num621++) @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { if (damage > 0) { - if (CalamityMod.Instance.legendaryMode) // it is the plague, you get very sick. + if (CalamityWorld.getFixedBoi) // it is the plague, you get very sick. { player.AddBuff(ModContent.BuffType(), 240, true); player.AddBuff(BuffID.Poisoned, 240, true); diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index b5bf47af51..72561fed4c 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -133,7 +133,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { if (damage > 0) { - if (CalamityMod.Instance.legendaryMode) // it is the plague, you get very sick. + if (CalamityWorld.getFixedBoi) // it is the plague, you get very sick. { player.AddBuff(ModContent.BuffType(), 300, true); player.AddBuff(BuffID.Poisoned, 300, true); @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath SoundEngine.PlaySound(SoundID.Item14, NPC.Center); NPC.position.X = NPC.position.X + (float)(NPC.width / 2); NPC.position.Y = NPC.position.Y + (float)(NPC.height / 2); - NPC.width = NPC.height = CalamityMod.Instance.legendaryMode ? 300 : 216; + NPC.width = NPC.height = CalamityWorld.getFixedBoi ? 300 : 216; NPC.position.X = NPC.position.X - (float)(NPC.width / 2); NPC.position.Y = NPC.position.Y - (float)(NPC.height / 2); for (int num621 = 0; num621 < 15; num621++) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 1e255d5676..cd6abb3c17 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -798,7 +798,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath break; } - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { type = ModContent.ProjectileType(); } @@ -887,13 +887,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath baseVelocity.Normalize(); baseVelocity *= speed; - if (Main.rand.NextBool(10) && CalamityMod.Instance.legendaryMode) + if (Main.rand.NextBool(10) && CalamityWorld.getFixedBoi) { type = ModContent.ProjectileType(); baseVelocity *= 0.75f; gaussMode = true; } - else if (Main.rand.NextBool(2) && CalamityMod.Instance.legendaryMode) + else if (Main.rand.NextBool(2) && CalamityWorld.getFixedBoi) { type = ModContent.ProjectileType(); baseVelocity *= 0.4f; @@ -1323,7 +1323,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { if (damage > 0) { - if (CalamityMod.Instance.legendaryMode) // it is the plague, you get very sick. + if (CalamityWorld.getFixedBoi) // it is the plague, you get very sick. { player.AddBuff(ModContent.BuffType(), 480, true); player.AddBuff(BuffID.Poisoned, 480, true); diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index cc69a0f62a..c84fbc4f94 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.Calamity().VulnerableToSickness = false; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.dontTakeDamage = true; } diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 6eee9b3e2d..e6bf7a2141 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -55,6 +55,7 @@ namespace CalamityMod.NPCs.Polterghast private int soundTimer = 0; private bool reachedChargingPoint = false; private bool threeAM = false; + private int nameStage = 1; public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/PolterghastHit"); public static readonly SoundStyle P2Sound = new("CalamityMod/Sounds/Custom/PolterghastP2Transition"); public static readonly SoundStyle P3Sound = new("CalamityMod/Sounds/Custom/PolterghastP3Transition"); @@ -92,7 +93,7 @@ namespace CalamityMod.NPCs.Polterghast Main.npcFrameCount[NPC.type] = 12; NPCID.Sets.TrailingMode[NPC.type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); - NPCID.Sets.MPAllowedEnemies[Type] = true; + NPCID.Sets.MPAllowedEnemies[Type] = true; } public override void SetDefaults() @@ -125,12 +126,20 @@ namespace CalamityMod.NPCs.Polterghast bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon, - // Will move to localization whenever that is cleaned up. - new FlavorTextBestiaryInfoElement("Screaming and crying, a cacophony of spirits in anguish tear through the narrow hallways of the dungeon, searching for more—alive or dead—to add to their numbers.") + // Will move to localization whenever that is cleaned up. + new FlavorTextBestiaryInfoElement("Screaming and crying, a cacophony of spirits in anguish tear through the narrow hallways of the dungeon, searching for more—alive or dead—to add to their numbers.") }); } - + public override void ModifyTypeName(ref string typeName) + { + typeName = nameStage switch + { + 2 => "Necroghast", + 3 => "Necroplasm", + _ => "Polterghast", + }; + } public override void BossHeadSlot(ref int index) { @@ -221,7 +230,7 @@ namespace CalamityMod.NPCs.Polterghast bool chargePhase = calamityGlobalNPC.newAI[0] >= chargePhaseGateValue; int chargeAmt = getPissed ? 4 : phase3 ? 3 : phase2 ? 2 : 1; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { chargeAmt = phase4 ? int.MaxValue : getPissed ? 6 : phase3 ? 4 : phase2 ? 3 : 2; } @@ -232,7 +241,7 @@ namespace CalamityMod.NPCs.Polterghast bool reset = NPC.ai[2] >= chargePhaseGateValue + 120f; float speedUpDistance = 480f - 360f * (1f - lifeRatio); - if ((Main.time >= 27000 && Main.time < 30600 && Main.dayTime == false && CalamityMod.Instance.legendaryMode) || threeAM) + if ((Main.time >= 27000 && Main.time < 30600 && Main.dayTime == false && CalamityWorld.getFixedBoi) || threeAM) { threeAM = true; chargeVelocity *= 2; @@ -287,7 +296,7 @@ namespace CalamityMod.NPCs.Polterghast } // Play a random creepy sound every once in a while in the zenith seed - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { soundTimer++; int gate = threeAM ? 60 : phase4 ? 300 : phase3 ? 420 : phase2 ? 540 : 600; @@ -315,7 +324,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { for (int I = 0; I < 3; I++) { @@ -701,6 +710,7 @@ namespace CalamityMod.NPCs.Polterghast NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, NPC.whoAmI, 0f, 0f, 0f, 0, 0, 0); } + // Phase 1: "Polterghast" if (!phase2 && !phase3) { NPC.damage = NPC.defDamage; @@ -788,6 +798,8 @@ namespace CalamityMod.NPCs.Polterghast } } } + + // Phase 2: "Necroghast" else if (!phase3) { if (NPC.ai[0] == 0f) @@ -833,7 +845,8 @@ namespace CalamityMod.NPCs.Polterghast } } - NPC.GivenName = "Necroghast"; + // Actually changes name to Necroghast + nameStage = 2; NPC.damage = (int)(NPC.defDamage * 1.2f); NPC.defense = (int)(NPC.defDefense * 0.8f); @@ -922,6 +935,8 @@ namespace CalamityMod.NPCs.Polterghast } } } + + // Phase 3: "Necroplasm" else { NPC.HitSound = SoundID.NPCHit36; @@ -941,7 +956,7 @@ namespace CalamityMod.NPCs.Polterghast { NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); - if (expertMode && !CalamityMod.Instance.legendaryMode) + if (expertMode && !CalamityWorld.getFixedBoi) { for (int I = 0; I < 3; I++) { @@ -984,7 +999,8 @@ namespace CalamityMod.NPCs.Polterghast } } - NPC.GivenName = "Necroplasm"; + // Actually changes name to Necroplasm + nameStage = 3; NPC.damage = (int)(NPC.defDamage * 1.4f); NPC.defense = (int)(NPC.defDefense * 0.5f); @@ -1052,7 +1068,7 @@ namespace CalamityMod.NPCs.Polterghast } } - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { NPC.GivenName = "Polterplasm"; } @@ -1082,7 +1098,7 @@ namespace CalamityMod.NPCs.Polterghast string sulfSeaBoostMessage = "Mods.CalamityMod.GhostBossText4"; Color sulfSeaBoostColor = AcidRainEvent.TextColor; - if ((Main.rand.NextBool(20) && DateTime.Now.Month == 4 && DateTime.Now.Day == 1) || CalamityMod.Instance.legendaryMode) + if ((Main.rand.NextBool(20) && DateTime.Now.Month == 4 && DateTime.Now.Day == 1) || CalamityWorld.getFixedBoi) { sulfSeaBoostMessage = "Mods.CalamityMod.AprilFools2"; // Goddamn boomer duke moments } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 28db54b4f2..c8446a4550 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -238,7 +238,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - if (Main.npc[CalamityGlobalNPC.doughnutBossHealer].ai[0] == 599 && CalamityMod.Instance.legendaryMode && Main.netMode != NetmodeID.MultiplayerClient) + if (Main.npc[CalamityGlobalNPC.doughnutBossHealer].ai[0] == 599 && CalamityWorld.getFixedBoi && Main.netMode != NetmodeID.MultiplayerClient) { // gain more health once the healer's channel heal is done NPC.lifeMax += 7500; @@ -258,11 +258,11 @@ namespace CalamityMod.NPCs.ProfanedGuardians Player player = Main.player[NPC.target]; - if ((!Main.dayTime && !CalamityMod.Instance.legendaryMode) || !player.active || player.dead || Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + if ((!Main.dayTime && !CalamityWorld.getFixedBoi) || !player.active || player.dead || Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) { NPC.TargetClosest(false); player = Main.player[NPC.target]; - if ((!Main.dayTime && !CalamityMod.Instance.legendaryMode) || !player.active || player.dead || Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + if ((!Main.dayTime && !CalamityWorld.getFixedBoi) || !player.active || player.dead || Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) { if (NPC.velocity.Y > 3f) NPC.velocity.Y = 3f; @@ -642,7 +642,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = ModContent.Request("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianCommanderGlow").Value; Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { texture2D15 = ModContent.Request("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianCommanderGlowNight").Value; color37 = Color.Cyan; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index 4e529dd56f..f62a9abf75 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -205,7 +205,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - if (Main.npc[CalamityGlobalNPC.doughnutBossHealer].ai[0] == 599 && CalamityMod.Instance.legendaryMode && Main.netMode != NetmodeID.MultiplayerClient) + if (Main.npc[CalamityGlobalNPC.doughnutBossHealer].ai[0] == 599 && CalamityWorld.getFixedBoi && Main.netMode != NetmodeID.MultiplayerClient) { // gain more health once the healer's channel heal is done NPC.lifeMax += 7500; @@ -355,7 +355,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { if (Math.Abs(NPC.Center.X - player.Center.X) > 10f) { @@ -670,7 +670,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = ModContent.Request("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianDefenderGlow").Value; Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { texture2D15 = ModContent.Request("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianDefenderGlowNight").Value; color37 = Color.Cyan; @@ -761,7 +761,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { // eat projectiles but take more damage based on piercing in the zenith seed - if (CalamityMod.Instance.legendaryMode && !projectile.minion) + if (CalamityWorld.getFixedBoi && !projectile.minion) { if (projectile.penetrate <= -1 || projectile.penetrate > 5) { diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index 4ed009fffb..0a0d8f041b 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) NPC.ai[0]++; if (NPC.ai[0] >= 300f) NPC.ai[1] = 1f; @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = NPC.direction; } - if (NPC.ai[1] == 1f && CalamityMod.Instance.legendaryMode) + if (NPC.ai[1] == 1f && CalamityWorld.getFixedBoi) { NPC.ai[2]++; NPC.velocity = Vector2.Zero; @@ -431,7 +431,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = ModContent.Request("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianHealerGlow").Value; Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { texture2D15 = ModContent.Request("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianHealerGlowNight").Value; color37 = Color.Cyan; diff --git a/NPCs/Providence/ProvSky.cs b/NPCs/Providence/ProvSky.cs index d7dd84b0d4..b79a4af1bb 100644 --- a/NPCs/Providence/ProvSky.cs +++ b/NPCs/Providence/ProvSky.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -81,7 +82,7 @@ namespace CalamityMod.NPCs.Providence if (maxDepth >= 0 && minDepth < 0) { float intensity = GetIntensity(); - Color color = CalamityMod.Instance.legendaryMode ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Main.dayTime ? new Color(255, 200, 100) : new Color(100, 150, 255); + Color color = CalamityWorld.getFixedBoi ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Main.dayTime ? new Color(255, 200, 100) : new Color(100, 150, 255); spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color * intensity); } } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index c941180672..defc28aae8 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.Providence // Night bool and Color shifting bool bossRush = BossRushEvent.BossRushActive; - bool getFuckedAI = CalamityMod.Instance.legendaryMode; + bool getFuckedAI = CalamityWorld.getFixedBoi; int timeToShift = 30; //Switches color every half-second if (getFuckedAI) { diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index b2d087e768..d3bdcfcee3 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -234,7 +234,7 @@ namespace CalamityMod.NPCs.Ravager } } - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { bool finalStand = lifeRatio < 0.1f; //At 10% body health, does the funny final attack NPC.localAI[1]++; diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index c3acfe2454..785470be21 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.Ravager num285++; } } - else if (Main.netMode != NetmodeID.MultiplayerClient && !CalamityMod.Instance.legendaryMode) //GFB does something else + else if (Main.netMode != NetmodeID.MultiplayerClient && !CalamityWorld.getFixedBoi) //GFB does something else { NPC.NewNPC(NPC.GetSource_Death(), (int)NPC.Center.X, (int)NPC.position.Y + NPC.height, ModContent.NPCType(), NPC.whoAmI); } diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 848d064a96..7cdb3c7edc 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -203,7 +203,7 @@ namespace CalamityMod.NPCs.Signus int stealthSoundGate = 300; int maxStealth = 360; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { if (stealthTimer < maxStealth) { @@ -553,7 +553,7 @@ namespace CalamityMod.NPCs.Signus { if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalLamps = Main.getGoodWorld && !CalamityMod.Instance.legendaryMode ? 10 : 5; + int totalLamps = Main.getGoodWorld && !CalamityWorld.getFixedBoi ? 10 : 5; if (NPC.CountNPCS(ModContent.NPCType()) < totalLamps) { bool buffed = false; @@ -565,7 +565,7 @@ namespace CalamityMod.NPCs.Signus for (int x = 0; x < totalLamps; x++) { int type = ModContent.NPCType(); - if (Main.rand.NextBool(10) && CalamityMod.Instance.legendaryMode) + if (Main.rand.NextBool(10) && CalamityWorld.getFixedBoi) { type = ModContent.NPCType(); } @@ -685,7 +685,7 @@ namespace CalamityMod.NPCs.Signus SoundEngine.PlaySound(SoundID.Item73, NPC.Center); int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Vector2 velocity = CalamityMod.Instance.legendaryMode ? new Vector2(Main.rand.Next(-5, 6), Main.rand.Next(-5, 6)) : Vector2.Zero; + Vector2 velocity = CalamityWorld.getFixedBoi ? new Vector2(Main.rand.Next(-5, 6), Main.rand.Next(-5, 6)) : Vector2.Zero; if (Main.getGoodWorld) { velocity.Normalize(); @@ -844,7 +844,7 @@ namespace CalamityMod.NPCs.Signus spriteBatch.Draw(NPCTexture, vector43, new Rectangle?(frame), NPC.GetAlpha(drawColor) * transparency, rotation, vector11, scale, spriteEffects, 0f); Color color40 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { color40 = Color.MediumBlue; } @@ -864,7 +864,7 @@ namespace CalamityMod.NPCs.Signus } } - if (CalamityMod.Instance.legendaryMode) // make Sig's eyes more visible in the zenith seed due to the color change + if (CalamityWorld.getFixedBoi) // make Sig's eyes more visible in the zenith seed due to the color change { CalamityUtils.EnterShaderRegion(spriteBatch); Color outlineColor = Color.Lerp(Color.Blue, Color.White, 0.4f); diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn.cs b/NPCs/SlimeGod/CorruptSlimeSpawn.cs index baedfc223c..21265d0544 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn.cs @@ -1,5 +1,6 @@ using CalamityMod.Events; using CalamityMod.Projectiles.Boss; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Bestiary; @@ -73,7 +74,7 @@ namespace CalamityMod.NPCs.SlimeGod } public override void OnKill() { - if (CalamityMod.Instance.legendaryMode && Main.netMode != NetmodeID.MultiplayerClient) + if (CalamityWorld.getFixedBoi && Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs index d7d8b44692..f0bf3bc126 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs @@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.SlimeGod if (Main.rand.NextBool(8) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - if (CalamityMod.Instance.legendaryMode && Main.rand.NextBool(5)) + if (CalamityWorld.getFixedBoi && Main.rand.NextBool(5)) { if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs index 8328029e31..d5d006f683 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.SlimeGod if (Main.rand.NextBool(8) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - if (CalamityMod.Instance.legendaryMode && Main.rand.NextBool(5)) + if (CalamityWorld.getFixedBoi && Main.rand.NextBool(5)) { if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs index 0dd81f3531..dcf503b917 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.SlimeGod int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); } @@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.SlimeGod } if (Main.netMode != NetmodeID.MultiplayerClient && spikeTimer == 0f) { - int projcount = CalamityMod.Instance.legendaryMode ? 12 : 5; + int projcount = CalamityWorld.getFixedBoi ? 12 : 5; for (int n = 0; n < projcount; n++) { Vector2 vector4 = new Vector2((float)(n - 2), -4f); diff --git a/NPCs/SlimeGod/CrimulanSlimeGod.cs b/NPCs/SlimeGod/CrimulanSlimeGod.cs index 4acff0adcb..603f48dc0b 100644 --- a/NPCs/SlimeGod/CrimulanSlimeGod.cs +++ b/NPCs/SlimeGod/CrimulanSlimeGod.cs @@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.SlimeGod Vector2 spawnAt = NPC.Center + new Vector2(0f, NPC.height / 2f); NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnAt.X - 30, (int)spawnAt.Y, ModContent.NPCType()); NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnAt.X + 30, (int)spawnAt.Y, ModContent.NPCType()); - if (CalamityMod.Instance.legendaryMode && NPC.CountNPCS(ModContent.NPCType()) < 3) //split into 3 slimes if the other large slime hasn't split yet + if (CalamityWorld.getFixedBoi && NPC.CountNPCS(ModContent.NPCType()) < 3) //split into 3 slimes if the other large slime hasn't split yet { NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnAt.X, (int)spawnAt.Y - 30, ModContent.NPCType()); } diff --git a/NPCs/SlimeGod/EbonianSlimeGod.cs b/NPCs/SlimeGod/EbonianSlimeGod.cs index f09615da1e..85c881f524 100644 --- a/NPCs/SlimeGod/EbonianSlimeGod.cs +++ b/NPCs/SlimeGod/EbonianSlimeGod.cs @@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.SlimeGod Vector2 spawnAt = NPC.Center + new Vector2(0f, NPC.height / 2f); NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnAt.X - 30, (int)spawnAt.Y, ModContent.NPCType()); NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnAt.X + 30, (int)spawnAt.Y, ModContent.NPCType()); - if (CalamityMod.Instance.legendaryMode && NPC.CountNPCS(ModContent.NPCType()) < 3) // split into 3 slimes if the other large slime hasn't split yet + if (CalamityWorld.getFixedBoi && NPC.CountNPCS(ModContent.NPCType()) < 3) // split into 3 slimes if the other large slime hasn't split yet { NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnAt.X, (int)spawnAt.Y - 30, ModContent.NPCType()); } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index ed86a2a9d2..6c3d1f187d 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -188,7 +188,7 @@ namespace CalamityMod.NPCs.SlimeGod } // Emit dust - if (!CalamityMod.Instance.legendaryMode) // you must see his glory. + if (!CalamityWorld.getFixedBoi) // you must see his glory. { for (int k = 0; k < 5; k++) { @@ -548,11 +548,11 @@ namespace CalamityMod.NPCs.SlimeGod float num160 = 0f; int num161 = num159; spriteBatch.Draw(texture2D3, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY), NPC.frame, color24, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0); - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { spriteBatch.Draw(pog, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY), NPC.frame, color24, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0); } - if (!CalamityMod.Instance.legendaryMode) + if (!CalamityWorld.getFixedBoi) while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityConfig.Instance.Afterimages) { Color color26 = NPC.GetAlpha(color25); @@ -650,7 +650,7 @@ namespace CalamityMod.NPCs.SlimeGod { if (damage > 0) { - int debufftype = CalamityMod.Instance.legendaryMode ? BuffID.VortexDebuff : BuffID.Slow; + int debufftype = CalamityWorld.getFixedBoi ? BuffID.VortexDebuff : BuffID.Slow; player.AddBuff(debufftype, 180, true); player.AddBuff(BuffID.Weak, 180, true); player.AddBuff(BuffID.Darkness, 180, true); diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 77012d3104..c9a9d1eb5b 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -241,7 +241,7 @@ namespace CalamityMod.NPCs.StormWeaver int Previous = NPC.whoAmI; int totalLength = death ? 60 : revenge ? 50 : expertMode ? 40 : 30; int npcCounts = 0; - if (CalamityMod.Instance.legendaryMode) // use up every remaining npc but 20 for safety in the zenith seed + if (CalamityWorld.getFixedBoi) // use up every remaining npc but 20 for safety in the zenith seed { for (int i = 0; i < Main.maxNPCs; i++) { diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 043e8e6f29..16e4d9c2f3 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -282,7 +282,7 @@ namespace CalamityMod.NPCs.SunkenSea } // Gains Calamitas' bullet hells in the zenith seed - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { calamityGlobalNPC.newAI[0] += 1f; @@ -461,7 +461,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void ModifyTypeName(ref string typeName) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { if (Main.hardMode) { diff --git a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs index 68c26395db..8b37cb3708 100644 --- a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs +++ b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs @@ -102,7 +102,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.alpha = HeadSegment.alpha; AttackTimer += BossRushEvent.BossRushActive ? 1.5f : 1f; - float attackgate = !HeadSegment.Calamity().unbreakableDR && CalamityMod.Instance.legendaryMode ? 450f : 900f; + float attackgate = !HeadSegment.Calamity().unbreakableDR && CalamityWorld.getFixedBoi ? 450f : 900f; if (AttackTimer >= attackgate) { AttackTimer = 0f; diff --git a/NPCs/SupremeCalamitas/SepulcherHead.cs b/NPCs/SupremeCalamitas/SepulcherHead.cs index c971653e9d..8b01431dc1 100644 --- a/NPCs/SupremeCalamitas/SepulcherHead.cs +++ b/NPCs/SupremeCalamitas/SepulcherHead.cs @@ -172,7 +172,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (CalamityMod.Instance.legendaryMode && !NPC.AnyNPCs(ModContent.NPCType())) + if (CalamityWorld.getFixedBoi && !NPC.AnyNPCs(ModContent.NPCType())) { CalamityGlobalNPC global = NPC.Calamity(); global.DR = 0.4f; @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.DeathSound = DeathSound; } - if (Main.player[NPC.target].dead || (!NPC.AnyNPCs(ModContent.NPCType()) && !CalamityMod.Instance.legendaryMode) || CalamityGlobalNPC.SCal < 0 || !Main.npc[CalamityGlobalNPC.SCal].active) + if (Main.player[NPC.target].dead || (!NPC.AnyNPCs(ModContent.NPCType()) && !CalamityWorld.getFixedBoi) || CalamityGlobalNPC.SCal < 0 || !Main.npc[CalamityGlobalNPC.SCal].active) { NPC.TargetClosest(false); SoundEngine.PlaySound(DeathSound, Main.player[NPC.target].Center); diff --git a/NPCs/SupremeCalamitas/SepulcherTail.cs b/NPCs/SupremeCalamitas/SepulcherTail.cs index 9e5d9b2c05..b9d3a2f30c 100644 --- a/NPCs/SupremeCalamitas/SepulcherTail.cs +++ b/NPCs/SupremeCalamitas/SepulcherTail.cs @@ -146,7 +146,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (CalamityMod.Instance.legendaryMode && !NPC.AnyNPCs(ModContent.NPCType())) + if (CalamityWorld.getFixedBoi && !NPC.AnyNPCs(ModContent.NPCType())) { CalamityGlobalNPC global = NPC.Calamity(); global.DR = 0.5f; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index c1c163d165..e2fb658736 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void SetStaticDefaults() { - DisplayName.SetDefault("Supreme Calamitas"); + DisplayName.SetDefault("Supreme Witch, Calamitas"); Main.npcFrameCount[NPC.type] = 21; NPCID.Sets.TrailingMode[NPC.type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); @@ -239,7 +239,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void BossHeadSlot(ref int index) { bool inPhase2 = NPC.ai[0] == 3f; - if (!DownedBossSystem.downedSCal || BossRushEvent.BossRushActive) + if (!DownedBossSystem.downedCalamitas || BossRushEvent.BossRushActive) index = inPhase2 ? hoodedHeadIconP2Index : hoodedHeadIconIndex; else index = inPhase2 ? hoodlessHeadIconP2Index : hoodlessHeadIconIndex; @@ -410,12 +410,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas hellblastDamage /= 2; } - int bulletHellblast = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int bulletHellblast = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); int barrage = ModContent.ProjectileType(); - int gigablast = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int fireblast = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int wave = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int hellblast = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int gigablast = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int fireblast = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int wave = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int hellblast = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); int bodyWidth = 44; int bodyHeight = 42; @@ -441,7 +441,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { string key = "Mods.CalamityMod.SCalSummonText"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -558,7 +558,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas int xoffset = 0; int yoffset = 0; int maxoffset = 3; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { xoffset += Main.rand.Next(-maxoffset, maxoffset + 1); yoffset += Main.rand.Next(-maxoffset, maxoffset + 1); @@ -640,7 +640,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas forcefieldOpacity = Utils.GetLerpValue(0.1f, 0.6f, NPC.Opacity, true); if (NPC.alpha >= 230) { - if (DownedBossSystem.downedSCal && !bossRush) + if (DownedBossSystem.downedCalamitas && !bossRush) { // Create a teleport line effect Dust.QuickDustLine(NPC.Center, initialRitualPosition, 500f, Color.Red); @@ -732,7 +732,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); } - if (bulletHellCounter2 < 300 && !CalamityMod.Instance.legendaryMode) // Blasts from above + if (bulletHellCounter2 < 300 && !CalamityWorld.getFixedBoi) // Blasts from above { Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); } @@ -743,7 +743,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else // Blasts from above, left, and right { - if (!CalamityMod.Instance.legendaryMode) + if (!CalamityWorld.getFixedBoi) Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); @@ -819,7 +819,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); } - if (bulletHellCounter2 < 1200 && !CalamityMod.Instance.legendaryMode) // Blasts from below + if (bulletHellCounter2 < 1200 && !CalamityWorld.getFixedBoi) // Blasts from below { Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); } @@ -842,7 +842,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { string key = "Mods.CalamityMod.SCalBH2Text"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -880,7 +880,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); } - if (bulletHellCounter2 < 2100 && !CalamityMod.Instance.legendaryMode) // Blasts from above + if (bulletHellCounter2 < 2100 && !CalamityWorld.getFixedBoi) // Blasts from above { Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); } @@ -903,7 +903,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { string key = "Mods.CalamityMod.SCalBH3Text"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -950,7 +950,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); } - if (bulletHellCounter2 < 3000 && !CalamityMod.Instance.legendaryMode) // Blasts from below + if (bulletHellCounter2 < 3000 && !CalamityWorld.getFixedBoi) // Blasts from below { Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); } @@ -973,7 +973,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { string key = "Mods.CalamityMod.SCalBH4Text"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -1018,7 +1018,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); } - if (bulletHellCounter2 < 3900 && !CalamityMod.Instance.legendaryMode) // Blasts from above + if (bulletHellCounter2 < 3900 && !CalamityWorld.getFixedBoi) // Blasts from above { Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); } @@ -1029,7 +1029,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else // Blasts from above, left, and right { - if (!CalamityMod.Instance.legendaryMode) + if (!CalamityWorld.getFixedBoi) Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer); @@ -1045,7 +1045,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -1074,7 +1074,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!canDespawn) NPC.velocity.X *= 0.96f; - if (DownedBossSystem.downedSCal && !bossRush) + if (DownedBossSystem.downedCalamitas && !bossRush) { if (giveUpCounter == 720) { @@ -1143,7 +1143,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { string key = "Mods.CalamityMod.SCalDesparationText4"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -1155,7 +1155,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { string key = "Mods.CalamityMod.SCalDesparationText3"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -1167,7 +1167,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { string key = "Mods.CalamityMod.SCalDesparationText2"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -1179,7 +1179,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { string key = "Mods.CalamityMod.SCalDesparationText1"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -1248,7 +1248,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { string key = "Mods.CalamityMod.SCalPhase2Text"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -1262,7 +1262,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!bossRush) { string key = "Mods.CalamityMod.SCalSeekerRingText"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -2368,7 +2368,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!BossRushEvent.BossRushActive) { - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -2489,7 +2489,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.SCalBrothersText"; - if (DownedBossSystem.downedSCal) + if (DownedBossSystem.downedCalamitas) key += "Rematch"; CalamityUtils.DisplayLocalizedText(key, textColor); } @@ -2589,14 +2589,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!BossRushEvent.BossRushActive) NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 12, ModContent.NPCType()); - // Mark Supreme Calamitas as defeated - DownedBossSystem.downedSCal = true; + // Mark Calamitas as defeated + DownedBossSystem.downedCalamitas = true; CalamityNetcode.SyncWorld(); } public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); + npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); // Normal drops: Everything that would otherwise be in the bag var normalOnly = npcLoot.DefineNormalOnlyDropSet(); @@ -2641,12 +2641,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSCal, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCalamitas, ModContent.ItemType(), desc: DropHelper.FirstKillText); // Cynosure: If the Exo Mechs have been defeated and this is the first kill of SCal, drop the special lore item npcLoot.Add(ItemDropRule.ByCondition( DropHelper.If( - () => DownedBossSystem.downedExoMechs && !DownedBossSystem.downedSCal, + () => DownedBossSystem.downedExoMechs && !DownedBossSystem.downedCalamitas, desc: DropHelper.CynosureText), ModContent.ItemType() )); @@ -2733,7 +2733,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = DownedBossSystem.downedSCal && !BossRushEvent.BossRushActive ? TextureAssets.Npc[NPC.type].Value : ModContent.Request("CalamityMod/NPCs/SupremeCalamitas/SupremeCalamitasHooded").Value; + Texture2D texture2D15 = DownedBossSystem.downedCalamitas && !BossRushEvent.BossRushActive ? TextureAssets.Npc[NPC.type].Value : ModContent.Request("CalamityMod/NPCs/SupremeCalamitas/SupremeCalamitasHooded").Value; Vector2 vector11 = new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[NPC.type] / 2f); Color color36 = Color.White; @@ -2765,7 +2765,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (inPhase2) { // Make the sprite jitter with rage in phase 2. This does not happen in rematches since it would make little sense logically. - if (!DownedBossSystem.downedSCal) + if (!DownedBossSystem.downedCalamitas) vector43 += Main.rand.NextVector2Circular(0.25f, 0.7f); // And gain a flaming aura. diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 8e1303c237..9ea1fc3b25 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -236,13 +236,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas DartBurstCounter = 0f; SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound, NPC.Center); - int type = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); if (bossRush) damage /= 2; int totalProjectiles = bossRush ? 20 : death ? 16 : revenge ? 14 : expertMode ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; - float velocity = CalamityMod.Instance.legendaryMode ? 5f : 7f; + float velocity = CalamityWorld.getFixedBoi ? 5f : 7f; Vector2 spinningPoint = new Vector2(0f, -velocity); for (int k = 0; k < totalProjectiles; k++) { @@ -280,7 +280,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas spriteBatch.Draw(texture, mainDrawPosition, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); texture = ModContent.Request("CalamityMod/NPCs/SupremeCalamitas/SupremeCataclysmGlow").Value; - Color primarycolor = CalamityMod.Instance.legendaryMode ? Color.Blue : Color.Red; // why? because blue fire is awesome!! + Color primarycolor = CalamityWorld.getFixedBoi ? Color.Blue : Color.Red; // why? because blue fire is awesome!! Color baseGlowmaskColor = NPC.IsABestiaryIconDummy ? Color.White : Color.Lerp(Color.White, primarycolor, 0.5f); if (CalamityConfig.Instance.Afterimages) diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 2a64cd8c02..162062885d 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -231,13 +231,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas DartBurstCounter = 0f; SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound, NPC.Center); - int type = CalamityMod.Instance.legendaryMode ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int type = CalamityWorld.getFixedBoi ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); if (bossRush) damage /= 2; int totalProjectiles = bossRush ? 20 : death ? 16 : revenge ? 14 : expertMode ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; - float velocity = CalamityMod.Instance.legendaryMode ? 5f : 7f; + float velocity = CalamityWorld.getFixedBoi ? 5f : 7f; Vector2 spinningPoint = new Vector2(0f, -velocity); for (int k = 0; k < totalProjectiles; k++) { diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index ab2a77df15..95ade4a1da 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.TownNPCs public override string GetChat() { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { Main.player[Main.myPlayer].Hurt(PlayerDeathReason.ByCustomReason(Main.player[Main.myPlayer].name + " was slapped too hard."), Main.player[Main.myPlayer].statLife / 2, -Main.player[Main.myPlayer].direction, false, false, false, -1); SoundEngine.PlaySound(CnidarianJellyfishOnTheString.SlapSound, Main.player[Main.myPlayer].Center); diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index b6be2fc00a..a2a6f2aebc 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -319,7 +319,7 @@ namespace CalamityMod.NPCs.TownNPCs shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 60, 0, 0); nextSlot++; } - if (DownedBossSystem.downedCalamitas) + if (DownedBossSystem.downedCalamitasClone) { shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index c6fa295992..15e565b3c4 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.TownNPCs }); } - public override bool CanTownNPCSpawn(int numTownNPCs, int money) => DownedBossSystem.downedSCal && !NPC.AnyNPCs(NPCType()); + public override bool CanTownNPCSpawn(int numTownNPCs, int money) => DownedBossSystem.downedCalamitas && !NPC.AnyNPCs(NPCType()); public override List SetNPCNameList() => new List() { "Calamitas" }; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index e1a9a9d539..0fee275ea3 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -70,7 +70,7 @@ namespace CalamityMod.NPCs.Yharon public override void SetStaticDefaults() { - DisplayName.SetDefault("Jungle Dragon, Yharon"); + DisplayName.SetDefault("Yharon, Stalwart Defender"); // phase 1 name Main.npcFrameCount[NPC.type] = 7; NPCID.Sets.TrailingMode[NPC.type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.Yharon value.Position.X += 26f; value.Position.Y -= 14f; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; - NPCID.Sets.MPAllowedEnemies[Type] = true; + NPCID.Sets.MPAllowedEnemies[Type] = true; } public override void SetDefaults() @@ -120,11 +120,17 @@ namespace CalamityMod.NPCs.Yharon bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle, - // Will move to localization whenever that is cleaned up. - new FlavorTextBestiaryInfoElement("The loyal companion of the God-Hunter, they possess immense power compared to the Dragons of the past. This is likely partly due to fighting and training by their master's side.") + // Will move to localization whenever that is cleaned up. + new FlavorTextBestiaryInfoElement("The loyal companion of the God-Hunter, they possess immense power compared to the Dragons of the past. This is likely partly due to fighting and training by their master's side.") }); } + public override void ModifyTypeName(ref string typeName) + { + if (startSecondAI) + typeName = "Yharon, Resplendent Phoenix"; // phase 2 name + } + public override void SendExtraAI(BinaryWriter writer) { BitsByte bb = new BitsByte(); @@ -190,8 +196,8 @@ namespace CalamityMod.NPCs.Yharon float pie = (float)Math.PI; - CalamityGlobalNPC.yharon = NPC.whoAmI; - CalamityGlobalNPC.yharonP2 = -1; + CalamityGlobalNPC.yharon = NPC.whoAmI; + CalamityGlobalNPC.yharonP2 = -1; // Start phase 2 or not if (startSecondAI) @@ -340,12 +346,12 @@ namespace CalamityMod.NPCs.Yharon enraged = false; if (Main.netMode != NetmodeID.MultiplayerClient) { - safeBox.X = (int)(player.Center.X - (CalamityMod.Instance.legendaryMode ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f)); + safeBox.X = (int)(player.Center.X - (CalamityWorld.getFixedBoi ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f)); safeBox.Y = (int)(player.Center.Y - 10500f); - safeBox.Width = CalamityMod.Instance.legendaryMode ? 3000 : Main.getGoodWorld ? 2000 : bossRush ? 4000 : revenge ? 6000 : 7000; + safeBox.Width = CalamityWorld.getFixedBoi ? 3000 : Main.getGoodWorld ? 2000 : bossRush ? 4000 : revenge ? 6000 : 7000; safeBox.Height = 21000; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (CalamityMod.Instance.legendaryMode ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (CalamityMod.Instance.legendaryMode ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (CalamityWorld.getFixedBoi ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (CalamityWorld.getFixedBoi ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); } // Force Yharon to send a sync packet so that the arena gets sent immediately @@ -876,9 +882,9 @@ namespace CalamityMod.NPCs.Yharon NPC.Center = center; int type = ModContent.ProjectileType(); - int damage = CalamityMod.Instance.legendaryMode ? NPC.GetProjectileDamage(type) : 0; + int damage = CalamityWorld.getFixedBoi ? NPC.GetProjectileDamage(type) : 0; float bulletHellVortexDuration = flareDustPhaseTimer + teleportPhaseTimer - 15f; - int extraTime = CalamityMod.Instance.legendaryMode ? 300 : 0; + int extraTime = CalamityWorld.getFixedBoi ? 300 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, bulletHellVortexDuration + extraTime, NPC.whoAmI); // Yharon takes a small amount of damage in order to summon the bullet hell. This is to compensate for him being invulnerable during it. @@ -1225,9 +1231,9 @@ namespace CalamityMod.NPCs.Yharon NPC.Center = center; int type = ModContent.ProjectileType(); - int damage = CalamityMod.Instance.legendaryMode ? NPC.GetProjectileDamage(type) : 0; + int damage = CalamityWorld.getFixedBoi ? NPC.GetProjectileDamage(type) : 0; float bulletHellVortexDuration = flareDustPhaseTimer + teleportPhaseTimer - 15f; - int extraTime = CalamityMod.Instance.legendaryMode ? 300 : 0; + int extraTime = CalamityWorld.getFixedBoi ? 300 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, bulletHellVortexDuration + extraTime, NPC.whoAmI); // Yharon takes a small amount of damage in order to summon the bullet hell. This is to compensate for him being invulnerable during it. @@ -1532,7 +1538,7 @@ namespace CalamityMod.NPCs.Yharon #region AI2 public void Yharon_AI2(bool expertMode, bool revenge, bool death, bool bossRush, float pie, float lifeRatio, CalamityGlobalNPC calamityGlobalNPC) { - CalamityGlobalNPC.yharonP2 = NPC.whoAmI; + CalamityGlobalNPC.yharonP2 = NPC.whoAmI; float phase2GateValue = revenge ? 0.44f : expertMode ? 0.385f : 0.275f; bool phase2 = death || lifeRatio <= phase2GateValue; @@ -1562,7 +1568,7 @@ namespace CalamityMod.NPCs.Yharon bool invincible = invincibilityCounter < Phase2InvincibilityTime; if (invincible) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { if (NPC.life < NPC.lifeMax) { @@ -1917,9 +1923,9 @@ namespace CalamityMod.NPCs.Yharon NPC.Center = center; int type = ModContent.ProjectileType(); - int damage = CalamityMod.Instance.legendaryMode ? NPC.GetProjectileDamage(type) : 0; + int damage = CalamityWorld.getFixedBoi ? NPC.GetProjectileDamage(type) : 0; float bulletHellVortexDuration = spinPhaseTimer + 15f; - int extraTime = CalamityMod.Instance.legendaryMode ? 300 : 0; + int extraTime = CalamityWorld.getFixedBoi ? 300 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, bulletHellVortexDuration + extraTime, NPC.whoAmI); // Yharon takes a small amount of damage in order to summon the bullet hell. This is to compensate for him being invulnerable during it. @@ -2899,7 +2905,7 @@ namespace CalamityMod.NPCs.Yharon DownedBossSystem.downedYharon = true; CalamityNetcode.SyncWorld(); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { for (int i = 0; i < 4; i++) { diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index 405bcc45c7..b8f1da9eb1 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -1,6 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Boss if (damage <= 0 || Projectile.Opacity != 1f) return; - if (Projectile.ai[0] == 0f || CalamityMod.Instance.legendaryMode) + if (Projectile.ai[0] == 0f || CalamityWorld.getFixedBoi) target.AddBuff(ModContent.BuffType(), 120); else target.AddBuff(ModContent.BuffType(), 180); diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index a580df7dff..9514b4d4d0 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -1,11 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using System; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.Projectiles.Boss { @@ -83,7 +84,7 @@ namespace CalamityMod.Projectiles.Boss if (damage <= 0 || Projectile.timeLeft < 51) return; - if (Projectile.ai[0] == 0f || CalamityMod.Instance.legendaryMode) + if (Projectile.ai[0] == 0f || CalamityWorld.getFixedBoi) target.AddBuff(ModContent.BuffType(), 120); else target.AddBuff(ModContent.BuffType(), 180); diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index 702c5e6ac2..77166b18d6 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Boss if (damage <= 0 || Projectile.Opacity != 1f) return; - if (Projectile.ai[0] == 0f || CalamityMod.Instance.legendaryMode) + if (Projectile.ai[0] == 0f || CalamityWorld.getFixedBoi) target.AddBuff(ModContent.BuffType(), 120); else target.AddBuff(ModContent.BuffType(), 180); diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 5cb56691b0..3fafbfef13 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Boss // If the other projectile is indeed the same owned by the same player and they're too close, nudge them away. bool sameProjType = otherProj.type == Projectile.type; float taxicabDist = Vector2.Distance(Projectile.Center, otherProj.Center); - float distancegate = CalamityMod.Instance.legendaryMode ? 360f : 320f; + float distancegate = CalamityWorld.getFixedBoi ? 360f : 320f; if (sameProjType && taxicabDist < distancegate) { if (Projectile.position.X < otherProj.position.X) diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index 4f484843f9..2da4beab68 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Boss { Vector2 velocity = Projectile.velocity; velocity.Normalize(); - float distanceBetweenProjectiles = CalamityMod.Instance.legendaryMode ? 360 : bossRush ? 72f : 144f; + float distanceBetweenProjectiles = CalamityWorld.getFixedBoi ? 360 : bossRush ? 72f : 144f; Vector2 fireFrom = new Vector2(Main.npc[(int)Projectile.ai[1]].Center.X + (Main.npc[(int)Projectile.ai[1]].spriteDirection > 0 ? 34f : -34f), Main.npc[(int)Projectile.ai[1]].Center.Y - 74f) + velocity * distanceBetweenProjectiles; int projectileAmt = (int)(Projectile.localAI[1] / distanceBetweenProjectiles); int type = ModContent.ProjectileType(); diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index fc694da4d5..1d6eb14d62 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -1,5 +1,6 @@ using CalamityMod.Dusts; using CalamityMod.NPCs; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -87,8 +88,8 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.Opacity == 1f) { - int debufftype = CalamityMod.Instance.legendaryMode ? BuffID.Obstructed : BuffID.VortexDebuff; - int duration = CalamityMod.Instance.legendaryMode ? 30 : 60; + int debufftype = CalamityWorld.getFixedBoi ? BuffID.Obstructed : BuffID.VortexDebuff; + int duration = CalamityWorld.getFixedBoi ? 30 : 60; if (damage > 0) target.AddBuff(debufftype, duration, true); } diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index e53802a92a..a438272d49 100644 --- a/Projectiles/Boss/DarkEnergyBall2.cs +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -1,5 +1,6 @@ using CalamityMod.Dusts; using CalamityMod.NPCs; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -89,8 +90,8 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.Opacity == 1f) { - int debufftype = CalamityMod.Instance.legendaryMode ? BuffID.Obstructed : BuffID.VortexDebuff; - int duration = CalamityMod.Instance.legendaryMode ? 30 : 60; + int debufftype = CalamityWorld.getFixedBoi ? BuffID.Obstructed : BuffID.VortexDebuff; + int duration = CalamityWorld.getFixedBoi ? 30 : 60; if (damage > 0) target.AddBuff(debufftype, duration, true); } diff --git a/Projectiles/Boss/DyingSun.cs b/Projectiles/Boss/DyingSun.cs index 54748ac493..82a33c8ef8 100644 --- a/Projectiles/Boss/DyingSun.cs +++ b/Projectiles/Boss/DyingSun.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; -using System; +using System; using System.Collections.Generic; +using CalamityMod.World; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; @@ -44,7 +45,7 @@ namespace CalamityMod.Projectiles.Boss public Color SunColorFunction(float completionRatio) { - Color sunColor = CalamityMod.Instance.legendaryMode ? (new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) * 0.8f) : (Main.dayTime ? Color.Yellow : Color.Cyan); + Color sunColor = CalamityWorld.getFixedBoi ? (new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) * 0.8f) : (Main.dayTime ? Color.Yellow : Color.Cyan); return Color.Lerp(sunColor, Color.White, (float)Math.Sin(MathHelper.Pi * completionRatio) * 0.5f + 0.3f) * Projectile.Opacity; } diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index dea442cab0..7321aabf1f 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -1,9 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using System; +using System.IO; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs.Yharon; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -109,7 +110,7 @@ namespace CalamityMod.Projectiles.Boss } int tornadoSpeed = 10; int breakThreshold = -300; - bool breakapart = CalamityMod.Instance.legendaryMode && Projectile.ai[0] <= breakThreshold; + bool breakapart = CalamityWorld.getFixedBoi && Projectile.ai[0] <= breakThreshold; if (Projectile.ai[0] <= 0f && !breakapart) { float num622 = 0.104719758f; @@ -121,7 +122,7 @@ namespace CalamityMod.Projectiles.Boss num624 = (float)(Math.Cos((double)(num622 * -(double)Projectile.ai[0])) - 0.5) * num623; Projectile.position.X += num624 * -Projectile.direction; } - if (Projectile.ai[0] == breakThreshold && CalamityMod.Instance.legendaryMode) + if (Projectile.ai[0] == breakThreshold && CalamityWorld.getFixedBoi) { Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed; } diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index 34942e01ce..9fb50cde97 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -1,11 +1,11 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Projectiles.Boss; +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.Projectiles.Boss { @@ -163,7 +163,7 @@ namespace CalamityMod.Projectiles.Boss } } - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityMod.Instance.legendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.getFixedBoi) { Vector2 valueBoom = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); float spreadBoom = 15f * 0.0174f; @@ -191,7 +191,7 @@ namespace CalamityMod.Projectiles.Boss if (damage <= 0) return; - if (CalamityMod.Instance.legendaryMode) // it is the plague, you get very sick. + if (CalamityWorld.getFixedBoi) // it is the plague, you get very sick. { target.AddBuff(ModContent.BuffType(), 240, true); target.AddBuff(BuffID.Poisoned, 240, true); diff --git a/Projectiles/Boss/HolyAura.cs b/Projectiles/Boss/HolyAura.cs index 894361d73e..f7a4d23b32 100644 --- a/Projectiles/Boss/HolyAura.cs +++ b/Projectiles/Boss/HolyAura.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using System; +using CalamityMod.World; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -68,7 +69,7 @@ namespace CalamityMod.Projectiles.Boss Color color = Main.hslToRgb(hue[i] % 1f, 1f, 0.5f) * colorChangeAmt * colorChangeAmt2; bool underworld = Projectile.ai[0] == 2f; - if (!CalamityMod.Instance.legendaryMode) + if (!CalamityWorld.getFixedBoi) { if (Main.dayTime) { diff --git a/Projectiles/Boss/HolyExplosionBoom.cs b/Projectiles/Boss/HolyExplosionBoom.cs index 28d9b384aa..bdaf96015a 100644 --- a/Projectiles/Boss/HolyExplosionBoom.cs +++ b/Projectiles/Boss/HolyExplosionBoom.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -12,7 +13,7 @@ namespace CalamityMod.Projectiles.Boss public override float GetScreenshakePower(float pulseCompletionRatio) => CalamityUtils.Convert01To010(pulseCompletionRatio) * 16f; public override Color GetCurrentExplosionColor(float pulseCompletionRatio) { - Color explosionColor = CalamityMod.Instance.legendaryMode ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : (Main.dayTime ? Color.Orange : Color.BlueViolet); + Color explosionColor = CalamityWorld.getFixedBoi ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : (Main.dayTime ? Color.Orange : Color.BlueViolet); return Color.Lerp(explosionColor * 1.6f, Color.White, MathHelper.Clamp(pulseCompletionRatio * 2.2f, 0f, 1f)); } public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 62672e9667..7031177e1d 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -1,9 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using System; +using System.IO; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs.Yharon; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -111,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss } int tornadoSpeed = 10; int breakThreshold = -300; - bool breakapart = CalamityMod.Instance.legendaryMode && Projectile.ai[0] <= breakThreshold; + bool breakapart = CalamityWorld.getFixedBoi && Projectile.ai[0] <= breakThreshold; if (Projectile.ai[0] <= 0f && !breakapart) { float num622 = 0.104719758f; @@ -123,7 +124,7 @@ namespace CalamityMod.Projectiles.Boss num624 = (float)(Math.Cos((double)(num622 * -(double)Projectile.ai[0])) - 0.5) * num623; Projectile.position.X += num624 * -Projectile.direction; } - if (Projectile.ai[0] == breakThreshold && CalamityMod.Instance.legendaryMode) + if (Projectile.ai[0] == breakThreshold && CalamityWorld.getFixedBoi) { Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed; } diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index e1894737c3..f8bf5e39ca 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -1,9 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using System; +using System.IO; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs.Yharon; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -111,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss } int tornadoSpeed = 10; int breakThreshold = -300; - bool breakapart = CalamityMod.Instance.legendaryMode && Projectile.ai[0] <= breakThreshold; + bool breakapart = CalamityWorld.getFixedBoi && Projectile.ai[0] <= breakThreshold; if (Projectile.ai[0] <= 0f && !breakapart) { float num622 = 0.104719758f; @@ -123,7 +124,7 @@ namespace CalamityMod.Projectiles.Boss num624 = (float)(Math.Cos((double)(num622 * -(double)Projectile.ai[0])) - 0.5) * num623; Projectile.position.X += num624 * -Projectile.direction; } - if (Projectile.ai[0] == breakThreshold && CalamityMod.Instance.legendaryMode) + if (Projectile.ai[0] == breakThreshold && CalamityWorld.getFixedBoi) { Projectile.velocity.X = Main.rand.NextBool(2) ? -tornadoSpeed : tornadoSpeed; } diff --git a/Projectiles/Boss/MushBomb.cs b/Projectiles/Boss/MushBomb.cs index 34b709ba5f..c4b105bc9d 100644 --- a/Projectiles/Boss/MushBomb.cs +++ b/Projectiles/Boss/MushBomb.cs @@ -1,9 +1,11 @@ -using Microsoft.Xna.Framework; +using CalamityMod.World; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; + namespace CalamityMod.Projectiles.Boss { public class MushBomb : ModProjectile @@ -45,7 +47,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity.X *= 0.995f; } - public override Color? GetAlpha(Color drawColor) => CalamityMod.Instance.legendaryMode ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Projectile.alpha) : new Color(255, 255, 255, Projectile.alpha); + public override Color? GetAlpha(Color drawColor) => CalamityWorld.getFixedBoi ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Projectile.alpha) : new Color(255, 255, 255, Projectile.alpha); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index 671cf9c28a..1de1854c90 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => Projectile.velocity.Y >= 0f; - public override Color? GetAlpha(Color drawColor) => CalamityMod.Instance.legendaryMode ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Projectile.alpha) : new Color(255, 255, 255, Projectile.alpha); + public override Color? GetAlpha(Color drawColor) => CalamityWorld.getFixedBoi ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Projectile.alpha) : new Color(255, 255, 255, Projectile.alpha); public override bool PreDraw(ref Color lightColor) { @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Boss Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 2f); } - if (CalamityMod.Instance.legendaryMode && NPC.CountNPCS(NPCID.Crab) < 20 && Main.netMode != NetmodeID.MultiplayerClient) + if (CalamityWorld.getFixedBoi && NPC.CountNPCS(NPCID.Crab) < 20 && Main.netMode != NetmodeID.MultiplayerClient) { int crab = NPC.NewNPC(Projectile.GetSource_FromAI(), (int)Projectile.Center.X, (int)Projectile.Center.Y, NPCID.Crab); if (crab.WithinBounds(Main.maxNPCs)) diff --git a/Projectiles/Boss/OldDukeVortex.cs b/Projectiles/Boss/OldDukeVortex.cs index 957c818502..08f5822473 100644 --- a/Projectiles/Boss/OldDukeVortex.cs +++ b/Projectiles/Boss/OldDukeVortex.cs @@ -1,11 +1,12 @@ -using CalamityMod.Buffs.StatDebuffs; +using System; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.Projectiles.Boss { @@ -37,7 +38,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { if (Projectile.scale < 2f) { @@ -122,7 +123,7 @@ namespace CalamityMod.Projectiles.Boss } float distanceRequired = 800f * Projectile.scale; - float succPower = CalamityMod.Instance.legendaryMode ? 1f : 0.5f; + float succPower = CalamityWorld.getFixedBoi ? 1f : 0.5f; for (int i = 0; i < Main.maxPlayers; i++) { Player player = Main.player[i]; diff --git a/Projectiles/Boss/SwirlingFire.cs b/Projectiles/Boss/SwirlingFire.cs index 43ac92d724..70f7949ba0 100644 --- a/Projectiles/Boss/SwirlingFire.cs +++ b/Projectiles/Boss/SwirlingFire.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.World; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -30,11 +31,11 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { Vector2 fireVelocity = (Time / 6f).ToRotationVector2() * Main.rand.NextFloat(1.7f, 2.2f); - Dust fire = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(3f, 3f), CalamityMod.Instance.legendaryMode || !Main.dayTime ? 267 : 6); + Dust fire = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(3f, 3f), CalamityWorld.getFixedBoi || !Main.dayTime ? 267 : 6); fire.velocity = fireVelocity.RotatedBy(MathHelper.PiOver2); fire.scale = Main.rand.NextFloat(1.3f, 1.45f); fire.noGravity = true; - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) fire.color = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); else if (!Main.dayTime) fire.color = Color.Lerp(Color.Cyan, Color.BlueViolet, Main.rand.NextFloat()); diff --git a/Projectiles/Boss/YharonBulletHellVortex.cs b/Projectiles/Boss/YharonBulletHellVortex.cs index 0778a78590..2771501c9e 100644 --- a/Projectiles/Boss/YharonBulletHellVortex.cs +++ b/Projectiles/Boss/YharonBulletHellVortex.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; +using System.IO; using CalamityMod.NPCs.Yharon; -using System.IO; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -43,7 +44,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - if ((Main.npc[(int)Projectile.ai[1]].active && Main.npc[(int)Projectile.ai[1]].type == ModContent.NPCType()) || CalamityMod.Instance.legendaryMode) + if ((Main.npc[(int)Projectile.ai[1]].active && Main.npc[(int)Projectile.ai[1]].type == ModContent.NPCType()) || CalamityWorld.getFixedBoi) { if (TimeCountdown > 0f) { @@ -55,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss TimeCountdown--; // chase players in the zenith seed - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { Projectile.hostile = true; Projectile.width = Projectile.height = (int)(408f * Projectile.scale); diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index e2ee2820e3..af620ff175 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2615,7 +2615,7 @@ namespace CalamityMod.Projectiles } } - if (CalamityMod.Instance.legendaryMode && NPC.AnyNPCs(NPCType())) + if (CalamityWorld.getFixedBoi && NPC.AnyNPCs(NPCType())) { Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix); diff --git a/Projectiles/Enemy/CragmawVibeCheckChain.cs b/Projectiles/Enemy/CragmawVibeCheckChain.cs index 09c21c9750..c5bf731338 100644 --- a/Projectiles/Enemy/CragmawVibeCheckChain.cs +++ b/Projectiles/Enemy/CragmawVibeCheckChain.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using System.IO; +using CalamityMod.World; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System.IO; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy @@ -60,7 +61,7 @@ namespace CalamityMod.Projectiles.Enemy } if (Projectile.WithinRange(Main.player[toTarget].Center, 16f)) { - if (CalamityMod.Instance.legendaryMode) + if (CalamityWorld.getFixedBoi) { CombatText.NewText(Main.player[toTarget].getRect(), Color.Red, "Vibe check.", true); } diff --git a/Projectiles/Typeless/TerminusHoldout.cs b/Projectiles/Typeless/TerminusHoldout.cs index a883f92e4d..ada56f83e5 100644 --- a/Projectiles/Typeless/TerminusHoldout.cs +++ b/Projectiles/Typeless/TerminusHoldout.cs @@ -1,13 +1,13 @@ -using CalamityMod.Events; +using System; +using CalamityMod.Events; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.GameContent.Events; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Audio; using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent.Events; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture = CalamityMod.Instance.legendaryMode ? ModContent.Request("CalamityMod/Items/SummonItems/Terminus_GFB").Value : ModContent.Request(Texture).Value; + Texture2D texture = CalamityWorld.getFixedBoi ? ModContent.Request("CalamityMod/Items/SummonItems/Terminus_GFB").Value : ModContent.Request(Texture).Value; Vector2 baseDrawPosition = Projectile.Center - Main.screenPosition; Vector2 origin = texture.Size() * 0.5f; Color baseColor = Color.Lerp(Projectile.GetAlpha(lightColor), Color.White, Utils.GetLerpValue(40f, 120f, Time, true)); diff --git a/Scenes/BossBackgroundScenes/CalamitasCloneBackgroundScene.cs b/Scenes/BossBackgroundScenes/CalamitasCloneBackgroundScene.cs index 5e4337047f..eb8aaaa389 100644 --- a/Scenes/BossBackgroundScenes/CalamitasCloneBackgroundScene.cs +++ b/Scenes/BossBackgroundScenes/CalamitasCloneBackgroundScene.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using Terraria; using Terraria.ModLoader; diff --git a/Scenes/BossBackgroundScenes/DrunkCrabBackgroundScene.cs b/Scenes/BossBackgroundScenes/DrunkCrabBackgroundScene.cs index 6cf0794be2..5c7f048f6b 100644 --- a/Scenes/BossBackgroundScenes/DrunkCrabBackgroundScene.cs +++ b/Scenes/BossBackgroundScenes/DrunkCrabBackgroundScene.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs.Crabulon; +using CalamityMod.World; using Terraria; using Terraria.ModLoader; @@ -8,7 +9,7 @@ namespace CalamityMod.Systems { public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; - public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType()) && CalamityMod.Instance.legendaryMode; + public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType()) && CalamityWorld.getFixedBoi; public override void SpecialVisuals(Player player, bool isActive) { diff --git a/Scenes/MusicScenes/CalamitasMusicScene.cs b/Scenes/MusicScenes/CalamitasMusicScene.cs index e697339078..b2f37c5415 100644 --- a/Scenes/MusicScenes/CalamitasMusicScene.cs +++ b/Scenes/MusicScenes/CalamitasMusicScene.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Skies/DrunkCrabScreenShaderData.cs b/Skies/DrunkCrabScreenShaderData.cs index ffc556c50b..4a504379e0 100644 --- a/Skies/DrunkCrabScreenShaderData.cs +++ b/Skies/DrunkCrabScreenShaderData.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs.Crabulon; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.Graphics.Effects; @@ -36,10 +37,10 @@ namespace CalamityMod.Skies public override void Update(GameTime gameTime) { - if (CrabIndex == -1 || !CalamityMod.Instance.legendaryMode) + if (CrabIndex == -1 || !CalamityWorld.getFixedBoi) { UpdateBossIndex(); - if (CrabIndex == -1 || !CalamityMod.Instance.legendaryMode) + if (CrabIndex == -1 || !CalamityWorld.getFixedBoi) Filters.Scene["CalamityMod:DrunkCrabulon"].Deactivate(); } } diff --git a/Systems/DownedBossSystem.cs b/Systems/DownedBossSystem.cs index cfd0bc5554..9726581e88 100644 --- a/Systems/DownedBossSystem.cs +++ b/Systems/DownedBossSystem.cs @@ -19,7 +19,7 @@ namespace CalamityMod internal static bool _downedCryogen = false; internal static bool _downedAquaticScourge = false; internal static bool _downedBrimstoneElemental = false; - internal static bool _downedCalamitas = false; + internal static bool _downedCalamitasClone = false; internal static bool _downedLeviathan = false; internal static bool _downedAstrumAureus = false; internal static bool _downedPlaguebringer = false; @@ -40,7 +40,7 @@ namespace CalamityMod internal static bool _downedThanatos = false; // only used for loot drops internal static bool _downedArtemisAndApollo = false; // only used for loot drops internal static bool _downedExoMechs = false; - internal static bool _downedSCal = false; + internal static bool _downedCalamitas = false; internal static bool _downedAdultEidolonWyrm = false; // Minibosses @@ -160,15 +160,15 @@ namespace CalamityMod NPC.SetEventFlagCleared(ref _downedBrimstoneElemental, -1); } } - public static bool downedCalamitas + public static bool downedCalamitasClone { - get => _downedCalamitas; + get => _downedCalamitasClone; set { if (!value) - _downedCalamitas = false; + _downedCalamitasClone = false; else - NPC.SetEventFlagCleared(ref _downedCalamitas, -1); + NPC.SetEventFlagCleared(ref _downedCalamitasClone, -1); } } public static bool downedLeviathan @@ -358,15 +358,15 @@ namespace CalamityMod NPC.SetEventFlagCleared(ref _downedExoMechs, -1); } } - public static bool downedSCal + public static bool downedCalamitas { - get => _downedSCal; + get => _downedCalamitas; set { if (!value) - _downedSCal = false; + _downedCalamitas = false; else - NPC.SetEventFlagCleared(ref _downedSCal, -1); + NPC.SetEventFlagCleared(ref _downedCalamitas, -1); } } public static bool downedAdultEidolonWyrm @@ -516,7 +516,7 @@ namespace CalamityMod downedCryogen = false; downedAquaticScourge = false; downedBrimstoneElemental = false; - downedCalamitas = false; + downedCalamitasClone = false; downedLeviathan = false; downedAstrumAureus = false; downedBetsy = false; @@ -537,7 +537,7 @@ namespace CalamityMod downedThanatos = false; downedArtemisAndApollo = false; downedExoMechs = false; - downedSCal = false; + downedCalamitas = false; downedAdultEidolonWyrm = false; downedSecondSentinels = false; @@ -584,7 +584,7 @@ namespace CalamityMod downed.Add("aquaticScourge"); if (downedBrimstoneElemental) downed.Add("brimstoneElemental"); - if (downedCalamitas) + if (downedCalamitasClone) downed.Add("calamitas"); if (downedLeviathan) downed.Add("leviathan"); @@ -630,7 +630,7 @@ namespace CalamityMod downed.Add("ares"); if (downedExoMechs) downed.Add("exoMechs"); - if (downedSCal) + if (downedCalamitas) downed.Add("supremeCalamitas"); if (downedAdultEidolonWyrm) downed.Add("adultEidolonWyrm"); @@ -674,7 +674,7 @@ namespace CalamityMod downedDreadnautilus = downed.Contains("dreadnautilus"); downedCryogen = downed.Contains("cryogen"); downedBrimstoneElemental = downed.Contains("brimstoneElemental"); - downedCalamitas = downed.Contains("calamitas"); + downedCalamitasClone = downed.Contains("calamitas"); downedLeviathan = downed.Contains("leviathan"); downedAstrumAureus = downed.Contains("astrageldon"); downedBetsy = downed.Contains("betsy"); @@ -697,7 +697,7 @@ namespace CalamityMod downedArtemisAndApollo = downed.Contains("artemisAndApollo"); downedAres = downed.Contains("ares"); downedExoMechs = downed.Contains("exoMechs"); - downedSCal = downed.Contains("supremeCalamitas"); + downedCalamitas = downed.Contains("supremeCalamitas"); downedAdultEidolonWyrm = downed.Contains("adultEidolonWyrm"); downedCLAM = downed.Contains("clam"); diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/WorldMiscUpdateSystem.cs index 94b972932b..170f211391 100644 --- a/Systems/WorldMiscUpdateSystem.cs +++ b/Systems/WorldMiscUpdateSystem.cs @@ -1,4 +1,5 @@ -using CalamityMod.CalPlayer; +using System; +using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.NPCs; using CalamityMod.NPCs.AdultEidolonWyrm; @@ -8,8 +9,8 @@ using CalamityMod.Projectiles.Boss; using CalamityMod.Tiles; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.SunkenSea; +using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.DataStructures; using Terraria.GameContent.Events; @@ -85,7 +86,7 @@ namespace CalamityMod.Systems // Very, very, very rarely display a Lorde joke text if the system clock is set to April Fools Day. if (Main.rand.NextBool(100000000) && DateTime.Now.Month == 4 && DateTime.Now.Day == 1) { - string key = CalamityMod.Instance.legendaryMode ? "Mods.CalamityMod.AprilFoolsGFB" : "Mods.CalamityMod.AprilFools"; + string key = CalamityWorld.getFixedBoi ? "Mods.CalamityMod.AprilFoolsGFB" : "Mods.CalamityMod.AprilFools"; Color messageColor = Color.Crimson; CalamityUtils.DisplayLocalizedText(key, messageColor); } @@ -315,7 +316,7 @@ namespace CalamityMod.Systems public static bool CanPlaceBasedOnProximity(int x, int y, int tileType) { - if (tileType == ModContent.TileType() && !DownedBossSystem.downedCalamitas) + if (tileType == ModContent.TileType() && !DownedBossSystem.downedCalamitasClone) return false; int minDistanceFromOtherTiles = 6; @@ -340,7 +341,7 @@ namespace CalamityMod.Systems #region Handle Armored Digger Random Spawns public static void TrySpawnArmoredDigger(Player player, CalamityPlayer modPlayer) { - bool gfbCondition = CalamityMod.Instance.legendaryMode && (player.ZoneHallow || player.ZoneUnderworldHeight) && NPC.downedMoonlord; + bool gfbCondition = CalamityWorld.getFixedBoi && (player.ZoneHallow || player.ZoneUnderworldHeight) && NPC.downedMoonlord; if ((gfbCondition || (player.ZoneRockLayerHeight && !player.ZoneUnderworldHeight && !player.ZoneJungle)) && !player.ZoneDungeon && !modPlayer.ZoneSunkenSea && !modPlayer.ZoneAbyss && !CalamityPlayer.areThereAnyDamnBosses) { if (NPC.downedPlantBoss && player.townNPCs < 3f) @@ -416,7 +417,7 @@ namespace CalamityMod.Systems #region Handle Adult Eidolon Wyrm Spawns public static void TrySpawnAEoW(Player player, CalamityPlayer modPlayer) { - if (Main.netMode == NetmodeID.MultiplayerClient || !(modPlayer.ZoneAbyss || CalamityMod.Instance.legendaryMode) || !player.chaosState || player.dead) + if (Main.netMode == NetmodeID.MultiplayerClient || !(modPlayer.ZoneAbyss || CalamityWorld.getFixedBoi) || !player.chaosState || player.dead) return; bool adultWyrmAlive = CalamityGlobalNPC.adultEidolonWyrmHead != -1 && Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active; diff --git a/Systems/WorldSyncingSystem.cs b/Systems/WorldSyncingSystem.cs index 0db3e0fa97..6143bbb4f8 100644 --- a/Systems/WorldSyncingSystem.cs +++ b/Systems/WorldSyncingSystem.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Systems flags[3] = downedSlimeGod; flags[4] = downedCryogen; flags[5] = downedBrimstoneElemental; - flags[6] = downedCalamitas; + flags[6] = downedCalamitasClone; flags[7] = downedLeviathan; BitsByte flags2 = new BitsByte(); @@ -36,7 +36,7 @@ namespace CalamityMod.Systems // Don't write meaningful values for the now-unused vanilla boss booleans BitsByte flags3 = new BitsByte(); - flags3[0] = downedSCal; + flags3[0] = downedCalamitas; flags3[1] = downedDragonfolly; flags3[2] = downedCrabulon; flags3[3] = downedBetsy; @@ -173,7 +173,7 @@ namespace CalamityMod.Systems downedSlimeGod = flags[3]; downedCryogen = flags[4]; downedBrimstoneElemental = flags[5]; - downedCalamitas = flags[6]; + downedCalamitasClone = flags[6]; downedLeviathan = flags[7]; BitsByte flags2 = reader.ReadByte(); @@ -188,7 +188,7 @@ namespace CalamityMod.Systems // Explicitly discard the now-unused vanilla boss booleans BitsByte flags3 = reader.ReadByte(); - downedSCal = flags3[0]; + downedCalamitas = flags3[0]; downedDragonfolly = flags3[1]; downedCrabulon = flags3[2]; downedBetsy = flags3[3]; diff --git a/Tiles/ArenaTile.cs b/Tiles/ArenaTile.cs index 72b60f9e80..83b1fff6c3 100644 --- a/Tiles/ArenaTile.cs +++ b/Tiles/ArenaTile.cs @@ -1,10 +1,11 @@ -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.SupremeCalamitas; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ID; using CalamityMod.Skies; +using CalamityMod.World; namespace CalamityMod.Tiles { @@ -35,7 +36,7 @@ namespace CalamityMod.Tiles { if (closer) { - if (!NPC.AnyNPCs(ModContent.NPCType()) && !SCalSky.RitualDramaProjectileIsPresent && !(NPC.AnyNPCs(ModContent.NPCType()) && CalamityMod.Instance.legendaryMode)) + if (!NPC.AnyNPCs(ModContent.NPCType()) && !SCalSky.RitualDramaProjectileIsPresent && !(NPC.AnyNPCs(ModContent.NPCType()) && CalamityWorld.getFixedBoi)) { WorldGen.KillTile(i, j, false, false, false); if (!Main.tile[i, j].HasTile && Main.netMode != NetmodeID.SinglePlayer) diff --git a/Tiles/Furniture/BossTrophies/CalamitasTrophyTile.cs b/Tiles/Furniture/BossTrophies/CalamitasCloneTrophyTile.cs similarity index 80% rename from Tiles/Furniture/BossTrophies/CalamitasTrophyTile.cs rename to Tiles/Furniture/BossTrophies/CalamitasCloneTrophyTile.cs index 7796e9f8b5..4877271c1a 100644 --- a/Tiles/Furniture/BossTrophies/CalamitasTrophyTile.cs +++ b/Tiles/Furniture/BossTrophies/CalamitasCloneTrophyTile.cs @@ -2,14 +2,13 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; -using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ObjectData; namespace CalamityMod.Tiles.Furniture.BossTrophies { - public class CalamitasTrophyTile : ModTile + [LegacyName("CalamitasTrophyTile")] + public class CalamitasCloneTrophyTile : ModTile { public override void SetStaticDefaults() { @@ -20,7 +19,7 @@ namespace CalamityMod.Tiles.Furniture.BossTrophies public override void KillMultiTile(int i, int j, int frameX, int frameY) { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 48, ModContent.ItemType()); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 48, ModContent.ItemType()); } } } diff --git a/Tiles/Furniture/BossTrophies/CalamitasTrophyTile.png b/Tiles/Furniture/BossTrophies/CalamitasCloneTrophyTile.png similarity index 100% rename from Tiles/Furniture/BossTrophies/CalamitasTrophyTile.png rename to Tiles/Furniture/BossTrophies/CalamitasCloneTrophyTile.png diff --git a/Tiles/Furniture/BossTrophy.cs b/Tiles/Furniture/BossTrophy.cs index d6763d7079..903e013fd7 100644 --- a/Tiles/Furniture/BossTrophy.cs +++ b/Tiles/Furniture/BossTrophy.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Tiles.Furniture item = ModContent.ItemType(); break; case 7: - item = ModContent.ItemType(); + item = ModContent.ItemType(); break; case 8: item = ModContent.ItemType(); diff --git a/Tiles/Furniture/Fountains/SulphurousFountainTile.cs b/Tiles/Furniture/Fountains/SulphurousFountainTile.cs index 33b7ee10fd..eedbbeb654 100644 --- a/Tiles/Furniture/Fountains/SulphurousFountainTile.cs +++ b/Tiles/Furniture/Fountains/SulphurousFountainTile.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.Furniture.Fountains; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -21,7 +22,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - string waterColor = CalamityMod.Instance.legendaryMode ? "CalamityMod/PissWater" : "CalamityMod/SulphuricWater"; + string waterColor = CalamityWorld.getFixedBoi ? "CalamityMod/PissWater" : "CalamityMod/SulphuricWater"; if (Main.tile[i, j].TileFrameX >= 36) CalamityGlobalTile.SetActiveFountainColor(ModContent.Find(waterColor).Slot); } diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index e4d01ba0f2..8de0d225a0 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -1,7 +1,7 @@ using CalamityMod.Events; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.DesertScourge; using CalamityMod.NPCs.DevourerofGods; diff --git a/UI/DraedonSummoning/CodebreakerUI.cs b/UI/DraedonSummoning/CodebreakerUI.cs index 44b8689337..8b4b760705 100644 --- a/UI/DraedonSummoning/CodebreakerUI.cs +++ b/UI/DraedonSummoning/CodebreakerUI.cs @@ -273,7 +273,7 @@ namespace CalamityMod.UI.DraedonSummoning // If the slot is normally clicked, behavior depends on whether the player is holding power cells. else { - bool holdingPowercell = playerHandItem.type == powercellID || (playerHandItem.type == sampleID && CalamityMod.Instance.legendaryMode); + bool holdingPowercell = playerHandItem.type == powercellID || (playerHandItem.type == sampleID && CalamityWorld.getFixedBoi); bool powercellsinserted = !codebreakerTileEntity.ContainsBloodSample && temporaryItem.stack > 0; bool cansummon = codebreakerTileEntity.ReadyToSummonDraedon && CalamityWorld.AbleToSummonDraedon; @@ -281,7 +281,7 @@ namespace CalamityMod.UI.DraedonSummoning if (holdingPowercell && temporaryItem.stack < TECodebreaker.MaxCellCapacity) { // If theres no power cells inside, it's GFB, and the player has a blood sample, it can be inserted - if (playerHandItem.type == sampleID && CalamityMod.Instance.legendaryMode && !powercellsinserted && cansummon) + if (playerHandItem.type == sampleID && CalamityWorld.getFixedBoi && !powercellsinserted && cansummon) { // Play a gross sound if no samples are in yet if (temporaryItem.stack == 0) @@ -586,7 +586,7 @@ namespace CalamityMod.UI.DraedonSummoning { CalamityWorld.DraedonSummonCountdown = CalamityWorld.DraedonSummonCountdownMax; CalamityWorld.DraedonSummonPosition = codebreakerTileEntity.Center + new Vector2(-8f, -100f); - if (CalamityMod.Instance.legendaryMode && codebreakerTileEntity.ContainsBloodSample) + if (CalamityWorld.getFixedBoi && codebreakerTileEntity.ContainsBloodSample) { CalamityWorld.DraedonMechdusa = true; } diff --git a/UI/DraedonSummoning/DraedonDialogRegistry.cs b/UI/DraedonSummoning/DraedonDialogRegistry.cs index 852d274c44..0763dc9197 100644 --- a/UI/DraedonSummoning/DraedonDialogRegistry.cs +++ b/UI/DraedonSummoning/DraedonDialogRegistry.cs @@ -9,10 +9,10 @@ namespace CalamityMod.UI.DraedonSummoning "The exact circumstances, I do not know. I do know that my first instance of awareness was that I was surrounded by a workshop.\n\n" + "All I have known since then was the act of creation and destruction."); - public static readonly DraedonDialogEntry CalamitasBeforeHerDefeat = new("Calamitas", "The witch? She is a walking weapon. Such powerful magic in a living being was destined to be so. Look at yourself now.", () => !DownedBossSystem.downedSCal); + public static readonly DraedonDialogEntry CalamitasBeforeHerDefeat = new("Calamitas", "The witch? She is a walking weapon. Such powerful magic in a living being was destined to be so. Look at yourself now.", () => !DownedBossSystem.downedCalamitas); public static readonly DraedonDialogEntry CalamitasAfterHerDefeat = new("Calamitas", "She has mellowed, I've noticed. For you creatures so burdened by emotion and guilt, I wonder now, how she manages to live with herself.", () => - DownedBossSystem.downedSCal); + DownedBossSystem.downedCalamitas); public static readonly DraedonDialogEntry Plague = new("The Plague", "Fascinating, isn't it? I wasn't able to control it, unfortunately, but for science there is no such thing as failure as long as you record the results.\n\n" + "I knew the Astral Infection was capable of converting even machinery, but for nanotechnology I'd given it to react in kind, and begin to use the virus as a building block itself...\n\n" + @@ -26,7 +26,7 @@ namespace CalamityMod.UI.DraedonSummoning public static readonly DraedonDialogEntry TheTyrant = new("The Tyrant", "My patron...\n" + "He is not someone I have spoken to in a very long time.\n\n" + "Is that such a surprise? He no longer required my services and I no longer needed his patronage. Many years ago now he withdrew himself to some secret hideaway. I suspect, to the grave of dragons he spoke of...\n\n" + - "Should you locate him, I'll await the news of either his or your death. Perhaps I will collect the cadaver.", () => DownedBossSystem.downedSCal); + "Should you locate him, I'll await the news of either his or your death. Perhaps I will collect the cadaver.", () => DownedBossSystem.downedCalamitas); internal static List DialogOptions = new() { diff --git a/UI/SpeedrunTimerUI.cs b/UI/SpeedrunTimerUI.cs index da08e3236c..cd8e75828f 100644 --- a/UI/SpeedrunTimerUI.cs +++ b/UI/SpeedrunTimerUI.cs @@ -6,7 +6,7 @@ using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Cryogen; diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index a938b3c6ba..afd65ed963 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -628,9 +628,9 @@ namespace CalamityMod public static IItemDropRuleCondition PostSP(bool ui = true) => If(() => NPC.downedMechBoss3, ui, "Drops after defeating Skeletron Prime"); public static IItemDropRuleCondition Post1Mech(bool ui = true) => If(() => NPC.downedMechBossAny, ui, "Drops after defeating a Mechanical Boss"); public static IItemDropRuleCondition Post3Mechs(bool ui = true) => If(() => NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3, ui, "Drops after defeating all three Mechanical Bosses"); - public static IItemDropRuleCondition PostCal(bool ui = true) => If(() => DownedBossSystem.downedCalamitas, ui, "Drops after defeating Calamitas"); + public static IItemDropRuleCondition PostCal(bool ui = true) => If(() => DownedBossSystem.downedCalamitasClone, ui, "Drops after defeating Calamitas Clone"); public static IItemDropRuleCondition PostPlant(bool ui = true) => If(() => NPC.downedPlantBoss, ui, "Drops after defeating Plantera"); - public static IItemDropRuleCondition PostCalPlant(bool ui = true) => If(() => DownedBossSystem.downedCalamitas || NPC.downedPlantBoss, ui, "Drops after defeating Calamitas or Plantera"); + public static IItemDropRuleCondition PostCalPlant(bool ui = true) => If(() => DownedBossSystem.downedCalamitasClone || NPC.downedPlantBoss, ui, "Drops after defeating Calamitas or Plantera"); public static IItemDropRuleCondition PostLevi(bool ui = true) => If(() => DownedBossSystem.downedLeviathan, ui, "Drops after defeating the Leviathan and Anahita"); public static IItemDropRuleCondition PostAureus(bool ui = true) => If(() => DownedBossSystem.downedAstrumAureus, ui, "Drops after defeating Astrum Aureus"); public static IItemDropRuleCondition PostGolem(bool ui = true) => If(() => NPC.downedGolemBoss, ui, "Drops after defeating Golem"); @@ -652,7 +652,7 @@ namespace CalamityMod public static IItemDropRuleCondition PostDoG(bool ui = true) => If(() => DownedBossSystem.downedDoG, ui, "Drops after defeating the Devourer of Gods"); public static IItemDropRuleCondition PostYharon(bool ui = true) => If(() => DownedBossSystem.downedYharon, ui, "Drops after defeating Yharon"); public static IItemDropRuleCondition PostExos(bool ui = true) => If(() => DownedBossSystem.downedExoMechs, ui, "Drops after defeating the Exo Mechs"); - public static IItemDropRuleCondition PostSCal(bool ui = true) => If(() => DownedBossSystem.downedSCal, ui, "Drops after defeating Supreme Calamitas"); + public static IItemDropRuleCondition PostSCal(bool ui = true) => If(() => DownedBossSystem.downedCalamitas, ui, "Drops after defeating Calamitas"); public static IItemDropRuleCondition PostAEW(bool ui = true) => If(() => DownedBossSystem.downedAdultEidolonWyrm, ui, "Drops after defeating the Adult Eidolon Wyrm"); public static IItemDropRuleCondition PostClam(bool ui = true) => If(() => DownedBossSystem.downedCLAM, ui, "Drops after defeating the Giant Clam"); public static IItemDropRuleCondition PostClamHM(bool ui = true) => If(() => DownedBossSystem.downedCLAMHardMode, ui, "Drops after defeating the Giant Clam in Hardmode"); diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 7017389cf4..44b07f10db 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -8,7 +8,7 @@ using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crags; using CalamityMod.NPCs.Cryogen; diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index c39aec4b13..b0fd996e33 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -25,6 +25,11 @@ namespace CalamityMod.World public static bool revenge = false; // Revengeance Mode public static bool death = false; // Death Mode public static bool armageddon = false; // Armageddon Mode + public static bool LegendaryMode => Main.getGoodWorld && Main.masterMode; // Evaluates to whether vanilla's "Legendary Mode" is enabled (Master Mode on For the Worthy) + + // TODO -- This is intentionally a constant so that all relevant code gets compiled out, or at the very least cannot be re-enabled without extensive IL editing. + // When the 1.4.4 port occurs, this will be changed to a property which retrieves Main.zenithWorld. + internal const bool getFixedBoi = false; // True when the "get fixed boi" (aka "Zenith") seed is active, which combines all other seeds. // Sunken Sea public static Rectangle SunkenSeaLocation = Rectangle.Empty;