Files
CalamityModPublic/Items/Materials/NightmareFuel.cs
T
Ozzatron cdb8a5489e 1 - Renamed Exocrystals to Exo Prisms
2 - Added Miracle Matter
3 - Changed all Exo Weapon recipes to require 1 Miracle Matter
4 - Improved the tooltips of most late game crafting materials
5 - Changed some late game crafting recipes around
2021-09-12 20:07:49 -04:00

51 lines
2.0 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.DataStructures;
using Terraria.ID;
namespace CalamityMod.Items.Materials
{
public class NightmareFuel : ModItem
{
public int frameCounter = 0;
public int frame = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Nightmare Fuel");
Tooltip.SetDefault("May drain your sanity");
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6));
}
public override void SetDefaults()
{
item.width = 38;
item.height = 36;
item.maxStack = 999;
item.rare = ItemRarityID.Red;
item.value = Item.sellPrice(gold: 2);
item.Calamity().customRarity = CalamityRarity.DarkBlue;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = Main.itemTexture[item.type];
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/NightmareFuelGlow");
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
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.7f * brightness, 0.7f * brightness, 0f);
}
}
}