diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index ad7517e5bd..c7a3538504 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2238,6 +2238,9 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] >= fireballBreathTimer) { + // Set damage once charge starts + NPC.damage = setDamage; + if (NPC.ai[1] % (expertMode ? 6f : 8f) == 0f && Main.netMode != NetmodeID.MultiplayerClient) { float xOffset = 30f; diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index 2f8648e584..89771b207e 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Boss public class YharonFireball : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; - private float speedX = -1f; - private float speedX2 = -2f; + private float speedX = -3f; + private float speedX2 = -5f; public override void SetStaticDefaults() { @@ -95,13 +95,13 @@ namespace CalamityMod.Projectiles.Boss { for (int x = 0; x < 3; x++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX, -6f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); - speedX += 1f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX, -50f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); + speedX += 3f; } for (int x = 0; x < 2; x++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX2, -6f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); - speedX2 += 4f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX2, -75f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); + speedX2 += 10f; } } Projectile.ExpandHitboxBy(144); diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index df9e249e70..5457f659ec 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; + Projectile.Opacity = 0.25f; Projectile.alpha = 255; Projectile.penetrate = -1; Projectile.timeLeft = 3600; @@ -60,21 +61,43 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; - if (Projectile.ai[0] < TimeBeforeFalling) + if (Projectile.velocity.Y >= -16f) { - Projectile.ai[0] += 1f; - Projectile.velocity.Y -= 0.1f; - if (Projectile.velocity.Y < MaxUpwardVelocity) - Projectile.velocity.Y = MaxUpwardVelocity; + if (Projectile.Opacity < 1f) + { + Projectile.Opacity = 1f; + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); + int dustAmount = 36; + + for (int i = 0; i < dustAmount; i++) + { + Vector2 dustSpawnPosition = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.5f; + dustSpawnPosition = dustSpawnPosition.RotatedBy((double)((float)(i - (dustAmount / 2 - 1)) * MathHelper.TwoPi / (float)dustAmount), default) + Projectile.Center; + Vector2 dustVelocity = dustSpawnPosition - Projectile.Center; + + int dust = Dust.NewDust(dustSpawnPosition + dustVelocity, 0, 0, DustID.Pixie, dustVelocity.X, dustVelocity.Y); + Main.dust[dust].noGravity = true; + Main.dust[dust].noLight = true; + Main.dust[dust].velocity = dustVelocity; + } + } + } + + if (Projectile.velocity.Y < -1f) + { + // 129 frames to get from -50 to -1 + Projectile.velocity.Y *= 0.97f; } else { - Projectile.velocity.X *= 0.8f; + // 85 frames to get from -1 to 16 Projectile.velocity.Y += 0.2f; - if (Projectile.velocity.Y > MaxDownwardVelocity) - Projectile.velocity.Y = MaxDownwardVelocity; + if (Projectile.velocity.Y > 16f) + Projectile.velocity.Y = 16f; } + Projectile.velocity.X *= 0.995f; + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; if (Projectile.localAI[0] == 0f) @@ -83,6 +106,13 @@ namespace CalamityMod.Projectiles.Boss SoundEngine.PlaySound(FireballSound, Projectile.Center); } + if (Projectile.ai[0] >= 2f) + { + Projectile.alpha -= 25; + if (Projectile.alpha < 0) + Projectile.alpha = 0; + } + if (Main.rand.NextBool(16)) { Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Pixie, 0f, 0f, 200, default, 1f); @@ -91,6 +121,7 @@ namespace CalamityMod.Projectiles.Boss } } + public override bool CanHitPlayer(Player target) => Projectile.velocity.Y >= -16f; public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha); public override bool PreDraw(ref Color lightColor)