diff --git a/Items/SummonItems/ProfanedCore.cs b/Items/SummonItems/ProfanedCore.cs index 8aa95d0e74..c61306273d 100644 --- a/Items/SummonItems/ProfanedCore.cs +++ b/Items/SummonItems/ProfanedCore.cs @@ -1,5 +1,8 @@ using CalamityMod.Events; +using CalamityMod.NPCs; using CalamityMod.NPCs.Providence; +using CalamityMod.Projectiles.Boss; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,15 +36,27 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return !NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; + 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()) || canPissOffProvi) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) { - 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); + 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) + { + (Main.npc[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; } } diff --git a/Items/SummonItems/ProfanedShard.cs b/Items/SummonItems/ProfanedShard.cs index 28c9cfbc2d..11a1a9a4df 100644 --- a/Items/SummonItems/ProfanedShard.cs +++ b/Items/SummonItems/ProfanedShard.cs @@ -44,7 +44,6 @@ namespace CalamityMod.Items.SummonItems CalamityUtils.SpawnBossUsingItem(player, UseSound); return true; } - public override void ModifyTooltips(List list) => list.FindAndReplace("[SPAWN]", this.GetLocalizedValue(Main.remixWorld ? "SpawnRemix" : "SpawnNormal")); public override void AddRecipes() { diff --git a/Localization/en-US/Mods.CalamityMod.Condition.hjson b/Localization/en-US/Mods.CalamityMod.Condition.hjson index 07c3988bca..99fdd6fa50 100644 --- a/Localization/en-US/Mods.CalamityMod.Condition.hjson +++ b/Localization/en-US/Mods.CalamityMod.Condition.hjson @@ -41,7 +41,7 @@ Drops: { DownedT2AR: After defeating the second tier of Acid Rain FirstKill: Drops only on the first kill MechBoss: Drops on the first kill of the final Mechanical Boss - ProvidenceNight: Drops if Providence is only attacked during nighttime + ProvidenceEnraged: Drops if Providence has been enraged ProvidenceChallenge: ''' Drops if Providence was defeated only with the [i:CalamityMod/ProfanedSoulArtifact] Profaned Soul Artifact diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 6363622e50..c3de3820df 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -228,8 +228,7 @@ ProfanedCore: { Tooltip: ''' Summons Providence when used in the Hallow or Underworld - Unique drop changes depending on the biome fought in - Enrages when fought during nighttime + Use again while Providence is at high health to unleash Her perfect fury {$Common.NotConsumable} 'The heart of Her Guardians, Her wicked wrath shall burn upon whoever now wields it.' ''' @@ -239,16 +238,10 @@ ProfanedShard: { DisplayName: Profaned Shard Tooltip: ''' - [SPAWN] + Summons the Profaned Guardians when used in the Hallow or Underworld {$Common.NotConsumable} 'Her Guardians seek the holder of such vast stolen power.' ''' - SpawnNormal: - ''' - Summons the Profaned Guardians when used in the Hallow or Underworld - Enrages when fought during nighttime - ''' - SpawnRemix: Summons the Profaned Guardians when used in the Hallow or Underworld } SandstormsCore: { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 615e1eba18..edb2c1fdca 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3662,9 +3662,9 @@ namespace CalamityMod.NPCs cirrusBossActive = Main.npc[SCal].ModNPC().cirrus; } - bool nightProvi = npc.type == NPCType() && !Main.IsItDay(); + bool enragedProvi = npc.type == NPCType() && !ProvUtils.StandardAI(); bool dayEmpress = npc.type == NPCID.HallowBoss && NPC.ShouldEmpressBeEnraged(); - if (KillTime > 0 && AITimer < KillTime && !BossRushEvent.BossRushActive && !cirrusBossActive && (nightProvi || dayEmpress)) + if (KillTime > 0 && AITimer < KillTime && !BossRushEvent.BossRushActive && !cirrusBossActive && (enragedProvi || dayEmpress)) { // Set the DR scaling factor float DRScalar = 10f; @@ -6440,7 +6440,7 @@ namespace CalamityMod.NPCs modifiers.ScalingBonusDamage += (empowered ? 0.4f : 0.2f) * TagDamageMult; if (Main.netMode != NetmodeID.Server) { - var color = ProvUtils.GetDayNightColor(!Main.dayTime, 0); + var color = ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, 0); float power = Math.Min(npc.height / 100f, 3f); var position = new Vector2(Main.rand.NextFloat(npc.Left.X, npc.Right.X), Main.rand.NextFloat(npc.Top.Y, npc.Bottom.Y)); var particle = new FlameParticle(position, 50, 0.25f, power, color * (Main.dayTime ? 1f : 1.25f), color * (Main.dayTime ? 1.25f : 1f)); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 8f6db58b0b..2b8c31ad55 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -335,14 +335,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[3] < 0f) NPC.ai[3] = 0f; - // Enrage at nighttime - bool enraged = false; - if (!Main.dayTime && !Main.remixWorld) - { - enraged = true; - NPC.Calamity().CurrentlyEnraged = true; - } - bool phase1 = healerAlive || defenderAlive; NPC.chaseable = !phase1; @@ -367,7 +359,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float goLowOrHighDistance = 540f; // Side swap variables for Phase 2 - float defenderCommanderGuardPhase2Duration = (bossRush || enraged) ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float defenderCommanderGuardPhase2Duration = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; float moveToOtherSideInPhase2GateValue = defenderCommanderGuardPhase2Duration - 120f; float timeBeforeMoveToOtherSideInPhase2Reset = moveToOtherSideInPhase2GateValue * 2f; float totalGoLowDurationPhase2 = 210f; @@ -375,13 +367,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = (bossRush || enraged) ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; + float maxChargeVelocity = bossRush ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; if (Main.getGoodWorld) maxChargeVelocity *= 1.15f; if (CalamityWorld.LegendaryMode && revenge) maxChargeVelocity *= 2f; - float inertia = (bossRush || enraged) ? 40f : death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; + float inertia = bossRush ? 40f : death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; if (lifeRatio < 0.5f) inertia *= 0.8f; if (!phase1) @@ -464,7 +456,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (!goLow && !goLowPhase2 && !goHigh) calamityGlobalNPC.newAI[0] = -NPC.direction; - float velocity = (bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (Main.getGoodWorld) velocity *= 1.25f; if (healerAlive) @@ -501,7 +493,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 targetVector = destination - NPC.Center; Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity; - float phaseGateValue = (bossRush || enraged) ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; + float phaseGateValue = bossRush ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; bool continueShootingProjectiles = phase1 || (NPC.ai[2] < (phaseGateValue * 5f)); if (continueShootingProjectiles) @@ -515,7 +507,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Alternate between firing profaned spears and holy fire // Shoot holy blasts in final phase NPC.ai[2] += 1f; - float projectileShootGateValue = (bossRush || enraged) ? 40f : death ? 60f : revenge ? 90f : expertMode ? 100f : 150f; + float projectileShootGateValue = bossRush ? 40f : death ? 60f : revenge ? 90f : expertMode ? 100f : 150f; if (NPC.ai[2] % projectileShootGateValue == 0f) { if (phase1) @@ -529,7 +521,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } bool shootSpear = NPC.ai[2] % (projectileShootGateValue * 2f) == 0f; - float projectileVelocity = (bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float projectileVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; Vector2 finalProjectileVelocity = Vector2.Normalize(player.Center - shootFrom) * projectileVelocity; int type = shootSpear ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); @@ -542,8 +534,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (fireExtraProjectiles && shootSpear) { - int baseProjectileAmt = (bossRush || enraged) ? 4 : 2; - int spread = (bossRush || enraged) ? 18 : 10; + int baseProjectileAmt = bossRush ? 4 : 2; + int spread = bossRush ? 18 : 10; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < baseProjectileAmt; i++) { @@ -562,7 +554,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians else { // Shoot holy blasts - float holyBlastVelocity = (bossRush || enraged) ? 20f : death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; + float holyBlastVelocity = bossRush ? 20f : death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; int projTimeLeft = (int)(2000f / holyBlastVelocity); Vector2 finalHolyBlastVelocity = Vector2.Normalize(player.Center - shootFrom) * holyBlastVelocity; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -675,7 +667,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = Math.Sign(NPC.velocity.X); NPC.ai[1] += 1f; - float phaseGateValue = (bossRush || enraged) ? 90f : death ? 100f : revenge ? 110f : expertMode ? 120f : 135f; + float phaseGateValue = bossRush ? 90f : death ? 100f : revenge ? 110f : expertMode ? 120f : 135f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -696,7 +688,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = (bossRush || enraged) ? 1.053333f : death ? 1.05037f : revenge ? 1.047407f : expertMode ? 1.044444f : 1.04f; + float velocityMult = bossRush ? 1.053333f : death ? 1.05037f : revenge ? 1.047407f : expertMode ? 1.044444f : 1.04f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -799,7 +791,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool targetRanAwayAndWillNowBeFucked = NPC.ai[2] == 1f; bool boostVelocityToCatchUp = NPC.ai[1] == 0f || targetRanAwayAndWillNowBeFucked; - float velocity = (bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (Main.getGoodWorld) velocity *= 1.25f; if (boostVelocityToCatchUp) @@ -811,7 +803,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity; float totalSpears = 12f; - float shootDuration = (bossRush || enraged) ? 240f : death ? 280f : revenge ? 300f : expertMode ? 320f : 360f; + float shootDuration = bossRush ? 240f : death ? 280f : revenge ? 300f : expertMode ? 320f : 360f; float dontShootTime = shootDuration * 0.3f; float phaseGateValue = dontShootTime + shootDuration; @@ -856,7 +848,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } else if (NPC.ai[1] % spearShootDivisor == 0f) { - float spearVelocity = (bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float spearVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (Main.getGoodWorld) spearVelocity *= 1.25f; if (boostVelocityToCatchUp) @@ -874,8 +866,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[1] % (spearShootDivisor * 3) == 0f || targetRanAwayAndWillNowBeFucked) { knockbackVelocity *= 2f; - int baseProjectileAmt = (bossRush || enraged) ? 8 : expertMode ? 6 : 4; - int spread = (bossRush || enraged) ? 60 : expertMode ? 50 : 40; + int baseProjectileAmt = bossRush ? 8 : expertMode ? 6 : 4; + int spread = bossRush ? 60 : expertMode ? 50 : 40; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < baseProjectileAmt; i++) { @@ -911,7 +903,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } float laserGateValue = 120f; - float velocity = (bossRush || enraged) ? 4.5f : death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; + float velocity = bossRush ? 4.5f : death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; if (NPC.ai[1] < laserGateValue) velocity *= 6f; if (Main.getGoodWorld) @@ -967,7 +959,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { if (NPC.ai[2] == laserGateValue) { - float rotation = (bossRush || enraged) ? 435f : death ? 445f : revenge ? 450f : expertMode ? 455f : 465f; + float rotation = bossRush ? 435f : death ? 445f : revenge ? 450f : expertMode ? 455f : 465f; if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < 2800f) SoundEngine.PlaySound(HolyRaySound, Main.LocalPlayer.Center); @@ -1057,11 +1049,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = Texture_Glow.Value; Color timeBasedColorLerp = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (NPC.Calamity().CurrentlyEnraged) - { - texture2D15 = TextureNight_Glow.Value; - timeBasedColorLerp = Color.Lerp(Color.White, Color.Cyan, 0.75f); - } if (Main.zenithWorld) { texture2D15 = TextureNight_Glow.Value; @@ -1088,9 +1075,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); + NPC.DrawBackglow(Main.zenithWorld ? Main.DiscoColor : new Color(255, 64, 0, 0), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetColorBasedOnEnrage(false, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } // Draw laser effects @@ -1166,14 +1153,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 shieldDrawPos = NPC.Center - screenPos; shieldDrawPos -= new Vector2(shieldTexture.Width, shieldTexture.Height) * NPC.scale / 2f; shieldDrawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); - float minHue = NPC.Calamity().CurrentlyEnraged ? 0.4f : (defenderAlive && healerAlive) ? 0.18f : 0.06f; + float minHue = (defenderAlive && healerAlive) ? 0.18f : 0.06f; float maxHue = minHue + 0.12f; float opacityScaleDuringShieldDespawn = (TimeForShieldDespawn - NPC.localAI[1]) / TimeForShieldDespawn; float scaleDuringShieldDespawnScale = 1.8f; float scaleDuringShieldDespawn = (1f - opacityScaleDuringShieldDespawn) * scaleDuringShieldDespawnScale; float colorScale = MathHelper.Lerp(0f, shieldOpacity, opacityScaleDuringShieldDespawn); - Color color = Main.hslToRgb(MathHelper.Lerp(NPC.Calamity().CurrentlyEnraged ? minHue : maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * colorScale; - Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, NPC.Calamity().CurrentlyEnraged ? maxHue : maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * colorScale; + Color color = Main.hslToRgb(MathHelper.Lerp(maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * colorScale; + Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * colorScale; color2.A = 0; color *= 0.6f; color2 *= 0.6f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index b8d0f5f027..e9edd8fa51 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -247,20 +247,12 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool revenge = CalamityWorld.revenge || bossRush; bool death = CalamityWorld.death || bossRush; - // Enrage at nighttime - bool enraged = false; - if (!Main.dayTime && !Main.remixWorld) - { - enraged = true; - NPC.Calamity().CurrentlyEnraged = true; - } - bool phase1 = healerAlive; NPC.chaseable = !phase1; // Phase durations - float commanderGuardPhase2Duration = (bossRush || enraged) ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float commanderGuardPhase2Duration = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; float timeBeforeRocksRespawnInPhase2 = 90f; float throwRocksGateValue = 60f; @@ -269,7 +261,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = (bossRush || enraged) ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; + float maxChargeVelocity = bossRush ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; if (Main.getGoodWorld) maxChargeVelocity *= 1.15f; @@ -389,7 +381,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - float moveVelocity = (bossRush || enraged) ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; + float moveVelocity = bossRush ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; if (Main.getGoodWorld) moveVelocity *= 1.25f; if (healerAlive) @@ -439,7 +431,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Lay a holy bomb every once in a while in phase 1 and while not doing the laser attack if (!commanderUsingLaser) { - float projectileShootGateValue = (bossRush || enraged) ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float projectileShootGateValue = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; NPC.ai[1] += 1f; if (NPC.ai[1] >= projectileShootGateValue) { @@ -509,7 +501,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float shootMoltenBlastsGateValue = commanderGuardPhase2Duration / moltenBlastsDivisor; if (NPC.ai[1] % shootMoltenBlastsGateValue == 0f && !commanderGoingLowOrHighInPhase2) { - float moltenBlastVelocity = (bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float moltenBlastVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; int projTimeLeft = (int)(2400f / moltenBlastVelocity); Vector2 velocity = Vector2.Normalize(player.Center - shootFrom) * moltenBlastVelocity; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -616,7 +608,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = Math.Sign(NPC.velocity.X); NPC.ai[1] += 1f; - float phaseGateValue = (bossRush || enraged) ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; + float phaseGateValue = bossRush ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -637,7 +629,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = (bossRush || enraged) ? 1.04f : death ? 1.036667f : revenge ? 1.035f : expertMode ? 1.033333f : 1.03f; + float velocityMult = bossRush ? 1.04f : death ? 1.036667f : revenge ? 1.035f : expertMode ? 1.033333f : 1.03f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -649,7 +641,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians else if (NPC.localAI[2] == 1f) { // Charge towards target - float inertia = (bossRush || enraged) ? 57f : death ? 63f : revenge ? 66f : expertMode ? 69f : 75f; + float inertia = bossRush ? 57f : death ? 63f : revenge ? 66f : expertMode ? 69f : 75f; NPC.velocity = (NPC.velocity * (inertia - 1f) + targetVector * (NPC.velocity.Length() + (0.111111117f * inertia))) / inertia; // Stop charging towards the player when within a certain distance @@ -777,11 +769,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = Texture_Glow.Value; Color timeBasedGlowColor = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (NPC.Calamity().CurrentlyEnraged) - { - texture2D15 = TextureNight_Glow.Value; - timeBasedGlowColor = Color.Lerp(Color.White, Color.Cyan, 0.75f); - } if (Main.zenithWorld) { texture2D15 = TextureNight_Glow.Value; @@ -808,12 +795,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - Providence.Providence.BossMode mode = Providence.Providence.BossMode.Day; - if (!Main.dayTime) mode = Providence.Providence.BossMode.Night; + NPC.DrawBackglow(Main.zenithWorld ? Main.DiscoColor : new Color(255, 64, 0, 0), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); - NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); - - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetColorBasedOnEnrage(false, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } // Draw laser effects @@ -881,14 +865,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 shieldDrawPos = NPC.Center - screenPos; shieldDrawPos -= new Vector2(shieldTexture.Width, shieldTexture.Height) * NPC.scale / 2f; shieldDrawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); - float minHue = NPC.Calamity().CurrentlyEnraged ? 0.4f : 0.06f; + float minHue = 0.06f; float maxHue = minHue + 0.12f; float opacityScaleDuringShieldDespawn = (TimeForShieldDespawn - NPC.localAI[1]) / TimeForShieldDespawn; float scaleDuringShieldDespawnScale = 1.8f; float scaleDuringShieldDespawn = (1f - opacityScaleDuringShieldDespawn) * scaleDuringShieldDespawnScale; float colorScale = MathHelper.Lerp(0f, shieldOpacity, opacityScaleDuringShieldDespawn); - Color color = Main.hslToRgb(MathHelper.Lerp(NPC.Calamity().CurrentlyEnraged ? minHue : maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * colorScale; - Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, NPC.Calamity().CurrentlyEnraged ? maxHue : maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * colorScale; + Color color = Main.hslToRgb(MathHelper.Lerp(maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * colorScale; + Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * colorScale; color2.A = 0; color *= 0.6f; color2 *= 0.6f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index 090bc5367e..7b1e989a5b 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -177,14 +177,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[0] >= 300f) NPC.ai[1] = 1f; - // Enrage at nighttime - bool enraged = false; - if (!Main.dayTime && !Main.remixWorld) - { - enraged = true; - NPC.Calamity().CurrentlyEnraged = true; - } - // Direction if (Math.Abs(NPC.Center.X - player.Center.X) > 10f) { @@ -224,7 +216,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } bool useCrystalShards = AIState == (float)Phase.CrystalShards; - float velocity = useCrystalShards ? ((bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); + float velocity = useCrystalShards ? (bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); if (Main.getGoodWorld) velocity *= 1.25f; @@ -312,7 +304,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - int totalProjectiles = (bossRush || enraged) ? 18 : death ? 16 : revenge ? 14 : expertMode ? 12 : 10; + int totalProjectiles = bossRush ? 18 : death ? 16 : revenge ? 14 : expertMode ? 12 : 10; float speedX = -12f; float speedAdjustment = Math.Abs(speedX * 2f / (totalProjectiles - 1)); float speedY = -4f; @@ -351,7 +343,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, shootFrom); - int totalFlameProjectiles = (bossRush || enraged) ? 20 : 16; + int totalFlameProjectiles = bossRush ? 20 : 16; int totalRings = revenge ? 3 : 2; int healingStarChance = revenge ? 8 : expertMode ? 6 : 4; double radians = MathHelper.TwoPi / totalFlameProjectiles; @@ -369,7 +361,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians int type = ModContent.ProjectileType(); int dmgAmt = NPC.GetProjectileDamage(type); - if (Main.rand.NextBool(healingStarChance) && !enraged && !death) + if (Main.rand.NextBool(healingStarChance) && !death) { type = ModContent.ProjectileType(); dmgAmt = NPC.GetProjectileDamageNoScaling(type); @@ -412,7 +404,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Move towards a location above the player if (distanceFromDestination.Length() > idealDistanceFromDestination) { - float inertia = (bossRush || enraged) ? 28f : death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; + float inertia = bossRush ? 28f : death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; if (lifeRatio < 0.5f) inertia *= 0.8f; if (Main.getGoodWorld) @@ -467,11 +459,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = Texture_Glow.Value; Color timeBasedDrawColor = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (NPC.Calamity().CurrentlyEnraged) - { - texture2D15 = TextureNight_Glow.Value; - timeBasedDrawColor = Color.Lerp(Color.White, Color.Cyan, 0.75f); - } if (Main.zenithWorld) { texture2D15 = TextureNight_Glow.Value; @@ -511,12 +498,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - Providence.Providence.BossMode mode = Providence.Providence.BossMode.Day; - if (!Main.dayTime) mode = Providence.Providence.BossMode.Night; + NPC.DrawBackglow(Main.zenithWorld ? Main.DiscoColor : new Color(255, 64, 0, 0), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); - NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); - - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetColorBasedOnEnrage(false, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); spriteBatch.Draw(texture2D16, drawLocation, NPC.frame, overrideColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index a2a6edb15e..51c9797dd8 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -325,12 +325,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians drawPos += drawOrigin * NPC.scale + new Vector2(0f, NPC.gfxOffY); Rectangle frame = new Rectangle(0, 0, texture.Width, texture.Height); - Color col = Color.Orange; - - if (!Main.dayTime) col = Color.LightBlue; - if (!NPC.dontTakeDamage) - NPC.DrawBackglow(col.MultiplyRGBA(new Color(255, 255, 255, 0)), 4f, SpriteEffects.None, frame, screenPos, texture); + NPC.DrawBackglow(Color.Orange.MultiplyRGBA(new Color(255, 255, 255, 0)), 4f, SpriteEffects.None, frame, screenPos, texture); spriteBatch.Draw(texture, drawPos, frame, NPC.GetAlpha(drawColor), NPC.rotation, drawOrigin, NPC.scale, SpriteEffects.None, 0f); diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index a5e8989db5..50032de198 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -156,9 +156,9 @@ namespace CalamityMod.NPCs.Providence } } - NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); + NPC.DrawBackglow(new Color(255, 64, 0, 0), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); - spriteBatch.Draw(texture2D15, vector43, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture2D15, vector43, NPC.frame, ProvUtils.GetColorBasedOnEnrage(false, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); return false; } diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index bf8a0db736..f17852ea4c 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -163,9 +163,9 @@ namespace CalamityMod.NPCs.Providence } } - NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); + NPC.DrawBackglow(new Color(255, 64, 0, 0), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetColorBasedOnEnrage(false, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); spriteBatch.Draw(texture2D16, drawLocation, NPC.frame, violetLerp, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 9e8ea1d4b1..926df177f7 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -158,9 +158,9 @@ namespace CalamityMod.NPCs.Providence } } - NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); + NPC.DrawBackglow(new Color(255, 64, 0, 0), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetColorBasedOnEnrage(false, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); return false; } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 28c8278993..b59add40e6 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -34,7 +34,6 @@ using CalamityMod.Tiles.Ores; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Graphics.PackedVector; using ReLogic.Content; using ReLogic.Utilities; using Terraria; @@ -47,7 +46,6 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using static CalamityMod.Projectiles.Rogue.FinalDawnFlame; using Filters = Terraria.Graphics.Effects.Filters; namespace CalamityMod.NPCs.Providence @@ -76,8 +74,8 @@ namespace CalamityMod.NPCs.Providence public enum BossMode { - Night = -1, - Day = 0, + Enraged = -1, + Normal = 0, Rainbow = 1, } @@ -93,7 +91,7 @@ namespace CalamityMod.NPCs.Providence private int frameUsed = 0; private int healTimer = 0; internal bool challenge = Main.expertMode; // Used to determine if Profaned Soul Crystal should drop, couldn't figure out mp mems always dropping it so challenge is singleplayer only. - internal bool hasTakenDaytimeDamage = false; + public bool hasBeenGivenFullPower = false; public static bool shouldDrawInfernoBorder = true; // This is only here for other mods to disable it if they don't want it drawing. public bool Dying = false; public int DeathAnimationTimer; @@ -121,7 +119,7 @@ namespace CalamityMod.NPCs.Providence private const float TimeForStarDespawn = 120f; private const float TimeForShieldDespawn = 120f; - // Every single one of Providence's sprites, both night and day, and their glowmasks + // Every single one of Providence's sprites, both normal and enraged, and their glowmasks #region Textures public static Asset TextureAlt; public static Asset TextureAltNight; @@ -362,24 +360,24 @@ namespace CalamityMod.NPCs.Providence // Target variable and boss center Player player = Main.player[NPC.target]; - // Night bool and Color shifting + // Enraged bool and Color shifting bool bossRush = BossRushEvent.BossRushActive; bool getFuckedAI = Main.zenithWorld; if (getFuckedAI) NPC.localAI[1] = (float)BossMode.Rainbow; - else if (!ProvUtils.DayAI()) // Normal Night time activity - NPC.localAI[1] = (float)BossMode.Night; + else if (hasBeenGivenFullPower) // Enraged behavior + NPC.localAI[1] = (float)BossMode.Enraged; else - NPC.localAI[1] = (float)BossMode.Day; + NPC.localAI[1] = (float)BossMode.Normal; - // Has Night AI if it's any color except day - bool nightAI = NPC.localAI[1] != (float)BossMode.Day; + // Fully powered up AI if it's any color except normal + bool fullPowerAI = NPC.localAI[1] != (float)BossMode.Normal; // Difficulty bools - bool death = CalamityWorld.death || nightAI; - bool revenge = CalamityWorld.revenge || nightAI; - bool expertMode = Main.expertMode || nightAI; + bool death = CalamityWorld.death || fullPowerAI; + bool revenge = CalamityWorld.revenge || fullPowerAI; + bool expertMode = Main.expertMode || fullPowerAI; // Target's current biome bool isHoly = player.ZoneHallow; @@ -400,8 +398,8 @@ namespace CalamityMod.NPCs.Providence // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; - // Play enrage animation if night starts - if (!getFuckedAI && nightAI && calamityGlobalNPC.newAI[3] == spawnAnimationTime) + // Play enrage animation if she gets angy + if (!getFuckedAI && fullPowerAI && calamityGlobalNPC.newAI[3] == spawnAnimationTime) { AIState = (int)Phase.HolyBlast; NPC.ai[1] = 0f; @@ -410,6 +408,12 @@ namespace CalamityMod.NPCs.Providence 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.netUpdate = true; // Prevent netUpdate from being blocked by the spam counter. @@ -417,14 +421,14 @@ namespace CalamityMod.NPCs.Providence NPC.netSpam = 9; } - // Increase all projectile damage at night, but reduce to 0 for Zenith + // Increase all projectile damage while enraged, but reduce to 0 for Zenith int projectileDamageMult = 1; if (getFuckedAI) projectileDamageMult = 0; - else if (nightAI) + else if (fullPowerAI) projectileDamageMult = 2; - NPC.Calamity().CurrentlyEnraged = !bossRush && nightAI; + NPC.Calamity().CurrentlyEnraged = !bossRush && fullPowerAI; // Projectile damage values int holyLaserDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; @@ -436,19 +440,19 @@ namespace CalamityMod.NPCs.Providence int holyBlastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; int holyStarDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - // Change dust type at night + // Change dust type while enraged int dustType = ProvUtils.GetDustID(); // Phase times - float phaseTime = nightAI ? (240f - 60f * (1f - lifeRatio)) : 300f; - float crystalPhaseTime = nightAI ? (float)Math.Round(60f * lifeRatio) : death ? 60f : 120f; - int nightCrystalTime = 210; - int gfbCrystalTime = 1500 + nightCrystalTime; + float phaseTime = fullPowerAI ? (240f - 60f * (1f - lifeRatio)) : 300f; + float crystalPhaseTime = fullPowerAI ? (float)Math.Round(60f * lifeRatio) : death ? 60f : 120f; + int enragedCrystalTime = 210; + int gfbCrystalTime = 1500 + enragedCrystalTime; float attackDelayAfterCocoon = phaseTime * 0.3f; // Phases bool ignoreGuardianAmt = lifeRatio < (death ? 0.2f : 0.15f); - bool phase2 = lifeRatio < 0.75f && !nightAI; + bool phase2 = lifeRatio < 0.75f && !fullPowerAI; bool delayAttacks = NPC.localAI[2] > 0f; // Spear phase @@ -781,8 +785,8 @@ namespace CalamityMod.NPCs.Providence else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - // Guardian spawn unless it's night time specifically (can still spawn on Zenith) - if (NPC.localAI[1] != (float)BossMode.Night) + // Guardian spawn unless she's enraged specifically (can still spawn on Zenith) + if (NPC.localAI[1] != (float)BossMode.Enraged) { if (bossLife == 0f && NPC.life > 0) bossLife = NPC.lifeMax; @@ -871,13 +875,13 @@ namespace CalamityMod.NPCs.Providence predictiveShots = true; // Velocity and acceleration - float speedIncreaseTimer = nightAI ? 75f : death ? 120f : 150f; + float speedIncreaseTimer = fullPowerAI ? 75f : death ? 120f : 150f; bool increaseSpeed = calamityGlobalNPC.newAI[0] > speedIncreaseTimer || bossRush; float accelerationBoost = death ? 0.3f * (1f - lifeRatio) : 0.2f * (1f - lifeRatio); float velocityBoost = death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); float acceleration = (expertMode ? 1.1f : 1.05f) + accelerationBoost; float velocity = (expertMode ? 16f : 15f) + velocityBoost; - if (nightAI) + if (fullPowerAI) { acceleration = 1.5f; velocity = 25f; @@ -958,7 +962,7 @@ namespace CalamityMod.NPCs.Providence phase = (int)Phase.HolyBlast; break; case 3: - phase = (useCrystal || nightAI) ? (int)Phase.Crystal : (int)Phase.MoltenBlobs; + phase = (useCrystal || fullPowerAI) ? (int)Phase.Crystal : (int)Phase.MoltenBlobs; break; case 4: phase = useCrystal ? (int)Phase.MoltenBlobs : (int)Phase.FlameCocoon; @@ -967,31 +971,31 @@ namespace CalamityMod.NPCs.Providence phase = useCrystal ? (int)Phase.FlameCocoon : (int)Phase.HolyFire; break; case 6: - phase = (useLaser || nightAI) ? (int)Phase.Laser : (int)Phase.HolyBomb; + phase = (useLaser || fullPowerAI) ? (int)Phase.Laser : (int)Phase.HolyBomb; break; case 7: - phase = (useLaser || nightAI) ? (int)Phase.HolyBomb : (int)Phase.MoltenBlobs; + phase = (useLaser || fullPowerAI) ? (int)Phase.HolyBomb : (int)Phase.MoltenBlobs; break; case 8: - phase = (useLaser || nightAI) ? (int)Phase.MoltenBlobs : (int)Phase.SpearCocoon; + phase = (useLaser || fullPowerAI) ? (int)Phase.MoltenBlobs : (int)Phase.SpearCocoon; break; case 9: phase = (int)Phase.HolyBlast; break; case 10: - phase = (useCrystal || nightAI) ? (int)Phase.Crystal : (int)Phase.FlameCocoon; + phase = (useCrystal || fullPowerAI) ? (int)Phase.Crystal : (int)Phase.FlameCocoon; break; case 11: - phase = nightAI ? (int)Phase.FlameCocoon : (int)Phase.MoltenBlobs; + phase = fullPowerAI ? (int)Phase.FlameCocoon : (int)Phase.MoltenBlobs; break; case 12: - phase = (useLaser || nightAI) ? (int)Phase.Laser : (int)Phase.HolyBomb; + phase = (useLaser || fullPowerAI) ? (int)Phase.Laser : (int)Phase.HolyBomb; break; case 13: phase = (int)Phase.SpearCocoon; break; case 14: - phase = (useLaser || nightAI) ? (int)Phase.HolyBomb : (int)Phase.HolyBlast; + phase = (useLaser || fullPowerAI) ? (int)Phase.HolyBomb : (int)Phase.HolyBlast; break; default: break; @@ -1091,7 +1095,7 @@ namespace CalamityMod.NPCs.Providence SoundEngine.PlaySound(HolyRaySound, NPC.Center); - for (int i = 0; i < 30; i++) + for (int i = 0; i < 20; i++) { Particle p = new FlameParticle(NPC.Center + new Vector2(Main.rand.NextFloat(150), 0).RotatedByRandom(MathHelper.TwoPi), 40, Main.rand.NextFloat(1f, 1.6f), Main.rand.NextFloat(2f, 5f), hiColor, loColor); p.Velocity = new Vector2(Main.rand.NextFloat(3f, 19f), 0).RotatedByRandom(MathHelper.TwoPi); @@ -1103,7 +1107,7 @@ namespace CalamityMod.NPCs.Providence Color hColor = ProvUtils.GetProjectileColor(255, false); Color lColor = ProvUtils.GetProjectileColor(0, true); - for (int i = 0; i < 30; i++) + for (int i = 0; i < 20; i++) { Particle p = new FlameParticle(NPC.Center + new Vector2(Main.rand.NextFloat(150), 0).RotatedByRandom(MathHelper.TwoPi), 40, Main.rand.NextFloat(0.5f, 0.75f), Main.rand.NextFloat(1f, 2.5f), hColor, lColor); p.Velocity = new Vector2(Main.rand.NextFloat(3f, 19f), 0).RotatedByRandom(MathHelper.TwoPi); @@ -1113,7 +1117,7 @@ namespace CalamityMod.NPCs.Providence GeneralParticleHandler.SpawnParticle(new CustomPulse(NPC.Center, Vector2.Zero, hColor, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 1f, 0.1f, 15)); - for (float i = 0; i < 3; i += 0.25f) + for (float i = 0; i < 2.8f; i += 0.35f) { GeneralParticleHandler.SpawnParticle(new CustomPulse(NPC.Center, Vector2.Zero, hColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One * i, Main.rand.NextFloat(MathHelper.TwoPi), 0.05f, 0.35f, 35)); GeneralParticleHandler.SpawnParticle(new CustomPulse(NPC.Center, Vector2.Zero, hColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One * i, Main.rand.NextFloat(MathHelper.TwoPi), 0.05f, 0.475f, 25)); @@ -1124,25 +1128,48 @@ namespace CalamityMod.NPCs.Providence if (calamityGlobalNPC.newAI[3] > 10f && calamityGlobalNPC.newAI[3] < spawnAnimationTime) { + // Move effects slightly lower during enrage animation to appear as if they're converging on her core + Vector2 destination = NPC.Center + (NPC.localAI[1] != (float)BossMode.Normal ? new Vector2(0f, 40f) : Vector2.Zero); + if (calamityGlobalNPC.newAI[3] % 10f == 0) { - GeneralParticleHandler.SpawnParticle(new CustomPulse(NPC.Center, Vector2.Zero, Color.Lerp(new Color(25, 25, 25, 0), medColor, sc), "CalamityMod/Particles/SoftRoundExplosion", new Vector2(1.5f, 1f), Main.rand.NextBool(2) ? 0f : MathHelper.Pi, sc * 0.5f, sc * 0.1f, 20)); + GeneralParticleHandler.SpawnParticle(new CustomPulse(destination, Vector2.Zero, Color.Lerp(new Color(25, 25, 25, 0), medColor, sc), "CalamityMod/Particles/SoftRoundExplosion", new Vector2(1.5f, 1f), Main.rand.NextBool() ? 0f : MathHelper.Pi, sc * 0.5f, sc * 0.1f, 20)); SoundStyle SpawnFlareSound = SoundID.Item74; - SpawnFlareSound.MaxInstances = 10; - SoundEngine.PlaySound(SpawnFlareSound.WithVolumeScale(calamityGlobalNPC.newAI[3] / spawnAnimationTime).WithPitchOffset(-1 + (calamityGlobalNPC.newAI[3] / spawnAnimationTime)), NPC.Center); } - Vector2 startPos = NPC.Center + (new Vector2(Main.rand.NextFloat(80, 300) * (sc * 1.6f), 0).RotatedByRandom(Main.rand.NextFloat(MathHelper.TwoPi)) * new Vector2(1.5f, 1f)); + Vector2 startPos = destination + (new Vector2(Main.rand.NextFloat(80, 300) * (sc * 1.6f), 0).RotatedByRandom(Main.rand.NextFloat(MathHelper.TwoPi)) * new Vector2(1.5f, 1f)); + GeneralParticleHandler.SpawnParticle(new SparkParticle(startPos, startPos.DirectionTo(destination) * (startPos.Distance(destination) / 10), false, 10, Main.rand.NextFloat(0.2f, 0.5f) * (sc * 2), medColor)); + } - GeneralParticleHandler.SpawnParticle(new SparkParticle(startPos, startPos.DirectionTo(NPC.Center) * (startPos.Distance(NPC.Center) / 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); + + // Prevent netUpdate from being blocked by the spam counter. + if (NPC.netSpam >= 10) + NPC.netSpam = 9; + + NPC.netUpdate = true; + } + } } calamityGlobalNPC.newAI[3] += 1f; - if (nightAI && calamityGlobalNPC.newAI[3] >= spawnAnimationTime) + if (fullPowerAI && calamityGlobalNPC.newAI[3] >= spawnAnimationTime) calamityGlobalNPC.newAI[3] += 1f; return; @@ -1222,7 +1249,7 @@ namespace CalamityMod.NPCs.Providence projectileVelocityY += expertMode ? 4f : 3f; - if (nightAI) + if (fullPowerAI) projectileVelocityY *= 2f; Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom.X, shootFrom.Y, NPC.velocity.X * 0.25f, projectileVelocityY, ModContent.ProjectileType(), holyFireDamage, 0f, Main.myPlayer); @@ -1350,7 +1377,7 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, velocity2, type, holyStarDamage, 0f, Main.myPlayer); - Color dustColor = Main.hslToRgb(Main.rgbToHsl(nightAI ? new Color(100, 200, 250) : Color.Orange).X, 1f, 0.5f); + Color dustColor = Main.hslToRgb(Main.rgbToHsl(fullPowerAI ? new Color(100, 200, 250) : Color.Orange).X, 1f, 0.5f); dustColor.A = 255; int maxDust = 3; for (int j = 0; j < maxDust; j++) @@ -1646,7 +1673,7 @@ namespace CalamityMod.NPCs.Providence if (j % dustDivisor == 0) { currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, j / (float)maxHealDustIterations); - Color dustColor = Main.hslToRgb(Main.rgbToHsl(nightAI ? new Color(100, 200, 250) : new Color(255, 200, Math.Abs(Math.Abs(blue) - (int)(dustSpawned * 2.55f)))).X, 1f, 0.5f); + Color dustColor = Main.hslToRgb(Main.rgbToHsl(fullPowerAI ? new Color(100, 200, 250) : new Color(255, 200, Math.Abs(Math.Abs(blue) - (int)(dustSpawned * 2.55f)))).X, 1f, 0.5f); dustColor.A = 255; int dust = Dust.NewDust(currentDustPos, 0, 0, DustID.RainbowMk2, 0f, 0f, 0, dustColor, 1f); Main.dust[dust].position = currentDustPos + new Vector2(32f, 32f).RotatedByRandom(MathHelper.TwoPi) * i; @@ -1664,7 +1691,7 @@ namespace CalamityMod.NPCs.Providence } } - if (!nightAI) + if (!fullPowerAI) blue -= 255 / (maxDustLines - 1); } @@ -1675,7 +1702,7 @@ namespace CalamityMod.NPCs.Providence Vector2 dustSpawnPos = Vector2.Normalize(NPC.velocity) * new Vector2(80f, 160f); dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + dustLineEnd; Vector2 dustVelocity = dustSpawnPos - dustLineEnd; - Color dustColor = Main.hslToRgb(Main.rgbToHsl(nightAI ? new Color(100, 200, 250) : new Color(255, 200, Math.Abs(Math.Abs(blue) - (int)(circleDustSpawned * 7.08f)))).X, 1f, 0.5f); + Color dustColor = Main.hslToRgb(Main.rgbToHsl(fullPowerAI ? new Color(100, 200, 250) : new Color(255, 200, Math.Abs(Math.Abs(blue) - (int)(circleDustSpawned * 7.08f)))).X, 1f, 0.5f); dustColor.A = 255; int dust = Dust.NewDust(dustSpawnPos + dustVelocity, 0, 0, DustID.RainbowMk2, dustVelocity.X, dustVelocity.Y, 0, dustColor, 1.4f); Main.dust[dust].noGravity = true; @@ -1686,12 +1713,12 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { - float timeLeft = nightAI ? (float)(getFuckedAI ? gfbCrystalTime : nightCrystalTime) : 0f; + float timeLeft = fullPowerAI ? (float)(getFuckedAI ? gfbCrystalTime : enragedCrystalTime) : 0f; Projectile.NewProjectile(NPC.GetSource_FromAI(), crystalSpawnPos, Vector2.Zero, ModContent.ProjectileType(), crystalDamage, 0f, Main.myPlayer, lifeRatio, 0f, timeLeft); } } - if (NPC.ai[1] >= crystalPhaseTime + nightCrystalTime || !nightAI) + if (NPC.ai[1] >= crystalPhaseTime + enragedCrystalTime || !fullPowerAI) { AIState = (int)Phase.PhaseChange; NPC.TargetClosest(); @@ -1704,7 +1731,7 @@ namespace CalamityMod.NPCs.Providence Vector2 dustPosOffset = new Vector2(27f, 59f); - float rotation = (nightAI ? 445f : 460f) + (guardianAmt * 5); + float rotation = (fullPowerAI ? 445f : 460f) + (guardianAmt * 5); NPC.ai[2] += 1f; if (NPC.ai[2] < 120f) @@ -1755,7 +1782,7 @@ namespace CalamityMod.NPCs.Providence if (revenge) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); - if (nightAI && lifeRatio < 0.5f) + if (fullPowerAI && lifeRatio < 0.5f) { rotation *= 0.33f; velocity = velocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 2f); @@ -1902,12 +1929,12 @@ namespace CalamityMod.NPCs.Providence float distanceToTarget = Vector2.Distance(Main.player[NPC.target].Center, NPC.Center); float aiTimer = NPC.ai[3]; - // This bool is only relevant for non-Zenith night AI - bool nightTime = NPC.localAI[1] == (float)BossMode.Night; + // This bool is only relevant for non-Zenith enraged AI + bool fullPower = NPC.localAI[1] == (float)BossMode.Enraged; float baseDistance = 2800f; - float shorterFlameCocoonDistance = (CalamityWorld.death || nightTime) ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; - float shorterSpearCocoonDistance = (CalamityWorld.death || nightTime) ? 1000f : CalamityWorld.revenge ? 650f : Main.expertMode ? 300f : 0f; + float shorterFlameCocoonDistance = (CalamityWorld.death || fullPower) ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; + float shorterSpearCocoonDistance = (CalamityWorld.death || fullPower) ? 1000f : CalamityWorld.revenge ? 650f : Main.expertMode ? 300f : 0f; float shorterDistance = AIState == (int)Phase.FlameCocoon ? shorterFlameCocoonDistance : shorterSpearCocoonDistance; bool guardianAlive = false; @@ -1947,7 +1974,7 @@ namespace CalamityMod.NPCs.Providence return Utils.GetLerpValue(drawFireDistanceStart, clampedDistance, distanceToTarget, true); } - private void DespawnSpecificProjectiles(bool dying = false) + private void DespawnSpecificProjectiles(bool everything = false) { for (int x = 0; x < Main.maxProjectiles; x++) { @@ -1959,7 +1986,7 @@ namespace CalamityMod.NPCs.Providence else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) projectile.active = false; - if (dying) + if (everything) { if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || @@ -2068,13 +2095,13 @@ namespace CalamityMod.NPCs.Providence npcLoot.AddIf(info => { Providence prov = info.npc.ModNPC(); - return !prov.hasTakenDaytimeDamage; - }, ModContent.ItemType(), 1, 4, 4, desc: DropHelper.ProvidenceNightText); + return prov.hasBeenGivenFullPower; + }, ModContent.ItemType(), 1, 4, 4, desc: DropHelper.ProvidenceEnragedText); npcLoot.AddIf(info => { Providence prov = info.npc.ModNPC(); - return !prov.hasTakenDaytimeDamage; + return prov.hasBeenGivenFullPower; }, ModContent.ItemType(), 1, 30, 40); // Normal drops: Everything that would otherwise be in the bag @@ -2129,7 +2156,7 @@ namespace CalamityMod.NPCs.Providence public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - bool offColor = NPC.localAI[1] != (float)BossMode.Day; + bool offColor = NPC.localAI[1] != (float)BossMode.Normal && (NPC.Calamity().newAI[3] >= 180f || Main.zenithWorld); Texture2D texture = offColor ? TextureNight.Value : TextureAssets.Npc[Type].Value; Texture2D textureGlow = offColor ? TextureNight_Glow.Value : Texture_Glow.Value; @@ -2146,12 +2173,10 @@ namespace CalamityMod.NPCs.Providence float spawnAnimationTime = 180f; bool spawnAnimation = NPC.Calamity().newAI[3] < spawnAnimationTime; - if (spawnAnimation) + // Bloom circle effect should only appear on spawn animation and not enrage animation, since you can't see it + if (spawnAnimation && NPC.localAI[1] == (float)BossMode.Normal) { Asset orbTex = ModContent.Request("CalamityMod/Particles/BloomCircle"); - - Asset flareTex = ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlast"); - float sc = CalamityUtils.CircInEasing((float)NPC.Calamity().newAI[3] / (float)spawnAnimationTime, 1); for (int i = 0; i < 3; i++) @@ -2241,7 +2266,7 @@ namespace CalamityMod.NPCs.Providence // Draw the glowmask textures + their afterimages // These are the colors at their strongest point. It'll shift towards white by the brightness value used earlier. - Color WingColor = ProvUtils.GetProjectileColor(0); // Default to day + Color WingColor = ProvUtils.GetProjectileColor(0); // Default to normal Color CrystalColor = Color.Violet; if (NPC.localAI[1] == (float)BossMode.Rainbow) @@ -2274,7 +2299,7 @@ namespace CalamityMod.NPCs.Providence CrystalColor = Color.BlueViolet; } } - else if (NPC.localAI[1] == (float)BossMode.Night) + else if (NPC.localAI[1] == (float)BossMode.Enraged && !spawnAnimation) { WingColor = Color.Cyan; CrystalColor = Color.BlueViolet; @@ -2572,19 +2597,6 @@ namespace CalamityMod.NPCs.Providence public override void OnHitByProjectile(Projectile projectile, NPC.HitInfo hit, int damageDone) { - if (!hasTakenDaytimeDamage) - { - if (NPC.localAI[1] == (float)BossMode.Day) - { - hasTakenDaytimeDamage = true; - - if (Main.netMode != NetmodeID.SinglePlayer) - { - ProvidenceDyeConditionSyncPacket.Send(this); - } - } - } - if (challenge) { List exceptionList = new List() @@ -2624,19 +2636,6 @@ namespace CalamityMod.NPCs.Providence public override void OnHitByItem(Player player, Item item, NPC.HitInfo hit, int damageDone) { - if (!hasTakenDaytimeDamage) - { - if (NPC.localAI[1] == (float)BossMode.Day) - { - hasTakenDaytimeDamage = true; - - if (Main.netMode != NetmodeID.SinglePlayer) - { - ProvidenceDyeConditionSyncPacket.Send(this); - } - } - } - if (challenge) { challenge = false; @@ -2726,6 +2725,8 @@ namespace CalamityMod.NPCs.Providence if (npc.type == ModContent.NPCType() && !BossRushEvent.BossRushActive) { Main.item[itemIndex].GetGlobalItem().HolyFlame = 2f; + if ((npc.ModNPC as Providence).hasBeenGivenFullPower) + Main.item[itemIndex].GetGlobalItem().ProviWasEnraged = true; } else { @@ -2737,6 +2738,7 @@ namespace CalamityMod.NPCs.Providence public float HolyFlame = 0f; public float FlameTimer = 0f; + public bool ProviWasEnraged = false; public override void Update(Item item, ref float gravity, ref float maxFallSpeed) { @@ -2775,7 +2777,7 @@ namespace CalamityMod.NPCs.Providence Color alph = new Color(255f * (HolyFlame / 2f), 255f * (HolyFlame / 2f), 0f, 0f); Color alph2 = new Color(155f * (HolyFlame / 2f), 0f, 0f, 0f); - if (!Main.dayTime) + if (ProviWasEnraged) { lColor.B = 255; @@ -2812,11 +2814,11 @@ namespace CalamityMod.NPCs.Providence // These will be used for almost every single one of her projectiles, so it's useful to have. public static class ProvUtils { - public static bool DayAI() => (Main.IsItDay() || Main.remixWorld) && !Main.zenithWorld && !BossRushEvent.BossRushActive; + public static bool StandardAI() => (CalamityGlobalNPC.holyBoss == -1 || !Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) && !Main.zenithWorld && !BossRushEvent.BossRushActive; - // Simplified to day/night only. For PSC and Profaned Guardians - public static Color GetDayNightColor(int Alpha, bool Outline = false) => GetDayNightColor(!Main.IsItDay() && !Main.remixWorld, Alpha, Outline); - public static Color GetDayNightColor(bool Night, int Alpha, bool Outline = false) + // Simplified to day/night only. For PSC + public static Color GetColorBasedOnEnrage(int Alpha, bool Outline = false) => GetColorBasedOnEnrage(!Main.IsItDay() && !Main.remixWorld, Alpha, Outline); + public static Color GetColorBasedOnEnrage(bool Night, int Alpha, bool Outline = false) { Color FinalColor = new Color(255, Outline ? 0 : 155, Outline ? 0 : 25, Alpha); // Default to day @@ -2841,7 +2843,10 @@ namespace CalamityMod.NPCs.Providence alpha = 100; } - Color FinalColor = new Color(255, Outline ? 0 : 255, Outline ? 0 : 255, alpha); // Default to day + Color FinalColor = new Color(255, Outline ? 0 : 255, Outline ? 0 : 255, alpha); // Default to normal + // Color changing should only occur with Providence's projectiles + if (CalamityGlobalNPC.holyBoss == -1) + return FinalColor; if (Main.zenithWorld) { @@ -2858,7 +2863,7 @@ namespace CalamityMod.NPCs.Providence else // Red FinalColor = new Color(250, 100, Outline ? 200 : 100, alpha); } - else if (!DayAI()) + else if (!StandardAI()) FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, alpha); if (Outline) @@ -2869,7 +2874,10 @@ namespace CalamityMod.NPCs.Providence public static Color GetProjectileColor(int Alpha, bool Outline = false) { - Color FinalColor = new Color(255, Outline ? 0 : 155, Outline ? 0 : 25, Alpha); // Default to day + Color FinalColor = new Color(255, Outline ? 0 : 155, Outline ? 0 : 25, Alpha); // Default to normal + // Color changing should only occur with Providence's projectiles + if (CalamityGlobalNPC.holyBoss == -1) + return FinalColor; if (Main.zenithWorld) { @@ -2886,7 +2894,7 @@ namespace CalamityMod.NPCs.Providence else // Red FinalColor = new Color(250, 100, Outline ? 200 : 100, Alpha); } - else if (!DayAI()) + else if (!StandardAI()) FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, Alpha); if (Outline) @@ -2895,10 +2903,10 @@ namespace CalamityMod.NPCs.Providence return FinalColor; } - // Assign the night bool to turn it into a binary day/night state without accounting for GFB + // Assign the night bool to turn it into a binary day/night state without accounting for GFB, used for PSC public static int GetDustID(bool? Night = null) { - int DustType = (int)CalamityDusts.ProfanedFire; // Default to day + int DustType = (int)CalamityDusts.ProfanedFire; // Default to normal if (Night.HasValue) { @@ -2920,7 +2928,7 @@ namespace CalamityMod.NPCs.Providence else // Red DustType = DustID.RedTorch; } - else if (!DayAI()) + else if (!StandardAI()) DustType = (int)CalamityDusts.Nightwither; return DustType; diff --git a/Packets/Entities/Providence/ProvidenceDyeConditionSyncPacket.cs b/Packets/Entities/Providence/ProvidenceDyeConditionSyncPacket.cs index c2ca88ae9f..42134ed1c2 100644 --- a/Packets/Entities/Providence/ProvidenceDyeConditionSyncPacket.cs +++ b/Packets/Entities/Providence/ProvidenceDyeConditionSyncPacket.cs @@ -21,19 +21,19 @@ namespace CalamityMod.Packets var packet = Instance.CreateBasePacket(); packet.WriteWhoAmI(providence); - packet.Write(providence.hasTakenDaytimeDamage); + packet.Write(providence.hasBeenGivenFullPower); packet.Send(toClient, ignoreClient); } public override void HandlePacket(in BinaryReader packet, int sender) { var providence = packet.ReadModNPC(); - var hasTakenDaytimeDmg = packet.ReadBoolean(); + var hasBeenEnraged = packet.ReadBoolean(); if (providence is null) return; - providence.hasTakenDaytimeDamage = hasTakenDaytimeDmg; + providence.hasBeenGivenFullPower = hasBeenEnraged; } } } diff --git a/Particles/CustomSprite.cs b/Particles/CustomSprite.cs index 1f0b1bdb66..0b18707b4d 100644 --- a/Particles/CustomSprite.cs +++ b/Particles/CustomSprite.cs @@ -5,7 +5,6 @@ using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.ModLoader; -using static CalamityMod.Projectiles.Rogue.FinalDawnFlame; namespace CalamityMod.Particles { @@ -22,6 +21,7 @@ namespace CalamityMod.Particles int Timer = 0; float maxGravity = 0f; + float Opacity = 1f; public override bool SetLifetime => true; public override bool UseCustomDraw => true; @@ -54,6 +54,7 @@ namespace CalamityMod.Particles if (Timer > Lifetime - 20) { Scale *= 0.9f; + Opacity *= 0.9f; } Velocity *= 0.85f; @@ -73,7 +74,7 @@ namespace CalamityMod.Particles Rectangle fr = tex.Frame(1, frames, 0, currentFrame); - Main.EntitySpriteDraw(tex.Value, Position - Main.screenPosition, fr, Color.Lerp(Color.Transparent, Color, Scale), Rotation, new Vector2(tex.Width() * 0.5f, tex.Height() / frames * 0.5f), 1f, SpriteEffects.None); + Main.EntitySpriteDraw(tex.Value, Position - Main.screenPosition, fr, Color.Lerp(Color.Transparent, Color, Opacity), Rotation, new Vector2(tex.Width() * 0.5f, tex.Height() / frames * 0.5f), 1f, SpriteEffects.None); } } } diff --git a/Projectiles/Boss/HolyAura.cs b/Projectiles/Boss/HolyAura.cs index 6ef84c0b5e..3ceab6d0b0 100644 --- a/Projectiles/Boss/HolyAura.cs +++ b/Projectiles/Boss/HolyAura.cs @@ -1,6 +1,6 @@ using System; +using CalamityMod.NPCs; using CalamityMod.NPCs.Providence; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -31,6 +31,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.timeLeft = 210; } + public override void AI() => Projectile.Center = Main.npc[CalamityGlobalNPC.holyBoss].Center; + public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; @@ -76,7 +78,7 @@ namespace CalamityMod.Projectiles.Boss bool underworld = Projectile.ai[0] == 2f; if (!Main.zenithWorld) { - if (Main.IsItDay() || Main.remixWorld) + if (ProvUtils.StandardAI()) { color.R = 255; if (underworld) @@ -84,18 +86,18 @@ namespace CalamityMod.Projectiles.Boss } else { - color.B = 255; + byte blueValue = (byte)(MathHelper.Clamp(MathHelper.Lerp(0, 255, Main.npc[CalamityGlobalNPC.holyBoss].Calamity().newAI[3] / 120f), 0, 255)); + if (blueValue > 255) blueValue = 255; + color.B = blueValue; if (underworld) - color.G = 0; + color.G = (byte)(255 - blueValue); else - color.R = 0; + color.R = (byte)(255 - blueValue); } } color.A = 0; - { - if (color.R > 0) color.R = (byte)MathHelper.Lerp(0, color.R, amount2); if (color.G > 0) diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index d38d41e26d..4b2b1d3666 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; + Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Vector2 sc = Vector2.One; @@ -157,7 +157,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { - int totalProjectiles = !ProvUtils.DayAI() ? 8 : 6; + int totalProjectiles = !ProvUtils.StandardAI() ? 8 : 6; if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) totalProjectiles *= 2; diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index 783cbbc98c..cb0933c919 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Boss { float squish = CalamityUtils.SineBumpEasing(SquishAnimation, 1) * 0.25f; - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBombNight").Value; + Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBombNight").Value; int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, new Vector2(Projectile.scale + squish, Projectile.scale - squish), texture, offset: new Vector2(0, (-22 * (1 - squish)))); diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index af899962cb..3385962d35 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Boss SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); } - Projectile.alpha -= !ProvUtils.DayAI() ? 10 : 5; + Projectile.alpha -= !ProvUtils.StandardAI() ? 10 : 5; if (Projectile.alpha <= 0) Projectile.Kill(); @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { Projectile.scale = 1.5f; - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFireNight").Value; + Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFireNight").Value; int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, new Vector2(Projectile.scale)); diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index dc59bc060b..3c191e8a20 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 playerDirection = Main.player[playerTracker].Center - Projectile.Center; playerDirection.Normalize(); playerDirection *= projVelocityMult; - float inertia = !ProvUtils.DayAI() ? 20f : 25f; + float inertia = !ProvUtils.StandardAI() ? 20f : 25f; Projectile.velocity = (Projectile.velocity * (inertia - 1f) + playerDirection) / inertia; Projectile.velocity.Normalize(); Projectile.velocity *= projVelocityMult; @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; + Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture); diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index 1fc4462898..d07046f83a 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.velocity.Y > velocityYCap) Projectile.velocity.Y = velocityYCap; - float velocityX = !ProvUtils.DayAI() ? 0.025f : 0.02f; + float velocityX = !ProvUtils.StandardAI() ? 0.025f : 0.02f; if (Projectile.position.X + Projectile.width < player.position.X) { if (Projectile.velocity.X < 0f) @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity.X -= velocityX; } - float velocityXCap = !ProvUtils.DayAI() ? 10f : 8f; + float velocityXCap = !ProvUtils.StandardAI() ? 10f : 8f; if (Projectile.velocity.X > velocityXCap || Projectile.velocity.X < -velocityXCap) Projectile.velocity.X *= 0.97f; @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFlareNight").Value; + Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFlareNight").Value; int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture); diff --git a/Projectiles/Boss/HolyProfanedCore.cs b/Projectiles/Boss/HolyProfanedCore.cs new file mode 100644 index 0000000000..db3c46a704 --- /dev/null +++ b/Projectiles/Boss/HolyProfanedCore.cs @@ -0,0 +1,91 @@ +using CalamityMod.Items.SummonItems; +using CalamityMod.NPCs; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class HolyProfanedCore : ModProjectile, ILocalizedModType + { + public override LocalizedText DisplayName => CalamityUtils.GetItemName(ModContent.ItemType()); + public override string Texture => "CalamityMod/Items/SummonItems/ProfanedCore"; + + public const int Lifetime = 180; + public const int ShakeThreshold = 90; + public ref float Timer => ref Projectile.ai[0]; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 20; + Projectile.hostile = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.timeLeft = Lifetime; + } + + public override void AI() + { + var Prov = CalamityGlobalNPC.holyBoss; + // Abort if Provi does not exist + if (Prov == -1) + { + Projectile.active = false; + return; + } + + Timer++; + + // First, briefly flies up + // Then, moves towards the position of Provi's core on her sprite, speed scales based on distance to make it smooth + if (Timer <= 30) + { + Projectile.velocity.Y = -4.5f; + } + else if (Timer > 30 && Timer <= Lifetime) + { + Projectile.velocity = Vector2.Zero; + Vector2 proviCoreLocation = Main.npc[Prov].Center + new Vector2(0f, 40f); + Projectile.Center += (proviCoreLocation - Projectile.Center) * 0.0375f; + + // Awesome particle effects or something + if (Timer > ShakeThreshold) + { + Color flameColor = new Color(255, 223, 112), crystalColor = new Color(190, 141, 184); + + float starScale = MathHelper.Lerp(0f, 6f, (Timer - ShakeThreshold) / (Lifetime - ShakeThreshold)); + CustomSpark attacka = new(proviCoreLocation, Vector2.Zero, "CalamityMod/Particles/FullStar", false, 2, starScale, flameColor, Vector2.One, extraRotation: MathHelper.PiOver4); + GeneralParticleHandler.SpawnParticle(attacka); + CustomSpark attacka2 = new(proviCoreLocation, Vector2.Zero, "CalamityMod/Particles/FullStar", false, 2, starScale * 0.4f, flameColor, Vector2.One); + GeneralParticleHandler.SpawnParticle(attacka2); + + if (Timer % 2 == 0) + { + CustomSpark crystal = new(proviCoreLocation + Main.rand.NextVector2Circular(300, 300), -Vector2.UnitY * 2f, "CalamityMod/Particles/ProvidenceMarkParticle", false, 15, 2f, crystalColor, Vector2.One, fadeIn: true); + GeneralParticleHandler.SpawnParticle(crystal); + } + else + { + Vector2 spawnLocation = proviCoreLocation + Main.rand.NextVector2Circular(250, 250); + CustomSprite rockConverge = new(spawnLocation, (proviCoreLocation - spawnLocation) * 0.08f, 15, "CalamityMod/NPCs/ProfanedGuardians/ProfanedRocks" + Main.rand.Next(1, 6 + 1), 0.3f, Color.White, 0f, false); + rockConverge.Rotation = Main.rand.NextFloat(0f, MathHelper.TwoPi); + GeneralParticleHandler.SpawnParticle(rockConverge); + } + } + } + } + + public override bool PreDraw(ref Color lightColor) + { + float shakeAmt = MathHelper.Clamp(MathHelper.Lerp(0f, 8f, (Timer - ShakeThreshold) / (Lifetime - ShakeThreshold)), 0f, 8f); + Vector2 drawPos = Projectile.Center + Main.rand.NextVector2CircularEdge(shakeAmt, shakeAmt); + + Projectile.DrawProjectileWithBackglow(new Color(255, 255, 25), lightColor, 3.5f, xPos: drawPos.X, yPos: drawPos.Y); + return false; + } + } +} diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index e09f2ac6e0..00a92cabf5 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -69,14 +69,14 @@ namespace CalamityMod.Projectiles.Boss bool commanderSpear = Projectile.ai[0] == -1f; bool enragedCommanderSpear = Projectile.ai[0] == -2f; - float timeGateValue = !ProvUtils.DayAI() ? 420f : ((commanderSpear || enragedCommanderSpear) ? 360f : 540f); + float timeGateValue = !ProvUtils.StandardAI() ? 420f : ((commanderSpear || enragedCommanderSpear) ? 360f : 540f); if (Projectile.ai[0] <= 0f) { Projectile.ai[1] += 1f; - float slowGateValue = !ProvUtils.DayAI() ? 60f : ((commanderSpear || enragedCommanderSpear) ? 30f : 90f); + float slowGateValue = !ProvUtils.StandardAI() ? 60f : ((commanderSpear || enragedCommanderSpear) ? 30f : 90f); float fastGateValue = 30f; - float minVelocity = !ProvUtils.DayAI() ? 4f : (enragedCommanderSpear ? 6f : commanderSpear ? 4.5f : 3f); + float minVelocity = !ProvUtils.StandardAI() ? 4f : (enragedCommanderSpear ? 6f : commanderSpear ? 4.5f : 3f); float maxVelocity = minVelocity * 4f; float extremeVelocity = maxVelocity * 2f; float deceleration = 0.95f; @@ -105,8 +105,8 @@ namespace CalamityMod.Projectiles.Boss } else { - float frequency = !ProvUtils.DayAI() ? 0.2f : 0.1f; - float amplitude = !ProvUtils.DayAI() ? 4f : 2f; + float frequency = !ProvUtils.StandardAI() ? 0.2f : 0.1f; + float amplitude = !ProvUtils.StandardAI() ? 4f : 2f; Projectile.ai[1] += frequency; @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; bool aimedSpear = Projectile.ai[0] > 0f; - Color baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125); // Default to day + Color baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125); // Default to standard yellow if (Main.zenithWorld) { @@ -145,7 +145,7 @@ namespace CalamityMod.Projectiles.Boss else // Red baseColor = new Color(255, aimedSpear ? 0 : 125, aimedSpear ? 0 : 255); } - else if (!ProvUtils.DayAI()) + else if (!ProvUtils.StandardAI()) baseColor = new Color(aimedSpear ? 100 : 175, aimedSpear ? 255 : 175, 255); GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(20), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity, false, 15, Main.rand.NextFloat(0.5f, 1.5f) * MathHelper.Clamp(Projectile.velocity.Length() / 15, 0f, 2f), aimedSpear ? baseColor : ProvUtils.GetProjectileColor(255, false))); @@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Boss Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; bool aimedSpear = Projectile.ai[0] > 0f; - Color baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125); // Default to day + Color baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125); // Default to standard yellow Color baseColor2 = new Color(15, 35, 50, 0); if (Main.zenithWorld) @@ -174,7 +174,7 @@ namespace CalamityMod.Projectiles.Boss else // Red baseColor = new Color(255, aimedSpear ? 0 : 125, aimedSpear ? 0 : 255); } - else if (!ProvUtils.DayAI()) + else if (!ProvUtils.StandardAI()) baseColor = new Color(aimedSpear ? 100 : 175, aimedSpear ? 255 : 175, 255); if (!aimedSpear) diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index e6f75f7469..457affed38 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlastNight").Value; + Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlastNight").Value; int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.alpha, true), 4f, texture); @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Boss GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f, 0.045f, 5)); - int blobAmt = !ProvUtils.DayAI() ? 9 : 6; + int blobAmt = !ProvUtils.StandardAI() ? 9 : 6; if (Projectile.owner == Main.myPlayer) { Vector2 additionalBlobVelocity = new Vector2(Projectile.velocity.X * 0.1f, Projectile.velocity.Y); diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index 83f9446068..9c3698fe8f 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value; + Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value; int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * (1 + Projectile.frame); float squish = CalamityUtils.SineBumpEasing(Landing, 1) * 0.5f; diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index d3cf52037b..174bca5a2c 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -61,13 +61,13 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return ProvUtils.GetDayNightColor(Projectile.alpha); + return ProvUtils.GetProjectileColor(lightColor); } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/ProfanedSpearNight").Value; - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(Projectile.alpha, true), 4f, texture); + Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/ProfanedSpearNight").Value; + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; @@ -75,8 +75,8 @@ namespace CalamityMod.Projectiles.Boss public override void OnKill(int timeLeft) { - Color hiColor = ProvUtils.GetDayNightColor(255, false); - Color loColor = ProvUtils.GetDayNightColor(0, true); + Color hiColor = ProvUtils.GetProjectileColor(255); + Color loColor = ProvUtils.GetProjectileColor(0, true); for (int i = 0; i < 25; i++) { diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index 3b03365fff..b77439580e 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -127,28 +127,28 @@ namespace CalamityMod.Projectiles.Boss // Increment timer Projectile.localAI[0] += 1f; - // At day, fires every 300 frames but lasts 1500-3600 frames. - // At night, fires every 30 framges but lasts 210 frames. - // In GFB, fires at night rate for the first 210 frames, then at day rate for the next 1500. - bool dayAI = ProvUtils.DayAI() || (Main.zenithWorld && Projectile.timeLeft < 1500); + // Normally, fires every 300 frames but lasts 1500-3600 frames. + // When enraged, fires every 30 frames but lasts 210 frames. + // In GFB, fires at enraged rate for the first 210 frames, then at standard rate for the next 1500. + bool standardAI = ProvUtils.StandardAI() || (Main.zenithWorld && Projectile.timeLeft < 1500); - if (Projectile.localAI[0] >= (dayAI ? 300f : 30f)) + if (Projectile.localAI[0] >= (standardAI ? 300f : 30f)) { - // Spawn shards every 30 frames at night or at 300 frames during day - if (Projectile.localAI[0] % 30f == 0f || dayAI) + // Spawn shards every 30 frames while enraged or at 300 frames normally + if (Projectile.localAI[0] % 30f == 0f || standardAI) { SoundEngine.PlaySound(SoundID.Item109, Projectile.Center); Projectile.netUpdate = true; if (Projectile.owner == Main.myPlayer) { - int totalProjectiles = dayAI ? 15 : (Projectile.localAI[0] % 60f == 0f ? 15 : 10); - float speedX = dayAI ? -21f : -15f; + int totalProjectiles = standardAI ? 15 : (Projectile.localAI[0] % 60f == 0f ? 15 : 10); + float speedX = standardAI ? -21f : -15f; float speedAdjustment = Math.Abs(speedX * 2f / (totalProjectiles - 1)); float speedY = -3f; for (int i = 0; i < totalProjectiles; i++) { - float x4 = dayAI ? Main.rgbToHsl(new Color(255, 200, Main.DiscoB)).X : Main.rgbToHsl(new Color(Main.DiscoR, 200, 255)).X; - float randomSpread = dayAI ? 0f : Main.rand.Next(-150, 151) * 0.01f * (1f - lifeRatio); + float x4 = standardAI ? Main.rgbToHsl(new Color(255, 200, Main.DiscoB)).X : Main.rgbToHsl(new Color(Main.DiscoR, 200, 255)).X; + float randomSpread = standardAI ? 0f : Main.rand.Next(-150, 151) * 0.01f * (1f - lifeRatio); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX + speedAdjustment * i + randomSpread, speedY, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Main.myPlayer, x4, Projectile.whoAmI); } CrystalExplosion(); diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index 482e4f40be..a745f81594 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -59,8 +59,8 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(Projectile.Center, 0.3f * Projectile.Opacity, 0.3f * Projectile.Opacity, 0.3f * Projectile.Opacity); - // Night AI or Guardian Healer - if (!ProvUtils.DayAI() || healerGuardianAlive) + // Enraged AI or Guardian Healer + if (!ProvUtils.StandardAI() || healerGuardianAlive) Projectile.extraUpdates = 1; if (Projectile.timeLeft < 300) @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Boss else { Projectile.velocity.Y *= 1.06f; - float fallSpeed = (CalamityWorld.revenge || (Projectile.maxPenetrate != (int)Providence.BossMode.Day)) ? 3.5f : 3f; + float fallSpeed = (CalamityWorld.revenge || (Projectile.maxPenetrate != (int)Providence.BossMode.Normal)) ? 3.5f : 3f; if (Projectile.velocity.Y > fallSpeed) Projectile.velocity.Y = fallSpeed; } diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index 11d92a468f..7ca90e54b2 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Boss { ExtraWidth = Projectile.ai[2]; - bool scissorLasers = CalamityWorld.revenge || !ProvUtils.DayAI(); + bool scissorLasers = CalamityWorld.revenge || !ProvUtils.StandardAI(); Vector2? vector78 = null; if (Projectile.velocity.HasNaNs() || Projectile.velocity == Vector2.Zero) @@ -158,12 +158,12 @@ namespace CalamityMod.Projectiles.Boss Vector2 scale = new Vector2(Projectile.scale * ExtraWidth, Projectile.scale); - bool dayTime = ProvUtils.DayAI(); - Texture2D texture2D19 = dayTime ? ModContent.Request(Texture, AssetRequestMode.ImmediateLoad).Value : + bool standardTexture = ProvUtils.StandardAI(); + Texture2D texture2D19 = standardTexture ? ModContent.Request(Texture, AssetRequestMode.ImmediateLoad).Value : ModContent.Request("CalamityMod/Projectiles/Boss/ProvidenceHolyRayNight", AssetRequestMode.ImmediateLoad).Value; - Texture2D texture2D20 = dayTime ? ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMid", AssetRequestMode.ImmediateLoad).Value : + Texture2D texture2D20 = standardTexture ? ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMid", AssetRequestMode.ImmediateLoad).Value : ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMidNight", AssetRequestMode.ImmediateLoad).Value; - Texture2D texture2D21 = dayTime ? ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEnd", AssetRequestMode.ImmediateLoad).Value : + Texture2D texture2D21 = standardTexture ? ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEnd", AssetRequestMode.ImmediateLoad).Value : ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEndNight", AssetRequestMode.ImmediateLoad).Value; float rayDrawLength = Projectile.localAI[1]; //length of laser diff --git a/Projectiles/Summon/MiniGuardianHolyRay.cs b/Projectiles/Summon/MiniGuardianHolyRay.cs index 0256dbe178..7064b63c4f 100644 --- a/Projectiles/Summon/MiniGuardianHolyRay.cs +++ b/Projectiles/Summon/MiniGuardianHolyRay.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Summon ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEndNight", AssetRequestMode.ImmediateLoad).Value; float num223 = Projectile.localAI[1]; //length of laser - Color color44 = ProvUtils.GetDayNightColor(!Main.dayTime, 0) * 0.9f; + Color color44 = ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, 0) * 0.9f; Vector2 vector = Projectile.Center - Main.screenPosition; Rectangle? sourceRectangle2 = null; Main.spriteBatch.Draw(texture2D19, vector, sourceRectangle2, color44, Projectile.rotation, texture2D19.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs index 29d1cbf675..3b4ae0053b 100644 --- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs +++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Normal : Providence.BossMode.Enraged); int dustID = ProvUtils.GetDustID(!Main.dayTime); int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Summon public override Color? GetAlpha(Color lightColor) { - return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha); + return ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) @@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); + Projectile.DrawBackglow(ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } @@ -325,7 +325,7 @@ namespace CalamityMod.Projectiles.Summon public override Color? GetAlpha(Color lightColor) { - return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha); + return ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) @@ -333,7 +333,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); + Projectile.DrawBackglow(ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } @@ -499,8 +499,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Type].Value); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha), 1); + Projectile.DrawBackglow(ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Type].Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha), 1); return false; } @@ -735,7 +735,7 @@ namespace CalamityMod.Projectiles.Summon public override Color? GetAlpha(Color lightColor) { - return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha); + return ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) @@ -743,7 +743,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Summon/ProfanedCrystalRangedHugesNight").Value; int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); + Projectile.DrawBackglow(ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } @@ -939,14 +939,14 @@ namespace CalamityMod.Projectiles.Summon public override Color? GetAlpha(Color lightColor) { - return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha); + return ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); + Projectile.DrawBackglow(ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } @@ -1790,8 +1790,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { var psc = Projectile.ai[0] > 0f; - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime && psc, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Type].Value); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], ProvUtils.GetDayNightColor(!Main.dayTime && psc, Projectile.alpha), 1); + Projectile.DrawBackglow(ProvUtils.GetColorBasedOnEnrage(!Main.dayTime && psc, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Type].Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], ProvUtils.GetColorBasedOnEnrage(!Main.dayTime && psc, Projectile.alpha), 1); return false; } @@ -1908,7 +1908,7 @@ namespace CalamityMod.Projectiles.Summon public override Color? GetAlpha(Color lightColor) { - return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha); + return ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) @@ -1916,7 +1916,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); + Projectile.DrawBackglow(ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } @@ -2047,7 +2047,7 @@ namespace CalamityMod.Projectiles.Summon public override Color? GetAlpha(Color lightColor) { - return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha); + return ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) @@ -2055,7 +2055,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); + Projectile.DrawBackglow(ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index 1cb2255b9f..9b1fce5a1a 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -119,7 +119,7 @@ namespace CalamityMod public static string CatastropheKilledLast = CalamityUtils.GetTextValue("Condition.Drops.CatastropheKilledLast"); public static string CynosureText = CalamityUtils.GetTextValue("Condition.Drops.Cynosure"); - public static string ProvidenceNightText = CalamityUtils.GetTextValue("Condition.Drops.ProvidenceNight"); + public static string ProvidenceEnragedText = CalamityUtils.GetTextValue("Condition.Drops.ProvidenceEnraged"); public static string ProvidenceChallengeText = CalamityUtils.GetTextValue("Condition.Drops.ProvidenceChallenge"); #endregion