Files
CalamityModPublic/Projectiles/Melee/Feather.cs
T
mountaindrew10 02ee97774c 1 - Fixed a lot of weird spear visual issues.
2 - Changed Elemental Lance a lot.
3 - Removed Iridescent Excalibur healing because it was buggy (I'll add it again later for the true melee projectile).
2024-03-22 02:53:53 -05:00

52 lines
1.6 KiB
C#

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class Feather : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/Magic/TradewindsProjectile";
private const int TimeLeft = 150;
public override void SetDefaults()
{
Projectile.width = 14;
Projectile.height = 14;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.MeleeNoSpeed;
Projectile.penetrate = 1;
Projectile.timeLeft = TimeLeft;
Projectile.aiStyle = ProjAIStyleID.Arrow;
}
public override void AI()
{
Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + MathHelper.PiOver2;
}
public override bool PreDraw(ref Color lightColor)
{
if (Projectile.timeLeft > TimeLeft - 5)
return false;
return true;
}
public override void OnKill(int timeLeft)
{
for (int i = 0; i < 10; i++)
{
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.YellowTorch, Projectile.oldVelocity.X, Projectile.oldVelocity.Y, 100, default, 1.4f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0.5f;
}
}
}
}