diff --git a/Content/Items/Accessories/WaspNest.cs b/Content/Items/Accessories/WaspNest.cs new file mode 100644 index 0000000..d91a4d3 --- /dev/null +++ b/Content/Items/Accessories/WaspNest.cs @@ -0,0 +1,48 @@ +using Decimation.Lib.Items; +using Decimation.Lib.Util; +using Decimation.Lib.Util.Builder; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Decimation.Content.Items.Accessories +{ + public class WaspNest : DecimationAccessory + { + protected override string ItemName => "Wasp Nest"; + + protected override void InitAccessory() + { + item.width = 32; + item.height = 30; + item.value = Item.buyPrice(silver: 10); + item.rare = Rarity.Blue.GetRarityValue(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(BuffID.Thorns, 600); + + base.UpdateAccessory(player, hideVisual); + } + + protected override ModRecipe GetRecipe() + { + return new RecipeBuilder(this) + .WithIngredient(ItemID.BeeWax, 10) + .WithIngredient(ItemID.Stinger, 15) + .WithIngredient(ItemID.BottledHoney) + .WithStation(TileID.WorkBenches) + .Build(); + } + } + + internal class WaspNestPoisonEffect : GlobalNPC + { + public override void OnHitPlayer(NPC npc, Player target, int damage, bool crit) + { + if (target.HasEquippedAccessory(ModContent.ItemType()) && Main.rand.NextBool(2)) + npc.AddBuff(BuffID.Poisoned, 600); + } + } +} \ No newline at end of file diff --git a/Content/Items/Accessories/WaspNest.png b/Content/Items/Accessories/WaspNest.png new file mode 100644 index 0000000..7ac506d Binary files /dev/null and b/Content/Items/Accessories/WaspNest.png differ diff --git a/Lib/Items/DecimationAccessory.cs b/Lib/Items/DecimationAccessory.cs index fb6c153..bef6db6 100644 --- a/Lib/Items/DecimationAccessory.cs +++ b/Lib/Items/DecimationAccessory.cs @@ -1,4 +1,7 @@ -namespace Decimation.Lib.Items +using Decimation.Lib.Util; +using Terraria; + +namespace Decimation.Lib.Items { public abstract class DecimationAccessory : DecimationItem { @@ -11,5 +14,10 @@ InitAccessory(); } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.EquipAccessory(this); + } } } \ No newline at end of file