Added a nolight function for the GenericBloom particle Adjusted Absorber dust light and sprite Adjusted Arc Nova Diffuser's charge light so its green and scales with how charged it is Adjusted Arc Nova Diffuser's charge shot to stop trying to spawn particles offscreen
37 lines
980 B
C#
37 lines
980 B
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Dusts
|
|
{
|
|
public class AbsorberDust : 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.8f;
|
|
Vector3 DustLight = new Vector3(0.149f, 0.245f, 0.195f);
|
|
Lighting.AddLight(dust.position, DustLight * strength);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public override Color? GetAlpha(Dust dust, Color lightColor)
|
|
{
|
|
return new Color(lightColor.R, lightColor.G, lightColor.B, 25);
|
|
}
|
|
}
|
|
}
|