From e1e0230f2ec3f0df2d740003f47b9f3cb6d9505b Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 29 Apr 2022 17:59:58 -0500 Subject: [PATCH] 1 - Edited Yharon's weird fireball circles to be more interesting and made his bullet hells last less time to make it more action-oriented. --- NPCs/Yharon/Yharon.cs | 66 ++++++++++++++------------------- Projectiles/Boss/FlareDust2.cs | 68 ---------------------------------- 2 files changed, 27 insertions(+), 107 deletions(-) diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index f6d83e03b0..fcf75ed8e0 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -265,11 +265,8 @@ namespace CalamityMod.NPCs.Yharon int newPhaseTimer = 180; - float flareDustPhaseScalar = death ? 48f : 60f; - phase2GateValue -= ai2GateValue; // 0.35, 70% HP = 0.7 - 0.55 = 0.15, 0.35 - 0.15 = 0.2 / 0.35 = 0.57, 60% HP = 0.6 - 0.55 = 0.05, 0.35 - 0.05 = 0.3 / 0.35 = 0.85, 80% HP = 0.8 - 0.55 = 0.25, 0.35 - 0.25 = 0.1 / 0.35 = 0.28 - int flareDustPhaseTimerReduction = revenge ? (int)(flareDustPhaseScalar * ((phase2GateValue - (lifeRatio - ai2GateValue)) / phase2GateValue)) : 0; - int flareDustPhaseTimer = (malice ? 210 : death ? 240 : 300) - flareDustPhaseTimerReduction; - int flareDustPhaseTimer2 = (malice ? 105 : death ? 120 : 150) - (flareDustPhaseTimerReduction / 2); + int flareDustPhaseTimer = malice ? 160 : death ? 200 : 240; + int flareDustPhaseTimer2 = malice ? 80 : death ? 100 : 120; float spinTime = flareDustPhaseTimer / 2; @@ -1082,7 +1079,7 @@ namespace CalamityMod.NPCs.Yharon } } - // Flare Dust that speeds up and whips around in a wave + // Flare Dust circle else if (NPC.ai[0] == 12f) { if (NPC.ai[2] == 0f) @@ -1094,12 +1091,12 @@ namespace CalamityMod.NPCs.Yharon { if (Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 projectileVelocity = player.Center - fromMouth; + Vector2 projectileVelocity = NPC.velocity; projectileVelocity.Normalize(); - projectileVelocity *= 0.1f; + projectileVelocity *= 12f; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer); } } @@ -1459,12 +1456,12 @@ namespace CalamityMod.NPCs.Yharon { if (Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 projectileVelocity = player.Center - fromMouth; + Vector2 projectileVelocity = NPC.velocity; projectileVelocity.Normalize(); - projectileVelocity *= 0.1f; + projectileVelocity *= 15f; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer); } } @@ -1666,8 +1663,8 @@ namespace CalamityMod.NPCs.Yharon bool doFastChargeTelegraph = NPC.localAI[1] <= fastChargeTelegraphTime; float fireballBreathTimer = 60f; - float fireballBreathPhaseTimer = fireballBreathTimer + 120f; - float fireballBreathPhaseVelocity = 22f; + float fireballBreathPhaseTimer = fireballBreathTimer + 80f; + float fireballBreathPhaseVelocity = expertMode ? 32f : 30f; float splittingFireballBreathTimer = 40f; float splittingFireballBreathPhaseVelocity = 22f; @@ -1677,9 +1674,7 @@ namespace CalamityMod.NPCs.Yharon float splittingFireballBreathYVelocityTimer = 40f; float splittingFireballBreathPhaseTimer = splittingFireballBreathTimer + splittingFireballBreathTimer2 + splittingFireballBreathYVelocityTimer; - float flareDustPhaseScalar = secondPhasePhase == 4 ? (death ? 54f : 60f) : (death ? 67f : 80f); - int spinPhaseTimerReduction = revenge ? (secondPhasePhase == 4 ? (int)(flareDustPhaseScalar * ((phase4GateValue - lifeRatio) / phase4GateValue)) : (int)(flareDustPhaseScalar * (ai2GateValue - lifeRatio))) : 0; - int spinPhaseTimer = (secondPhasePhase == 4 ? (malice ? 150 : death ? 160 : 180) : (malice ? 180 : death ? 200 : 240)) - spinPhaseTimerReduction; + int spinPhaseTimer = secondPhasePhase == 4 ? (malice ? 80 : death ? 100 : 120) : (malice ? 120 : death ? 150 : 180); float spinTime = spinPhaseTimer / 2; float spinRotation = MathHelper.TwoPi * 3 / spinTime; float spinPhaseVelocity = 25f; @@ -2055,7 +2050,7 @@ namespace CalamityMod.NPCs.Yharon } } - // Fireball spit + // Fireball spit charge else if (NPC.ai[0] == 3f) { int num29 = (vectorCenter.X < targetData.Center.X) ? 1 : -1; @@ -2078,24 +2073,30 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] == fireballBreathTimer) { - int direction = (targetData.Center.X > vectorCenter.X) ? 1 : -1; - NPC.velocity = new Vector2(direction, 0f) * fireballBreathPhaseVelocity; - NPC.direction = NPC.spriteDirection = direction; + Vector2 vector = NPC.SafeDirectionTo(targetData.Center, Vector2.UnitX * NPC.spriteDirection); + NPC.spriteDirection = (vector.X > 0f) ? 1 : -1; + NPC.rotation = vector.ToRotation(); + + if (NPC.spriteDirection == -1) + NPC.rotation += pie; + + NPC.velocity = vector * fireballBreathPhaseVelocity; + SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonFire"), NPC.Center); } if (NPC.ai[1] >= fireballBreathTimer) { - if (NPC.ai[1] % 10 == 0 && Main.netMode != NetmodeID.MultiplayerClient) + if (NPC.ai[1] % (expertMode ? 6f : 8f) == 0f && Main.netMode != NetmodeID.MultiplayerClient) { float xOffset = 30f; Vector2 position = vectorCenter + new Vector2((110f + xOffset) * NPC.direction, -20f).RotatedBy(NPC.rotation); - Vector2 projectileVelocity = targetData.Center - position; + Vector2 projectileVelocity = NPC.velocity; projectileVelocity.Normalize(); - projectileVelocity *= 0.1f; + projectileVelocity *= 2f; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), position, projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), position, projectileVelocity, type, damage, 0f, Main.myPlayer); } if (Math.Abs(targetData.Center.X - vectorCenter.X) > 700f && Math.Abs(NPC.velocity.X) < chargeSpeed) @@ -2454,25 +2455,12 @@ namespace CalamityMod.NPCs.Yharon switch ((int)NPC.ai[0]) { case 2: + case 3: case 5: case 7: case 8: case 9: num43 = 0f; - break; - case 3: - num43 = 0.01f; - num42 = 0f; - - if (NPC.spriteDirection == -1) - num42 -= pie; - - if (NPC.ai[1] >= fireballBreathTimer) - { - num42 += NPC.spriteDirection * pie / 12f; - num43 = 0.05f; - } - break; case 4: num43 = 0.01f; diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index 3b79ad090e..8991e19d97 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -13,9 +13,6 @@ namespace CalamityMod.Projectiles.Boss { public override string Texture => "CalamityMod/Projectiles/Boss/FlareBomb"; - private bool start = true; - private Vector2 velocity = Vector2.Zero; - public override void SetStaticDefaults() { DisplayName.SetDefault("Flare Bomb"); @@ -36,18 +33,6 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = 1; } - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(start); - writer.WriteVector2(velocity); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - start = reader.ReadBoolean(); - velocity = reader.ReadVector2(); - } - public override void AI() { Projectile.frameCounter++; @@ -59,59 +44,6 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.frame >= Main.projFrames[Projectile.type]) Projectile.frame = 0; - if (Projectile.ai[0] == 1f) - { - if (Projectile.timeLeft < 630) - { - if (Projectile.velocity.Length() < 6f) - { - Projectile.velocity *= 1.025f; - } - else - { - if (start) - { - velocity = Projectile.velocity; - start = false; - } - - Projectile.ai[1] += 0.1f; - - float amplitude = 2f; - - float wavyVelocity = (float)Math.Cos(Projectile.ai[1]); - - Projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity) * amplitude; - } - } - } - else - { - if (Projectile.timeLeft < 420) - { - if (Projectile.velocity.Length() < 12f) - { - Projectile.velocity *= 1.05f; - } - else - { - if (start) - { - velocity = Projectile.velocity; - start = false; - } - - Projectile.ai[1] += 0.1f; - - float amplitude = 2f; - - float wavyVelocity = (float)Math.Sin(Projectile.ai[1]); - - Projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity) * amplitude; - } - } - } - Lighting.AddLight(Projectile.Center, 0.5f, 0.25f, 0f); }