Files
CalamityModPublic/Dusts/HolyFireDust.cs
T
DominicKarma42 55e89c9b98 Replaced (hopefully) every magic number with a constant
Note: Does not include item rarities, and appears to shown nonexistant using directive movement in the commit. This does not really affect anything, however.
2020-05-30 17:56:36 -04:00

40 lines
1.0 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class HolyFireDust : ModDust
{
public override void OnSpawn(Dust dust)
{
dust.velocity.Y = Main.rand.Next(-10, 6) * 0.1f;
dust.velocity.X *= 0.3f;
dust.scale *= 0.7f;
}
public override bool MidUpdate(Dust dust)
{
if (!dust.noGravity)
{
dust.velocity.Y += 0.05f;
}
if (!dust.noLight)
{
float strength = dust.scale * 1.4f;
if (strength > 1f)
{
strength = 1f;
}
Lighting.AddLight(dust.position, 0.25f * strength, 0.25f * strength, 0.1f * strength);
}
return true;
}
public override Color? GetAlpha(Dust dust, Color lightColor)
{
return new Color(lightColor.R, lightColor.G, lightColor.B, 25);
}
}
}