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
+5 -7
View File
@@ -35,11 +35,10 @@ public class CarbonShuriken : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
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,11 +46,10 @@ public class CarbonShuriken : ModProjectile
{
if (Main.rand.NextBool(3))
{
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1];
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true;
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousDust>());
Main.dust[dust].scale = 1f;
Main.dust[dust].velocity *= 0.1f;
Main.dust[dust].noGravity = true;
}
}
}
+5 -6
View File
@@ -39,7 +39,7 @@ public class CarbonShurikenNihon : ModProjectile
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,11 +47,10 @@ public class CarbonShurikenNihon : ModProjectile
{
if (Main.rand.NextBool(3))
{
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.NightsAxeSparkle>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1];
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true;
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.NightsAxeSparkle>());
Main.dust[dust].scale = 1f;
Main.dust[dust].velocity *= 0.1f;
Main.dust[dust].noGravity = true;
}
}
}
+5 -7
View File
@@ -40,11 +40,10 @@ public class HerosShuriken : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
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);
}
}
@@ -52,11 +51,10 @@ public class HerosShuriken : ModProjectile
{
if (Main.rand.NextBool(3))
{
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1];
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true;
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust>());
Main.dust[dust].scale = 1f;
Main.dust[dust].velocity *= 0.1f;
Main.dust[dust].noGravity = true;
}
}
}
+5 -7
View File
@@ -35,11 +35,10 @@ public class OniSlayer : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
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,11 +46,10 @@ public class OniSlayer : ModProjectile
{
if (Main.rand.NextBool(3))
{
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.OniDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1];
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true;
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.OniDust>());
Main.dust[dust].scale = 1f;
Main.dust[dust].velocity *= 0.1f;
Main.dust[dust].noGravity = true;
}
}
}
+5 -7
View File
@@ -35,11 +35,10 @@ public class SparklingDemon : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
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,11 +46,10 @@ public class SparklingDemon : ModProjectile
{
if (Main.rand.NextBool(3))
{
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1];
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true;
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>());
Main.dust[dust].scale = 1f;
Main.dust[dust].velocity *= 0.1f;
Main.dust[dust].noGravity = true;
}
}
}
@@ -35,7 +35,7 @@ public class StonePlatedShurikenProj : ModProjectile
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);
}
}
@@ -43,11 +43,10 @@ public class StonePlatedShurikenProj : ModProjectile
{
if (Main.rand.NextBool(6))
{
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.Shuriken.StarDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1];
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = false;
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.Shuriken.StarDust>());
Main.dust[dust].scale = 1f;
Main.dust[dust].velocity *= 0.1f;
Main.dust[dust].noGravity = false;
}
}
}