From 5033d91f58d2c7da550b75a3928bc751ee9d64bf Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 12 Nov 2020 16:44:06 -0500 Subject: [PATCH] scorpio rocket resprites --- Projectiles/Ranged/BigNuke.cs | 23 ++++++--- Projectiles/Ranged/BigNuke.png | Bin 332 -> 369 bytes Projectiles/Ranged/MagnomalyRocket.cs | 6 +-- Projectiles/Ranged/MiniRocket.cs | 69 ++++++++++++-------------- Projectiles/Ranged/MiniRocket.png | Bin 332 -> 369 bytes 5 files changed, 51 insertions(+), 47 deletions(-) diff --git a/Projectiles/Ranged/BigNuke.cs b/Projectiles/Ranged/BigNuke.cs index 436841138d..9b21be1cf3 100644 --- a/Projectiles/Ranged/BigNuke.cs +++ b/Projectiles/Ranged/BigNuke.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { DisplayName.SetDefault("Big Nuke"); + Main.projFrames[projectile.type] = 4; } public override void SetDefaults() @@ -25,8 +26,21 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (Math.Abs(projectile.velocity.X) >= 8f || Math.Abs(projectile.velocity.Y) >= 8f) + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(90); + + //Animation + projectile.frameCounter++; + if (projectile.frameCounter > 7) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + + if (projectile.velocity.Length() >= 8f) { for (int num246 = 0; num246 < 2; num246++) { @@ -58,10 +72,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - projectile.position = projectile.Center; - projectile.width = projectile.height = 720; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 720); projectile.maxPenetrate = -1; projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Ranged/BigNuke.png b/Projectiles/Ranged/BigNuke.png index b6fbd0efbbd3ff1fca7c68ba9a26811b8ec32b8a..640914a5c480bf5d3bb53360c47402c29fac0d31 100644 GIT binary patch delta 355 zcmV-p0i6EK0`UTn7k`Kd1^@s6*P+@J0003tNklSRvemYb$?Y$KmMt3-Y||a}x&&-Sl*E46!)9cCsShAp?=N{fyIAO0sxc9Pkn3$ZJs2 zVCl-9(BLF+?x3icUc-z9X`LKw?)kUOH~#ke|JAht%8D&wPA_&< zbho{#QD&Uu&&<%4Y|=30Qn9y=$4RLMcRSVuJMFS5C*Ik-D{tEp^T+PSj2DslUYZPx zG?)~8gBdpIFe~slGc+j_ObM+Hp1bPfGr85JTjI9Am1bC7zTf4~?mpMBrBfJQ95H{q zEc#oC`I)z;@B9rl?u=)U(Yu~?-QwJ;seUz=zZRa?@p+f__{Ga*^7ft$4%L1?;-&$; O$>8bg=d#Wzp$P!Ktb4rx diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index 767866cf0e..3987b0c88b 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -82,10 +82,8 @@ namespace CalamityMod.Projectiles.Ranged { if (projectile.owner == Main.myPlayer) { - projectile.position = projectile.Center; - projectile.width = projectile.height = 192; - projectile.Center = projectile.position; - Main.PlaySound(SoundID.Item14, projectile.position); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 192); + Main.PlaySound(SoundID.Item14, projectile.Center); //DO NOT REMOVE THIS PROJECTILE Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); diff --git a/Projectiles/Ranged/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs index 4f328eebd1..a5f3e9dc2d 100644 --- a/Projectiles/Ranged/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { DisplayName.SetDefault("Rocket"); + Main.projFrames[projectile.type] = 4; } public override void SetDefaults() @@ -24,52 +25,46 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3) + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(90); + + //Animation + projectile.frameCounter++; + if (projectile.frameCounter > 7) { - projectile.tileCollide = false; - projectile.ai[1] = 0f; - projectile.alpha = 255; - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 200; - projectile.height = 200; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - projectile.knockBack = 10f; + projectile.frame++; + projectile.frameCounter = 0; } - else + if (projectile.frame >= Main.projFrames[projectile.type]) { - if (Math.Abs(projectile.velocity.X) >= 8f || Math.Abs(projectile.velocity.Y) >= 8f) - { - for (int num246 = 0; num246 < 2; num246++) - { - float num247 = 0f; - float num248 = 0f; - if (num246 == 1) - { - num247 = projectile.velocity.X * 0.5f; - num248 = projectile.velocity.Y * 0.5f; - } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); - Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; - Main.dust[num249].velocity *= 0.2f; - Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); - Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num249].velocity *= 0.05f; - } - } + projectile.frame = 0; } + + if (projectile.velocity.Length() >= 8f) + { + for (int num246 = 0; num246 < 2; num246++) + { + float num247 = 0f; + float num248 = 0f; + if (num246 == 1) + { + num247 = projectile.velocity.X * 0.5f; + num248 = projectile.velocity.Y * 0.5f; + } + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); + Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num249].velocity *= 0.2f; + Main.dust[num249].noGravity = true; + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); + Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[num249].velocity *= 0.05f; + } + } CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 20f, 20f); } public override void Kill(int timeLeft) { - projectile.position = projectile.Center; - projectile.width = projectile.height = 32; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 32); projectile.maxPenetrate = -1; projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Ranged/MiniRocket.png b/Projectiles/Ranged/MiniRocket.png index b6fbd0efbbd3ff1fca7c68ba9a26811b8ec32b8a..640914a5c480bf5d3bb53360c47402c29fac0d31 100644 GIT binary patch delta 355 zcmV-p0i6EK0`UTn7k`Kd1^@s6*P+@J0003tNklSRvemYb$?Y$KmMt3-Y||a}x&&-Sl*E46!)9cCsShAp?=N{fyIAO0sxc9Pkn3$ZJs2 zVCl-9(BLF+?x3icUc-z9X`LKw?)kUOH~#ke|JAht%8D&wPA_&< zbho{#QD&Uu&&<%4Y|=30Qn9y=$4RLMcRSVuJMFS5C*Ik-D{tEp^T+PSj2DslUYZPx zG?)~8gBdpIFe~slGc+j_ObM+Hp1bPfGr85JTjI9Am1bC7zTf4~?mpMBrBfJQ95H{q zEc#oC`I)z;@B9rl?u=)U(Yu~?-QwJ;seUz=zZRa?@p+f__{Ga*^7ft$4%L1?;-&$; O$>8bg=d#Wzp$P!Ktb4rx