Clean up all projectile code.

This commit is contained in:
Big Duckie
2022-07-05 22:32:27 -06:00
parent 2b34d060c5
commit 099f0a2e50
73 changed files with 651 additions and 840 deletions
+3 -4
View File
@@ -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<Dusts.RyuuDust3>(), 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<Dusts.RyuuDust3>());
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<Dusts.RyuuDust3>(), 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<Dusts.RyuuDust3>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
SoundEngine.PlaySound(SoundID.Item2, Projectile.position);
}
+3 -4
View File
@@ -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<Dusts.MeatDust>(), 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<Dusts.MeatDust>());
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<Dusts.MeatDust>(), 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<Dusts.MeatDust>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
SoundEngine.PlaySound(SoundID.Item1, Projectile.position);
}
+7 -8
View File
@@ -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<Dusts.LegendaryDust>(), 0f, 0f, 0, default, 1f);
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.LegendarySparkle>(), 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<Dusts.LegendaryDust>());
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.LegendarySparkle>());
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<Dusts.LegendaryDust>(), 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<Dusts.LegendaryDust>(), 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<Dusts.LegendarySparkle>(), 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<Dusts.LegendarySparkle>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
SoundEngine.PlaySound(SoundID.Item1, Projectile.position);
}
+18 -20
View File
@@ -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<Dusts.RainbowDust>(), 0f, 0f, 0, default, 1f);
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>(), 0f, 0f, 0, default, 1f);
int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f);
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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<Dusts.RainbowDust2>());
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<Dusts.RainbowDust3>());
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<Dusts.RainbowDust>(), 0f, 0f, 0, default, 1f);
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>(), 0f, 0f, 0, default, 1f);
int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f);
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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<Dusts.RainbowDust2>());
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<Dusts.RainbowDust3>());
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;
}
}
+3 -4
View File
@@ -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<Dusts.RyuuDust2>(), 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<Dusts.RyuuDust2>());
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<Dusts.RyuuDust2>(), 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<Dusts.RyuuDust2>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
SoundEngine.PlaySound(SoundID.Item1, Projectile.position);
}