71 lines
2.3 KiB
C#
71 lines
2.3 KiB
C#
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Accessories.Vanity
|
|
{
|
|
public class RedBow : ModItem, ILocalizedModType
|
|
{
|
|
|
|
public new string LocalizationCategory => "Items.Accessories";
|
|
public override void Load()
|
|
{
|
|
if (Main.netMode != NetmodeID.Server)
|
|
{
|
|
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Apelusa_Head", EquipType.Head, this);
|
|
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Apelusa_Body", EquipType.Body, this);
|
|
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Apelusa_Legs", EquipType.Legs, this);
|
|
}
|
|
}
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
|
|
if (Main.netMode == NetmodeID.Server)
|
|
return;
|
|
|
|
int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head);
|
|
ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false;
|
|
|
|
int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body);
|
|
ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true;
|
|
ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true;
|
|
|
|
int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs);
|
|
ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 22;
|
|
Item.height = 30;
|
|
Item.accessory = true;
|
|
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
|
|
Item.rare = ItemRarityID.Green;
|
|
Item.vanity = true;
|
|
Item.Calamity().devItem = true;
|
|
}
|
|
|
|
public override void UpdateVanity(Player player)
|
|
{
|
|
player.Calamity().redBow = true;
|
|
}
|
|
|
|
public override void UpdateAccessory(Player player, bool hideVisual)
|
|
{
|
|
if (!hideVisual)
|
|
{
|
|
player.Calamity().redBow = true;
|
|
}
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient(ItemID.Silk, 5).
|
|
AddTile(TileID.Loom).
|
|
Register();
|
|
}
|
|
}
|
|
}
|