Fixed Vanquisher Arrow Sound and GSS Visual Update

This commit is contained in:
Xyk committed 2025-10-07 14:42:20 -07:00
1 parent e4d9133743
commit 20bef78f26
2 files changed
+45 -12

No files matched your search

+44 -11
View File
@@ -1,5 +1,6 @@
using System.IO;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
@@ -111,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged
return;
// The bullet disappears in a puff of dust.
ProduceWarpCrossDust(Projectile.Center, (int)CalamityDusts.PurpleCosmilite);
ProduceWarpCrossDust(Projectile.Center, ModContent.DustType<SquashDust>(), 0.5f, Color.Magenta);
// The warp must be performed client side because it requires knowledge of the player's mouse position.
Projectile.netUpdate = true;
@@ -144,7 +145,17 @@ namespace CalamityMod.Projectiles.Ranged
// Now that the bullet has warped, produce a tiny puff of dust at its back for effect.
Vector2 warpInDustPos = Projectile.Center - bulletToMouseVec * TextureHeight;
ProduceWarpCrossDust(warpInDustPos, (int)CalamityDusts.BlueCosmilite);
ProduceWarpCrossDust(warpInDustPos, ModContent.DustType<SquashDust>(), 1f, Color.Cyan);
for (int i = 0; i < 3; i++)
{
Vector2 dustVel = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.05f) * Main.rand.NextFloat(9, 15);
Dust d = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<VoidDust>());
d.position = warpInDustPos;
d.velocity = dustVel;
d.noGravity = true;
d.scale *= Main.rand.NextFloat(0.6f, 1f);
d.color = Color.Cyan;
}
}
public override Color? GetAlpha(Color lightColor) => new Color(255, 255, 255, 140);
@@ -168,18 +179,21 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.Damage();
// Create a fancy triangle of dust.
int dustID = (int)CalamityDusts.BlueCosmilite;
int dustID = ModContent.DustType<SquashDust>();
int numDust = 9;
float triangleAngle = Main.rand.NextFloat(MathHelper.TwoPi);
for (int i = 0; i < numDust; ++i)
{
float speed = MathHelper.Lerp(0.2f, 3.6f, i / (float)(numDust - 1));
Vector2 dustVel = Vector2.UnitX.RotatedBy(triangleAngle) * speed;
float lerp = i / (float)(numDust - 1);
float speed = MathHelper.Lerp(0.2f, 3.6f, lerp);
Vector2 dustVel = Vector2.UnitX.RotatedBy(triangleAngle) * speed * 2;
Dust d = Dust.NewDustDirect(Projectile.Center, 0, 0, dustID);
d.position = Projectile.Center;
d.velocity = dustVel;
d.noGravity = true;
d.scale *= Main.rand.NextFloat(1.1f, 1.4f);
d.fadeIn = 1.5f;
d.scale *= Main.rand.NextFloat(1.4f, 1.9f) - lerp * 0.5f;
d.color = Color.Lerp(Color.Cyan, Color.Magenta, lerp);
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi * 2f / 3f);
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi * 4f / 3f);
}
@@ -199,17 +213,36 @@ namespace CalamityMod.Projectiles.Ranged
return true;
}
private void ProduceWarpCrossDust(Vector2 dustPos, int dustID)
private void ProduceWarpCrossDust(Vector2 dustPos, int dustID, float speedMultiplier, Color color)
{
for (int i = 0; i < 4; ++i)
if (speedMultiplier > 0.8f) //dark
{
float speed = Main.rand.NextFloat(2.0f, 4.1f);
Vector2 dustVel = Vector2.UnitX * speed;
for (int i = 0; i < 2; ++i)
{
Particle pulse = new CustomPulse(dustPos, Vector2.Zero, Color.Black, "CalamityMod/ExtraTextures/BasicCircle", Vector2.One, 0, 0.4f * speedMultiplier, 0.05f * speedMultiplier, 12, false);
GeneralParticleHandler.SpawnParticle(pulse);
Particle pulse2 = new CustomPulse(dustPos, Vector2.Zero, color, "CalamityMod/Particles/BloomRing", Vector2.One, 0, 0.15f * (1 + i * 0.2f) * speedMultiplier, 0.025f * (1 + i * 0.2f) * speedMultiplier, 12, true);
GeneralParticleHandler.SpawnParticle(pulse2);
}
}
else //light
{
Particle pulse = new CustomSpark(dustPos, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 10, 0.3f * speedMultiplier, color, new Vector2(1f, 1f), true, true, glowOpacity: 1f);
GeneralParticleHandler.SpawnParticle(pulse);
}
for (int i = 0; i < 5; ++i)
{
float speed = Main.rand.NextFloat(3f, 6f);
Vector2 dustVel = Vector2.UnitX * speed * speedMultiplier * 1.5f;
Dust d = Dust.NewDustDirect(Projectile.Center, 0, 0, dustID);
d.position = dustPos;
d.velocity = dustVel;
d.noGravity = true;
d.scale *= Main.rand.NextFloat(1.1f, 1.4f);
d.scale *= Main.rand.NextFloat(1.8f, 2.2f) * (1 - speed / 7);
d.color = color;
d.fadeIn = 1;
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.PiOver2);
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi);
Dust.CloneDust(d).velocity = dustVel.RotatedBy(-MathHelper.PiOver2);
+1 -1
View File
@@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Ranged
SoundStyle onKill = new("CalamityMod/Sounds/Item/ScorpioHit");
SoundEngine.PlaySound(onKill with { Volume = 0.25f, Pitch = 0.1f, PitchVariance = 0.3f }, Projectile.Center);
SoundEngine.PlaySound(SoundID.DD2_FlameburstTowerShot with { Volume = 0.8f, Pitch = -0.5f, PitchVariance = 0.3f }, Projectile.Center);
SoundEngine.PlaySound(SoundID.DD2_FlameburstTowerShot with { Volume = 0.4f, Pitch = -0.4f, PitchVariance = 0.3f }, Projectile.Center);
}
}
public override bool PreDraw(ref Color lightColor)