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

59 lines
1.8 KiB
C#

using System.Collections.Generic;
using Decimation.Content.NPCs.DuneWyrm;
using Decimation.Lib.Items;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Items.Boss.DuneWyrm
{
internal class DesertDessert : DecimationItem
{
protected override string ItemName => "Desert Dessert";
protected override string ItemTooltip => "Summons the Dune Wyrm";
protected override void Init()
{
item.width = 32;
item.height = 32;
item.value = Item.sellPrice(0, 0, 13);
item.useStyle = 4;
item.useAnimation = 30;
item.useTime = 30;
item.consumable = true;
this.item.maxStack = 20;
}
public override bool UseItem(Player player)
{
if (player.ZoneDesert)
{
if (Main.netMode == 0)
{
Main.PlaySound(15, (int) player.position.X, (int) player.position.Y, 0);
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<DuneWyrmHead>());
return true;
}
ModPacket packet = this.mod.GetPacket();
packet.Write((byte) DecimationModMessageType.SpawnBoss);
packet.Write(ModContent.NPCType<DuneWyrmHead>());
packet.Write(player.whoAmI);
packet.Send();
}
return false;
}
protected override ModRecipe GetRecipe() //How to craft this item
{
ModRecipe recipe = GetNewModRecipe(this, 1, new List<int> {TileID.Anvils});
recipe.AddIngredient(ItemID.SandBlock, 10);
recipe.AddIngredient(ItemID.WormTooth, 5);
return recipe;
}
}
}