Files
CalamityModPublic/Items/Accessories/PhantomicArtifact.cs
T

64 lines
2.1 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Items.Placeables.Plates;
using CalamityMod.Rarities;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.GameContent;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace CalamityMod.Items.Accessories
{
public class PhantomicArtifact : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
public override void SetDefaults()
{
Item.width = 50;
Item.height = 40;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType<PureGreen>();
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual) => player.Calamity().phantomicArtifact = true;
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<HallowedRune>().
AddIngredient<ExodiumCluster>(20).
AddIngredient<Onyxplate>(25).
AddIngredient<RuinousSoul>(5).
AddTile(TileID.LunarCraftingStation).
Register();
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
CalamityUtils.DrawInventoryCustomScale(
spriteBatch,
texture: TextureAssets.Item[Type].Value,
position,
frame,
drawColor,
itemColor,
origin,
scale,
wantedScale: 0.9f,
drawOffset: new(2f, -2f)
);
return false;
}
}
}