From 5b23355b9308b6cb3e545af45a74c7fed7de28ff Mon Sep 17 00:00:00 2001 From: FyloZ Date: Mon, 6 Jul 2020 21:22:34 -0400 Subject: [PATCH] Finished the Hour Hand. --- Content/Items/Weapons/HourHand.cs | 36 ++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Content/Items/Weapons/HourHand.cs b/Content/Items/Weapons/HourHand.cs index bf7a926..78bffca 100644 --- a/Content/Items/Weapons/HourHand.cs +++ b/Content/Items/Weapons/HourHand.cs @@ -1,5 +1,8 @@ +using System.Collections.Generic; +using Decimation.Content.Items.Misc.Souls; using Decimation.Content.Projectiles.DuneWyrm; using Decimation.Lib.Items; +using Decimation.Lib.Util.Builder; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -9,6 +12,8 @@ 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; @@ -21,21 +26,50 @@ namespace Decimation.Content.Items.Weapons item.useTime = 28; item.useAnimation = 28; item.knockBack = 5; - item.value = Item.buyPrice(gold: 1); + item.value = Item.buyPrice(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);