From 66ec20095d4d75b4fdf7943457cb3384a3990972 Mon Sep 17 00:00:00 2001 From: FyloZ Date: Wed, 10 Jun 2020 15:55:06 -0400 Subject: [PATCH] Added Wasp Nest. --- Content/Items/Accessories/WaspNest.cs | 48 +++++++++++++++++++++++++ Content/Items/Accessories/WaspNest.png | Bin 0 -> 594 bytes Lib/Items/DecimationAccessory.cs | 10 +++++- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 Content/Items/Accessories/WaspNest.cs create mode 100644 Content/Items/Accessories/WaspNest.png 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 0000000000000000000000000000000000000000..7ac506da40d65eb0a6c85abc2a554667b27eefbc GIT binary patch literal 594 zcmV-Y0qc@ks@!tF1cfRwTbI&uH6o2+Eqo}x*w&fm*hRS}WO`i{H zH~{{_;NmO=lsZY0y>+*c?M=K1{+uyFerR)7AV9{5lmTr3M%Q|UT(3HP6iKIjfb5`i zitJ_PknDVHne4WAUGP)EH2LEp7g;lWS5+Go3}^!Y$}NE&LOPbUkv(&7v z{v6IknE`D8@ZuSdn}W0TTgdJd&&Wap$NME8j6m(!$9xXT zK%FDUoPh~%084_pk#kf>G8U$FL=Fw$Fc?OkC^MiP05qVQW8_qz<%@P?8mXxPZ2)BT z&pVo|<3%Ri6G+Fcst^qJsQ3byR0P&$^D+2%`-iQ$CMf^ZWGp~ED0rHJ=3rY?gNN9o9CowIavinqNk|DjE)eGXekUy;WeKqxn_v g>;7%{R{%Z$Yb){AC(!<300000NkvXXu0mjf08oMhr~m)} literal 0 HcmV?d00001 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