63 lines
2.2 KiB
C#
63 lines
2.2 KiB
C#
using CalamityMod.CalPlayer;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Accessories.Vanity
|
|
{
|
|
public class Popo : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Accessories";
|
|
public override void Load()
|
|
{
|
|
if (Main.netMode != NetmodeID.Server)
|
|
{
|
|
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Popo_Head", EquipType.Head, this);
|
|
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/PopoNoseless_Head", EquipType.Head, name: "PopoNoseless");
|
|
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Popo_Body", EquipType.Body, this);
|
|
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Popo_Legs", EquipType.Legs, this);
|
|
}
|
|
}
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
|
|
if (Main.netMode == NetmodeID.Server)
|
|
return;
|
|
|
|
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 = 26;
|
|
Item.height = 30;
|
|
Item.accessory = true;
|
|
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
|
|
Item.rare = ItemRarityID.Pink;
|
|
Item.Calamity().devItem = true;
|
|
}
|
|
|
|
public override void UpdateVanity(Player player)
|
|
{
|
|
player.Calamity().snowmanHide = false;
|
|
player.Calamity().snowmanForce = true;
|
|
}
|
|
|
|
public override void UpdateAccessory(Player player, bool hideVisual)
|
|
{
|
|
CalamityPlayer modPlayer = player.Calamity();
|
|
modPlayer.snowman = true;
|
|
if (hideVisual)
|
|
{
|
|
modPlayer.snowmanHide = true;
|
|
}
|
|
}
|
|
}
|
|
}
|