Advertisement
itsmenick_

Making a modded helmet! Terraria, 2019, UPDATED!

Dec 15th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1. using Microsoft.Xna.Framework;
  2. using Terraria;
  3. using Terraria.ID;
  4. using Terraria.ModLoader;
  5. using static Terraria.ModLoader.ModContent;
  6.  
  7. namespace TestMod.Items.Armor
  8. {
  9.     [AutoloadEquip(EquipType.Head)]
  10.     public class ModdedHelmet : ModItem
  11.     {
  12.         public override void SetStaticDefaults()
  13.         {
  14.             Tooltip.SetDefault("This helmet is Modded.");
  15.         }
  16.  
  17.         public override void SetDefaults()
  18.         {
  19.             item.width = 18;
  20.             item.height = 18;
  21.             item.value = 1;
  22.             item.rare = 2;
  23.             item.defense = 5;
  24.         }
  25.  
  26.         public override bool IsArmorSet(Item head, Item body, Item legs)
  27.         {
  28.             return body.type == mod.ItemType("ModdedChestplate") && legs.type == mod.ItemType("ModdedLeggings");
  29.         }
  30.  
  31.         public override void UpdateArmorSet(Player player)
  32.         {
  33.             player.meleeDamage *= 0.5f;
  34.             player.AddBuff(BuffID.Spelunker, 1);
  35.         }
  36.  
  37.         public override void AddRecipes()
  38.         {
  39.             ModRecipe recipe = new ModRecipe(mod);
  40.             recipe.AddIngredient(ItemID.DirtBlock, 10);
  41.             recipe.SetResult(this);
  42.             recipe.AddRecipe();
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement