Removed nearly all unused textures in the entire mod, especially focusing on projectiles. Apotheosis & the Death Valley Duster weapon line were ignored to prevent merge conflicts.
65 lines
2.4 KiB
C#
65 lines
2.4 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Magic
|
|
{
|
|
public class PlasmaRay2 : ModProjectile
|
|
{
|
|
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Ray");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 4;
|
|
projectile.height = 4;
|
|
projectile.friendly = true;
|
|
projectile.tileCollide = false;
|
|
projectile.magic = true;
|
|
projectile.penetrate = 1;
|
|
projectile.extraUpdates = 100;
|
|
projectile.timeLeft = 40;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 65, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
|
if (projectile.velocity.X != projectile.velocity.X)
|
|
{
|
|
projectile.position.X = projectile.position.X + projectile.velocity.X;
|
|
projectile.velocity.X = -projectile.velocity.X;
|
|
}
|
|
if (projectile.velocity.Y != projectile.velocity.Y)
|
|
{
|
|
projectile.position.Y = projectile.position.Y + projectile.velocity.Y;
|
|
projectile.velocity.Y = -projectile.velocity.Y;
|
|
}
|
|
projectile.localAI[0] += 1f;
|
|
if (projectile.localAI[0] > 9f)
|
|
{
|
|
for (int num447 = 0; num447 < 4; num447++)
|
|
{
|
|
Vector2 vector33 = projectile.position;
|
|
vector33 -= projectile.velocity * ((float)num447 * 0.25f);
|
|
projectile.alpha = 255;
|
|
int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default, 0.25f);
|
|
Main.dust[num448].position = vector33;
|
|
Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f;
|
|
Main.dust[num448].velocity *= 0.2f;
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
for (int k = 0; k < 3; k++)
|
|
{
|
|
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 65, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
|
|
}
|
|
}
|
|
}
|
|
}
|