Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.IO;
- using Terraria;
- using Terraria.ID;
- using Terraria.ModLoader;
- namespace KhaelisPotionExpansion.Items
- {
- public class FearlessPotion : ModItem
- {
- public override void SetDefaults()
- {
- base.SetDefaults();
- item.name = "Fearless Potion"; //Name of the item
- item.width = 14; //Width of the sprite when used
- item.height = 24; //Height of the sprite when used
- item.maxStack = 30; //Highest possible stack
- AddTooltip("Increases Melee attack speed by 10%"); //Mouseover discription
- item.buffType = mod.BuffType("FearlessBuff"); //Adds the buff type to the potion. Uses the "Name" from ModBase.cs
- item.value = 1000; //Item shop value. 10 silver buy, 2 silver sell.
- item.rare = 1; //Item rarity: Blue
- item.useAnimation = 17; //How many frames it takes to fully use the item
- item.useTime = 17; //Probably the same as useAnimation. So leave these values the same.
- item.useStyle = 2; //The way an item is used. 2 = eating/drinking animation
- item.consumable = true; //The item is consumed when used
- item.useTurn = true; //Allowed to turn your character's direction while being used.
- item.useSound = 3; //The sound played when using the item.
- }
- public override bool CanUseItem(Player player)
- {
- if (player.HasBuff(mod.BuffType("KhaelisSuperFearlessBuff")) >= 0)
- {
- return false;
- }
- return true;
- }
- public override bool UseItem(Player player)
- {
- player.AddBuff(item.buffType, 21600); //Adds the buff when used.
- return true;
- }
- public override void AddRecipes() //Adds the recipe list for this item
- {
- ModRecipe recipe = new ModRecipe(mod); //This is needed and will always be the same for every item.
- recipe.AddIngredient(ItemID.BottledWater, 1); //These should be self explanitory. though, heres some more info. AddIngredient("ItemID", "AmountNeeded")
- recipe.AddIngredient(ItemID.Deathweed, 1);
- recipe.AddIngredient(ItemID.Fireblossom, 1);
- recipe.AddIngredient(ItemID.AntlionMandible, 1);
- recipe.SetResult(this, 1); //The items above will result in this item with a count of 1
- recipe.AddTile(13); //The tile requirement for crafting. 13 = alchemy/bottle
- recipe.AddRecipe(); //Adds the recipe to the list.
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement