From 87911531c8a6955c19fd6bf6264268b92e4b4434 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 11 Nov 2020 18:59:07 -0500 Subject: [PATCH] fixed terra arrows --- Projectiles/Ranged/TerraArrowMain.cs | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Projectiles/Ranged/TerraArrowMain.cs b/Projectiles/Ranged/TerraArrowMain.cs index 95adf35cc4..dfdd91da56 100644 --- a/Projectiles/Ranged/TerraArrowMain.cs +++ b/Projectiles/Ranged/TerraArrowMain.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Projectiles.Ranged { public class TerraArrowMain : ModProjectile { + private bool initialized = false; public override void SetStaticDefaults() { DisplayName.SetDefault("Arrow"); @@ -21,25 +22,31 @@ namespace CalamityMod.Projectiles.Ranged projectile.arrow = true; projectile.penetrate = 1; projectile.timeLeft = 600; + projectile.extraUpdates = 1; } public override void AI() { - projectile.velocity *= 1.005f; - if (projectile.velocity.Length() >= 20f) - { - projectile.Kill(); - } + if (!initialized) + { + projectile.velocity *= 0.5f; + initialized = true; + } + if (projectile.FinalExtraUpdate() && initialized) + { + projectile.velocity *= 1.003f; + if (projectile.velocity.Length() >= 22f) + { + projectile.Kill(); + } + } projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override void Kill(int timeLeft) { - projectile.position = projectile.Center; - projectile.width = projectile.height = 32; - projectile.position.X -= (float)(projectile.width / 2); - projectile.position.Y -= (float)(projectile.height / 2); - Main.PlaySound(SoundID.Item60, projectile.position); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 32); + Main.PlaySound(SoundID.Item60, projectile.Center); for (int d = 0; d < 3; d++) { int terra = Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, 0f, 0f, 100, default, 2f);