using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Materials { public class CoreofCinder : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Core of Sunlight"); } public override void SetDefaults() { item.width = 34; item.height = 34; item.maxStack = 999; item.value = Item.sellPrice(silver: 40); item.rare = ItemRarityID.Yellow; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/CoreofCinderGlow")); } public override void Update(ref float gravity, ref float maxFallSpeed) { float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); Lighting.AddLight(item.Center, 0.3f * brightness, 0.3f * brightness, 0.05f * brightness); } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.Ectoplasm); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this, 3); recipe.AddRecipe(); } } }