45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using CalamityMod.CalPlayer;
|
|
using CalamityMod.CustomRecipes;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Accessories
|
|
{
|
|
[LegacyName("UnstablePrism")]
|
|
public class UnstableGraniteCore : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Accessories";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 5));
|
|
ItemID.Sets.AnimatesAsSoul[Type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 46;
|
|
Item.height = 48;
|
|
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
|
|
Item.rare = ItemRarityID.Orange;
|
|
Item.accessory = true;
|
|
}
|
|
|
|
public override void UpdateInventory(Player player)
|
|
{
|
|
if (Main.netMode != NetmodeID.MultiplayerClient && !RecipeUnlockHandler.HasFoundUnstableGraniteCore)
|
|
{
|
|
RecipeUnlockHandler.HasFoundUnstableGraniteCore = true;
|
|
CalamityNetcode.SyncWorld();
|
|
}
|
|
}
|
|
|
|
public override void UpdateAccessory(Player player, bool hideVisual)
|
|
{
|
|
CalamityPlayer modPlayer = player.Calamity();
|
|
modPlayer.unstableGraniteCore = true;
|
|
}
|
|
}
|
|
}
|