Files
CalamityModPublic/Projectiles/Ranged/TorrentialArrow.cs
T
Ozzatron d4b5160f98 1 - Fully replaced Momentum Capacitor. It is now a channeled Burden Breaker.
2 - Stealth no longer gives movement speed.
3 - Moved a bunch of CalamityGlobalProjectile utilities to CalamityUtils where they belong.
4 - Renamed several things in CalamityGlobalProjectile
2022-07-02 19:42:56 -04:00

66 lines
2.0 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class TorrentialArrow : 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 = 2;
Projectile.timeLeft = 300;
Projectile.DamageType = DamageClass.Ranged;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.arrow = true;
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
}
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(53, Main.DiscoG, 255, Projectile.alpha);
public override bool PreDraw(ref Color lightColor) => Projectile.DrawBeam(40f, 1.5f, lightColor);
}
}