diff --git a/Items/SummonItems/ProfanedCore.cs b/Items/SummonItems/ProfanedCore.cs index 0176a2ae0c..4cb746ce79 100644 --- a/Items/SummonItems/ProfanedCore.cs +++ b/Items/SummonItems/ProfanedCore.cs @@ -1,4 +1,6 @@ -using CalamityMod.Events; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Events; using CalamityMod.NPCs; using CalamityMod.NPCs.Providence; using CalamityMod.Projectiles.Boss; @@ -36,28 +38,27 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - var Prov = CalamityGlobalNPC.holyBoss; - bool canPissOffProvi = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged; - return ((!NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHallow || player.ZoneUnderworldHeight)) || canPissOffProvi) && !BossRushEvent.BossRushActive; + return !NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) { - var Prov = CalamityGlobalNPC.holyBoss; - bool usingToMakeProviPissedOff = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged; - if (usingToMakeProviPissedOff) + int posX = (int)player.position.X; + int posY = (int)(player.position.Y - 100f); + int bossToSpawn = ModContent.NPCType(); + NPC prov = CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, Providence.SpawnSound); + if (Main.getGoodWorld) { - (Main.npc[Prov].ModNPC as Providence).hasBeenGivenFullPower = true; + (prov.ModNPC as Providence).hasBeenGivenFullPower = true; Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0); } - else - { - int posX = (int)player.position.X; - int posY = (int)(player.position.Y - 100f); - int bossToSpawn = ModContent.NPCType(); - CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, Providence.SpawnSound); - } return true; } + + public override void ModifyTooltips(List tooltips) + { + string enrageTooltip = Main.getGoodWorld ? "\n" + this.GetLocalizedValue("EnrageText") : ""; + tooltips.FindAndReplace("[ENRAGE]", enrageTooltip); + } } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 3ae132b727..4e949f3dee 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -226,11 +226,11 @@ ProfanedCore: { DisplayName: Profaned Core Tooltip: ''' - Summons Providence when used in the Hallow or Underworld - Use again while Providence is at high health to unleash Her perfect fury + Summons Providence when used in the Hallow or Underworld[ENRAGE] {$Common.NotConsumable} 'The heart of Her Guardians, Her wicked wrath shall burn upon whoever now wields it.' ''' + EnrageText: "[c/64c8fa:The nature of this world will unleash Her perfect fury, beware!]" } ProfanedShard: { diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 9c0835999f..e21ebc6a6a 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -598,7 +598,7 @@ TownPiggy: { Techno: Techno JohnPork: John Pork Piglet: Piglet - Poogie: Poogie + Poogie: Poogie } Chat: { diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 43ff5d3db8..06a46f1b90 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -290,7 +290,7 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - if (Main.getGoodWorld) + if (Main.zenithWorld) NPC.scale *= 0.25f; } @@ -400,8 +400,7 @@ namespace CalamityMod.NPCs.Providence Player player = Main.player[NPC.target]; // Enraged bool and Color shifting - bool getFuckedAI = Main.zenithWorld; - if (getFuckedAI) + if (Main.zenithWorld) NPC.localAI[1] = (float)BossMode.Rainbow; else if (hasBeenGivenFullPower) // Enraged behavior NPC.localAI[1] = (float)BossMode.Enraged; @@ -426,29 +425,15 @@ namespace CalamityMod.NPCs.Providence // Is in spawning animation float spawnAnimationTime = 180f; bool spawnAnimation = calamityGlobalNPC.newAI[3] < spawnAnimationTime; - if (!spawnAnimation) - { NPC.Opacity = 1f; - } // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; - // Play enrage animation if she gets angy - if (!getFuckedAI && fullPowerAI && calamityGlobalNPC.newAI[3] == spawnAnimationTime) + // Sync "enrage" status in FTW + if (NPC.localAI[1] == (float)BossMode.Enraged && calamityGlobalNPC.newAI[3] == 0f) { - AIState = (int)Phase.HolyBlast; - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - calamityGlobalNPC.newAI[1] = 0f; - calamityGlobalNPC.newAI[2] = 0f; - calamityGlobalNPC.newAI[3] = 0f; - - // Despawn existing projectiles and summon the aura again - DespawnSpecificProjectiles(true); - Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, -1); if (Main.netMode != NetmodeID.SinglePlayer) ProvidenceDyeConditionSyncPacket.Send(this); NPC.ForceNetUpdate(false); @@ -811,7 +796,7 @@ namespace CalamityMod.NPCs.Providence calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon || AIState == (int)Phase.Laser || spawnAnimation; // Movement - if (getFuckedAI || (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon)) + if (Main.zenithWorld || (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon)) { // Slowly drift down when spawning if (spawnAnimation) @@ -878,14 +863,8 @@ namespace CalamityMod.NPCs.Providence } if (laserPhaseSlow) { - acceleration *= getFuckedAI ? 0.6f : 0.2f; - velocity *= getFuckedAI ? 0.6f : 0.2f; - } - - if (Main.getGoodWorld) - { - velocity *= 1.2f; - acceleration *= 1.2f; + acceleration *= Main.zenithWorld ? 0.6f : 0.2f; + velocity *= Main.zenithWorld ? 0.6f : 0.2f; } if (!targetDead) @@ -898,14 +877,11 @@ namespace CalamityMod.NPCs.Providence float moveUpThreshold = player.position.Y - (NPC.position.Y + NPC.height); if (moveUpThreshold < (laserPhaseSlow ? 150f : 200f)) // 150 - NPC.velocity.Y -= Main.getGoodWorld ? 0.4f : 0.2f; + NPC.velocity.Y -= fullPowerAI ? 0.4f : 0.2f; if (moveUpThreshold > (laserPhaseSlow ? 200f : 250f)) // 200 - NPC.velocity.Y += Main.getGoodWorld ? 0.4f : 0.2f; + NPC.velocity.Y += fullPowerAI ? 0.4f : 0.2f; float speedCap = laserPhaseSlow ? 2f : 6f; - if (Main.getGoodWorld) - speedCap *= 1.5f; - if (NPC.velocity.Y > speedCap) NPC.velocity.Y = speedCap; if (NPC.velocity.Y < -speedCap) @@ -1121,29 +1097,7 @@ namespace CalamityMod.NPCs.Providence GeneralParticleHandler.SpawnParticle(new SparkParticle(startPos, startPos.DirectionTo(destination) * (startPos.Distance(destination) / 10), false, 10, Main.rand.NextFloat(0.2f, 0.5f) * (sc * 2), medColor)); } - // Used to heal her back to full HP during enrage animation - if (fullPowerAI && calamityGlobalNPC.newAI[3] % 9f == 0f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int healAmt = NPC.lifeMax / 400; - if (healAmt > NPC.lifeMax - NPC.life) - healAmt = NPC.lifeMax - NPC.life; - - if (healAmt > 0) - { - NPC.life += healAmt; - NPC.HealEffect(healAmt, true); - NPC.ForceNetUpdate(false); - } - } - } - calamityGlobalNPC.newAI[3] += 1f; - - if (fullPowerAI && calamityGlobalNPC.newAI[3] >= spawnAnimationTime) - calamityGlobalNPC.newAI[3] += 1f; - return; } @@ -1238,7 +1192,7 @@ namespace CalamityMod.NPCs.Providence borderPosition ??= NPC.Center; borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f); Vector2 fireSparklesFrom = fireFrom + new Vector2(0, -30); - if (!targetDead && !getFuckedAI) + if (!targetDead && !Main.zenithWorld) { if (NPC.velocity.Length() <= 2f) NPC.velocity = Vector2.Zero; @@ -1509,7 +1463,7 @@ namespace CalamityMod.NPCs.Providence borderPosition ??= NPC.Center; borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f); - if (!targetDead && !getFuckedAI) + if (!targetDead && !Main.zenithWorld) { if (NPC.velocity.Length() <= 2f) NPC.velocity = Vector2.Zero; @@ -1554,9 +1508,6 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); - - if (Main.getGoodWorld) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1581,9 +1532,6 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); - - if (Main.getGoodWorld) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); } } @@ -1601,7 +1549,7 @@ namespace CalamityMod.NPCs.Providence case (int)Phase.Crystal: - if (!targetDead && !getFuckedAI) + if (!targetDead && !Main.zenithWorld) NPC.velocity *= 0.9f; NPC.ai[1] += 1f; @@ -1673,7 +1621,7 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { - float timeLeft = fullPowerAI ? (float)(getFuckedAI ? gfbCrystalTime : enragedCrystalTime) : 0f; + float timeLeft = fullPowerAI ? (float)(Main.zenithWorld ? gfbCrystalTime : enragedCrystalTime) : 0f; Projectile.NewProjectile(NPC.GetSource_FromAI(), crystalSpawnPos, Vector2.Zero, ModContent.ProjectileType(), CrystalDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, lifeRatio, 0f, timeLeft); } } @@ -2094,7 +2042,7 @@ namespace CalamityMod.NPCs.Providence public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - bool offColor = NPC.localAI[1] != (float)BossMode.Normal && (NPC.Calamity().newAI[3] >= 180f || Main.zenithWorld); + bool offColor = NPC.localAI[1] != (float)BossMode.Normal; Texture2D texture = offColor ? TextureNight.Value : TextureAssets.Npc[Type].Value; Texture2D textureGlow = offColor ? TextureNight_Glow.Value : Texture_Glow.Value; diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 3abbfc578f..c70af794b1 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -161,9 +161,6 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { int totalProjectiles = !ProvUtils.StandardAI() ? 8 : 6; - if (Main.getGoodWorld) - totalProjectiles *= 2; - float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 5f; diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 36404593ba..e76ac00c6f 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.timeLeft = 160; } - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) { if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) { @@ -74,8 +74,8 @@ namespace CalamityMod.Projectiles.Boss } else { - Projectile.ai[1] += 0.05f; - Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, (float)Math.Abs(Math.Sin(Projectile.ai[1]))); + Projectile.ai[1] += 0.075f; + Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, MathF.Abs(MathF.Sin(Projectile.ai[1]))); } } else if (Projectile.velocity.Length() < 16f) diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index a25b4d1497..5347d93748 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -90,12 +90,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.01f, 0f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); @@ -106,12 +106,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.05f, 0f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index c5a137939a..1a972a6df7 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -166,7 +166,7 @@ namespace CalamityMod.Projectiles.Boss { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f) + additionalBlobVelocity; velocity.Y = -Math.Abs(velocity.Y); - if (Main.getGoodWorld) + if (!ProvUtils.StandardAI()) velocity *= 2f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), BlobDamage, 0f, Projectile.owner); diff --git a/Scenes/MusicScenes/ProvidenceMusicScene.cs b/Scenes/MusicScenes/ProvidenceMusicScene.cs index 33b94b0f75..57c5e761e3 100644 --- a/Scenes/MusicScenes/ProvidenceMusicScene.cs +++ b/Scenes/MusicScenes/ProvidenceMusicScene.cs @@ -13,12 +13,12 @@ namespace CalamityMod.Systems public override int NPCType => ModContent.NPCType(); public static int ProvidenceTrack => (int)CalamityMod.Instance.GetMusicFromMusicMod("Providence"); public static int SilenceTrack => MusicLoader.GetMusicSlot(CalamityMod.Instance, "Sounds/Music/Silence"); - public override int? MusicModMusic => ProvidenceSpawnState() < 180f && ProvUtils.StandardAI() ? SilenceTrack : ProvidenceTrack; + public override int? MusicModMusic => ProvidenceSpawnState() < 180f ? SilenceTrack : ProvidenceTrack; public override int VanillaMusic => MusicID.LunarBoss; public override int OtherworldMusic => MusicID.OtherworldlyLunarBoss; public override void SpecialVisuals(Player player, bool isActive) { - if (ProvidenceSpawnState() == 180f && ProvUtils.StandardAI()) + if (ProvidenceSpawnState() == 180f) Main.musicFade[ProvidenceTrack] = 1f; } public static float ProvidenceSpawnState()