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
+3 -4
View File
@@ -25,9 +25,8 @@ public class DemonArrow : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>());
Dust obj = Main.dust[dust]; Main.dust[dust].velocity /= 2f;
obj.velocity /= 2f;
} }
} }
@@ -35,7 +34,7 @@ public class DemonArrow : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
} }
SoundEngine.PlaySound(SoundID.Item2, Projectile.position); SoundEngine.PlaySound(SoundID.Item2, Projectile.position);
} }
+3 -4
View File
@@ -25,9 +25,8 @@ public class GoldenSpiritArrow : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>());
Dust obj = Main.dust[dust]; Main.dust[dust].velocity /= 2f;
obj.velocity /= 2f;
} }
} }
@@ -35,7 +34,7 @@ public class GoldenSpiritArrow : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
} }
SoundEngine.PlaySound(SoundID.Item1, Projectile.position); SoundEngine.PlaySound(SoundID.Item1, Projectile.position);
} }
+7 -8
View File
@@ -24,10 +24,9 @@ public class LegendaryArrow : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.LegendaryDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.LegendaryDust>());
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.LegendarySparkle>(), 0f, 0f, 0, default, 1f); Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.LegendarySparkle>());
Dust obj = Main.dust[dust]; Main.dust[dust].velocity /= 2f;
obj.velocity /= 2f;
} }
} }
@@ -35,8 +34,8 @@ public class LegendaryArrow : ModProjectile
{ {
if (Main.rand.NextBool(1)) if (Main.rand.NextBool(1))
{ {
target.AddBuff(69, 900, false); target.AddBuff(BuffID.Ichor, 900, false);
target.AddBuff(70, 900, false); target.AddBuff(BuffID.Venom, 900, false);
} }
} }
@@ -44,11 +43,11 @@ public class LegendaryArrow : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.LegendaryDust>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.LegendaryDust>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
} }
for (int j = 0; j < 5; j++) for (int j = 0; j < 5; j++)
{ {
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.LegendarySparkle>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.LegendarySparkle>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
} }
SoundEngine.PlaySound(SoundID.Item1, Projectile.position); SoundEngine.PlaySound(SoundID.Item1, Projectile.position);
} }
+18 -20
View File
@@ -25,20 +25,19 @@ public class RainbowArrow : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
@@ -47,8 +46,8 @@ public class RainbowArrow : ModProjectile
{ {
if (Main.rand.NextBool(1)) if (Main.rand.NextBool(1))
{ {
target.AddBuff(69, 900, false); target.AddBuff(BuffID.Ichor, 900, false);
target.AddBuff(70, 900, false); target.AddBuff(BuffID.Venom, 900, false);
} }
} }
@@ -58,20 +57,19 @@ public class RainbowArrow : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
+3 -4
View File
@@ -25,9 +25,8 @@ public class StormArrow : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust2>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust2>());
Dust obj = Main.dust[dust]; Main.dust[dust].velocity /= 2f;
obj.velocity /= 2f;
} }
} }
@@ -35,7 +34,7 @@ public class StormArrow : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust2>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust2>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
} }
SoundEngine.PlaySound(SoundID.Item1, Projectile.position); SoundEngine.PlaySound(SoundID.Item1, Projectile.position);
} }
+10 -15
View File
@@ -8,10 +8,6 @@ namespace FabusMod.Projectiles.Daggers;
public class ColorfulSolution : ModProjectile public class ColorfulSolution : ModProjectile
{ {
private const float maxTicks = 70f;
private const int alphaReducation = 25;
public override void SetStaticDefaults() public override void SetStaticDefaults()
{ {
DisplayName.SetDefault("Colorful Solution"); DisplayName.SetDefault("Colorful Solution");
@@ -45,7 +41,7 @@ public class ColorfulSolution : ModProjectile
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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);
} }
} }
@@ -53,20 +49,19 @@ public class ColorfulSolution : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
@@ -75,7 +70,7 @@ public class ColorfulSolution : ModProjectile
{ {
if (Main.rand.NextBool(1)) if (Main.rand.NextBool(1))
{ {
target.AddBuff(70, 720, false); target.AddBuff(BuffID.Venom, 720, false);
} }
} }
} }
+8 -10
View File
@@ -28,11 +28,10 @@ public class BlueBolt : ModProjectile
Projectile.velocity.Y += Projectile.ai[0]; Projectile.velocity.Y += Projectile.ai[0];
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDustBlue>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDustBlue>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.5f;
obj.velocity *= 0.5f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
@@ -42,11 +41,10 @@ public class BlueBolt : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDustBlue>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDustBlue>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.5f;
obj.velocity *= 0.5f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
} }
+10 -12
View File
@@ -28,15 +28,14 @@ public class BlueBoltRMB : ModProjectile
Projectile.velocity.Y += Projectile.ai[0]; Projectile.velocity.Y += Projectile.ai[0];
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDustBlue>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDustBlue>());
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 1f; Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.5f;
obj.velocity *= 0.5f;
Main.dust[dust1].noGravity = true; Main.dust[dust1].noGravity = true;
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>());
Main.dust[dust2].scale = 0.8f; Main.dust[dust2].scale = 0.8f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.5f;
obj2.velocity *= 0.5f;
Main.dust[dust2].noGravity = true; Main.dust[dust2].noGravity = true;
} }
} }
@@ -47,15 +46,14 @@ public class BlueBoltRMB : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDustBlue>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDustBlue>());
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 1f; Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.5f;
obj.velocity *= 0.5f;
Main.dust[dust1].noGravity = true; Main.dust[dust1].noGravity = true;
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>());
Main.dust[dust2].scale = 0.8f; Main.dust[dust2].scale = 0.8f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.5f;
obj2.velocity *= 0.5f;
Main.dust[dust2].noGravity = true; Main.dust[dust2].noGravity = true;
} }
} }
+8 -10
View File
@@ -28,11 +28,10 @@ public class OrangeBolt : ModProjectile
Projectile.velocity.Y += Projectile.ai[0]; Projectile.velocity.Y += Projectile.ai[0];
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDust>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.5f;
obj.velocity *= 0.5f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
@@ -42,11 +41,10 @@ public class OrangeBolt : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDust>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.5f;
obj.velocity *= 0.5f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
} }
+10 -12
View File
@@ -28,15 +28,14 @@ public class OrangeBoltRMB : ModProjectile
Projectile.velocity.Y += Projectile.ai[0]; Projectile.velocity.Y += Projectile.ai[0];
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDust>());
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 1f; Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.5f;
obj.velocity *= 0.5f;
Main.dust[dust1].noGravity = true; Main.dust[dust1].noGravity = true;
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>());
Main.dust[dust2].scale = 0.8f; Main.dust[dust2].scale = 0.8f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.5f;
obj2.velocity *= 0.5f;
Main.dust[dust2].noGravity = true; Main.dust[dust2].noGravity = true;
} }
} }
@@ -47,15 +46,14 @@ public class OrangeBoltRMB : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDust>());
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 1f; Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.5f;
obj.velocity *= 0.5f;
Main.dust[dust1].noGravity = true; Main.dust[dust1].noGravity = true;
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>());
Main.dust[dust2].scale = 0.8f; Main.dust[dust2].scale = 0.8f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.5f;
obj2.velocity *= 0.5f;
Main.dust[dust2].noGravity = true; Main.dust[dust2].noGravity = true;
} }
} }
+16 -18
View File
@@ -28,20 +28,19 @@ public class RainbowBolt : ModProjectile
Projectile.velocity.Y += Projectile.ai[0]; Projectile.velocity.Y += Projectile.ai[0];
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
@@ -52,20 +51,19 @@ public class RainbowBolt : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
+22 -24
View File
@@ -28,25 +28,24 @@ public class RainbowBoltRMB : ModProjectile
Projectile.velocity.Y += Projectile.ai[0]; Projectile.velocity.Y += Projectile.ai[0];
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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 dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SpectralWitherDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SpectralWitherDust>());
Main.dust[dust4].scale = 0.7f; Main.dust[dust4].scale = 0.7f;
Dust obj4 = Main.dust[dust4]; Main.dust[dust4].velocity *= 0.1f;
obj4.velocity *= 0.1f;
Main.dust[dust4].noGravity = true; Main.dust[dust4].noGravity = true;
} }
} }
@@ -57,25 +56,24 @@ public class RainbowBoltRMB : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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 dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SpectralWitherDust>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SpectralWitherDust>());
Main.dust[dust4].scale = 0.7f; Main.dust[dust4].scale = 0.7f;
Dust obj4 = Main.dust[dust4]; Main.dust[dust4].velocity *= 0.1f;
obj4.velocity *= 0.1f;
Main.dust[dust4].noGravity = true; Main.dust[dust4].noGravity = true;
} }
} }
+9 -14
View File
@@ -28,8 +28,7 @@ public class GoldenOrb : ModProjectile
{ {
if (Projectile.alpha > 70) if (Projectile.alpha > 70)
{ {
Projectile projectile = Projectile; Projectile.alpha -= 15;
projectile.alpha -= 15;
if (Projectile.alpha < 70) if (Projectile.alpha < 70)
{ {
Projectile.alpha = 70; Projectile.alpha = 70;
@@ -47,7 +46,7 @@ public class GoldenOrb : ModProjectile
{ {
if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && Main.npc[i].lifeMax > 5) if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && Main.npc[i].lifeMax > 5)
{ {
Vector2 newMove = ((Entity)Main.npc[i]).Center - Projectile.Center; Vector2 newMove = Main.npc[i].Center - Projectile.Center;
float distanceTo = (float)Math.Sqrt(newMove.X * newMove.X + newMove.Y * newMove.Y); float distanceTo = (float)Math.Sqrt(newMove.X * newMove.X + newMove.Y * newMove.Y);
if (distanceTo < distance) if (distanceTo < distance)
{ {
@@ -65,11 +64,10 @@ public class GoldenOrb : ModProjectile
} }
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
AnimateProjectile(); AnimateProjectile();
} }
@@ -85,14 +83,11 @@ public class GoldenOrb : ModProjectile
public void AnimateProjectile() public void AnimateProjectile()
{ {
Projectile projectile = Projectile; Projectile.frameCounter++;
projectile.frameCounter++;
if (Projectile.frameCounter >= 5) if (Projectile.frameCounter >= 5)
{ {
Projectile projectile2 = Projectile; Projectile.frame++;
projectile2.frame++; Projectile.frame %= 3;
Projectile projectile3 = Projectile;
projectile3.frame %= 3;
Projectile.frameCounter = 0; Projectile.frameCounter = 0;
} }
} }
@@ -55,14 +55,11 @@ public class IllusoryMirrorRMB : ModProjectile
public void AnimateProjectile() public void AnimateProjectile()
{ {
Projectile projectile = Projectile; Projectile.frameCounter++;
projectile.frameCounter++;
if (Projectile.frameCounter >= 7) if (Projectile.frameCounter >= 7)
{ {
Projectile projectile2 = Projectile; Projectile.frame++;
projectile2.frame++; Projectile.frame %= 5;
Projectile projectile3 = Projectile;
projectile3.frame %= 5;
Projectile.frameCounter = 0; Projectile.frameCounter = 0;
} }
} }
@@ -31,25 +31,25 @@ public class SpectralIllusionRMB : ModProjectile
AnimateProjectile(); AnimateProjectile();
if (Main.rand.NextBool(2)) 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].scale = 2f;
Main.dust[dust1].velocity.Y -= 0.5f; Main.dust[dust1].velocity.Y -= 0.5f;
Main.dust[dust1].velocity.X = 0f; Main.dust[dust1].velocity.X = 0f;
Main.dust[dust1].noGravity = true; 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].scale = 2f;
Main.dust[dust2].velocity.Y += 0.5f; Main.dust[dust2].velocity.Y += 0.5f;
Main.dust[dust2].velocity.X = 0f; Main.dust[dust2].velocity.X = 0f;
Main.dust[dust2].noGravity = true; 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].scale = 2f;
Main.dust[dust3].velocity.Y += 0.5f; Main.dust[dust3].velocity.Y += 0.5f;
Main.dust[dust3].velocity.X = 0f; Main.dust[dust3].velocity.X = 0f;
Main.dust[dust3].noGravity = true; 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].scale = 2f;
Main.dust[dust4].velocity.Y += 0.5f; Main.dust[dust4].velocity.Y += 0.5f;
Main.dust[dust4].velocity.X = 0f; Main.dust[dust4].velocity.X = 0f;
@@ -67,14 +67,11 @@ public class SpectralIllusionRMB : ModProjectile
public void AnimateProjectile() public void AnimateProjectile()
{ {
Projectile projectile = Projectile; Projectile.frameCounter++;
projectile.frameCounter++;
if (Projectile.frameCounter >= 8) if (Projectile.frameCounter >= 8)
{ {
Projectile projectile2 = Projectile; Projectile.frame++;
projectile2.frame++; Projectile.frame %= 7;
Projectile projectile3 = Projectile;
projectile3.frame %= 7;
Projectile.frameCounter = 0; Projectile.frameCounter = 0;
} }
} }
+21 -29
View File
@@ -54,8 +54,7 @@ public class CoalescenceBeam : ModProjectile
{ {
if (Charge == MAX_CHARGE) if (Charge == MAX_CHARGE)
{ {
Vector2 unit = Projectile.velocity; DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, Projectile.velocity, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60);
DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, unit, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60);
} }
return false; return false;
} }
@@ -65,9 +64,8 @@ public class CoalescenceBeam : ModProjectile
float r = Utils.ToRotation(unit) + rotation; float r = Utils.ToRotation(unit) + rotation;
for (float i = transDist; i <= Distance; i += step) for (float i = transDist; i <= Distance; i += step)
{ {
Color c = Color.White;
Vector2 origin = start + i * unit; Vector2 origin = start + i * unit;
Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : c, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : color, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
} }
Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
@@ -77,10 +75,9 @@ public class CoalescenceBeam : ModProjectile
{ {
if (Charge == MAX_CHARGE) if (Charge == MAX_CHARGE)
{ {
Player p = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
Vector2 unit = Projectile.velocity;
float point = 0f; float point = 0f;
if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), p.Center, p.Center + unit * Distance, 22f, ref point)) if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), player.Center, player.Center + Projectile.velocity * Distance, 22f, ref point))
{ {
return true; return true;
} }
@@ -99,48 +96,44 @@ public class CoalescenceBeam : ModProjectile
Player player = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
if (Projectile.owner == Main.myPlayer) if (Projectile.owner == Main.myPlayer)
{ {
Vector2 diff = mousePos - player.Center; Projectile.velocity = mousePos - player.Center;
diff.Normalize(); Projectile.velocity.Normalize();
Projectile.velocity = diff; Projectile.direction = (Main.MouseWorld.X > player.position.X) ? 1 : (-1);
Projectile.direction = ((Main.MouseWorld.X > player.position.X) ? 1 : (-1));
Projectile.netUpdate = true; Projectile.netUpdate = true;
} }
Projectile.position = player.Center + Projectile.velocity * MOVE_DISTANCE; Projectile.position = player.Center + Projectile.velocity * MOVE_DISTANCE;
Projectile.timeLeft = 2; Projectile.timeLeft = 2;
int dir = Projectile.direction; player.ChangeDir(Projectile.direction);
player.ChangeDir(dir);
player.heldProj = Projectile.whoAmI; player.heldProj = Projectile.whoAmI;
player.itemTime = 2; player.itemTime = 2;
player.itemAnimation = 2; player.itemAnimation = 2;
player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * dir, Projectile.velocity.X * dir); player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * Projectile.direction, Projectile.velocity.X * Projectile.direction);
if (!player.channel) if (!player.channel)
{ {
Projectile.Kill(); Projectile.Kill();
} }
else else
{ {
if (Main.time % 10.0 < 1.0 && !player.CheckMana(player.inventory[player.selectedItem].mana, true, false)) if (Main.time % 10.0 < 1.0 && !player.CheckMana(player.inventory[player.selectedItem].mana, true))
{ {
Projectile.Kill(); Projectile.Kill();
} }
Vector2 offset = Projectile.velocity; Vector2 offset = Projectile.velocity * 40f;
offset *= 40f;
Vector2 pos = player.Center + offset - new Vector2(10f, 10f); Vector2 pos = player.Center + offset - new Vector2(10f, 10f);
if (Charge < MAX_CHARGE) if (Charge < MAX_CHARGE)
{ {
Charge++; Charge++;
} }
int chargeFact = (int)(Charge / 20f); int chargeFact = (int)(Charge / 20f);
Vector2 dustVelocity = Vector2.UnitX * 18f; Vector2 dustVelocity = Utils.RotatedBy(Vector2.UnitX * 18f, (double)(Projectile.rotation - 1.57f));
dustVelocity = Utils.RotatedBy(dustVelocity, (double)(Projectile.rotation - 1.57f), default);
Vector2 spawnPos = Projectile.Center + dustVelocity; Vector2 spawnPos = Projectile.Center + dustVelocity;
for (int j = 0; j < chargeFact + 1; j++) for (int j = 0; j < chargeFact + 1; j++)
{ {
Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2); Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2);
Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f, 0, default, 1f)]; int dust = Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f);
obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; Main.dust[dust].velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f;
obj.noGravity = true; Main.dust[dust].noGravity = true;
obj.scale = Main.rand.Next(10, 20) * 0.05f; Main.dust[dust].scale = Main.rand.Next(10, 20) * 0.05f;
} }
} }
if (Charge < MAX_CHARGE) if (Charge < MAX_CHARGE)
@@ -167,9 +160,9 @@ public class CoalescenceBeam : ModProjectile
{ {
float num1 = Utils.ToRotation(Projectile.velocity) + ((Main.rand.NextBool(2)) ? (-1f) : 1f) * 1.57f; float num1 = Utils.ToRotation(Projectile.velocity) + ((Main.rand.NextBool(2)) ? (-1f) : 1f) * 1.57f;
float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0); float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0);
//new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2);
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.TerraDust2>(), 0f, 0f, 0, default, 1f); Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.TerraDust2>());
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>(), 0f, 0f, 0, default, 1f); Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>());
} }
DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f);
Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight));
@@ -182,8 +175,7 @@ public class CoalescenceBeam : ModProjectile
public override void CutTiles() public override void CutTiles()
{ {
DelegateMethods.tilecut_0 = (TileCuttingContext)2; DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile;
Vector2 unit = Projectile.velocity; Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles));
Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles));
} }
} }
+8 -17
View File
@@ -54,8 +54,7 @@ public class GoldenBeam : ModProjectile
{ {
if (Charge == MAX_CHARGE) if (Charge == MAX_CHARGE)
{ {
Vector2 unit = Projectile.velocity; DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, Projectile.velocity, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60);
DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, unit, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60);
} }
return false; return false;
} }
@@ -65,9 +64,8 @@ public class GoldenBeam : ModProjectile
float r = Utils.ToRotation(unit) + rotation; float r = Utils.ToRotation(unit) + rotation;
for (float i = transDist; i <= Distance; i += step) for (float i = transDist; i <= Distance; i += step)
{ {
Color c = Color.White;
Vector2 origin = start + i * unit; Vector2 origin = start + i * unit;
Main.EntitySpriteDraw(texture, origin - Main.screenPosition, (Rectangle?)new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : c, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, origin - Main.screenPosition, (Rectangle?)new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : color, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
} }
Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, (Rectangle?)new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, (Rectangle?)new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, (Rectangle?)new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, (Rectangle?)new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
@@ -77,10 +75,9 @@ public class GoldenBeam : ModProjectile
{ {
if (Charge == 50f) if (Charge == 50f)
{ {
Player p = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
Vector2 unit = Projectile.velocity;
float point = 0f; float point = 0f;
if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), p.Center, p.Center + unit * Distance, 22f, ref point)) if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), player.Center, player.Center + Projectile.velocity * Distance, 22f, ref point))
{ {
return true; return true;
} }
@@ -139,7 +136,7 @@ public class GoldenBeam : ModProjectile
for (int j = 0; j < chargeFact + 1; j++) for (int j = 0; j < chargeFact + 1; j++)
{ {
Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2); Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2);
Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f, 0, default, 1f)]; Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f)];
obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f;
obj.noGravity = true; obj.noGravity = true;
obj.scale = Main.rand.Next(10, 20) * 0.05f; obj.scale = Main.rand.Next(10, 20) * 0.05f;
@@ -149,11 +146,9 @@ public class GoldenBeam : ModProjectile
{ {
return; return;
} }
Vector2 start = player.Center;
_ = Projectile.velocity * -1f;
for (Distance = MOVE_DISTANCE; Distance <= 2200f; Distance += 5f) for (Distance = MOVE_DISTANCE; Distance <= 2200f; Distance += 5f)
{ {
start = player.Center + Projectile.velocity * Distance; Vector2 start = player.Center + Projectile.velocity * Distance;
if (!Collision.CanHit(player.Center, 1, 1, start, 1, 1)) if (!Collision.CanHit(player.Center, 1, 1, start, 1, 1))
{ {
Distance -= 5f; Distance -= 5f;
@@ -167,9 +162,6 @@ public class GoldenBeam : ModProjectile
} }
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
float num1 = Utils.ToRotation(Projectile.velocity) + ((Main.rand.NextBool(2)) ? (-1f) : 1f) * 1.57f;
float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0);
new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2);
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f); Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f);
} }
DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f);
@@ -183,8 +175,7 @@ public class GoldenBeam : ModProjectile
public override void CutTiles() public override void CutTiles()
{ {
DelegateMethods.tilecut_0 = (TileCuttingContext)2; DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile;
Vector2 unit = Projectile.velocity; Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles));
Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles));
} }
} }
+12 -22
View File
@@ -54,8 +54,7 @@ public class HellfireBeamProj : ModProjectile
{ {
if (Charge == MAX_CHARGE) if (Charge == MAX_CHARGE)
{ {
Vector2 unit = Projectile.velocity; DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, Projectile.velocity, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60);
DrawLaser(TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, unit, 10f, Projectile.damage, -1.57f, 1f, 1000f, Color.White, 60);
} }
return false; return false;
} }
@@ -65,9 +64,8 @@ public class HellfireBeamProj : ModProjectile
float r = Utils.ToRotation(unit) + rotation; float r = Utils.ToRotation(unit) + rotation;
for (float i = transDist; i <= Distance; i += step) for (float i = transDist; i <= Distance; i += step)
{ {
Color c = Color.White;
Vector2 origin = start + i * unit; Vector2 origin = start + i * unit;
Main.EntitySpriteDraw(texture, origin - Main.screenPosition, (Rectangle?)new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : c, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, origin - Main.screenPosition, (Rectangle?)new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : color, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
} }
Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, (Rectangle?)new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, (Rectangle?)new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, (Rectangle?)new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, (Rectangle?)new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
@@ -77,10 +75,9 @@ public class HellfireBeamProj : ModProjectile
{ {
if (Charge == MAX_CHARGE) if (Charge == MAX_CHARGE)
{ {
Player p = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
Vector2 unit = Projectile.velocity;
float point = 0f; float point = 0f;
if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), p.Center, p.Center + unit * Distance, 22f, ref point)) if (Collision.CheckAABBvLineCollision(Utils.TopLeft(targetHitbox), Utils.Size(targetHitbox), player.Center, player.Center + Projectile.velocity * Distance, 22f, ref point))
{ {
return true; return true;
} }
@@ -100,9 +97,8 @@ public class HellfireBeamProj : ModProjectile
Player player = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
if (Projectile.owner == Main.myPlayer) if (Projectile.owner == Main.myPlayer)
{ {
Vector2 diff = mousePos - player.Center; Projectile.velocity = mousePos - player.Center;
diff.Normalize(); Projectile.velocity.Normalize();s
Projectile.velocity = diff;
Projectile.direction = (Main.MouseWorld.X > player.position.X) ? 1 : (-1); Projectile.direction = (Main.MouseWorld.X > player.position.X) ? 1 : (-1);
Projectile.netUpdate = true; Projectile.netUpdate = true;
} }
@@ -124,8 +120,7 @@ public class HellfireBeamProj : ModProjectile
{ {
Projectile.Kill(); Projectile.Kill();
} }
Vector2 offset = Projectile.velocity; Vector2 offset = Projectile.velocity * 40f;
offset *= 40f;
Vector2 pos = player.Center + offset - new Vector2(10f, 10f); Vector2 pos = player.Center + offset - new Vector2(10f, 10f);
if (Charge < MAX_CHARGE) if (Charge < MAX_CHARGE)
{ {
@@ -138,7 +133,7 @@ public class HellfireBeamProj : ModProjectile
for (int j = 0; j < chargeFact + 1; j++) for (int j = 0; j < chargeFact + 1; j++)
{ {
Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2); Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2);
Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f, 0, default, 1f)]; Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f)];
obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f;
obj.noGravity = true; obj.noGravity = true;
obj.scale = Main.rand.Next(10, 20) * 0.05f; obj.scale = Main.rand.Next(10, 20) * 0.05f;
@@ -149,7 +144,6 @@ public class HellfireBeamProj : ModProjectile
return; return;
} }
Vector2 start = player.Center; Vector2 start = player.Center;
_ = Projectile.velocity * -1f;
for (Distance = MOVE_DISTANCE; Distance <= 2200f; Distance += 5f) for (Distance = MOVE_DISTANCE; Distance <= 2200f; Distance += 5f)
{ {
start = player.Center + Projectile.velocity * Distance; start = player.Center + Projectile.velocity * Distance;
@@ -166,11 +160,8 @@ public class HellfireBeamProj : ModProjectile
} }
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
float num1 = Utils.ToRotation(Projectile.velocity) + (Main.rand.NextBool(2) ? (-1f) : 1f) * 1.57f; Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.BloodDust>());
float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0); Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>());
//new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2);
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.BloodDust>(), 0f, 0f, 0, default, 1f);
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxWitherDust>(), 0f, 0f, 0, default, 1f);
} }
DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f);
Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight));
@@ -183,8 +174,7 @@ public class HellfireBeamProj : ModProjectile
public override void CutTiles() public override void CutTiles()
{ {
DelegateMethods.tilecut_0 = (TileCuttingContext)2; DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile;
Vector2 unit = Projectile.velocity; Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles));
Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles));
} }
} }
+9 -15
View File
@@ -65,9 +65,8 @@ public class RainbowBeam : ModProjectile
float r = Utils.ToRotation(unit) + rotation; float r = Utils.ToRotation(unit) + rotation;
for (float i = transDist; i <= Distance; i += step) for (float i = transDist; i <= Distance; i += step)
{ {
Color c = Color.White;
Vector2 origin = start + i * unit; Vector2 origin = start + i * unit;
Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : c, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : color, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
} }
Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
@@ -101,9 +100,8 @@ public class RainbowBeam : ModProjectile
Player player = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
if (Projectile.owner == Main.myPlayer) if (Projectile.owner == Main.myPlayer)
{ {
Vector2 diff = mousePos - player.Center; Projectile.velocity = mousePos - player.Center;
diff.Normalize(); Projectile.velocity.Normalize();
Projectile.velocity = diff;
Projectile.direction = ((Main.MouseWorld.X > player.position.X) ? 1 : (-1)); Projectile.direction = ((Main.MouseWorld.X > player.position.X) ? 1 : (-1));
Projectile.netUpdate = true; Projectile.netUpdate = true;
} }
@@ -139,7 +137,7 @@ public class RainbowBeam : ModProjectile
for (int j = 0; j < chargeFact + 1; j++) for (int j = 0; j < chargeFact + 1; j++)
{ {
Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2); Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2);
Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f, 0, default, 1f)]; Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f)];
obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f;
obj.noGravity = true; obj.noGravity = true;
obj.scale = Main.rand.Next(10, 20) * 0.05f; obj.scale = Main.rand.Next(10, 20) * 0.05f;
@@ -167,12 +165,9 @@ public class RainbowBeam : ModProjectile
} }
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
float num1 = Utils.ToRotation(Projectile.velocity) + ((Main.rand.NextBool(2)) ? (-1f) : 1f) * 1.57f; Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0); Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>());
//new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>());
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>(), 0f, 0f, 0, default, 1f);
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>(), 0f, 0f, 0, default, 1f);
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f);
} }
DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f);
Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight));
@@ -185,8 +180,7 @@ public class RainbowBeam : ModProjectile
public override void CutTiles() public override void CutTiles()
{ {
DelegateMethods.tilecut_0 = (TileCuttingContext)2; DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile;
Vector2 unit = Projectile.velocity; Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles));
Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles));
} }
} }
+6 -12
View File
@@ -66,9 +66,8 @@ public class VengeanceBeam : ModProjectile
float r = Utils.ToRotation(unit) + rotation; float r = Utils.ToRotation(unit) + rotation;
for (float i = transDist; i <= Distance; i += step) for (float i = transDist; i <= Distance; i += step)
{ {
Color c = Color.White;
origin = start + i * unit; origin = start + i * unit;
Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : c, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, origin - Main.screenPosition, new Rectangle(0, 26, 28, 26), (i < transDist) ? Color.Transparent : color, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
} }
Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + unit * (transDist - step) - Main.screenPosition, new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, start + (Distance + step) * unit - Main.screenPosition, new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(14f, 13f), scale, SpriteEffects.None, 0);
@@ -139,7 +138,7 @@ public class VengeanceBeam : ModProjectile
for (int j = 0; j < chargeFact + 1; j++) for (int j = 0; j < chargeFact + 1; j++)
{ {
Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2); Vector2 spawn = spawnPos + Utils.ToRotationVector2((float)Main.rand.NextDouble() * 6.28f) * (12f - chargeFact * 2);
Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f, 0, default, 1f)]; Dust obj = Main.dust[Dust.NewDust(pos, 20, 20, DustID.YellowTorch, Projectile.velocity.X / 2f, Projectile.velocity.Y / 2f)];
obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; obj.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f;
obj.noGravity = true; obj.noGravity = true;
obj.scale = Main.rand.Next(10, 20) * 0.05f; obj.scale = Main.rand.Next(10, 20) * 0.05f;
@@ -150,7 +149,6 @@ public class VengeanceBeam : ModProjectile
return; return;
} }
Vector2 start = player.Center; Vector2 start = player.Center;
_ = Projectile.velocity * -1f;
for (Distance = MOVE_DISTANCE; Distance <= 2200f; Distance += 5f) for (Distance = MOVE_DISTANCE; Distance <= 2200f; Distance += 5f)
{ {
start = player.Center + Projectile.velocity * Distance; start = player.Center + Projectile.velocity * Distance;
@@ -167,11 +165,8 @@ public class VengeanceBeam : ModProjectile
} }
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
float num1 = Utils.ToRotation(Projectile.velocity) + ((Main.rand.NextBool(2)) ? (-1f) : 1f) * 1.57f; Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.HolyDust>());
float num2 = (float)(Main.rand.NextDouble() * 0.800000011920929 + 1.0); Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDust>());
new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2);
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.HolyDust>(), 0f, 0f, 0, default, 1f);
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.FoxDust>(), 0f, 0f, 0, default, 1f);
} }
DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f);
Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * (Distance - MOVE_DISTANCE), 26f, new Utils.TileActionAttempt(DelegateMethods.CastLight));
@@ -184,8 +179,7 @@ public class VengeanceBeam : ModProjectile
public override void CutTiles() public override void CutTiles()
{ {
DelegateMethods.tilecut_0 = (TileCuttingContext)2; DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile;
Vector2 unit = Projectile.velocity; Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles));
Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * Distance, (Projectile.width + 16) * Projectile.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles));
} }
} }
+8 -10
View File
@@ -30,11 +30,10 @@ public class GoldenLightBlast : ModProjectile
Projectile.velocity.Y += Projectile.ai[0]; Projectile.velocity.Y += Projectile.ai[0];
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
@@ -42,11 +41,10 @@ public class GoldenLightBlast : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, Projectile.position); SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, Projectile.position);
} }
+8 -10
View File
@@ -30,11 +30,10 @@ public class LightBlast : ModProjectile
Projectile.velocity.Y += Projectile.ai[0]; Projectile.velocity.Y += Projectile.ai[0];
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust2>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust2>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
@@ -42,11 +41,10 @@ public class LightBlast : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust2>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust2>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, Projectile.position); SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, Projectile.position);
} }
+16 -18
View File
@@ -29,20 +29,19 @@ public class RainbowLightBlast : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
@@ -53,20 +52,19 @@ public class RainbowLightBlast : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
+3 -4
View File
@@ -26,9 +26,8 @@ public class LunarBolt : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100)
{ {
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.CrystalDust2>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.CrystalDust2>());
Dust obj = Main.dust[dust]; Main.dust[dust].velocity /= 2f;
obj.velocity /= 2f;
} }
} }
@@ -36,7 +35,7 @@ public class LunarBolt : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.CrystalDust2>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f, 0, default, 1f); Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType<Dusts.CrystalDust2>(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
} }
SoundEngine.PlaySound(SoundID.Item1, Projectile.position); SoundEngine.PlaySound(SoundID.Item1, Projectile.position);
} }
+6 -9
View File
@@ -46,9 +46,9 @@ public class GoddessMinion : Minion
public override void CheckActive() public override void CheckActive()
{ {
Player obj = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
FabuPlayer modPlayer = obj.GetModPlayer<FabuPlayer>(); FabuPlayer modPlayer = player.GetModPlayer<FabuPlayer>();
if (obj.dead) if (player.dead)
{ {
modPlayer.goddessMinion = false; modPlayer.goddessMinion = false;
} }
@@ -60,14 +60,11 @@ public class GoddessMinion : Minion
public void AnimateProjectile() public void AnimateProjectile()
{ {
Projectile projectile = Projectile; Projectile.frameCounter++;
projectile.frameCounter++;
if (Projectile.frameCounter >= 2) if (Projectile.frameCounter >= 2)
{ {
Projectile projectile2 = Projectile; Projectile.frame++;
projectile2.frame++; Projectile.frame %= 3;
Projectile projectile3 = Projectile;
projectile3.frame %= 3;
Projectile.frameCounter = 0; Projectile.frameCounter = 0;
} }
} }
+5 -4
View File
@@ -1,4 +1,5 @@
using Terraria; using Terraria;
using Terraria.ID;
using Terraria.ModLoader; using Terraria.ModLoader;
namespace FabusMod.Projectiles.Pets; namespace FabusMod.Projectiles.Pets;
@@ -7,7 +8,7 @@ public class FoxPet : ModProjectile
{ {
public override void SetDefaults() public override void SetDefaults()
{ {
Projectile.CloneDefaults(111); Projectile.CloneDefaults(ProjectileID.Bunny);
AIType = 111; AIType = 111;
Main.projFrames[Projectile.type] = 8; Main.projFrames[Projectile.type] = 8;
Projectile.width = 70; Projectile.width = 70;
@@ -28,9 +29,9 @@ public class FoxPet : ModProjectile
public override void AI() public override void AI()
{ {
Player obj = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
FabuPlayer modPlayer = obj.GetModPlayer<FabuPlayer>(); FabuPlayer modPlayer = player.GetModPlayer<FabuPlayer>();
if (obj.dead) if (player.dead)
{ {
modPlayer.foxPet = false; modPlayer.foxPet = false;
} }
+5 -4
View File
@@ -1,4 +1,5 @@
using Terraria; using Terraria;
using Terraria.ID;
using Terraria.ModLoader; using Terraria.ModLoader;
namespace FabusMod.Projectiles.Pets; namespace FabusMod.Projectiles.Pets;
@@ -14,9 +15,9 @@ public class MechanicalTooth : ModProjectile
public override void SetDefaults() public override void SetDefaults()
{ {
Projectile.CloneDefaults(ProjectileID.ZephyrFish);
Projectile.width = 26; Projectile.width = 26;
Projectile.height = 20; Projectile.height = 20;
Projectile.CloneDefaults(380);
AIType = 380; AIType = 380;
} }
@@ -28,9 +29,9 @@ public class MechanicalTooth : ModProjectile
public override void AI() public override void AI()
{ {
Player obj = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
FabuPlayer modPlayer = obj.GetModPlayer<FabuPlayer>(); FabuPlayer modPlayer = player.GetModPlayer<FabuPlayer>();
if (obj.dead) if (player.dead)
{ {
modPlayer.kregPet = false; modPlayer.kregPet = false;
} }
+5 -4
View File
@@ -1,4 +1,5 @@
using Terraria; using Terraria;
using Terraria.ID;
using Terraria.ModLoader; using Terraria.ModLoader;
namespace FabusMod.Projectiles.Pets; namespace FabusMod.Projectiles.Pets;
@@ -7,7 +8,7 @@ public class PinkFoxPet : ModProjectile
{ {
public override void SetDefaults() public override void SetDefaults()
{ {
Projectile.CloneDefaults(111); Projectile.CloneDefaults(ProjectileID.Bunny);
AIType = 111; AIType = 111;
Main.projFrames[Projectile.type] = 8; Main.projFrames[Projectile.type] = 8;
Projectile.width = 70; Projectile.width = 70;
@@ -28,9 +29,9 @@ public class PinkFoxPet : ModProjectile
public override void AI() public override void AI()
{ {
Player obj = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
FabuPlayer modPlayer = obj.GetModPlayer<FabuPlayer>(); FabuPlayer modPlayer = player.GetModPlayer<FabuPlayer>();
if (obj.dead) if (player.dead)
{ {
modPlayer.pinkFoxPet = false; modPlayer.pinkFoxPet = false;
} }
+5 -4
View File
@@ -1,4 +1,5 @@
using Terraria; using Terraria;
using Terraria.ID;
using Terraria.ModLoader; using Terraria.ModLoader;
namespace FabusMod.Projectiles.Pets; namespace FabusMod.Projectiles.Pets;
@@ -14,7 +15,7 @@ public class WindUpFabu : ModProjectile
public override void SetDefaults() public override void SetDefaults()
{ {
Projectile.CloneDefaults(112); Projectile.CloneDefaults(ProjectileID.Penguin);
Projectile.width = 34; Projectile.width = 34;
Projectile.height = 34; Projectile.height = 34;
AIType = 112; AIType = 112;
@@ -28,9 +29,9 @@ public class WindUpFabu : ModProjectile
public override void AI() public override void AI()
{ {
Player obj = Main.player[Projectile.owner]; Player player = Main.player[Projectile.owner];
FabuPlayer modPlayer = obj.GetModPlayer<FabuPlayer>(); FabuPlayer modPlayer = player.GetModPlayer<FabuPlayer>();
if (obj.dead) if (player.dead)
{ {
modPlayer.fabu = false; modPlayer.fabu = false;
} }
+10 -13
View File
@@ -27,30 +27,27 @@ public class RainbowAxeBeam : ModProjectile
{ {
if (Projectile.alpha <= 140) if (Projectile.alpha <= 140)
{ {
Projectile projectile = Projectile; Projectile.alpha++;
projectile.alpha++;
} }
if (Projectile.alpha > 140) if (Projectile.alpha > 140)
{ {
Projectile projectile2 = Projectile; Projectile.alpha += 15;
projectile2.alpha += 15;
} }
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
+9 -11
View File
@@ -34,8 +34,7 @@ public class RainbowBullet : ModProjectile
{ {
if (Projectile.alpha > 70) if (Projectile.alpha > 70)
{ {
Projectile projectile = Projectile; Projectile.alpha -= 15;
projectile.alpha -= 15;
if (Projectile.alpha < 70) if (Projectile.alpha < 70)
{ {
Projectile.alpha = 70; Projectile.alpha = 70;
@@ -71,17 +70,16 @@ public class RainbowBullet : ModProjectile
} }
if (Main.rand.NextBool(3)) if (Main.rand.NextBool(3))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>(), 0f, 0f, 0, default, 1f); Main.dust[dust1].velocity *= 0f;
int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f);
Dust obj = Main.dust[dust1];
obj.velocity *= 0f;
Main.dust[dust1].noGravity = true; Main.dust[dust1].noGravity = true;
Dust obj2 = Main.dust[dust2];
obj2.velocity *= 0f; int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>());
Main.dust[dust2].velocity *= 0f;
Main.dust[dust2].noGravity = true; Main.dust[dust2].noGravity = true;
Dust obj3 = Main.dust[dust3];
obj3.velocity *= 0f; int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>());
Main.dust[dust3].velocity *= 0f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
+18 -23
View File
@@ -7,8 +7,6 @@ namespace FabusMod.Projectiles.RainbowDemon;
public class RainbowDemonArrow : ModProjectile public class RainbowDemonArrow : ModProjectile
{ {
private const int alphaReducation = 25;
public override void SetDefaults() public override void SetDefaults()
{ {
Projectile.width = 18; Projectile.width = 18;
@@ -28,8 +26,7 @@ public class RainbowDemonArrow : ModProjectile
{ {
if (Projectile.alpha > 30) if (Projectile.alpha > 30)
{ {
Projectile projectile = Projectile; Projectile.alpha -= 15;
projectile.alpha -= 15;
if (Projectile.alpha < 30) if (Projectile.alpha < 30)
{ {
Projectile.alpha = 30; Projectile.alpha = 30;
@@ -37,20 +34,19 @@ public class RainbowDemonArrow : ModProjectile
} }
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>(), 0f, 0f, 0, default, 1f); Main.dust[dust1].velocity *= 0.1f;
int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f);
Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1];
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; Main.dust[dust2].noGravity = true;
int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>());
Main.dust[dust1].scale = 0.9f;
Main.dust[dust3].scale = 0.9f; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
@@ -61,20 +57,19 @@ public class RainbowDemonArrow : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
@@ -29,8 +29,7 @@ public class RainbowDemonClaymoreProj : ModProjectile
{ {
if (Projectile.alpha > 70) if (Projectile.alpha > 70)
{ {
Projectile projectile = Projectile; Projectile.alpha -= 15;
projectile.alpha -= 15;
if (Projectile.alpha < 70) if (Projectile.alpha < 70)
{ {
Projectile.alpha = 70; Projectile.alpha = 70;
@@ -66,20 +65,19 @@ public class RainbowDemonClaymoreProj : ModProjectile
} }
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
AnimateProjectile(); AnimateProjectile();
@@ -96,14 +94,11 @@ public class RainbowDemonClaymoreProj : ModProjectile
public void AnimateProjectile() public void AnimateProjectile()
{ {
Projectile projectile = Projectile; Projectile.frameCounter++;
projectile.frameCounter++;
if (Projectile.frameCounter >= 5) if (Projectile.frameCounter >= 5)
{ {
Projectile projectile2 = Projectile; Projectile.frame++;
projectile2.frame++; Projectile.frame %= 3;
Projectile projectile3 = Projectile;
projectile3.frame %= 3;
Projectile.frameCounter = 0; Projectile.frameCounter = 0;
} }
} }
+11 -18
View File
@@ -7,10 +7,6 @@ namespace FabusMod.Projectiles.RainbowDemon;
public class RainbowDemonKnife : ModProjectile public class RainbowDemonKnife : ModProjectile
{ {
private const int alphaReducation = 25;
private const float maxTicks = 70f;
public override void SetDefaults() public override void SetDefaults()
{ {
Projectile.width = 16; Projectile.width = 16;
@@ -35,11 +31,10 @@ public class RainbowDemonKnife : ModProjectile
{ {
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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) if (Projectile.alpha > 30)
{ {
Projectile projectile = Projectile; Projectile.alpha -= 15;
projectile.alpha -= 15;
if (Projectile.alpha < 30) if (Projectile.alpha < 30)
{ {
Projectile.alpha = 30; Projectile.alpha = 30;
@@ -56,20 +50,19 @@ public class RainbowDemonKnife : ModProjectile
} }
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
@@ -78,7 +71,7 @@ public class RainbowDemonKnife : ModProjectile
{ {
if (Main.rand.NextBool(1)) if (Main.rand.NextBool(1))
{ {
target.AddBuff(70, 720, false); target.AddBuff(BuffID.Venom, 720, false);
} }
} }
} }
@@ -8,8 +8,6 @@ namespace FabusMod.Projectiles.RainbowDemon;
public class RainbowDemonMagicBall : ModProjectile public class RainbowDemonMagicBall : ModProjectile
{ {
private const int alphaReducation = 25;
public override void SetDefaults() public override void SetDefaults()
{ {
Projectile.width = 10; Projectile.width = 10;
@@ -27,28 +25,26 @@ public class RainbowDemonMagicBall : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
public override bool OnTileCollide(Vector2 oldVelocity) public override bool OnTileCollide(Vector2 oldVelocity)
{ {
Projectile projectile = Projectile; Projectile.penetrate--;
projectile.penetrate--;
if (Projectile.penetrate <= 0) if (Projectile.penetrate <= 0)
{ {
Projectile.Kill(); Projectile.Kill();
@@ -64,8 +60,7 @@ public class RainbowDemonMagicBall : ModProjectile
{ {
Projectile.velocity.Y = 0f - oldVelocity.Y; Projectile.velocity.Y = 0f - oldVelocity.Y;
} }
Projectile projectile2 = Projectile; Projectile.velocity *= 0.75f;
projectile2.velocity = projectile2.velocity * 0.75f;
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
return false; return false;
+10 -15
View File
@@ -9,8 +9,6 @@ public class RainbowDemonMelee : ModProjectile
{ {
private const float maxTicks = 300f; private const float maxTicks = 300f;
private const int alphaReducation = 25;
public override void SetDefaults() public override void SetDefaults()
{ {
Projectile.width = 80; Projectile.width = 80;
@@ -36,11 +34,10 @@ public class RainbowDemonMelee : ModProjectile
{ {
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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) if (Projectile.alpha > 30)
{ {
Projectile projectile = Projectile; Projectile.alpha -= 15;
projectile.alpha -= 15;
if (Projectile.alpha < 30) if (Projectile.alpha < 30)
{ {
Projectile.alpha = 30; Projectile.alpha = 30;
@@ -70,20 +66,19 @@ public class RainbowDemonMelee : ModProjectile
} }
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
@@ -24,8 +24,7 @@ public class RainbowDemonShredderProj : ModProjectile
{ {
if (Projectile.alpha > 30) if (Projectile.alpha > 30)
{ {
Projectile projectile = Projectile; Projectile.alpha -= 15;
projectile.alpha -= 15;
if (Projectile.alpha < 30) if (Projectile.alpha < 30)
{ {
Projectile.alpha = 30; Projectile.alpha = 30;
@@ -33,20 +32,19 @@ public class RainbowDemonShredderProj : ModProjectile
} }
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
+12 -17
View File
@@ -28,8 +28,7 @@ public class RainbowOrb : ModProjectile
{ {
if (Projectile.alpha > 70) if (Projectile.alpha > 70)
{ {
Projectile projectile = Projectile; Projectile.alpha -= 15;
projectile.alpha -= 15;
if (Projectile.alpha < 70) if (Projectile.alpha < 70)
{ {
Projectile.alpha = 70; Projectile.alpha = 70;
@@ -65,20 +64,19 @@ public class RainbowOrb : ModProjectile
} }
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
AnimateProjectile(); AnimateProjectile();
@@ -95,14 +93,11 @@ public class RainbowOrb : ModProjectile
public void AnimateProjectile() public void AnimateProjectile()
{ {
Projectile projectile = Projectile; Projectile.frameCounter++;
projectile.frameCounter++;
if (Projectile.frameCounter >= 5) if (Projectile.frameCounter >= 5)
{ {
Projectile projectile2 = Projectile; Projectile.frame++;
projectile2.frame++; Projectile.frame %= 3;
Projectile projectile3 = Projectile;
projectile3.frame %= 3;
Projectile.frameCounter = 0; Projectile.frameCounter = 0;
} }
} }
+1 -1
View File
@@ -33,7 +33,7 @@ public class BloodDrop : ModProjectile
{ {
if (Main.rand.NextBool(3)&& Projectile.alpha <= 100) if (Main.rand.NextBool(3)&& Projectile.alpha <= 100)
{ {
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.BloodDust>(), 0f, 0f, 0, default, 1f); Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.BloodDust>());
} }
} }
} }
+8 -11
View File
@@ -34,11 +34,11 @@ public class DemonProjRMB : ModProjectile
AnimateProjectile(); AnimateProjectile();
if (Main.rand.NextBool(2)) if (Main.rand.NextBool(2))
{ {
int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.BloodDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.BloodDust>());
Main.dust[num1].scale = 1.9f; Main.dust[dust].scale = 1.9f;
Main.dust[num1].velocity.Y -= 1.5f; Main.dust[dust].velocity.Y -= 1.5f;
Main.dust[num1].velocity.X = 0f; Main.dust[dust].velocity.X = 0f;
Main.dust[num1].noGravity = true; Main.dust[dust].noGravity = true;
} }
} }
@@ -94,14 +94,11 @@ public class DemonProjRMB : ModProjectile
public void AnimateProjectile() public void AnimateProjectile()
{ {
Projectile projectile = Projectile; Projectile.frameCounter++;
projectile.frameCounter++;
if (Projectile.frameCounter >= 3) if (Projectile.frameCounter >= 3)
{ {
Projectile projectile2 = Projectile; Projectile.frame++;
projectile2.frame++; Projectile.frame %= 14;
Projectile projectile3 = Projectile;
projectile3.frame %= 14;
Projectile.frameCounter = 0; Projectile.frameCounter = 0;
} }
} }
+5 -6
View File
@@ -28,15 +28,14 @@ public class DemonProjTwo : ModProjectile
public override void AI() public override void AI()
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.OniDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.OniDust>());
Main.dust[dust1].scale = 2f; Main.dust[dust1].scale = 2f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; Main.dust[dust1].noGravity = true;
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.OniDust>(), 0f, 0f, 0, default, 1f);
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.OniDust>());
Main.dust[dust2].scale = 2f; Main.dust[dust2].scale = 2f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; Main.dust[dust2].noGravity = true;
} }
+19 -20
View File
@@ -26,26 +26,25 @@ public class DemonWave : ModProjectile
public override void AI() public override void AI()
{ {
int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>());
Dust obj = Main.dust[num1]; Main.dust[dust1].velocity *= 0f;
obj.velocity *= 0f; Main.dust[dust1].noGravity = true;
Main.dust[num1].noGravity = true;
int num2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>(), 0f, 0f, 0, default, 1f); int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>());
Dust obj2 = Main.dust[num2]; Main.dust[dust2].velocity *= 0f;
obj2.velocity *= 0f; Main.dust[dust2].noGravity = true;
Main.dust[num2].noGravity = true;
int num3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>(), 0f, 0f, 0, default, 1f); int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>());
Dust obj3 = Main.dust[num3]; Main.dust[dust3].velocity *= 0f;
obj3.velocity *= 0f; Main.dust[dust3].noGravity = true;
Main.dust[num3].noGravity = true;
int num4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>(), 0f, 0f, 0, default, 1f); int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>());
Dust obj4 = Main.dust[num4]; Main.dust[dust4].velocity *= 0f;
obj4.velocity *= 0f; Main.dust[dust4].noGravity = true;
Main.dust[num4].noGravity = true;
int num5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>(), 0f, 0f, 0, default, 1f); int dust5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust3>());
Dust obj5 = Main.dust[num5]; Main.dust[dust5].velocity *= 0f;
obj5.velocity *= 0f; Main.dust[dust5].noGravity = true;
Main.dust[num5].noGravity = true;
} }
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
+20 -22
View File
@@ -26,7 +26,6 @@ public class DreamCatcherProjRMB : ModProjectile
Projectile.ignoreWater = true; Projectile.ignoreWater = true;
Projectile.tileCollide = false; Projectile.tileCollide = false;
Projectile.extraUpdates = 0; Projectile.extraUpdates = 0;
Projectile projectile = Projectile;
Projectile.velocity = Projectile.velocity * 0f; Projectile.velocity = Projectile.velocity * 0f;
} }
@@ -35,21 +34,23 @@ public class DreamCatcherProjRMB : ModProjectile
AnimateProjectile(); AnimateProjectile();
if (Main.rand.NextBool(2)) if (Main.rand.NextBool(2))
{ {
int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
Main.dust[num1].scale = 1.9f; Main.dust[dust1].scale = 1.9f;
Main.dust[num1].velocity.Y -= 1.5f; Main.dust[dust1].velocity.Y -= 1.5f;
Main.dust[num1].velocity.X = 0f; Main.dust[dust1].velocity.X = 0f;
Main.dust[num1].noGravity = true; Main.dust[dust1].noGravity = true;
int num2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>(), 0f, 0f, 0, default, 1f);
Main.dust[num2].scale = 1.9f; int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>());
Main.dust[num2].velocity.Y -= 1.5f; Main.dust[dust2].scale = 1.9f;
Main.dust[num2].velocity.X = 0f; Main.dust[dust2].velocity.Y -= 1.5f;
Main.dust[num2].noGravity = true; Main.dust[dust2].velocity.X = 0f;
int num3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f); Main.dust[dust2].noGravity = true;
Main.dust[num3].scale = 1.9f;
Main.dust[num3].velocity.Y -= 1.5f; int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>());
Main.dust[num3].velocity.X = 0f; Main.dust[dust3].scale = 1.9f;
Main.dust[num3].noGravity = true; Main.dust[dust3].velocity.Y -= 1.5f;
Main.dust[dust3].velocity.X = 0f;
Main.dust[dust3].noGravity = true;
} }
} }
@@ -104,14 +105,11 @@ public class DreamCatcherProjRMB : ModProjectile
public void AnimateProjectile() public void AnimateProjectile()
{ {
Projectile projectile = Projectile; Projectile.frameCounter++;
projectile.frameCounter++;
if (Projectile.frameCounter >= 3) if (Projectile.frameCounter >= 3)
{ {
Projectile projectile2 = Projectile; Projectile.frame++;
projectile2.frame++; Projectile.frame %= 14;
Projectile projectile3 = Projectile;
projectile3.frame %= 14;
Projectile.frameCounter = 0; Projectile.frameCounter = 0;
} }
} }
+17 -18
View File
@@ -61,35 +61,34 @@ public class DreamCatcherProjTwo : ModProjectile
Projectile.velocity = (10f * Projectile.velocity + move) / 11f; Projectile.velocity = (10f * Projectile.velocity + move) / 11f;
AdjustMagnitude(ref Projectile.velocity); AdjustMagnitude(ref Projectile.velocity);
} }
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
Main.dust[dust1].scale = 2f; Main.dust[dust1].scale = 2f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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].scale = 2f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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].scale = 2f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>(), 0f, 0f, 0, default, 1f);
int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>());
Main.dust[dust4].scale = 2f; Main.dust[dust4].scale = 2f;
Dust obj4 = Main.dust[dust4]; Main.dust[dust4].velocity *= 0.1f;
obj4.velocity *= 0.1f;
Main.dust[dust4].noGravity = true; Main.dust[dust4].noGravity = true;
int dust5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f);
int dust5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>());
Main.dust[dust5].scale = 2f; Main.dust[dust5].scale = 2f;
Dust obj5 = Main.dust[dust5]; Main.dust[dust5].velocity *= 0.1f;
obj5.velocity *= 0.1f;
Main.dust[dust5].noGravity = true; Main.dust[dust5].noGravity = true;
int dust6 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f);
int dust6 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>());
Main.dust[dust6].scale = 2f; Main.dust[dust6].scale = 2f;
Dust obj6 = Main.dust[dust6]; Main.dust[dust6].velocity *= 0.1f;
obj6.velocity *= 0.1f;
Main.dust[dust6].noGravity = true; Main.dust[dust6].noGravity = true;
} }
+22 -23
View File
@@ -26,29 +26,28 @@ public class DreamCatcherWave : ModProjectile
public override void AI() public override void AI()
{ {
int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
Dust obj = Main.dust[num1]; Main.dust[dust1].velocity *= 0f;
obj.velocity *= 0f; Main.dust[dust1].noGravity = true;
Main.dust[num1].noGravity = true;
int num2 = 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>());
Dust obj2 = Main.dust[num2]; Main.dust[dust2].velocity *= 0f;
obj2.velocity *= 0f; Main.dust[dust2].noGravity = true;
Main.dust[num2].noGravity = true;
int num3 = 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>());
Dust obj3 = Main.dust[num3]; Main.dust[dust3].velocity *= 0f;
obj3.velocity *= 0f; Main.dust[dust3].noGravity = true;
Main.dust[num3].noGravity = true;
int num4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>(), 0f, 0f, 0, default, 1f); int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>());
Dust obj4 = Main.dust[num4]; Main.dust[dust4].velocity *= 0f;
obj4.velocity *= 0f; Main.dust[dust4].noGravity = true;
Main.dust[num4].noGravity = true;
int num5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f); int dust5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>());
Dust obj5 = Main.dust[num5]; Main.dust[dust5].velocity *= 0f;
obj5.velocity *= 0f; Main.dust[dust5].noGravity = true;
Main.dust[num5].noGravity = true;
int num6 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default, 1f); int num6 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>());
Dust obj6 = Main.dust[num6]; Main.dust[num6].velocity *= 0f;
obj6.velocity *= 0f;
Main.dust[num6].noGravity = true; Main.dust[num6].noGravity = true;
} }
+8 -11
View File
@@ -34,11 +34,11 @@ public class GoldenFuryProjRMB : ModProjectile
AnimateProjectile(); AnimateProjectile();
if (Main.rand.NextBool(2)) if (Main.rand.NextBool(2))
{ {
int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f);
Main.dust[num1].scale = 1.9f; Main.dust[dust].scale = 1.9f;
Main.dust[num1].velocity.Y -= 1.5f; Main.dust[dust].velocity.Y -= 1.5f;
Main.dust[num1].velocity.X = 0f; Main.dust[dust].velocity.X = 0f;
Main.dust[num1].noGravity = true; Main.dust[dust].noGravity = true;
} }
} }
@@ -93,14 +93,11 @@ public class GoldenFuryProjRMB : ModProjectile
public void AnimateProjectile() public void AnimateProjectile()
{ {
Projectile projectile = Projectile; Projectile.frameCounter++;
projectile.frameCounter++;
if (Projectile.frameCounter >= 3) if (Projectile.frameCounter >= 3)
{ {
Projectile projectile2 = Projectile; Projectile.frame++;
projectile2.frame++; Projectile.frame %= 14;
Projectile projectile3 = Projectile;
projectile3.frame %= 14;
Projectile.frameCounter = 0; Projectile.frameCounter = 0;
} }
} }
+5 -6
View File
@@ -28,15 +28,14 @@ public class GoldenFuryProjTwo : ModProjectile
public override void AI() public override void AI()
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>());
Main.dust[dust1].scale = 2f; Main.dust[dust1].scale = 2f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; Main.dust[dust1].noGravity = true;
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f);
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>());
Main.dust[dust2].scale = 2f; Main.dust[dust2].scale = 2f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; Main.dust[dust2].noGravity = true;
} }
+19 -20
View File
@@ -26,26 +26,25 @@ public class GoldenFuryWave : ModProjectile
public override void AI() public override void AI()
{ {
int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.GoldenDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.GoldenDust>());
Dust obj = Main.dust[num1]; Main.dust[dust1].velocity *= 0f;
obj.velocity *= 0f; Main.dust[dust1].noGravity = true;
Main.dust[num1].noGravity = true;
int num2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.GoldenDust>(), 0f, 0f, 0, default, 1f); int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.GoldenDust>());
Dust obj2 = Main.dust[num2]; Main.dust[dust2].velocity *= 0f;
obj2.velocity *= 0f; Main.dust[dust2].noGravity = true;
Main.dust[num2].noGravity = true;
int num3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.GoldenDust>(), 0f, 0f, 0, default, 1f); int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.GoldenDust>());
Dust obj3 = Main.dust[num3]; Main.dust[dust3].velocity *= 0f;
obj3.velocity *= 0f; Main.dust[dust3].noGravity = true;
Main.dust[num3].noGravity = true;
int num4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.GoldenDust>(), 0f, 0f, 0, default, 1f); int dust4 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.GoldenDust>());
Dust obj4 = Main.dust[num4]; Main.dust[dust4].velocity *= 0f;
obj4.velocity *= 0f; Main.dust[dust4].noGravity = true;
Main.dust[num4].noGravity = true;
int num5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.GoldenDust>(), 0f, 0f, 0, default, 1f); int dust5 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.GoldenDust>());
Dust obj5 = Main.dust[num5]; Main.dust[dust5].velocity *= 0f;
obj5.velocity *= 0f; Main.dust[dust5].noGravity = true;
Main.dust[num5].noGravity = true;
} }
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
+8 -9
View File
@@ -27,20 +27,19 @@ public class RainbowClump : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
+4 -5
View File
@@ -26,11 +26,10 @@ public class ShimadaWave : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.5f) if (Utils.NextFloat(Main.rand) < 0.5f)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust2>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust2>());
Main.dust[dust1].scale = 1.9f; Main.dust[dust].scale = 1.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
} }
+4 -5
View File
@@ -26,11 +26,10 @@ public class ShimadaWaveNihon : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.5f) if (Utils.NextFloat(Main.rand) < 0.5f)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.OniDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.OniDust>());
Main.dust[dust1].scale = 1.9f; Main.dust[dust].scale = 1.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
} }
+1 -2
View File
@@ -42,11 +42,10 @@ public class CarbonKnife : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position); SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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);
} }
} }
} }
+1 -2
View File
@@ -42,11 +42,10 @@ public class CarbonKnifeNihon : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position); SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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);
} }
} }
} }
+1 -2
View File
@@ -42,11 +42,10 @@ public class DeathBlossom : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position); SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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);
} }
} }
} }
+3 -4
View File
@@ -55,10 +55,9 @@ public class FumaShuriken : ModProjectile
} }
if (Main.rand.NextBool(3)) if (Main.rand.NextBool(3))
{ {
int num1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust>());
Dust obj = Main.dust[num1]; Main.dust[dust].velocity *= 0f;
obj.velocity *= 0f; Main.dust[dust].noGravity = true;
Main.dust[num1].noGravity = true;
} }
} }
+1 -2
View File
@@ -42,11 +42,10 @@ public class GoldenKnife : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position); SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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);
} }
} }
} }
+1 -2
View File
@@ -42,11 +42,10 @@ public class RainbowKnife : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position); SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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);
} }
} }
} }
+5 -7
View File
@@ -35,11 +35,10 @@ public class CarbonShuriken : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position); SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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)) if (Main.rand.NextBool(3))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousDust>());
Main.dust[dust1].scale = 1f; Main.dust[dust].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
} }
+5 -6
View File
@@ -39,7 +39,7 @@ public class CarbonShurikenNihon : ModProjectile
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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)) if (Main.rand.NextBool(3))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.NightsAxeSparkle>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.NightsAxeSparkle>());
Main.dust[dust1].scale = 1f; Main.dust[dust].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
} }
+5 -7
View File
@@ -40,11 +40,10 @@ public class HerosShuriken : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position); SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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)) if (Main.rand.NextBool(3))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RyuuDust>());
Main.dust[dust1].scale = 1f; Main.dust[dust].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
} }
+5 -7
View File
@@ -35,11 +35,10 @@ public class OniSlayer : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position); SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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)) if (Main.rand.NextBool(3))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.OniDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.OniDust>());
Main.dust[dust1].scale = 1f; Main.dust[dust].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
} }
+5 -7
View File
@@ -35,11 +35,10 @@ public class SparklingDemon : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position); SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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)) if (Main.rand.NextBool(3))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>());
Main.dust[dust1].scale = 1f; Main.dust[dust].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
} }
@@ -35,7 +35,7 @@ public class StonePlatedShurikenProj : ModProjectile
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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)) 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); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.Shuriken.StarDust>());
Main.dust[dust1].scale = 1f; Main.dust[dust].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = false;
Main.dust[dust1].noGravity = false;
} }
} }
} }
+10 -14
View File
@@ -24,18 +24,16 @@ public class GoldenStaffProj : ModProjectile
{ {
if (Main.rand.NextBool(4)) if (Main.rand.NextBool(4))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
public override bool OnTileCollide(Vector2 oldVelocity) public override bool OnTileCollide(Vector2 oldVelocity)
{ {
Projectile projectile = Projectile; Projectile.penetrate--;
projectile.penetrate--;
if (Projectile.penetrate <= 0) if (Projectile.penetrate <= 0)
{ {
Projectile.Kill(); Projectile.Kill();
@@ -51,8 +49,7 @@ public class GoldenStaffProj : ModProjectile
{ {
Projectile.velocity.Y = 0f - oldVelocity.Y; Projectile.velocity.Y = 0f - oldVelocity.Y;
} }
Projectile projectile2 = Projectile; Projectile.velocity *= 0.75f;
projectile2.velocity = projectile2.velocity * 0.75f;
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
return false; return false;
@@ -62,11 +59,10 @@ public class GoldenStaffProj : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.MeatDust>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
+15 -20
View File
@@ -24,26 +24,23 @@ public class NatureStaffProj : ModProjectile
{ {
if (Main.rand.NextBool(5)) if (Main.rand.NextBool(5))
{ {
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.NatureStaffDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.NatureStaffDust>());
Main.dust[dust2].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust2]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust2].noGravity = true;
} }
if (Main.rand.NextBool(4)) if (Main.rand.NextBool(4))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.NatureStaffDust2>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.NatureStaffDust2>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj2 = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj2.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
public override bool OnTileCollide(Vector2 oldVelocity) public override bool OnTileCollide(Vector2 oldVelocity)
{ {
Projectile projectile = Projectile; Projectile.penetrate--;
projectile.penetrate--;
if (Projectile.penetrate <= 0) if (Projectile.penetrate <= 0)
{ {
Projectile.Kill(); Projectile.Kill();
@@ -59,8 +56,7 @@ public class NatureStaffProj : ModProjectile
{ {
Projectile.velocity.Y = 0f - oldVelocity.Y; Projectile.velocity.Y = 0f - oldVelocity.Y;
} }
Projectile projectile2 = Projectile; Projectile.velocity *= 0.75f;
projectile2.velocity *= 0.75f;
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
return false; return false;
@@ -70,11 +66,10 @@ public class NatureStaffProj : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.NatureStaffDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.NatureStaffDust>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
@@ -83,7 +78,7 @@ public class NatureStaffProj : ModProjectile
{ {
if (Main.rand.NextBool(4)) if (Main.rand.NextBool(4))
{ {
target.AddBuff(20, 180, false); target.AddBuff(BuffID.Poisoned, 180, false);
} }
} }
} }
@@ -24,26 +24,23 @@ public class SorcerousHellstaffProj : ModProjectile
{ {
if (Main.rand.NextBool(3)) if (Main.rand.NextBool(3))
{ {
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDust>());
Main.dust[dust2].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust2]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust2].noGravity = true;
} }
if (Main.rand.NextBool(4)) if (Main.rand.NextBool(4))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDust2>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDust2>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj2 = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj2.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
public override bool OnTileCollide(Vector2 oldVelocity) public override bool OnTileCollide(Vector2 oldVelocity)
{ {
Projectile projectile = Projectile; Projectile.penetrate--;
projectile.penetrate--;
if (Projectile.penetrate <= 0) if (Projectile.penetrate <= 0)
{ {
Projectile.Kill(); Projectile.Kill();
@@ -59,8 +56,7 @@ public class SorcerousHellstaffProj : ModProjectile
{ {
Projectile.velocity.Y = 0f - oldVelocity.Y; Projectile.velocity.Y = 0f - oldVelocity.Y;
} }
Projectile projectile2 = Projectile; Projectile.velocity *= 0.75f;
projectile2.velocity *= 0.75f;
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
return false; return false;
@@ -70,11 +66,10 @@ public class SorcerousHellstaffProj : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDust>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
@@ -83,7 +78,7 @@ public class SorcerousHellstaffProj : ModProjectile
{ {
if (Main.rand.NextBool(6)) if (Main.rand.NextBool(6))
{ {
target.AddBuff(24, 180, false); target.AddBuff(BuffID.OnFire, 180, false);
} }
} }
} }
@@ -24,26 +24,23 @@ public class SorcerousHellstaffProjWhite : ModProjectile
{ {
if (Main.rand.NextBool(3)) if (Main.rand.NextBool(3))
{ {
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDustWhite>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDustWhite>());
Main.dust[dust2].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust2]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust2].noGravity = true;
} }
if (Main.rand.NextBool(4)) if (Main.rand.NextBool(4))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDustPurple>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDustPurple>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj2 = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj2.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
} }
public override bool OnTileCollide(Vector2 oldVelocity) public override bool OnTileCollide(Vector2 oldVelocity)
{ {
Projectile projectile = Projectile; Projectile.penetrate--;
projectile.penetrate--;
if (Projectile.penetrate <= 0) if (Projectile.penetrate <= 0)
{ {
Projectile.Kill(); Projectile.Kill();
@@ -59,8 +56,7 @@ public class SorcerousHellstaffProjWhite : ModProjectile
{ {
Projectile.velocity.Y = 0f - oldVelocity.Y; Projectile.velocity.Y = 0f - oldVelocity.Y;
} }
Projectile projectile2 = Projectile; Projectile.velocity *= 0.75f;
projectile2.velocity *= 0.75f;
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
return false; return false;
@@ -70,11 +66,10 @@ public class SorcerousHellstaffProjWhite : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDustWhite>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousHellDustWhite>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
@@ -83,7 +78,7 @@ public class SorcerousHellstaffProjWhite : ModProjectile
{ {
if (Main.rand.NextBool(6)) if (Main.rand.NextBool(6))
{ {
target.AddBuff(24, 180, false); target.AddBuff(BuffID.OnFire, 180, false);
} }
} }
} }
@@ -42,8 +42,7 @@ public class SorcerousStaffProj : ModProjectile
public override bool OnTileCollide(Vector2 oldVelocity) public override bool OnTileCollide(Vector2 oldVelocity)
{ {
Projectile projectile = Projectile; Projectile.penetrate--;
projectile.penetrate--;
if (Projectile.penetrate <= 0) if (Projectile.penetrate <= 0)
{ {
Projectile.Kill(); Projectile.Kill();
@@ -59,8 +58,7 @@ public class SorcerousStaffProj : ModProjectile
{ {
Projectile.velocity.Y = 0f - oldVelocity.Y; Projectile.velocity.Y = 0f - oldVelocity.Y;
} }
Projectile projectile2 = Projectile; Projectile.velocity *= 0.75f;
projectile2.velocity *= 0.75f;
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
return false; return false;
@@ -70,11 +68,10 @@ public class SorcerousStaffProj : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousDust>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.SorcerousDust>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
+10 -13
View File
@@ -24,28 +24,26 @@ public class TranquilityProj : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
public override bool OnTileCollide(Vector2 oldVelocity) public override bool OnTileCollide(Vector2 oldVelocity)
{ {
Projectile projectile = Projectile; Projectile.penetrate--;
projectile.penetrate--;
if (Projectile.penetrate <= 0) if (Projectile.penetrate <= 0)
{ {
Projectile.Kill(); Projectile.Kill();
@@ -61,8 +59,7 @@ public class TranquilityProj : ModProjectile
{ {
Projectile.velocity.Y = 0f - oldVelocity.Y; Projectile.velocity.Y = 0f - oldVelocity.Y;
} }
Projectile projectile2 = Projectile; Projectile.velocity *= 0.75f;
projectile2.velocity = projectile2.velocity * 0.75f;
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
return false; return false;
+16 -18
View File
@@ -26,20 +26,19 @@ public class SpectralMoonBolt : ModProjectile
{ {
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
@@ -48,20 +47,19 @@ public class SpectralMoonBolt : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
SoundEngine.PlaySound(SoundID.Item1, Projectile.position); SoundEngine.PlaySound(SoundID.Item1, Projectile.position);
+9 -11
View File
@@ -40,11 +40,10 @@ public class TheSpinningRainbow : ModProjectile
SoundEngine.PlaySound(SoundID.Dig, Projectile.position); SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
Vector2 position = Projectile.position; Vector2 position = Projectile.position;
Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f)); Vector2 rotVector = Utils.ToRotationVector2(Projectile.rotation - MathHelper.ToRadians(90f));
_ = position + rotVector * 16f;
int item = 0; int item = 0;
if (Main.netMode == NetmodeID.MultiplayerClient && 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,20 +51,19 @@ public class TheSpinningRainbow : ModProjectile
{ {
if (Main.rand.NextBool(3)) if (Main.rand.NextBool(3))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>(), 0f, 0f, 0, default, 1f); int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 1f; Main.dust[dust1].scale = 1f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; Main.dust[dust1].noGravity = true;
int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust2>());
Main.dust[dust2].scale = 1f; Main.dust[dust2].scale = 1f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; Main.dust[dust2].noGravity = true;
int dust3 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust3>());
Main.dust[dust3].scale = 1f; Main.dust[dust3].scale = 1f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }
+13 -20
View File
@@ -30,19 +30,17 @@ public class TheWhisperingIcicle : ModProjectile
{ {
if (Main.rand.NextBool(3)) if (Main.rand.NextBool(3))
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.CrystalDust2>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.CrystalDust2>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
AnimateProjectile(); AnimateProjectile();
} }
public override bool OnTileCollide(Vector2 oldVelocity) public override bool OnTileCollide(Vector2 oldVelocity)
{ {
Projectile projectile = Projectile; Projectile.penetrate--;
projectile.penetrate--;
if (Projectile.penetrate <= 0) if (Projectile.penetrate <= 0)
{ {
Projectile.Kill(); Projectile.Kill();
@@ -58,8 +56,7 @@ public class TheWhisperingIcicle : ModProjectile
{ {
Projectile.velocity.Y = 0f - oldVelocity.Y; Projectile.velocity.Y = 0f - oldVelocity.Y;
} }
Projectile projectile2 = Projectile; Projectile.velocity *= 0.75f;
projectile2.velocity *= 0.75f;
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
return false; return false;
@@ -69,11 +66,10 @@ public class TheWhisperingIcicle : ModProjectile
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
int dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.CrystalDust2>(), 0f, 0f, 0, default, 1f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.CrystalDust2>());
Main.dust[dust1].scale = 0.9f; Main.dust[dust].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust].velocity *= 0.1f;
obj.velocity *= 0.1f; Main.dust[dust].noGravity = true;
Main.dust[dust1].noGravity = true;
} }
SoundEngine.PlaySound(SoundID.Item27, Projectile.position); SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
} }
@@ -90,14 +86,11 @@ public class TheWhisperingIcicle : ModProjectile
public void AnimateProjectile() public void AnimateProjectile()
{ {
Projectile projectile = Projectile; Projectile.frameCounter++;
projectile.frameCounter++;
if (Projectile.frameCounter >= 3) if (Projectile.frameCounter >= 3)
{ {
Projectile projectile2 = Projectile; Projectile.frame++;
projectile2.frame++; Projectile.frame %= 16;
Projectile projectile3 = Projectile;
projectile3.frame %= 16;
Projectile.frameCounter = 0; Projectile.frameCounter = 0;
} }
} }
+9 -11
View File
@@ -33,8 +33,7 @@ public class WishNeedle : ModProjectile
{ {
if (Projectile.alpha > 70) if (Projectile.alpha > 70)
{ {
Projectile projectile = Projectile; Projectile.alpha -= 15;
projectile.alpha -= 15;
if (Projectile.alpha < 70) if (Projectile.alpha < 70)
{ {
Projectile.alpha = 70; Projectile.alpha = 70;
@@ -70,20 +69,19 @@ public class WishNeedle : ModProjectile
} }
if (Utils.NextFloat(Main.rand) < 0.1f && Projectile.alpha <= 100) 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 dust1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<Dusts.RainbowDust>());
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);
Main.dust[dust1].scale = 0.9f; Main.dust[dust1].scale = 0.9f;
Dust obj = Main.dust[dust1]; Main.dust[dust1].velocity *= 0.1f;
obj.velocity *= 0.1f;
Main.dust[dust1].noGravity = true; 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; Main.dust[dust2].scale = 0.9f;
Dust obj2 = Main.dust[dust2]; Main.dust[dust2].velocity *= 0.1f;
obj2.velocity *= 0.1f;
Main.dust[dust2].noGravity = true; 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; Main.dust[dust3].scale = 0.9f;
Dust obj3 = Main.dust[dust3]; Main.dust[dust3].velocity *= 0.1f;
obj3.velocity *= 0.1f;
Main.dust[dust3].noGravity = true; Main.dust[dust3].noGravity = true;
} }
} }