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
+11 -18
View File
@@ -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<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;
}
}
@@ -78,7 +71,7 @@ public class RainbowDemonKnife : ModProjectile
{
if (Main.rand.NextBool(1))
{
target.AddBuff(70, 720, false);
target.AddBuff(BuffID.Venom, 720, false);
}
}
}