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