/
ExampleBreastplate.cs
39 lines (34 loc) · 1.57 KB
/
ExampleBreastplate.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace ExampleMod.Content.Items.Armor
{
// The AutoloadEquip attribute automatically attaches an equip texture to this item.
// Providing the EquipType.Body value here will result in TML expecting X_Arms.png, X_Body.png and X_FemaleBody.png sprite-sheet files to be placed next to the item's main texture.
[AutoloadEquip(EquipType.Body)]
public class ExampleBreastplate : ModItem
{
public static int MaxManaIncrease = 20;
public static int MaxMinionIncrease = 1;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaIncrease, MaxMinionIncrease);
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 = 6; // The amount of defense the item will give when equipped
}
public override void UpdateEquip(Player player) {
player.buffImmune[BuffID.OnFire] = true; // Make the player immune to Fire
player.statManaMax2 += MaxManaIncrease; // Increase how many mana points the player can have by 20
player.maxMinions += MaxMinionIncrease; // Increase how many minions the player can have by one
}
// Please see Content/ExampleRecipes.cs for a detailed explanation of recipe creation.
public override void AddRecipes() {
CreateRecipe().AddIngredient<ExampleItem>()
.AddTile<Tiles.Furniture.ExampleWorkbench>()
.Register();
}
}
}