BiggulFottum
Terrarian
I'm kinda new to Terraria mod development and have been struggling to make this work.
can anyone help me out?
Here's my code:
can anyone help me out?
Here's my code:
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace biggulsadditions.Content.Items.Equipable.Armor.Head
{
// The AutoloadEquip attribute automatically attaches an equip texture to this item.
// Providing the EquipType.Head value here will result in TML expecting a X_Head.png file to be placed next to the item's main texture.
[AutoloadEquip(EquipType.Head)]
public class ObsidianMind : ModItem
{
public override void SetStaticDefaults()
{
ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false;
}
public override void SetDefaults() {
Item.width = 18; // Width of the item
Item.height = 18; // Height of the item
Item.value = Item.sellPrice(gold: 1); // How many coins the item is worth
Item.rare = ItemRarityID.Green; // The rarity of the item
Item.defense = 5; // The amount of defense the item will give when equipped
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
if (target.life <= 0) // Check if the NPC will die from this hit
{
player.statLife += 2;
player.HealEffect(10);
}
}
}
}