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
@@ -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;
}
}
@@ -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<Dusts.RainbowHealingDust>(), 0f, 0f, 0, default, 1f);
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowHealingDust>());
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<Dusts.RainbowDust>(), 0f, 0f, 0, default, 1f);
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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<Dusts.RainbowDust2>(), 0f, 0f, 0, default, 1f);
int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>());
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<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f);
int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>());
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;
}
}