38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
using Terraria.ID;
|
|
|
|
namespace CalamityMod.Items.Materials
|
|
{
|
|
public class EssenceofCinder : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Essence of Sunlight");
|
|
Tooltip.SetDefault("The essence of sky, light, and storm creatures");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 30;
|
|
item.height = 24;
|
|
item.maxStack = 999;
|
|
item.value = Item.sellPrice(silver: 40);
|
|
item.rare = ItemRarityID.Pink;
|
|
}
|
|
|
|
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
|
{
|
|
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]);
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|