using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; using Terraria.ID; using Terraria.DataStructures; using Terraria.GameContent; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Items.Accessories { public class TheTransformer : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 16)); ItemID.Sets.AnimatesAsSoul[Type] = true; } public override void SetDefaults() { Item.width = 42; Item.height = 56; Item.value = CalamityGlobalItem.Rarity4BuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.transformer = true; modPlayer.aSpark = true; } 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.95f, drawOffset: new(0f, 0f) ); return false; } } }