Files
CalamityModPublic/Projectiles/Ranged/BlueExoArrow2.cs
T
termigator1359 1b22071cf4 squash merge: Removed all unused textures
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.
2020-11-15 14:25:46 -05:00

65 lines
1.8 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class BlueExoArrow2 : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/LaserProj";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Arrow");
}
public override void SetDefaults()
{
projectile.width = 5;
projectile.height = 5;
projectile.friendly = true;
projectile.alpha = 255;
projectile.penetrate = 1;
projectile.extraUpdates = 5;
projectile.timeLeft = 300;
projectile.tileCollide = false;
projectile.ranged = true;
projectile.arrow = true;
}
public override void AI()
{
if (projectile.alpha > 0)
{
projectile.alpha -= 25;
}
if (projectile.alpha < 0)
{
projectile.alpha = 0;
}
float num55 = 40f;
float num56 = 1.5f;
if (projectile.ai[1] == 0f)
{
projectile.localAI[0] += num56;
if (projectile.localAI[0] > num55)
{
projectile.localAI[0] = num55;
}
}
else
{
projectile.localAI[0] -= num56;
if (projectile.localAI[0] <= 0f)
{
projectile.Kill();
}
}
}
public override Color? GetAlpha(Color lightColor) => new Color(0, 0, 250, projectile.alpha);
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) => projectile.DrawBeam(40f, 1.5f, lightColor);
}
}