Clean up all projectile code.
This commit is contained in:
+12
-17
@@ -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<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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user