diff --git a/Projectiles/Arrows/DemonArrow.cs b/Projectiles/Arrows/DemonArrow.cs index a375e1a..a43697f 100644 --- a/Projectiles/Arrows/DemonArrow.cs +++ b/Projectiles/Arrows/DemonArrow.cs @@ -25,9 +25,8 @@ public class DemonArrow : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj = Main.dust[dust]; - obj.velocity /= 2f; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].velocity /= 2f; } } @@ -35,7 +34,7 @@ public class DemonArrow : ModProjectile { for (int i = 0; i < 5; i++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } SoundEngine.PlaySound(SoundID.Item2, Projectile.position); } diff --git a/Projectiles/Arrows/GoldenSpiritArrow.cs b/Projectiles/Arrows/GoldenSpiritArrow.cs index f384c8a..d0e3287 100644 --- a/Projectiles/Arrows/GoldenSpiritArrow.cs +++ b/Projectiles/Arrows/GoldenSpiritArrow.cs @@ -25,9 +25,8 @@ public class GoldenSpiritArrow : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj = Main.dust[dust]; - obj.velocity /= 2f; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].velocity /= 2f; } } @@ -35,7 +34,7 @@ public class GoldenSpiritArrow : ModProjectile { for (int i = 0; i < 5; i++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } SoundEngine.PlaySound(SoundID.Item1, Projectile.position); } diff --git a/Projectiles/Arrows/LegendaryArrow.cs b/Projectiles/Arrows/LegendaryArrow.cs index 14e56ab..c4d0d0e 100644 --- a/Projectiles/Arrows/LegendaryArrow.cs +++ b/Projectiles/Arrows/LegendaryArrow.cs @@ -24,10 +24,9 @@ public class LegendaryArrow : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj = Main.dust[dust]; - obj.velocity /= 2f; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].velocity /= 2f; } } @@ -35,8 +34,8 @@ public class LegendaryArrow : ModProjectile { if (Main.rand.NextBool(1)) { - target.AddBuff(69, 900, false); - target.AddBuff(70, 900, false); + target.AddBuff(BuffID.Ichor, 900, false); + target.AddBuff(BuffID.Venom, 900, false); } } @@ -44,11 +43,11 @@ public class LegendaryArrow : ModProjectile { for (int i = 0; i < 5; i++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } for (int j = 0; j < 5; j++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } SoundEngine.PlaySound(SoundID.Item1, Projectile.position); } diff --git a/Projectiles/Arrows/RainbowArrow.cs b/Projectiles/Arrows/RainbowArrow.cs index 51a2c71..a491b80 100644 --- a/Projectiles/Arrows/RainbowArrow.cs +++ b/Projectiles/Arrows/RainbowArrow.cs @@ -25,20 +25,19 @@ public class RainbowArrow : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } @@ -47,8 +46,8 @@ public class RainbowArrow : ModProjectile { if (Main.rand.NextBool(1)) { - target.AddBuff(69, 900, false); - target.AddBuff(70, 900, false); + target.AddBuff(BuffID.Ichor, 900, false); + target.AddBuff(BuffID.Venom, 900, false); } } @@ -58,20 +57,19 @@ public class RainbowArrow : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } diff --git a/Projectiles/Arrows/StormArrow.cs b/Projectiles/Arrows/StormArrow.cs index c55fba8..f0759ff 100644 --- a/Projectiles/Arrows/StormArrow.cs +++ b/Projectiles/Arrows/StormArrow.cs @@ -25,9 +25,8 @@ public class StormArrow : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj = Main.dust[dust]; - obj.velocity /= 2f; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].velocity /= 2f; } } @@ -35,7 +34,7 @@ public class StormArrow : ModProjectile { for (int i = 0; i < 5; i++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } SoundEngine.PlaySound(SoundID.Item1, Projectile.position); } diff --git a/Projectiles/Daggers/ColorfulSolution.cs b/Projectiles/Daggers/ColorfulSolution.cs index 14157ee..753b743 100644 --- a/Projectiles/Daggers/ColorfulSolution.cs +++ b/Projectiles/Daggers/ColorfulSolution.cs @@ -8,10 +8,6 @@ namespace FabusMod.Projectiles.Daggers; public class ColorfulSolution : ModProjectile { - private const float maxTicks = 70f; - - private const int alphaReducation = 25; - public override void SetStaticDefaults() { DisplayName.SetDefault("Colorful Solution"); @@ -45,7 +41,7 @@ public class ColorfulSolution : ModProjectile int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } @@ -53,20 +49,19 @@ public class ColorfulSolution : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } @@ -75,7 +70,7 @@ public class ColorfulSolution : ModProjectile { if (Main.rand.NextBool(1)) { - target.AddBuff(70, 720, false); + target.AddBuff(BuffID.Venom, 720, false); } } } diff --git a/Projectiles/FoxPistol/BlueBolt.cs b/Projectiles/FoxPistol/BlueBolt.cs index 88dd42f..10547a7 100644 --- a/Projectiles/FoxPistol/BlueBolt.cs +++ b/Projectiles/FoxPistol/BlueBolt.cs @@ -28,11 +28,10 @@ public class BlueBolt : ModProjectile Projectile.velocity.Y += Projectile.ai[0]; if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.5f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.5f; + Main.dust[dust].noGravity = true; } } @@ -42,11 +41,10 @@ public class BlueBolt : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.5f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.5f; + Main.dust[dust].noGravity = true; } } } diff --git a/Projectiles/FoxPistol/BlueBoltRMB.cs b/Projectiles/FoxPistol/BlueBoltRMB.cs index fa4acfc..03fe1ab 100644 --- a/Projectiles/FoxPistol/BlueBoltRMB.cs +++ b/Projectiles/FoxPistol/BlueBoltRMB.cs @@ -28,15 +28,14 @@ public class BlueBoltRMB : ModProjectile Projectile.velocity.Y += Projectile.ai[0]; if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.5f; + Main.dust[dust1].velocity *= 0.5f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.8f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.5f; + Main.dust[dust2].velocity *= 0.5f; Main.dust[dust2].noGravity = true; } } @@ -47,15 +46,14 @@ public class BlueBoltRMB : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.5f; + Main.dust[dust1].velocity *= 0.5f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.8f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.5f; + Main.dust[dust2].velocity *= 0.5f; Main.dust[dust2].noGravity = true; } } diff --git a/Projectiles/FoxPistol/OrangeBolt.cs b/Projectiles/FoxPistol/OrangeBolt.cs index 4ceba28..8f7e618 100644 --- a/Projectiles/FoxPistol/OrangeBolt.cs +++ b/Projectiles/FoxPistol/OrangeBolt.cs @@ -28,11 +28,10 @@ public class OrangeBolt : ModProjectile Projectile.velocity.Y += Projectile.ai[0]; if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.5f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.5f; + Main.dust[dust].noGravity = true; } } @@ -42,11 +41,10 @@ public class OrangeBolt : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.5f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.5f; + Main.dust[dust].noGravity = true; } } } diff --git a/Projectiles/FoxPistol/OrangeBoltRMB.cs b/Projectiles/FoxPistol/OrangeBoltRMB.cs index f962a0d..8e9f1b1 100644 --- a/Projectiles/FoxPistol/OrangeBoltRMB.cs +++ b/Projectiles/FoxPistol/OrangeBoltRMB.cs @@ -28,15 +28,14 @@ public class OrangeBoltRMB : ModProjectile Projectile.velocity.Y += Projectile.ai[0]; if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.5f; + Main.dust[dust1].velocity *= 0.5f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.8f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.5f; + Main.dust[dust2].velocity *= 0.5f; Main.dust[dust2].noGravity = true; } } @@ -47,15 +46,14 @@ public class OrangeBoltRMB : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.5f; + Main.dust[dust1].velocity *= 0.5f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.8f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.5f; + Main.dust[dust2].velocity *= 0.5f; Main.dust[dust2].noGravity = true; } } diff --git a/Projectiles/FoxPistol/RainbowBolt.cs b/Projectiles/FoxPistol/RainbowBolt.cs index 1b95042..6a696c1 100644 --- a/Projectiles/FoxPistol/RainbowBolt.cs +++ b/Projectiles/FoxPistol/RainbowBolt.cs @@ -28,20 +28,19 @@ public class RainbowBolt : ModProjectile Projectile.velocity.Y += Projectile.ai[0]; if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } @@ -52,20 +51,19 @@ public class RainbowBolt : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } diff --git a/Projectiles/FoxPistol/RainbowBoltRMB.cs b/Projectiles/FoxPistol/RainbowBoltRMB.cs index dbf2471..555ce48 100644 --- a/Projectiles/FoxPistol/RainbowBoltRMB.cs +++ b/Projectiles/FoxPistol/RainbowBoltRMB.cs @@ -28,25 +28,24 @@ public class RainbowBoltRMB : ModProjectile Projectile.velocity.Y += Projectile.ai[0]; if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; + + int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust4].scale = 0.7f; - Dust obj4 = Main.dust[dust4]; - obj4.velocity *= 0.1f; + Main.dust[dust4].velocity *= 0.1f; Main.dust[dust4].noGravity = true; } } @@ -57,25 +56,24 @@ public class RainbowBoltRMB : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; + + int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust4].scale = 0.7f; - Dust obj4 = Main.dust[dust4]; - obj4.velocity *= 0.1f; + Main.dust[dust4].velocity *= 0.1f; Main.dust[dust4].noGravity = true; } } diff --git a/Projectiles/GoldenOrb.cs b/Projectiles/GoldenOrb.cs index 4e9f143..abfc7bb 100644 --- a/Projectiles/GoldenOrb.cs +++ b/Projectiles/GoldenOrb.cs @@ -28,8 +28,7 @@ public class GoldenOrb : ModProjectile { if (Projectile.alpha > 70) { - Projectile projectile = Projectile; - projectile.alpha -= 15; + Projectile.alpha -= 15; if (Projectile.alpha < 70) { Projectile.alpha = 70; @@ -47,7 +46,7 @@ public class GoldenOrb : ModProjectile { if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && Main.npc[i].lifeMax > 5) { - Vector2 newMove = ((Entity)Main.npc[i]).Center - Projectile.Center; + Vector2 newMove = Main.npc[i].Center - Projectile.Center; float distanceTo = (float)Math.Sqrt(newMove.X * newMove.X + newMove.Y * newMove.Y); if (distanceTo < distance) { @@ -65,11 +64,10 @@ public class GoldenOrb : ModProjectile } if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } AnimateProjectile(); } @@ -85,14 +83,11 @@ public class GoldenOrb : ModProjectile public void AnimateProjectile() { - Projectile projectile = Projectile; - projectile.frameCounter++; + Projectile.frameCounter++; if (Projectile.frameCounter >= 5) { - Projectile projectile2 = Projectile; - projectile2.frame++; - Projectile projectile3 = Projectile; - projectile3.frame %= 3; + Projectile.frame++; + Projectile.frame %= 3; Projectile.frameCounter = 0; } } diff --git a/Projectiles/IllusoryMirror/IllusoryMirrorRMB.cs b/Projectiles/IllusoryMirror/IllusoryMirrorRMB.cs index 4e08d8d..be6eb5a 100644 --- a/Projectiles/IllusoryMirror/IllusoryMirrorRMB.cs +++ b/Projectiles/IllusoryMirror/IllusoryMirrorRMB.cs @@ -55,14 +55,11 @@ public class IllusoryMirrorRMB : ModProjectile public void AnimateProjectile() { - Projectile projectile = Projectile; - projectile.frameCounter++; + Projectile.frameCounter++; if (Projectile.frameCounter >= 7) { - Projectile projectile2 = Projectile; - projectile2.frame++; - Projectile projectile3 = Projectile; - projectile3.frame %= 5; + Projectile.frame++; + Projectile.frame %= 5; Projectile.frameCounter = 0; } } diff --git a/Projectiles/IllusoryMirror/SpectralIllusionRMB.cs b/Projectiles/IllusoryMirror/SpectralIllusionRMB.cs index 13983cd..3347aff 100644 --- a/Projectiles/IllusoryMirror/SpectralIllusionRMB.cs +++ b/Projectiles/IllusoryMirror/SpectralIllusionRMB.cs @@ -31,25 +31,25 @@ public class SpectralIllusionRMB : ModProjectile AnimateProjectile(); if (Main.rand.NextBool(2)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 2f; Main.dust[dust1].velocity.Y -= 0.5f; Main.dust[dust1].velocity.X = 0f; Main.dust[dust1].noGravity = true; - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 2f; Main.dust[dust2].velocity.Y += 0.5f; Main.dust[dust2].velocity.X = 0f; Main.dust[dust2].noGravity = true; - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 2f; Main.dust[dust3].velocity.Y += 0.5f; Main.dust[dust3].velocity.X = 0f; Main.dust[dust3].noGravity = true; - int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust4].scale = 2f; Main.dust[dust4].velocity.Y += 0.5f; Main.dust[dust4].velocity.X = 0f; @@ -67,14 +67,11 @@ public class SpectralIllusionRMB : ModProjectile public void AnimateProjectile() { - Projectile projectile = Projectile; - projectile.frameCounter++; + Projectile.frameCounter++; if (Projectile.frameCounter >= 8) { - Projectile projectile2 = Projectile; - projectile2.frame++; - Projectile projectile3 = Projectile; - projectile3.frame %= 7; + Projectile.frame++; + Projectile.frame %= 7; Projectile.frameCounter = 0; } } diff --git a/Projectiles/Lasers/CoalescenceBeam.cs b/Projectiles/Lasers/CoalescenceBeam.cs index a8e9f84..192ed7f 100644 --- a/Projectiles/Lasers/CoalescenceBeam.cs +++ b/Projectiles/Lasers/CoalescenceBeam.cs @@ -54,8 +54,7 @@ public class CoalescenceBeam : ModProjectile { if (Charge == MAX_CHARGE) { - Vector2 unit = Projectile.velocity; - DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, unit, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60); + DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, Projectile.velocity, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60); } return false; } @@ -65,9 +64,8 @@ public class CoalescenceBeam : ModProjectile float r = Utils.ToRotation(unit) + rotation; for (float i = transDist; i <= Distance; i += step) { - Color c = Color.White; Vector2 origin = start + i * unit; - Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : c, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : color, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); } Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); @@ -77,10 +75,9 @@ public class CoalescenceBeam : ModProjectile { if (Charge == MAX_CHARGE) { - Player p = Main.player[Projectile.owner]; - Vector2 unit = Projectile.velocity; + Player player = Main.player[Projectile.owner]; float point = 0f; - if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), p.Center, p.Center + unit * Distance, 22f, ref point)) + if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), player.Center, player.Center + Projectile.velocity * Distance, 22f, ref point)) { return true; } @@ -99,48 +96,44 @@ public class CoalescenceBeam : ModProjectile Player player = Main.player[Projectile.owner]; if (Projectile.owner == Main.myPlayer) { - Vector2 diff = mousePos - player.Center; - diff.Normalize(); - Projectile.velocity = diff; - Projectile.direction = ((Main.MouseWorld.X > player.position.X) ? 1 : (-1)); + Projectile.velocity = mousePos - player.Center; + Projectile.velocity.Normalize(); + Projectile.direction = (Main.MouseWorld.X > player.position.X) ? 1 : (-1); Projectile.netUpdate = true; } Projectile.position = player.Center + Projectile.velocity * MOVE_DISTANCE; Projectile.timeLeft = 2; - int dir = Projectile.direction; - player.ChangeDir(dir); + player.ChangeDir(Projectile.direction); player.heldProj = Projectile.whoAmI; player.itemTime = 2; player.itemAnimation = 2; - player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * dir, Projectile.velocity.X * dir); + player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * Projectile.direction, Projectile.velocity.X * Projectile.direction); if (!player.channel) { Projectile.Kill(); } else { - if (Main.time % 10.0 < 1.0 && !player.CheckMana(player.inventory[player.selectedItem].mana, true, false)) + if (Main.time % 10.0 < 1.0 && !player.CheckMana(player.inventory[player.selectedItem].mana, true)) { Projectile.Kill(); } - Vector2 offset = Projectile.velocity; - offset *= 40f; + Vector2 offset = Projectile.velocity * 40f; Vector2 pos = player.Center + offset - new Vector2(10f, 10f); if (Charge < MAX_CHARGE) { Charge++; } int chargeFact = (int)(Charge / 20f); - Vector2 dustVelocity = Vector2.UnitX * 18f; - dustVelocity = Utils.RotatedBy(dustVelocity, (double)(Projectile.rotation - 1.57f), default); + Vector2 dustVelocity = Utils.RotatedBy(Vector2.UnitX * 18f, (double)(Projectile.rotation - 1.57f)); Vector2 spawnPos = Projectile.Center + dustVelocity; for (int j = 0; j < chargeFact + 1; j++) { Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2); - Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f, 0, default, 1f)]; - obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; - obj.noGravity = true; - obj.scale = Main.rand.Next(10, 20) * 0.05f; + int dust = Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f); + Main.dust[dust].velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; + Main.dust[dust].noGravity = true; + Main.dust[dust].scale = Main.rand.Next(10, 20) * 0.05f; } } if (Charge < MAX_CHARGE) @@ -167,9 +160,9 @@ public class CoalescenceBeam : ModProjectile { float num1 = Utils.ToRotation(Projectile.velocity) + ((Main.rand.NextBool(2)) ? (-1f) : 1f) * 1.57f; float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0); - //new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); } DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); @@ -182,8 +175,7 @@ public class CoalescenceBeam : ModProjectile public override void CutTiles() { - DelegateMethods.tilecut_0 = (TileCuttingContext)2; - Vector2 unit = Projectile.velocity; - Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); } } diff --git a/Projectiles/Lasers/GoldenBeam.cs b/Projectiles/Lasers/GoldenBeam.cs index 733fcb4..d65ada9 100644 --- a/Projectiles/Lasers/GoldenBeam.cs +++ b/Projectiles/Lasers/GoldenBeam.cs @@ -54,8 +54,7 @@ public class GoldenBeam : ModProjectile { if (Charge == MAX_CHARGE) { - Vector2 unit = Projectile.velocity; - DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, unit, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60); + DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, Projectile.velocity, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60); } return false; } @@ -65,9 +64,8 @@ public class GoldenBeam : ModProjectile float r = Utils.ToRotation(unit) + rotation; for (float i = transDist; i <= Distance; i += step) { - Color c = Color.White; Vector2 origin = start + i * unit; - Main.EntitySpriteDraw(texture, origin - Main.screenPosition, (Rectangle?)new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : c, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, origin - Main.screenPosition, (Rectangle?)new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : color, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); } Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, (Rectangle?)new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, (Rectangle?)new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); @@ -77,10 +75,9 @@ public class GoldenBeam : ModProjectile { if (Charge == 50f) { - Player p = Main.player[Projectile.owner]; - Vector2 unit = Projectile.velocity; + Player player = Main.player[Projectile.owner]; float point = 0f; - if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), p.Center, p.Center + unit * Distance, 22f, ref point)) + if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), player.Center, player.Center + Projectile.velocity * Distance, 22f, ref point)) { return true; } @@ -139,7 +136,7 @@ public class GoldenBeam : ModProjectile for (int j = 0; j < chargeFact + 1; j++) { Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2); - Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f, 0, default, 1f)]; + Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f)]; obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; obj.noGravity = true; obj.scale = Main.rand.Next(10, 20) * 0.05f; @@ -149,11 +146,9 @@ public class GoldenBeam : ModProjectile { return; } - Vector2 start = player.Center; - _ = Projectile.velocity * -1f; for (Distance = MOVE_DISTANCE; Distance <= 2200f; Distance += 5f) { - start = player.Center + Projectile.velocity * Distance; + Vector2 start = player.Center + Projectile.velocity * Distance; if (!Collision.CanHit(player.Center, 1, 1, start, 1, 1)) { Distance -= 5f; @@ -167,9 +162,6 @@ public class GoldenBeam : ModProjectile } for (int i = 0; i < 2; i++) { - float num1 = Utils.ToRotation(Projectile.velocity) + ((Main.rand.NextBool(2)) ? (-1f) : 1f) * 1.57f; - float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0); - new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); } DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); @@ -183,8 +175,7 @@ public class GoldenBeam : ModProjectile public override void CutTiles() { - DelegateMethods.tilecut_0 = (TileCuttingContext)2; - Vector2 unit = Projectile.velocity; - Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); } } diff --git a/Projectiles/Lasers/HellfireBeamProj.cs b/Projectiles/Lasers/HellfireBeamProj.cs index 75625d8..f8ef841 100644 --- a/Projectiles/Lasers/HellfireBeamProj.cs +++ b/Projectiles/Lasers/HellfireBeamProj.cs @@ -54,8 +54,7 @@ public class HellfireBeamProj : ModProjectile { if (Charge == MAX_CHARGE) { - Vector2 unit = Projectile.velocity; - DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, unit, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60); + DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, Projectile.velocity, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60); } return false; } @@ -65,9 +64,8 @@ public class HellfireBeamProj : ModProjectile float r = Utils.ToRotation(unit) + rotation; for (float i = transDist; i <= Distance; i += step) { - Color c = Color.White; Vector2 origin = start + i * unit; - Main.EntitySpriteDraw(texture, origin - Main.screenPosition, (Rectangle?)new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : c, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, origin - Main.screenPosition, (Rectangle?)new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : color, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); } Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, (Rectangle?)new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, (Rectangle?)new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); @@ -77,10 +75,9 @@ public class HellfireBeamProj : ModProjectile { if (Charge == MAX_CHARGE) { - Player p = Main.player[Projectile.owner]; - Vector2 unit = Projectile.velocity; + Player player = Main.player[Projectile.owner]; float point = 0f; - if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), p.Center, p.Center + unit * Distance, 22f, ref point)) + if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), player.Center, player.Center + Projectile.velocity * Distance, 22f, ref point)) { return true; } @@ -100,9 +97,8 @@ public class HellfireBeamProj : ModProjectile Player player = Main.player[Projectile.owner]; if (Projectile.owner == Main.myPlayer) { - Vector2 diff = mousePos - player.Center; - diff.Normalize(); - Projectile.velocity = diff; + Projectile.velocity = mousePos - player.Center; + Projectile.velocity.Normalize();s Projectile.direction = (Main.MouseWorld.X > player.position.X) ? 1 : (-1); Projectile.netUpdate = true; } @@ -124,8 +120,7 @@ public class HellfireBeamProj : ModProjectile { Projectile.Kill(); } - Vector2 offset = Projectile.velocity; - offset *= 40f; + Vector2 offset = Projectile.velocity * 40f; Vector2 pos = player.Center + offset - new Vector2(10f, 10f); if (Charge < MAX_CHARGE) { @@ -138,7 +133,7 @@ public class HellfireBeamProj : ModProjectile for (int j = 0; j < chargeFact + 1; j++) { Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2); - Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f, 0, default, 1f)]; + Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f)]; obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; obj.noGravity = true; obj.scale = Main.rand.Next(10, 20) * 0.05f; @@ -149,7 +144,6 @@ public class HellfireBeamProj : ModProjectile return; } Vector2 start = player.Center; - _ = Projectile.velocity * -1f; for (Distance = MOVE_DISTANCE; Distance <= 2200f; Distance += 5f) { start = player.Center + Projectile.velocity * Distance; @@ -166,11 +160,8 @@ public class HellfireBeamProj : ModProjectile } for (int i = 0; i < 2; i++) { - float num1 = Utils.ToRotation(Projectile.velocity) + (Main.rand.NextBool(2) ? (-1f) : 1f) * 1.57f; - float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0); - //new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); } DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); @@ -183,8 +174,7 @@ public class HellfireBeamProj : ModProjectile public override void CutTiles() { - DelegateMethods.tilecut_0 = (TileCuttingContext)2; - Vector2 unit = Projectile.velocity; - Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); } } diff --git a/Projectiles/Lasers/RainbowBeam.cs b/Projectiles/Lasers/RainbowBeam.cs index ae480f7..7f40368 100644 --- a/Projectiles/Lasers/RainbowBeam.cs +++ b/Projectiles/Lasers/RainbowBeam.cs @@ -65,9 +65,8 @@ public class RainbowBeam : ModProjectile float r = Utils.ToRotation(unit) + rotation; for (float i = transDist; i <= Distance; i += step) { - Color c = Color.White; Vector2 origin = start + i * unit; - Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : c, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : color, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); } Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); @@ -101,9 +100,8 @@ public class RainbowBeam : ModProjectile Player player = Main.player[Projectile.owner]; if (Projectile.owner == Main.myPlayer) { - Vector2 diff = mousePos - player.Center; - diff.Normalize(); - Projectile.velocity = diff; + Projectile.velocity = mousePos - player.Center; + Projectile.velocity.Normalize(); Projectile.direction = ((Main.MouseWorld.X > player.position.X) ? 1 : (-1)); Projectile.netUpdate = true; } @@ -139,7 +137,7 @@ public class RainbowBeam : ModProjectile for (int j = 0; j < chargeFact + 1; j++) { Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2); - Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f, 0, default, 1f)]; + Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f)]; obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; obj.noGravity = true; obj.scale = Main.rand.Next(10, 20) * 0.05f; @@ -167,12 +165,9 @@ public class RainbowBeam : ModProjectile } for (int i = 0; i < 2; i++) { - float num1 = Utils.ToRotation(Projectile.velocity) + ((Main.rand.NextBool(2)) ? (-1f) : 1f) * 1.57f; - float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0); - //new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); } DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); @@ -185,8 +180,7 @@ public class RainbowBeam : ModProjectile public override void CutTiles() { - DelegateMethods.tilecut_0 = (TileCuttingContext)2; - Vector2 unit = Projectile.velocity; - Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); } } diff --git a/Projectiles/Lasers/VengeanceBeam.cs b/Projectiles/Lasers/VengeanceBeam.cs index 9ba8e4e..309b5ff 100644 --- a/Projectiles/Lasers/VengeanceBeam.cs +++ b/Projectiles/Lasers/VengeanceBeam.cs @@ -66,9 +66,8 @@ public class VengeanceBeam : ModProjectile float r = Utils.ToRotation(unit) + rotation; for (float i = transDist; i <= Distance; i += step) { - Color c = Color.White; origin = start + i * unit; - Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : c, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : color, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); } Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); @@ -139,7 +138,7 @@ public class VengeanceBeam : ModProjectile for (int j = 0; j < chargeFact + 1; j++) { Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2); - Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f, 0, default, 1f)]; + Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f)]; obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; obj.noGravity = true; obj.scale = Main.rand.Next(10, 20) * 0.05f; @@ -150,7 +149,6 @@ public class VengeanceBeam : ModProjectile return; } Vector2 start = player.Center; - _ = Projectile.velocity * -1f; for (Distance = MOVE_DISTANCE; Distance <= 2200f; Distance += 5f) { start = player.Center + Projectile.velocity * Distance; @@ -167,11 +165,8 @@ public class VengeanceBeam : ModProjectile } for (int i = 0; i < 2; i++) { - float num1 = Utils.ToRotation(Projectile.velocity) + ((Main.rand.NextBool(2)) ? (-1f) : 1f) * 1.57f; - float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0); - new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); } DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); @@ -184,8 +179,7 @@ public class VengeanceBeam : ModProjectile public override void CutTiles() { - DelegateMethods.tilecut_0 = (TileCuttingContext)2; - Vector2 unit = Projectile.velocity; - Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); } } diff --git a/Projectiles/LightBlasts/GoldenLightBlast.cs b/Projectiles/LightBlasts/GoldenLightBlast.cs index 367b248..2fe9838 100644 --- a/Projectiles/LightBlasts/GoldenLightBlast.cs +++ b/Projectiles/LightBlasts/GoldenLightBlast.cs @@ -30,11 +30,10 @@ public class GoldenLightBlast : ModProjectile Projectile.velocity.Y += Projectile.ai[0]; if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } @@ -42,11 +41,10 @@ public class GoldenLightBlast : ModProjectile { for (int i = 0; i < 5; i++) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, Projectile.position); } diff --git a/Projectiles/LightBlasts/LightBlast.cs b/Projectiles/LightBlasts/LightBlast.cs index 39fa94f..a44ad43 100644 --- a/Projectiles/LightBlasts/LightBlast.cs +++ b/Projectiles/LightBlasts/LightBlast.cs @@ -30,11 +30,10 @@ public class LightBlast : ModProjectile Projectile.velocity.Y += Projectile.ai[0]; if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } @@ -42,11 +41,10 @@ public class LightBlast : ModProjectile { for (int i = 0; i < 5; i++) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, Projectile.position); } diff --git a/Projectiles/LightBlasts/RainbowLightBlast.cs b/Projectiles/LightBlasts/RainbowLightBlast.cs index 313f74d..0353303 100644 --- a/Projectiles/LightBlasts/RainbowLightBlast.cs +++ b/Projectiles/LightBlasts/RainbowLightBlast.cs @@ -29,20 +29,19 @@ public class RainbowLightBlast : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } @@ -53,20 +52,19 @@ public class RainbowLightBlast : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } diff --git a/Projectiles/LunarBolt.cs b/Projectiles/LunarBolt.cs index b6ba23a..1328517 100644 --- a/Projectiles/LunarBolt.cs +++ b/Projectiles/LunarBolt.cs @@ -26,9 +26,8 @@ public class LunarBolt : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj = Main.dust[dust]; - obj.velocity /= 2f; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].velocity /= 2f; } } @@ -36,7 +35,7 @@ public class LunarBolt : ModProjectile { for (int i = 0; i < 5; i++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } SoundEngine.PlaySound(SoundID.Item1, Projectile.position); } diff --git a/Projectiles/Minions/GoddessMinion.cs b/Projectiles/Minions/GoddessMinion.cs index 0b7ce47..daa2c05 100644 --- a/Projectiles/Minions/GoddessMinion.cs +++ b/Projectiles/Minions/GoddessMinion.cs @@ -46,9 +46,9 @@ public class GoddessMinion : Minion public override void CheckActive() { - Player obj = Main.player[Projectile.owner]; - FabuPlayer modPlayer = obj.GetModPlayer(); - if (obj.dead) + Player player = Main.player[Projectile.owner]; + FabuPlayer modPlayer = player.GetModPlayer(); + if (player.dead) { modPlayer.goddessMinion = false; } @@ -60,14 +60,11 @@ public class GoddessMinion : Minion public void AnimateProjectile() { - Projectile projectile = Projectile; - projectile.frameCounter++; + Projectile.frameCounter++; if (Projectile.frameCounter >= 2) { - Projectile projectile2 = Projectile; - projectile2.frame++; - Projectile projectile3 = Projectile; - projectile3.frame %= 3; + Projectile.frame++; + Projectile.frame %= 3; Projectile.frameCounter = 0; } } diff --git a/Projectiles/Pets/FoxPet.cs b/Projectiles/Pets/FoxPet.cs index eac8844..0feef9a 100644 --- a/Projectiles/Pets/FoxPet.cs +++ b/Projectiles/Pets/FoxPet.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace FabusMod.Projectiles.Pets; @@ -7,7 +8,7 @@ public class FoxPet : ModProjectile { public override void SetDefaults() { - Projectile.CloneDefaults(111); + Projectile.CloneDefaults(ProjectileID.Bunny); AIType = 111; Main.projFrames[Projectile.type] = 8; Projectile.width = 70; @@ -28,9 +29,9 @@ public class FoxPet : ModProjectile public override void AI() { - Player obj = Main.player[Projectile.owner]; - FabuPlayer modPlayer = obj.GetModPlayer(); - if (obj.dead) + Player player = Main.player[Projectile.owner]; + FabuPlayer modPlayer = player.GetModPlayer(); + if (player.dead) { modPlayer.foxPet = false; } diff --git a/Projectiles/Pets/MechanicalTooth.cs b/Projectiles/Pets/MechanicalTooth.cs index 4c1c248..9dcb643 100644 --- a/Projectiles/Pets/MechanicalTooth.cs +++ b/Projectiles/Pets/MechanicalTooth.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace FabusMod.Projectiles.Pets; @@ -14,9 +15,9 @@ public class MechanicalTooth : ModProjectile public override void SetDefaults() { + Projectile.CloneDefaults(ProjectileID.ZephyrFish); Projectile.width = 26; Projectile.height = 20; - Projectile.CloneDefaults(380); AIType = 380; } @@ -28,9 +29,9 @@ public class MechanicalTooth : ModProjectile public override void AI() { - Player obj = Main.player[Projectile.owner]; - FabuPlayer modPlayer = obj.GetModPlayer(); - if (obj.dead) + Player player = Main.player[Projectile.owner]; + FabuPlayer modPlayer = player.GetModPlayer(); + if (player.dead) { modPlayer.kregPet = false; } diff --git a/Projectiles/Pets/PinkFoxPet.cs b/Projectiles/Pets/PinkFoxPet.cs index 09cb3d2..771b171 100644 --- a/Projectiles/Pets/PinkFoxPet.cs +++ b/Projectiles/Pets/PinkFoxPet.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace FabusMod.Projectiles.Pets; @@ -7,7 +8,7 @@ public class PinkFoxPet : ModProjectile { public override void SetDefaults() { - Projectile.CloneDefaults(111); + Projectile.CloneDefaults(ProjectileID.Bunny); AIType = 111; Main.projFrames[Projectile.type] = 8; Projectile.width = 70; @@ -28,9 +29,9 @@ public class PinkFoxPet : ModProjectile public override void AI() { - Player obj = Main.player[Projectile.owner]; - FabuPlayer modPlayer = obj.GetModPlayer(); - if (obj.dead) + Player player = Main.player[Projectile.owner]; + FabuPlayer modPlayer = player.GetModPlayer(); + if (player.dead) { modPlayer.pinkFoxPet = false; } diff --git a/Projectiles/Pets/WindUpFabu.cs b/Projectiles/Pets/WindUpFabu.cs index 25278cc..20f004a 100644 --- a/Projectiles/Pets/WindUpFabu.cs +++ b/Projectiles/Pets/WindUpFabu.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace FabusMod.Projectiles.Pets; @@ -14,7 +15,7 @@ public class WindUpFabu : ModProjectile public override void SetDefaults() { - Projectile.CloneDefaults(112); + Projectile.CloneDefaults(ProjectileID.Penguin); Projectile.width = 34; Projectile.height = 34; AIType = 112; @@ -28,9 +29,9 @@ public class WindUpFabu : ModProjectile public override void AI() { - Player obj = Main.player[Projectile.owner]; - FabuPlayer modPlayer = obj.GetModPlayer(); - if (obj.dead) + Player player = Main.player[Projectile.owner]; + FabuPlayer modPlayer = player.GetModPlayer(); + if (player.dead) { modPlayer.fabu = false; } diff --git a/Projectiles/RainbowAxeBeam.cs b/Projectiles/RainbowAxeBeam.cs index f7707dd..76227f7 100644 --- a/Projectiles/RainbowAxeBeam.cs +++ b/Projectiles/RainbowAxeBeam.cs @@ -27,30 +27,27 @@ public class RainbowAxeBeam : ModProjectile { if (Projectile.alpha <= 140) { - Projectile projectile = Projectile; - projectile.alpha++; + Projectile.alpha++; } if (Projectile.alpha > 140) { - Projectile projectile2 = Projectile; - projectile2.alpha += 15; + Projectile.alpha += 15; } if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } diff --git a/Projectiles/RainbowBullet.cs b/Projectiles/RainbowBullet.cs index 6bdc540..2a5d1da 100644 --- a/Projectiles/RainbowBullet.cs +++ b/Projectiles/RainbowBullet.cs @@ -34,8 +34,7 @@ public class RainbowBullet : ModProjectile { if (Projectile.alpha > 70) { - Projectile projectile = Projectile; - projectile.alpha -= 15; + Projectile.alpha -= 15; if (Projectile.alpha < 70) { Projectile.alpha = 70; @@ -71,17 +70,16 @@ public class RainbowBullet : ModProjectile } if (Main.rand.NextBool(3)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj = Main.dust[dust1]; - obj.velocity *= 0f; + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust1].velocity *= 0f; Main.dust[dust1].noGravity = true; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0f; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust2].velocity *= 0f; Main.dust[dust2].noGravity = true; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0f; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust3].velocity *= 0f; Main.dust[dust3].noGravity = true; } } diff --git a/Projectiles/RainbowDemon/RainbowDemonArrow.cs b/Projectiles/RainbowDemon/RainbowDemonArrow.cs index ccac18d..8cf4c5f 100644 --- a/Projectiles/RainbowDemon/RainbowDemonArrow.cs +++ b/Projectiles/RainbowDemon/RainbowDemonArrow.cs @@ -7,8 +7,6 @@ namespace FabusMod.Projectiles.RainbowDemon; public class RainbowDemonArrow : ModProjectile { - private const int alphaReducation = 25; - public override void SetDefaults() { Projectile.width = 18; @@ -28,8 +26,7 @@ public class RainbowDemonArrow : ModProjectile { if (Projectile.alpha > 30) { - Projectile projectile = Projectile; - projectile.alpha -= 15; + Projectile.alpha -= 15; if (Projectile.alpha < 30) { Projectile.alpha = 30; @@ -37,20 +34,19 @@ public class RainbowDemonArrow : ModProjectile } if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust1].scale = 0.9f; Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } @@ -61,20 +57,19 @@ public class RainbowDemonArrow : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } diff --git a/Projectiles/RainbowDemon/RainbowDemonClaymoreProj.cs b/Projectiles/RainbowDemon/RainbowDemonClaymoreProj.cs index 7635734..382e206 100644 --- a/Projectiles/RainbowDemon/RainbowDemonClaymoreProj.cs +++ b/Projectiles/RainbowDemon/RainbowDemonClaymoreProj.cs @@ -29,8 +29,7 @@ public class RainbowDemonClaymoreProj : ModProjectile { if (Projectile.alpha > 70) { - Projectile projectile = Projectile; - projectile.alpha -= 15; + Projectile.alpha -= 15; if (Projectile.alpha < 70) { Projectile.alpha = 70; @@ -66,20 +65,19 @@ public class RainbowDemonClaymoreProj : ModProjectile } if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } AnimateProjectile(); @@ -96,14 +94,11 @@ public class RainbowDemonClaymoreProj : ModProjectile public void AnimateProjectile() { - Projectile projectile = Projectile; - projectile.frameCounter++; + Projectile.frameCounter++; if (Projectile.frameCounter >= 5) { - Projectile projectile2 = Projectile; - projectile2.frame++; - Projectile projectile3 = Projectile; - projectile3.frame %= 3; + Projectile.frame++; + Projectile.frame %= 3; Projectile.frameCounter = 0; } } diff --git a/Projectiles/RainbowDemon/RainbowDemonKnife.cs b/Projectiles/RainbowDemon/RainbowDemonKnife.cs index 2972df3..0d1111c 100644 --- a/Projectiles/RainbowDemon/RainbowDemonKnife.cs +++ b/Projectiles/RainbowDemon/RainbowDemonKnife.cs @@ -7,10 +7,6 @@ namespace FabusMod.Projectiles.RainbowDemon; public class RainbowDemonKnife : ModProjectile { - private const int alphaReducation = 25; - - private const float maxTicks = 70f; - public override void SetDefaults() { Projectile.width = 16; @@ -35,11 +31,10 @@ public class RainbowDemonKnife : ModProjectile { Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } @@ -47,8 +42,7 @@ public class RainbowDemonKnife : ModProjectile { if (Projectile.alpha > 30) { - Projectile projectile = Projectile; - projectile.alpha -= 15; + Projectile.alpha -= 15; if (Projectile.alpha < 30) { Projectile.alpha = 30; @@ -56,20 +50,19 @@ public class RainbowDemonKnife : ModProjectile } if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } @@ -78,7 +71,7 @@ public class RainbowDemonKnife : ModProjectile { if (Main.rand.NextBool(1)) { - target.AddBuff(70, 720, false); + target.AddBuff(BuffID.Venom, 720, false); } } } diff --git a/Projectiles/RainbowDemon/RainbowDemonMagicBall.cs b/Projectiles/RainbowDemon/RainbowDemonMagicBall.cs index f912147..a374500 100644 --- a/Projectiles/RainbowDemon/RainbowDemonMagicBall.cs +++ b/Projectiles/RainbowDemon/RainbowDemonMagicBall.cs @@ -8,8 +8,6 @@ namespace FabusMod.Projectiles.RainbowDemon; public class RainbowDemonMagicBall : ModProjectile { - private const int alphaReducation = 25; - public override void SetDefaults() { Projectile.width = 10; @@ -27,28 +25,26 @@ public class RainbowDemonMagicBall : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } public override bool OnTileCollide(Vector2 oldVelocity) { - Projectile projectile = Projectile; - projectile.penetrate--; + Projectile.penetrate--; if (Projectile.penetrate <= 0) { Projectile.Kill(); @@ -64,8 +60,7 @@ public class RainbowDemonMagicBall : ModProjectile { Projectile.velocity.Y = 0f - oldVelocity.Y; } - Projectile projectile2 = Projectile; - projectile2.velocity = projectile2.velocity * 0.75f; + Projectile.velocity *= 0.75f; SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } return false; diff --git a/Projectiles/RainbowDemon/RainbowDemonMelee.cs b/Projectiles/RainbowDemon/RainbowDemonMelee.cs index 165c56e..fd582ae 100644 --- a/Projectiles/RainbowDemon/RainbowDemonMelee.cs +++ b/Projectiles/RainbowDemon/RainbowDemonMelee.cs @@ -9,8 +9,6 @@ public class RainbowDemonMelee : ModProjectile { private const float maxTicks = 300f; - private const int alphaReducation = 25; - public override void SetDefaults() { Projectile.width = 80; @@ -36,11 +34,10 @@ public class RainbowDemonMelee : ModProjectile { Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } @@ -48,8 +45,7 @@ public class RainbowDemonMelee : ModProjectile { if (Projectile.alpha > 30) { - Projectile projectile = Projectile; - projectile.alpha -= 15; + Projectile.alpha -= 15; if (Projectile.alpha < 30) { Projectile.alpha = 30; @@ -70,20 +66,19 @@ public class RainbowDemonMelee : ModProjectile } if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } diff --git a/Projectiles/RainbowDemon/RainbowDemonShredderProj.cs b/Projectiles/RainbowDemon/RainbowDemonShredderProj.cs index 7abbe7f..f3b4963 100644 --- a/Projectiles/RainbowDemon/RainbowDemonShredderProj.cs +++ b/Projectiles/RainbowDemon/RainbowDemonShredderProj.cs @@ -24,8 +24,7 @@ public class RainbowDemonShredderProj : ModProjectile { if (Projectile.alpha > 30) { - Projectile projectile = Projectile; - projectile.alpha -= 15; + Projectile.alpha -= 15; if (Projectile.alpha < 30) { Projectile.alpha = 30; @@ -33,20 +32,19 @@ public class RainbowDemonShredderProj : ModProjectile } if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } diff --git a/Projectiles/RainbowOrb.cs b/Projectiles/RainbowOrb.cs index dc58c60..bf2b9d5 100644 --- a/Projectiles/RainbowOrb.cs +++ b/Projectiles/RainbowOrb.cs @@ -28,8 +28,7 @@ public class RainbowOrb : ModProjectile { if (Projectile.alpha > 70) { - Projectile projectile = Projectile; - projectile.alpha -= 15; + Projectile.alpha -= 15; if (Projectile.alpha < 70) { Projectile.alpha = 70; @@ -65,20 +64,19 @@ public class RainbowOrb : ModProjectile } if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } AnimateProjectile(); @@ -95,14 +93,11 @@ public class RainbowOrb : ModProjectile public void AnimateProjectile() { - Projectile projectile = Projectile; - projectile.frameCounter++; + Projectile.frameCounter++; if (Projectile.frameCounter >= 5) { - Projectile projectile2 = Projectile; - projectile2.frame++; - Projectile projectile3 = Projectile; - projectile3.frame %= 3; + Projectile.frame++; + Projectile.frame %= 3; Projectile.frameCounter = 0; } } diff --git a/Projectiles/Shimada/BloodDrop.cs b/Projectiles/Shimada/BloodDrop.cs index b84d55f..39a0110 100644 --- a/Projectiles/Shimada/BloodDrop.cs +++ b/Projectiles/Shimada/BloodDrop.cs @@ -33,7 +33,7 @@ public class BloodDrop : ModProjectile { if (Main.rand.NextBool(3)&& Projectile.alpha <= 100) { - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); } } } diff --git a/Projectiles/Shimada/DemonProjRMB.cs b/Projectiles/Shimada/DemonProjRMB.cs index bd917a8..119a1d8 100644 --- a/Projectiles/Shimada/DemonProjRMB.cs +++ b/Projectiles/Shimada/DemonProjRMB.cs @@ -34,11 +34,11 @@ public class DemonProjRMB : ModProjectile AnimateProjectile(); if (Main.rand.NextBool(2)) { - int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[num1].scale = 1.9f; - Main.dust[num1].velocity.Y -= 1.5f; - Main.dust[num1].velocity.X = 0f; - Main.dust[num1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 1.9f; + Main.dust[dust].velocity.Y -= 1.5f; + Main.dust[dust].velocity.X = 0f; + Main.dust[dust].noGravity = true; } } @@ -94,14 +94,11 @@ public class DemonProjRMB : ModProjectile public void AnimateProjectile() { - Projectile projectile = Projectile; - projectile.frameCounter++; + Projectile.frameCounter++; if (Projectile.frameCounter >= 3) { - Projectile projectile2 = Projectile; - projectile2.frame++; - Projectile projectile3 = Projectile; - projectile3.frame %= 14; + Projectile.frame++; + Projectile.frame %= 14; Projectile.frameCounter = 0; } } diff --git a/Projectiles/Shimada/DemonProjTwo.cs b/Projectiles/Shimada/DemonProjTwo.cs index cdaeee5..ea36aac 100644 --- a/Projectiles/Shimada/DemonProjTwo.cs +++ b/Projectiles/Shimada/DemonProjTwo.cs @@ -28,15 +28,14 @@ public class DemonProjTwo : ModProjectile public override void AI() { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 2f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 2f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; } diff --git a/Projectiles/Shimada/DemonWave.cs b/Projectiles/Shimada/DemonWave.cs index d14929a..fb019b3 100644 --- a/Projectiles/Shimada/DemonWave.cs +++ b/Projectiles/Shimada/DemonWave.cs @@ -26,26 +26,25 @@ public class DemonWave : ModProjectile public override void AI() { - int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj = Main.dust[num1]; - obj.velocity *= 0f; - Main.dust[num1].noGravity = true; - int num2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj2 = Main.dust[num2]; - obj2.velocity *= 0f; - Main.dust[num2].noGravity = true; - int num3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj3 = Main.dust[num3]; - obj3.velocity *= 0f; - Main.dust[num3].noGravity = true; - int num4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj4 = Main.dust[num4]; - obj4.velocity *= 0f; - Main.dust[num4].noGravity = true; - int num5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj5 = Main.dust[num5]; - obj5.velocity *= 0f; - Main.dust[num5].noGravity = true; + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust1].velocity *= 0f; + Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust2].velocity *= 0f; + Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust3].velocity *= 0f; + Main.dust[dust3].noGravity = true; + + int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust4].velocity *= 0f; + Main.dust[dust4].noGravity = true; + + int dust5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust5].velocity *= 0f; + Main.dust[dust5].noGravity = true; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Shimada/DreamCatcherProjRMB.cs b/Projectiles/Shimada/DreamCatcherProjRMB.cs index 021b408..8488d09 100644 --- a/Projectiles/Shimada/DreamCatcherProjRMB.cs +++ b/Projectiles/Shimada/DreamCatcherProjRMB.cs @@ -26,7 +26,6 @@ public class DreamCatcherProjRMB : ModProjectile Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.extraUpdates = 0; - Projectile projectile = Projectile; Projectile.velocity = Projectile.velocity * 0f; } @@ -35,21 +34,23 @@ public class DreamCatcherProjRMB : ModProjectile AnimateProjectile(); if (Main.rand.NextBool(2)) { - int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[num1].scale = 1.9f; - Main.dust[num1].velocity.Y -= 1.5f; - Main.dust[num1].velocity.X = 0f; - Main.dust[num1].noGravity = true; - int num2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[num2].scale = 1.9f; - Main.dust[num2].velocity.Y -= 1.5f; - Main.dust[num2].velocity.X = 0f; - Main.dust[num2].noGravity = true; - int num3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[num3].scale = 1.9f; - Main.dust[num3].velocity.Y -= 1.5f; - Main.dust[num3].velocity.X = 0f; - Main.dust[num3].noGravity = true; + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust1].scale = 1.9f; + Main.dust[dust1].velocity.Y -= 1.5f; + Main.dust[dust1].velocity.X = 0f; + Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust2].scale = 1.9f; + Main.dust[dust2].velocity.Y -= 1.5f; + Main.dust[dust2].velocity.X = 0f; + Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust3].scale = 1.9f; + Main.dust[dust3].velocity.Y -= 1.5f; + Main.dust[dust3].velocity.X = 0f; + Main.dust[dust3].noGravity = true; } } @@ -104,14 +105,11 @@ public class DreamCatcherProjRMB : ModProjectile public void AnimateProjectile() { - Projectile projectile = Projectile; - projectile.frameCounter++; + Projectile.frameCounter++; if (Projectile.frameCounter >= 3) { - Projectile projectile2 = Projectile; - projectile2.frame++; - Projectile projectile3 = Projectile; - projectile3.frame %= 14; + Projectile.frame++; + Projectile.frame %= 14; Projectile.frameCounter = 0; } } diff --git a/Projectiles/Shimada/DreamCatcherProjTwo.cs b/Projectiles/Shimada/DreamCatcherProjTwo.cs index 9b14d8a..f1e3085 100644 --- a/Projectiles/Shimada/DreamCatcherProjTwo.cs +++ b/Projectiles/Shimada/DreamCatcherProjTwo.cs @@ -61,35 +61,34 @@ public class DreamCatcherProjTwo : ModProjectile Projectile.velocity = (10f * Projectile.velocity + move) / 11f; AdjustMagnitude(ref Projectile.velocity); } - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 2f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 2f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 2f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; - int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + + int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust4].scale = 2f; - Dust obj4 = Main.dust[dust4]; - obj4.velocity *= 0.1f; + Main.dust[dust4].velocity *= 0.1f; Main.dust[dust4].noGravity = true; - int dust5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + + int dust5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust5].scale = 2f; - Dust obj5 = Main.dust[dust5]; - obj5.velocity *= 0.1f; + Main.dust[dust5].velocity *= 0.1f; Main.dust[dust5].noGravity = true; - int dust6 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + + int dust6 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust6].scale = 2f; - Dust obj6 = Main.dust[dust6]; - obj6.velocity *= 0.1f; + Main.dust[dust6].velocity *= 0.1f; Main.dust[dust6].noGravity = true; } diff --git a/Projectiles/Shimada/DreamCatcherWave.cs b/Projectiles/Shimada/DreamCatcherWave.cs index 581950f..3199607 100644 --- a/Projectiles/Shimada/DreamCatcherWave.cs +++ b/Projectiles/Shimada/DreamCatcherWave.cs @@ -26,29 +26,28 @@ public class DreamCatcherWave : ModProjectile public override void AI() { - int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj = Main.dust[num1]; - obj.velocity *= 0f; - Main.dust[num1].noGravity = true; - int num2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj2 = Main.dust[num2]; - obj2.velocity *= 0f; - Main.dust[num2].noGravity = true; - int num3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj3 = Main.dust[num3]; - obj3.velocity *= 0f; - Main.dust[num3].noGravity = true; - int num4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj4 = Main.dust[num4]; - obj4.velocity *= 0f; - Main.dust[num4].noGravity = true; - int num5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj5 = Main.dust[num5]; - obj5.velocity *= 0f; - Main.dust[num5].noGravity = true; - int num6 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj6 = Main.dust[num6]; - obj6.velocity *= 0f; + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust1].velocity *= 0f; + Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust2].velocity *= 0f; + Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust3].velocity *= 0f; + Main.dust[dust3].noGravity = true; + + int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust4].velocity *= 0f; + Main.dust[dust4].noGravity = true; + + int dust5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust5].velocity *= 0f; + Main.dust[dust5].noGravity = true; + + int num6 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[num6].velocity *= 0f; Main.dust[num6].noGravity = true; } diff --git a/Projectiles/Shimada/GoldenFuryProjRMB.cs b/Projectiles/Shimada/GoldenFuryProjRMB.cs index 5c653a6..0f4c2e1 100644 --- a/Projectiles/Shimada/GoldenFuryProjRMB.cs +++ b/Projectiles/Shimada/GoldenFuryProjRMB.cs @@ -34,11 +34,11 @@ public class GoldenFuryProjRMB : ModProjectile AnimateProjectile(); if (Main.rand.NextBool(2)) { - int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[num1].scale = 1.9f; - Main.dust[num1].velocity.Y -= 1.5f; - Main.dust[num1].velocity.X = 0f; - Main.dust[num1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + Main.dust[dust].scale = 1.9f; + Main.dust[dust].velocity.Y -= 1.5f; + Main.dust[dust].velocity.X = 0f; + Main.dust[dust].noGravity = true; } } @@ -93,14 +93,11 @@ public class GoldenFuryProjRMB : ModProjectile public void AnimateProjectile() { - Projectile projectile = Projectile; - projectile.frameCounter++; + Projectile.frameCounter++; if (Projectile.frameCounter >= 3) { - Projectile projectile2 = Projectile; - projectile2.frame++; - Projectile projectile3 = Projectile; - projectile3.frame %= 14; + Projectile.frame++; + Projectile.frame %= 14; Projectile.frameCounter = 0; } } diff --git a/Projectiles/Shimada/GoldenFuryProjTwo.cs b/Projectiles/Shimada/GoldenFuryProjTwo.cs index 609ccdd..6624e6c 100644 --- a/Projectiles/Shimada/GoldenFuryProjTwo.cs +++ b/Projectiles/Shimada/GoldenFuryProjTwo.cs @@ -28,15 +28,14 @@ public class GoldenFuryProjTwo : ModProjectile public override void AI() { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 2f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 2f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; } diff --git a/Projectiles/Shimada/GoldenFuryWave.cs b/Projectiles/Shimada/GoldenFuryWave.cs index 8c87d1c..c5e9843 100644 --- a/Projectiles/Shimada/GoldenFuryWave.cs +++ b/Projectiles/Shimada/GoldenFuryWave.cs @@ -26,26 +26,25 @@ public class GoldenFuryWave : ModProjectile public override void AI() { - int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj = Main.dust[num1]; - obj.velocity *= 0f; - Main.dust[num1].noGravity = true; - int num2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj2 = Main.dust[num2]; - obj2.velocity *= 0f; - Main.dust[num2].noGravity = true; - int num3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj3 = Main.dust[num3]; - obj3.velocity *= 0f; - Main.dust[num3].noGravity = true; - int num4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj4 = Main.dust[num4]; - obj4.velocity *= 0f; - Main.dust[num4].noGravity = true; - int num5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj5 = Main.dust[num5]; - obj5.velocity *= 0f; - Main.dust[num5].noGravity = true; + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust1].velocity *= 0f; + Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust2].velocity *= 0f; + Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust3].velocity *= 0f; + Main.dust[dust3].noGravity = true; + + int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust4].velocity *= 0f; + Main.dust[dust4].noGravity = true; + + int dust5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust5].velocity *= 0f; + Main.dust[dust5].noGravity = true; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Shimada/RainbowClump.cs b/Projectiles/Shimada/RainbowClump.cs index 49c9850..cfe87c1 100644 --- a/Projectiles/Shimada/RainbowClump.cs +++ b/Projectiles/Shimada/RainbowClump.cs @@ -27,20 +27,19 @@ public class RainbowClump : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } diff --git a/Projectiles/Shimada/ShimadaWave.cs b/Projectiles/Shimada/ShimadaWave.cs index ff1adfe..7d40170 100644 --- a/Projectiles/Shimada/ShimadaWave.cs +++ b/Projectiles/Shimada/ShimadaWave.cs @@ -26,11 +26,10 @@ public class ShimadaWave : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.5f) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 1.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 1.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } } diff --git a/Projectiles/Shimada/ShimadaWaveNihon.cs b/Projectiles/Shimada/ShimadaWaveNihon.cs index a636151..4ffa8e8 100644 --- a/Projectiles/Shimada/ShimadaWaveNihon.cs +++ b/Projectiles/Shimada/ShimadaWaveNihon.cs @@ -26,11 +26,10 @@ public class ShimadaWaveNihon : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.5f) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 1.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 1.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } } diff --git a/Projectiles/Shortsword/CarbonKnife.cs b/Projectiles/Shortsword/CarbonKnife.cs index 52b6a08..8b40b53 100644 --- a/Projectiles/Shortsword/CarbonKnife.cs +++ b/Projectiles/Shortsword/CarbonKnife.cs @@ -42,11 +42,10 @@ public class CarbonKnife : ModProjectile SoundEngine.PlaySound(SoundID.Dig, Projectile.position); Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } } diff --git a/Projectiles/Shortsword/CarbonKnifeNihon.cs b/Projectiles/Shortsword/CarbonKnifeNihon.cs index d233591..2475bb9 100644 --- a/Projectiles/Shortsword/CarbonKnifeNihon.cs +++ b/Projectiles/Shortsword/CarbonKnifeNihon.cs @@ -42,11 +42,10 @@ public class CarbonKnifeNihon : ModProjectile SoundEngine.PlaySound(SoundID.Dig, Projectile.position); Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } } diff --git a/Projectiles/Shortsword/DeathBlossom.cs b/Projectiles/Shortsword/DeathBlossom.cs index 79cabc7..ee71063 100644 --- a/Projectiles/Shortsword/DeathBlossom.cs +++ b/Projectiles/Shortsword/DeathBlossom.cs @@ -42,11 +42,10 @@ public class DeathBlossom : ModProjectile SoundEngine.PlaySound(SoundID.Dig, Projectile.position); Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } } diff --git a/Projectiles/Shortsword/FumaShuriken.cs b/Projectiles/Shortsword/FumaShuriken.cs index e4ca3d9..ed83012 100644 --- a/Projectiles/Shortsword/FumaShuriken.cs +++ b/Projectiles/Shortsword/FumaShuriken.cs @@ -55,10 +55,9 @@ public class FumaShuriken : ModProjectile } if (Main.rand.NextBool(3)) { - int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Dust obj = Main.dust[num1]; - obj.velocity *= 0f; - Main.dust[num1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].velocity *= 0f; + Main.dust[dust].noGravity = true; } } diff --git a/Projectiles/Shortsword/GoldenKnife.cs b/Projectiles/Shortsword/GoldenKnife.cs index 27cfec0..648c8b1 100644 --- a/Projectiles/Shortsword/GoldenKnife.cs +++ b/Projectiles/Shortsword/GoldenKnife.cs @@ -42,11 +42,10 @@ public class GoldenKnife : ModProjectile SoundEngine.PlaySound(SoundID.Dig, Projectile.position); Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } } diff --git a/Projectiles/Shortsword/RainbowKnife.cs b/Projectiles/Shortsword/RainbowKnife.cs index 2da5f76..d5db26f 100644 --- a/Projectiles/Shortsword/RainbowKnife.cs +++ b/Projectiles/Shortsword/RainbowKnife.cs @@ -42,11 +42,10 @@ public class RainbowKnife : ModProjectile SoundEngine.PlaySound(SoundID.Dig, Projectile.position); Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } } diff --git a/Projectiles/Shuriken/CarbonShuriken.cs b/Projectiles/Shuriken/CarbonShuriken.cs index 9cfe050..f4efdb8 100644 --- a/Projectiles/Shuriken/CarbonShuriken.cs +++ b/Projectiles/Shuriken/CarbonShuriken.cs @@ -35,11 +35,10 @@ public class CarbonShuriken : ModProjectile SoundEngine.PlaySound(SoundID.Dig, Projectile.position); Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } @@ -47,11 +46,10 @@ public class CarbonShuriken : ModProjectile { if (Main.rand.NextBool(3)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 1f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } } diff --git a/Projectiles/Shuriken/CarbonShurikenNihon.cs b/Projectiles/Shuriken/CarbonShurikenNihon.cs index c7eb58e..d231dd6 100644 --- a/Projectiles/Shuriken/CarbonShurikenNihon.cs +++ b/Projectiles/Shuriken/CarbonShurikenNihon.cs @@ -39,7 +39,7 @@ public class CarbonShurikenNihon : ModProjectile int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } @@ -47,11 +47,10 @@ public class CarbonShurikenNihon : ModProjectile { if (Main.rand.NextBool(3)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 1f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } } diff --git a/Projectiles/Shuriken/HerosShuriken.cs b/Projectiles/Shuriken/HerosShuriken.cs index ebacea0..68133a3 100644 --- a/Projectiles/Shuriken/HerosShuriken.cs +++ b/Projectiles/Shuriken/HerosShuriken.cs @@ -40,11 +40,10 @@ public class HerosShuriken : ModProjectile SoundEngine.PlaySound(SoundID.Dig, Projectile.position); Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } @@ -52,11 +51,10 @@ public class HerosShuriken : ModProjectile { if (Main.rand.NextBool(3)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 1f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } } diff --git a/Projectiles/Shuriken/OniSlayer.cs b/Projectiles/Shuriken/OniSlayer.cs index f5c1f01..6374bd4 100644 --- a/Projectiles/Shuriken/OniSlayer.cs +++ b/Projectiles/Shuriken/OniSlayer.cs @@ -35,11 +35,10 @@ public class OniSlayer : ModProjectile SoundEngine.PlaySound(SoundID.Dig, Projectile.position); Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } @@ -47,11 +46,10 @@ public class OniSlayer : ModProjectile { if (Main.rand.NextBool(3)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 1f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } } diff --git a/Projectiles/Shuriken/SparklingDemon.cs b/Projectiles/Shuriken/SparklingDemon.cs index 94fb158..a6f6033 100644 --- a/Projectiles/Shuriken/SparklingDemon.cs +++ b/Projectiles/Shuriken/SparklingDemon.cs @@ -35,11 +35,10 @@ public class SparklingDemon : ModProjectile SoundEngine.PlaySound(SoundID.Dig, Projectile.position); Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } @@ -47,11 +46,10 @@ public class SparklingDemon : ModProjectile { if (Main.rand.NextBool(3)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 1f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } } diff --git a/Projectiles/Shuriken/StonePlatedShurikenProj.cs b/Projectiles/Shuriken/StonePlatedShurikenProj.cs index 2556ffe..8c8fe81 100644 --- a/Projectiles/Shuriken/StonePlatedShurikenProj.cs +++ b/Projectiles/Shuriken/StonePlatedShurikenProj.cs @@ -35,7 +35,7 @@ public class StonePlatedShurikenProj : ModProjectile int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } @@ -43,11 +43,10 @@ public class StonePlatedShurikenProj : ModProjectile { if (Main.rand.NextBool(6)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = false; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 1f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = false; } } } diff --git a/Projectiles/SorcerousStaff/GoldenStaffProj.cs b/Projectiles/SorcerousStaff/GoldenStaffProj.cs index 025280d..921d2d1 100644 --- a/Projectiles/SorcerousStaff/GoldenStaffProj.cs +++ b/Projectiles/SorcerousStaff/GoldenStaffProj.cs @@ -24,18 +24,16 @@ public class GoldenStaffProj : ModProjectile { if (Main.rand.NextBool(4)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } public override bool OnTileCollide(Vector2 oldVelocity) { - Projectile projectile = Projectile; - projectile.penetrate--; + Projectile.penetrate--; if (Projectile.penetrate <= 0) { Projectile.Kill(); @@ -51,8 +49,7 @@ public class GoldenStaffProj : ModProjectile { Projectile.velocity.Y = 0f - oldVelocity.Y; } - Projectile projectile2 = Projectile; - projectile2.velocity = projectile2.velocity * 0.75f; + Projectile.velocity *= 0.75f; SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } return false; @@ -62,11 +59,10 @@ public class GoldenStaffProj : ModProjectile { for (int i = 0; i < 5; i++) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } diff --git a/Projectiles/SorcerousStaff/NatureStaffProj.cs b/Projectiles/SorcerousStaff/NatureStaffProj.cs index 9891622..344ec64 100644 --- a/Projectiles/SorcerousStaff/NatureStaffProj.cs +++ b/Projectiles/SorcerousStaff/NatureStaffProj.cs @@ -24,26 +24,23 @@ public class NatureStaffProj : ModProjectile { if (Main.rand.NextBool(5)) { - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust2].scale = 0.9f; - Dust obj = Main.dust[dust2]; - obj.velocity *= 0.1f; - Main.dust[dust2].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } if (Main.rand.NextBool(4)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj2 = Main.dust[dust1]; - obj2.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } public override bool OnTileCollide(Vector2 oldVelocity) { - Projectile projectile = Projectile; - projectile.penetrate--; + Projectile.penetrate--; if (Projectile.penetrate <= 0) { Projectile.Kill(); @@ -59,8 +56,7 @@ public class NatureStaffProj : ModProjectile { Projectile.velocity.Y = 0f - oldVelocity.Y; } - Projectile projectile2 = Projectile; - projectile2.velocity *= 0.75f; + Projectile.velocity *= 0.75f; SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } return false; @@ -70,11 +66,10 @@ public class NatureStaffProj : ModProjectile { for (int i = 0; i < 5; i++) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } @@ -83,7 +78,7 @@ public class NatureStaffProj : ModProjectile { if (Main.rand.NextBool(4)) { - target.AddBuff(20, 180, false); + target.AddBuff(BuffID.Poisoned, 180, false); } } } diff --git a/Projectiles/SorcerousStaff/SorcerousHellstaffProj.cs b/Projectiles/SorcerousStaff/SorcerousHellstaffProj.cs index ef27d40..2cede24 100644 --- a/Projectiles/SorcerousStaff/SorcerousHellstaffProj.cs +++ b/Projectiles/SorcerousStaff/SorcerousHellstaffProj.cs @@ -24,26 +24,23 @@ public class SorcerousHellstaffProj : ModProjectile { if (Main.rand.NextBool(3)) { - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust2].scale = 0.9f; - Dust obj = Main.dust[dust2]; - obj.velocity *= 0.1f; - Main.dust[dust2].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } if (Main.rand.NextBool(4)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj2 = Main.dust[dust1]; - obj2.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } public override bool OnTileCollide(Vector2 oldVelocity) { - Projectile projectile = Projectile; - projectile.penetrate--; + Projectile.penetrate--; if (Projectile.penetrate <= 0) { Projectile.Kill(); @@ -59,8 +56,7 @@ public class SorcerousHellstaffProj : ModProjectile { Projectile.velocity.Y = 0f - oldVelocity.Y; } - Projectile projectile2 = Projectile; - projectile2.velocity *= 0.75f; + Projectile.velocity *= 0.75f; SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } return false; @@ -70,11 +66,10 @@ public class SorcerousHellstaffProj : ModProjectile { for (int i = 0; i < 5; i++) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } @@ -83,7 +78,7 @@ public class SorcerousHellstaffProj : ModProjectile { if (Main.rand.NextBool(6)) { - target.AddBuff(24, 180, false); + target.AddBuff(BuffID.OnFire, 180, false); } } } diff --git a/Projectiles/SorcerousStaff/SorcerousHellstaffProjWhite.cs b/Projectiles/SorcerousStaff/SorcerousHellstaffProjWhite.cs index 2317704..de03424 100644 --- a/Projectiles/SorcerousStaff/SorcerousHellstaffProjWhite.cs +++ b/Projectiles/SorcerousStaff/SorcerousHellstaffProjWhite.cs @@ -24,26 +24,23 @@ public class SorcerousHellstaffProjWhite : ModProjectile { if (Main.rand.NextBool(3)) { - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust2].scale = 0.9f; - Dust obj = Main.dust[dust2]; - obj.velocity *= 0.1f; - Main.dust[dust2].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } if (Main.rand.NextBool(4)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj2 = Main.dust[dust1]; - obj2.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } } public override bool OnTileCollide(Vector2 oldVelocity) { - Projectile projectile = Projectile; - projectile.penetrate--; + Projectile.penetrate--; if (Projectile.penetrate <= 0) { Projectile.Kill(); @@ -59,8 +56,7 @@ public class SorcerousHellstaffProjWhite : ModProjectile { Projectile.velocity.Y = 0f - oldVelocity.Y; } - Projectile projectile2 = Projectile; - projectile2.velocity *= 0.75f; + Projectile.velocity *= 0.75f; SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } return false; @@ -70,11 +66,10 @@ public class SorcerousHellstaffProjWhite : ModProjectile { for (int i = 0; i < 5; i++) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } @@ -83,7 +78,7 @@ public class SorcerousHellstaffProjWhite : ModProjectile { if (Main.rand.NextBool(6)) { - target.AddBuff(24, 180, false); + target.AddBuff(BuffID.OnFire, 180, false); } } } diff --git a/Projectiles/SorcerousStaff/SorcerousStaffProj.cs b/Projectiles/SorcerousStaff/SorcerousStaffProj.cs index 8030bfe..c13400d 100644 --- a/Projectiles/SorcerousStaff/SorcerousStaffProj.cs +++ b/Projectiles/SorcerousStaff/SorcerousStaffProj.cs @@ -42,8 +42,7 @@ public class SorcerousStaffProj : ModProjectile public override bool OnTileCollide(Vector2 oldVelocity) { - Projectile projectile = Projectile; - projectile.penetrate--; + Projectile.penetrate--; if (Projectile.penetrate <= 0) { Projectile.Kill(); @@ -59,8 +58,7 @@ public class SorcerousStaffProj : ModProjectile { Projectile.velocity.Y = 0f - oldVelocity.Y; } - Projectile projectile2 = Projectile; - projectile2.velocity *= 0.75f; + Projectile.velocity *= 0.75f; SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } return false; @@ -70,11 +68,10 @@ public class SorcerousStaffProj : ModProjectile { for (int i = 0; i < 5; i++) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } diff --git a/Projectiles/SorcerousStaff/TranquilityProj.cs b/Projectiles/SorcerousStaff/TranquilityProj.cs index d17f2d5..5471d41 100644 --- a/Projectiles/SorcerousStaff/TranquilityProj.cs +++ b/Projectiles/SorcerousStaff/TranquilityProj.cs @@ -24,28 +24,26 @@ public class TranquilityProj : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } public override bool OnTileCollide(Vector2 oldVelocity) { - Projectile projectile = Projectile; - projectile.penetrate--; + Projectile.penetrate--; if (Projectile.penetrate <= 0) { Projectile.Kill(); @@ -61,8 +59,7 @@ public class TranquilityProj : ModProjectile { Projectile.velocity.Y = 0f - oldVelocity.Y; } - Projectile projectile2 = Projectile; - projectile2.velocity = projectile2.velocity * 0.75f; + Projectile.velocity *= 0.75f; SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } return false; diff --git a/Projectiles/SpectralMoonBolt.cs b/Projectiles/SpectralMoonBolt.cs index 7fc4560..0c1180e 100644 --- a/Projectiles/SpectralMoonBolt.cs +++ b/Projectiles/SpectralMoonBolt.cs @@ -26,20 +26,19 @@ public class SpectralMoonBolt : ModProjectile { if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } @@ -48,20 +47,19 @@ public class SpectralMoonBolt : ModProjectile { for (int i = 0; i < 5; i++) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } SoundEngine.PlaySound(SoundID.Item1, Projectile.position); diff --git a/Projectiles/TheSpinningRainbow.cs b/Projectiles/TheSpinningRainbow.cs index 6f62e2e..aab7ccb 100644 --- a/Projectiles/TheSpinningRainbow.cs +++ b/Projectiles/TheSpinningRainbow.cs @@ -40,11 +40,10 @@ public class TheSpinningRainbow : ModProjectile SoundEngine.PlaySound(SoundID.Dig, Projectile.position); Vector2 position = Projectile.position; Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); - _ = position + rotVector * 16f; int item = 0; if (Main.netMode == NetmodeID.MultiplayerClient && item >= 0) { - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile); } } @@ -52,20 +51,19 @@ public class TheSpinningRainbow : ModProjectile { if (Main.rand.NextBool(3)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 1f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 1f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 1f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } } diff --git a/Projectiles/TheWhisperingIcicle.cs b/Projectiles/TheWhisperingIcicle.cs index 54bf468..c6705bd 100644 --- a/Projectiles/TheWhisperingIcicle.cs +++ b/Projectiles/TheWhisperingIcicle.cs @@ -30,19 +30,17 @@ public class TheWhisperingIcicle : ModProjectile { if (Main.rand.NextBool(3)) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } AnimateProjectile(); } public override bool OnTileCollide(Vector2 oldVelocity) { - Projectile projectile = Projectile; - projectile.penetrate--; + Projectile.penetrate--; if (Projectile.penetrate <= 0) { Projectile.Kill(); @@ -58,8 +56,7 @@ public class TheWhisperingIcicle : ModProjectile { Projectile.velocity.Y = 0f - oldVelocity.Y; } - Projectile projectile2 = Projectile; - projectile2.velocity *= 0.75f; + Projectile.velocity *= 0.75f; SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } return false; @@ -69,11 +66,10 @@ public class TheWhisperingIcicle : ModProjectile { for (int i = 0; i < 5; i++) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; - Main.dust[dust1].noGravity = true; + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); + Main.dust[dust].scale = 0.9f; + Main.dust[dust].velocity *= 0.1f; + Main.dust[dust].noGravity = true; } SoundEngine.PlaySound(SoundID.Item27, Projectile.position); } @@ -90,14 +86,11 @@ public class TheWhisperingIcicle : ModProjectile public void AnimateProjectile() { - Projectile projectile = Projectile; - projectile.frameCounter++; + Projectile.frameCounter++; if (Projectile.frameCounter >= 3) { - Projectile projectile2 = Projectile; - projectile2.frame++; - Projectile projectile3 = Projectile; - projectile3.frame %= 16; + Projectile.frame++; + Projectile.frame %= 16; Projectile.frameCounter = 0; } } diff --git a/Projectiles/WishNeedle.cs b/Projectiles/WishNeedle.cs index 81a0125..47f4de8 100644 --- a/Projectiles/WishNeedle.cs +++ b/Projectiles/WishNeedle.cs @@ -33,8 +33,7 @@ public class WishNeedle : ModProjectile { if (Projectile.alpha > 70) { - Projectile projectile = Projectile; - projectile.alpha -= 15; + Projectile.alpha -= 15; if (Projectile.alpha < 70) { Projectile.alpha = 70; @@ -70,20 +69,19 @@ public class WishNeedle : ModProjectile } if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) { - int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); - int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 0, default, 1f); + int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust1].scale = 0.9f; - Dust obj = Main.dust[dust1]; - obj.velocity *= 0.1f; + Main.dust[dust1].velocity *= 0.1f; Main.dust[dust1].noGravity = true; + + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust2].scale = 0.9f; - Dust obj2 = Main.dust[dust2]; - obj2.velocity *= 0.1f; + Main.dust[dust2].velocity *= 0.1f; Main.dust[dust2].noGravity = true; + + int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType()); Main.dust[dust3].scale = 0.9f; - Dust obj3 = Main.dust[dust3]; - obj3.velocity *= 0.1f; + Main.dust[dust3].velocity *= 0.1f; Main.dust[dust3].noGravity = true; } }