Decimation_Mod/Content/Items/Weapons/HourHand.cs
2020-06-23 14:28:18 -04:00

50 lines
1.6 KiB
C#

using Decimation.Content.Projectiles;
using Decimation.Lib.Items;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Items.Weapons
{
public class HourHand : DecimationWeapon
{
protected override string ItemName => "Hour Hand";
protected override string ItemTooltip => "The sands of time flow in your favor!";
protected override int Damages => 45;
protected override int ProjectileId => ModContent.ProjectileType<HourHandProjectile>();
protected override void InitWeapon()
{
item.width = 32;
item.height = 32;
item.useTime = 28;
item.useAnimation = 28;
item.knockBack = 5;
item.value = Item.buyPrice(gold: 1);
item.rare = 2;
item.crit = 7;
item.shootSpeed = 10f;
item.autoReuse = true;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage,
ref float knockBack)
{
if (Main.rand.NextBool()) player.AddBuff(BuffID.Swiftness, 300);
return true;
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
{
if (Main.rand.NextBool()) target.AddBuff(BuffID.Slow, 300);
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
Lighting.AddLight(item.Center, 0f, 0f, 1f);
}
}
}