Files
CalamityModPublic/Projectiles/Melee/YinYoLight.cs
T
GinYuH 177940845d TP support for vanilla-based projectiles
FeatherLarge is just a straight up resprite as the vanilla sprite it used was updated
Also the Belladonna seed is now animated (breaking critical change)
2024-10-22 21:32:54 -07:00

50 lines
1.5 KiB
C#

using Microsoft.Xna.Framework;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class YinYoLight : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
private const int speedTimerMax = 30;
private int speedTimer = 0;
public override string Texture => "Terraria/Images/Item_528";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Type] = 10;
ProjectileID.Sets.TrailingMode[Type] = 1;
}
public override void SetDefaults()
{
Projectile.width = Projectile.height = 10;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.MeleeNoSpeed;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = 3;
Projectile.timeLeft = 120;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 30;
}
public override void AI()
{
Projectile.rotation += 0.5f;
speedTimer--;
if (speedTimer <= 0)
{
speedTimer = speedTimerMax;
Projectile.velocity *= -1f;
}
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2);
return false;
}
}
}