- Added support for animated projectiles - Refactoring - Removed useless fields - Fixed swords not dealing damages - Added Hour Hand (from Evie's PR)
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using Decimation.Lib.Items;
|
|
using Terraria;
|
|
|
|
namespace Decimation.Content.Projectiles
|
|
{
|
|
public class HourHandProjectile : DecimationProjectile
|
|
{
|
|
protected override int AnimationFrames => 4;
|
|
protected override DecimationWeapon.DamageType DamageType => DecimationWeapon.DamageType.Ranged;
|
|
protected override int Damages => 45;
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.projFrames[projectile.type] = 4;
|
|
}
|
|
|
|
protected override void Init()
|
|
{
|
|
projectile.width = 10;
|
|
projectile.height = 10;
|
|
projectile.timeLeft = 600;
|
|
projectile.penetrate = 1;
|
|
projectile.aiStyle = 8;
|
|
aiType = 253;
|
|
}
|
|
|
|
public override bool PreAI()
|
|
{
|
|
if (++projectile.frameCounter >= 5)
|
|
{
|
|
projectile.frameCounter = 0;
|
|
|
|
if (++projectile.frame >= 4)
|
|
{
|
|
projectile.frame = 0;
|
|
}
|
|
}
|
|
|
|
Lighting.AddLight(projectile.Center, 0f, 0f, 1f);
|
|
projectile.rotation = projectile.velocity.ToRotation();
|
|
|
|
return true;
|
|
}
|
|
}
|
|
} |