Decimation_Mod/Content/Items/Accessories/WaspNest.cs
FyloZ 884e67c5e2 Updated some potions's sprite.
Changed buy price to sell price.
2020-07-09 18:03:44 -04:00

51 lines
1.6 KiB
C#

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 string ItemTooltip => "Attackers also take damage\n" +
"Attackers have 50% chances to be poisoned";
protected override void InitAccessory()
{
item.width = 32;
item.height = 30;
item.value = Item.sellPrice(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<WaspNest>()) && Main.rand.NextBool(2))
npc.AddBuff(BuffID.Poisoned, 600);
}
}
}