using System.Collections.Generic; using Decimation.Content.Items.Misc.Souls; using Decimation.Content.Projectiles.Boss.DuneWyrm; using Decimation.Lib.Items; using Decimation.Lib.Util.Builder; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace Decimation.Content.Items.Weapons { public class HourHand : DecimationWeapon { private const int ManaCost = 20; 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(); protected override void InitWeapon() { item.width = 32; item.height = 32; item.useTime = 28; item.useAnimation = 28; item.knockBack = 5; item.value = Item.sellPrice(gold: 4, silver: 70); item.rare = 2; item.crit = 7; item.shootSpeed = 10f; item.autoReuse = true; } protected override List GetRecipes() { return new List { new RecipeBuilder(this) .WithIngredient(ItemID.AncientBattleArmorMaterial) .WithIngredient(ItemID.EnchantedSword) .WithIngredient(ModContent.ItemType(), 10) .WithIngredient(ItemID.GoldBar, 5) .WithStation(TileID.MythrilAnvil) .Build(), new RecipeBuilder(this) .WithIngredient(ItemID.AncientBattleArmorMaterial) .WithIngredient(ItemID.EnchantedSword) .WithIngredient(ModContent.ItemType(), 10) .WithIngredient(ItemID.PlatinumBar, 5) .WithStation(TileID.MythrilAnvil) .Build() }; } 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); if (player.statMana - ManaCost < 0) return false; player.statMana -= ManaCost; return true; } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { if (Main.rand.NextBool()) target.AddBuff(BuffID.Slow, 300); } 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); } } }