Lighting and particle adjustments

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
This commit is contained in:
Xyk committed 2023-10-01 20:46:09 -07:00
1 parent c2b379906a
commit 4fa5b6c9d4
7 files changed
+29 -20

No files matched your search

+3 -6
View File
@@ -21,12 +21,9 @@ namespace CalamityMod.Dusts
}
if (!dust.noLight)
{
float strength = dust.scale * 1.4f;
if (strength > 1f)
{
strength = 1f;
}
Lighting.AddLight(dust.position, 1.43f * strength, 1.88f * strength, 1.43f * strength);
float strength = dust.scale * 1.8f;
Vector3 DustLight = new Vector3(0.149f, 0.245f, 0.195f);
Lighting.AddLight(dust.position, DustLight * strength);
}
return true;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

@@ -496,8 +496,8 @@ MadAlchemistsCocktailGlove: {
Fires a variety of high-velocity flasks
Press <right> to throw a prismatic flask that inflicts many debuffs
Red flasks explode violently
Blue flasks contain poison gas
Green flasks summon lunar flares
Blue flasks contain poison gas
Green flasks summon lunar flares
Purple flasks explode into homing shrapnel
'''
}
+7 -2
View File
@@ -14,8 +14,9 @@ namespace CalamityMod.Particles
private float opacity;
private Color BaseColor;
private bool ProduceLight;
public GenericBloom(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime)
public GenericBloom(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime, bool produceLight = true)
{
Position = position;
Velocity = velocity;
@@ -23,13 +24,17 @@ namespace CalamityMod.Particles
Scale = scale;
Lifetime = lifeTime;
Rotation = Main.rand.NextFloat(MathHelper.TwoPi);
ProduceLight = produceLight;
}
public override void Update()
{
opacity = (float)Math.Sin(LifetimeCompletion * MathHelper.Pi);
Color = BaseColor * opacity;
Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f);
if (ProduceLight)
{
Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f);
}
Velocity *= 0.95f;
}
+1 -2
View File
@@ -37,13 +37,12 @@ namespace CalamityMod.Projectiles.Healing
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.timeLeft = 2710;
Projectile.timeLeft = 1810;
}
public override void AI()
{
Framecounter++;
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
{
Player player = Main.player[playerIndex];
+6 -2
View File
@@ -174,10 +174,14 @@ namespace CalamityMod.Projectiles.Ranged
SparkParticle spark2 = new SparkParticle((tipPosition -Projectile.velocity * 4) + Main.rand.NextVector2Circular(12, 12), -Projectile.velocity * Main.rand.NextFloat(16.1f, 30.8f), false, Main.rand.Next(2, 7), Main.rand.NextFloat(particleScale / 350f, particleScale / 270f), Main.rand.NextBool(4) ? Color.Chartreuse : Color.Lime);
GeneralParticleHandler.SpawnParticle(spark2);
}
Particle orb = new GenericBloom(tipPosition, Projectile.velocity, Color.Lime, particleScale / 270f, 2);
Particle orb = new GenericBloom(tipPosition, Projectile.velocity, Color.Lime, particleScale / 270f, 2, false);
GeneralParticleHandler.SpawnParticle(orb);
Particle orb2 = new GenericBloom(tipPosition, Projectile.velocity, Color.White, particleScale / 400f, 2);
Particle orb2 = new GenericBloom(tipPosition, Projectile.velocity, Color.White, particleScale / 400f, 2, false);
GeneralParticleHandler.SpawnParticle(orb2);
float strength = particleScale / 45f;
Vector3 DustLight = new Vector3(0.000f, 0.255f, 0.000f);
Lighting.AddLight(tipPosition, DustLight * strength);
}
// Full charge dusts
+10 -6
View File
@@ -39,14 +39,18 @@ namespace CalamityMod.Projectiles.Ranged
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(-3, 3), 107);
dust.noGravity = true;
dust.scale = 1.2f;
if (Main.rand.NextBool())
if (Time < 120)
{
Vector2 trailPos = Projectile.Center + Main.rand.NextVector2Circular(10, 10);
float trailScale = Main.rand.NextFloat(0.8f, 1.2f);
Color trailColor = Main.rand.NextBool(3) ? Color.Chartreuse : Color.Lime;
Particle Trail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor);
GeneralParticleHandler.SpawnParticle(Trail);
if (Main.rand.NextBool())
{
Vector2 trailPos = Projectile.Center + Main.rand.NextVector2Circular(10, 10);
float trailScale = Main.rand.NextFloat(0.8f, 1.2f);
Color trailColor = Main.rand.NextBool(3) ? Color.Chartreuse : Color.Lime;
Particle Trail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor);
GeneralParticleHandler.SpawnParticle(Trail);
}
}
}
public override bool PreDraw(ref Color lightColor)