using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.GameContent; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Items.Accessories { public class StarTaintedGenerator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { Item.width = 38; Item.height = 60; Item.accessory = true; Item.value = CalamityGlobalItem.Rarity8BuyPrice; Item.rare = ItemRarityID.Yellow; } public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().voltaicJelly = true; player.Calamity().starbusterCore = true; player.Calamity().starTaintedGenerator = true; player.GetDamage() += 0.07f; player.buffImmune[ModContent.BuffType()] = true; } public override void AddRecipes() { CreateRecipe(). AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(3). AddTile(TileID.MythrilAnvil). 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.8f, drawOffset: new(0f, 0f) ); return false; } } }