Lucrecia (+lightspeed kinda) changes

- Slowed down base swing speed/frequency for the M1 but increased its energy gain on hit and hitbox size to compensate (hitbox was deceptively small to begin with compared to the visuals); this will require additional testing since it is likely worse overall
- Removed the M1’s projectile hitsound and replaced the sound that plays when reaching max energy (since both Lucrecia and Lightspeed share the latter, it affects both of them)
- Resource is now named “Darklight Energy” and all mentions of the resource have been adjusted accordingly
- Small sparkles burst from the player when at max energy
- More sensible internal naming schemes
- Multiple minor visual adjustments to the M1, the M2, and their projectiles
This commit is contained in:
Nathanael Overton committed 2025-12-21 16:41:55 -05:00
1 parent 7e144f0e80
commit ed13dc3274
15 files changed
+132 -88

No files matched your search

+5 -5
View File
@@ -286,10 +286,10 @@ namespace CalamityMod.CalPlayer
public int deadSunCounter = 6;
public int DragonsBreathAudioCooldown = 0;
public int DragonsBreathAudioCooldown2 = 0;
public int lucreciaEnergy = 0;
public int lucreciaEnergyTimer = 0;
public bool lucreciaEnergyPaused = false;
public bool lucreciaEnergyMaxSFXPlayed = false;
public int darklightEnergy = 0;
public int darklightEnergyTimer = 0;
public bool darklightEnergyPaused = false;
public bool darklightEnergyMaxFXPlayed = false;
private int lucreciaParticleTimer = 0;
public int elementalMastery = 0;
public int elementalMasteryTimer = 0;
@@ -3256,7 +3256,7 @@ namespace CalamityMod.CalPlayer
burningSeaBurnOut = 0;
flareGunOverheat = 0;
hellbornShots = 0;
lucreciaEnergy = 0;
darklightEnergy = 0;
elementalMastery = 0;
garandShots = 0;
persecutedEnchantSummonTimer = 0;
+51 -30
View File
@@ -386,50 +386,61 @@ namespace CalamityMod.CalPlayer
Lighting.AddLight(Player.Center, Color.MediumOrchid.ToVector3());
}
if (Player.HeldItem.type == ModContent.ItemType<Lucrecia>() && lucreciaEnergy > 0)
if (Player.HeldItem.type == ModContent.ItemType<Lucrecia>() && darklightEnergy > 0)
{
if (lucreciaEnergy == Lucrecia.MaxEnergy && !lucreciaEnergyPaused)
if (darklightEnergy == Lucrecia.MaxEnergy && !darklightEnergyPaused)
{
lucreciaEnergyPaused = true;
lucreciaEnergyTimer = 0;
darklightEnergyPaused = true;
darklightEnergyTimer = 0;
}
lucreciaEnergyTimer++;
darklightEnergyTimer++;
// If the energy is at max, pause for 180 ticks
if (lucreciaEnergyPaused)
if (darklightEnergyPaused)
{
if (lucreciaEnergyTimer >= 1 && !lucreciaEnergyMaxSFXPlayed)
if (darklightEnergyTimer >= 1 && !darklightEnergyMaxFXPlayed)
{
SoundEngine.PlaySound(SoundID.Item79 with { Volume = 1.6f, Pitch = 0.4f }, Player.Center);
lucreciaEnergyMaxSFXPlayed = true;
SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged");
SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center);
for (int i = 0; i < 10; i++) // Circular ring of particles burst from player
{
float angle = MathHelper.TwoPi * (i / 10f);
Vector2 spawnDirection = angle.ToRotationVector2();
Vector2 velocity = spawnDirection * 14f;
CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f);
GeneralParticleHandler.SpawnParticle(spark);
}
darklightEnergyMaxFXPlayed = true;
}
// If the pause is Done, resume decrementing.
if (lucreciaEnergyTimer >= 180)
if (darklightEnergyTimer >= 180)
{
lucreciaEnergyPaused = false;
lucreciaEnergyTimer = 0;
lucreciaEnergy--;
darklightEnergyPaused = false;
darklightEnergyTimer = 0;
darklightEnergy--;
}
}
else // Decrementing
{
lucreciaEnergyMaxSFXPlayed = false;
darklightEnergyMaxFXPlayed = false;
// Once every 20 ticks
if (lucreciaEnergyTimer >= 20)
if (darklightEnergyTimer >= 20)
{
lucreciaEnergy--;
lucreciaEnergyTimer = 0;
darklightEnergy--;
darklightEnergyTimer = 0;
}
}
}
else
{
// Reset all energy variables when not holding the weapon
lucreciaEnergyTimer = 0;
lucreciaEnergyPaused = false;
lucreciaEnergy = 0;
darklightEnergyTimer = 0;
darklightEnergyPaused = false;
darklightEnergy = 0;
}
if (Player.HeldItem.type == ModContent.ItemType<Lightspeed>() && elementalMastery > 0)
@@ -447,9 +458,19 @@ namespace CalamityMod.CalPlayer
{
if (elementalMasteryTimer >= 1 && !elementalMasterySFXPlayed)
{
SoundEngine.PlaySound(SoundID.Item79 with { Volume = 1.6f, Pitch = 0.4f }, Player.Center);
elementalMasterySFXPlayed = true;
SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged");
SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center);
for (int i = 0; i < 10; i++) // Circular ring of particles burst from player
{
float angle = MathHelper.TwoPi * (i / 10f);
Vector2 spawnDirection = angle.ToRotationVector2();
Vector2 velocity = spawnDirection * 14f;
CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f);
GeneralParticleHandler.SpawnParticle(spark);
}
elementalMasterySFXPlayed = true;
}
// If the pause is Done, resume decrementing.
if (elementalMasteryTimer >= 180)
@@ -4478,7 +4499,7 @@ namespace CalamityMod.CalPlayer
int lucreciaItemID = ModContent.ItemType<Lucrecia>();
int lightspeedItemID = ModContent.ItemType<Lightspeed>();
if (Player.HeldItem.type == lucreciaItemID && lucreciaEnergy > 0)
if (Player.HeldItem.type == lucreciaItemID && darklightEnergy > 0)
{
lucreciaParticleTimer--;
@@ -4486,7 +4507,7 @@ namespace CalamityMod.CalPlayer
if (lucreciaParticleTimer <= 0)
{
// Reset the timer (spawn rate depends on energy)
lucreciaParticleTimer = (int)(20 - 15 * (lucreciaEnergy / 60));
lucreciaParticleTimer = (int)(20 - 15 * (darklightEnergy / 60));
float radius = Main.rand.NextFloat(160f, 190f); // Distance from center
float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius
@@ -4494,13 +4515,13 @@ namespace CalamityMod.CalPlayer
Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius;
// Scale opacity with energy
float opacity = lucreciaEnergy / (float)Lucrecia.MaxEnergy;
float opacity = darklightEnergy / (float)Lucrecia.MaxEnergy;
Color color = Main.rand.NextBool() ? Color.MediumPurple : Color.CornflowerBlue;
color *= opacity;
color *= opacity * 0.5f;
if (lucreciaEnergy >= 100)
if (darklightEnergy >= 100)
{
color *= 1.6f; // Brighter
color *= 2.4f; // Way brighter
}
Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path
@@ -4529,11 +4550,11 @@ namespace CalamityMod.CalPlayer
// Scale opacity with energy
float opacity = elementalMastery / (float)Lightspeed.MaxEnergy;
Color color = Main.rand.NextBool() ? Color.Aqua : Color.OrangeRed;
color *= opacity;
color *= opacity * 0.5f;
if (elementalMastery >= 100)
{
color *= 1.6f; // Brighter
color *= 2.4f; // Way brighter
}
Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path
@@ -11,13 +11,13 @@ using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Cooldowns
{
public class LucreciaEnergy : CooldownHandler
public class DarklightEnergy : CooldownHandler
{
private float AdjustedCompletion => instance.timeLeft / (float)Lucrecia.MaxEnergy;
private Color TextColor => Color.MediumPurple;
private Color TextBorderColor = Color.AntiqueWhite;
public static new string ID => "LucreciaEnergy";
public static new string ID => "DarklightEnergy";
public override bool CanTickDown => false;
public override bool ShouldDisplay => instance.player.HeldItem.type == ItemType<Lucrecia>();
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
File renamed without changes.

Before

Width:  |  Height:  |  Size: 490 B

After

Width:  |  Height:  |  Size: 490 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 239 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 184 B

+4 -4
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee
public static int MaxEnergy = 100;
public override int ProjectileType => ModContent.ProjectileType<LucreciaProj>();
public override int ProjectileType => ModContent.ProjectileType<LucreciaHoldout>();
public override void SetDefaults()
{
@@ -45,13 +45,13 @@ namespace CalamityMod.Items.Weapons.Melee
public override void HoldItem(Player player)
{
if (player.Calamity().cooldowns.TryGetValue(LucreciaEnergy.ID, out var cooldown))
if (player.Calamity().cooldowns.TryGetValue(DarklightEnergy.ID, out var cooldown))
{
cooldown.timeLeft = player.Calamity().lucreciaEnergy;
cooldown.timeLeft = player.Calamity().darklightEnergy;
}
else
{
player.AddCooldown(LucreciaEnergy.ID, 0);
player.AddCooldown(DarklightEnergy.ID, 0);
}
}
@@ -816,8 +816,8 @@ Lucrecia: {
Tooltip:
'''
[c/9370db:Fires a spiraling darklight shard when swung]
[c/837ce4:Hits with the blade itself build energy]
[c/7489ee:Energy is lost over time but briefly stops depleting after reaching its maximum]
[c/837ce4:Hits with the blade itself build Darklight Energy]
[c/7489ee:Darklight Energy is lost over time but briefly stops depleting after reaching its maximum]
[c/6495f7:Press <right> with maximum energy to fire a double helix comet]
'''
}
@@ -163,10 +163,10 @@ LightningThing.DisplayName: Lightning
LightspeedDashHitbox.DisplayName: Lightspeed Rupture
LightspeedHoldout.DisplayName: Lightspeed
LightspeedM1Hitbox.DisplayName: Lightspeed Stab
LucreciaProj.DisplayName: Lucrecia
LucreciaDNATrailCreator.DisplayName: Lucrecia DNA
LucreciaDoubleHelix.DisplayName: Lucrecia Helix Comet
LucreciaSmallProjectile.DisplayName: Lucrecia
LucreciaDNATrailCreator.DisplayName: Darklight Comet Trail
LucreciaDoubleHelix.DisplayName: Darklight Comet
LucreciaHoldout.DisplayName: Lucrecia Holdout
LucreciaShard.DisplayName: Lucrecia Shard
LuxorsGiftMelee.DisplayName: Luxor's Melee
MantisClawHoldout.DisplayName: Mantis Claw
MantisClawJet.DisplayName: Mantis Claw Jet
@@ -313,3 +313,4 @@ WulfrumScrew.DisplayName: Wulfrum Screw
WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver
YinYoDark.DisplayName: Dark Shard
YinYoLight.DisplayName: Light Shard
LucreciaBolt.DisplayName: Lucrecia Bolt
+1 -1
View File
@@ -102,6 +102,7 @@ Cooldowns: {
BubblyBurrowActive: Bubbly Burrow
BubblyBurrowCooldown: Bubbly Burrow Cooldown
ChaosState: Teleportation Cooldown
DarklightEnergy: Darklight Energy
DivineBless: Divine Bless Cooldown
DSOCritCooldown: Extra Critical Strike Chance
ParryCooldown: Parry Ability Cooldown
@@ -119,7 +120,6 @@ Cooldowns: {
KillModeCooldown: Kill Mode Cooldown
LifeSteal: Life Steal Cooldown
LionHeartShield: Energy Shell Cooldown
LucreciaEnergy: Lucrecia Energy
M1GarandShots: Chambered Rounds
MasterChefShieldDurability: MJOLNIR Shield Level
MasterChefShieldRecharge: MJOLNIR Shield Recharge
@@ -14,7 +14,7 @@ using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Projectiles.Melee
{
public class LucreciaSmallProjectile : ModProjectile, ILocalizedModType
public class LucreciaBolt : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
@@ -99,12 +99,6 @@ namespace CalamityMod.Projectiles.Melee
Projectile.ai[1] = 1f;
}
public override void OnKill(int timeLeft)
{
SoundStyle projectile = new("CalamityMod/Sounds/Item/LucreciaBoltImpact");
SoundEngine.PlaySound(projectile with { Volume = 0.9f, Pitch = Main.rand.NextFloat(-0.06f, 0.1f) }, Projectile.Center);
}
public override Color? GetAlpha(Color lightColor) => Color.Lerp(Color.MediumPurple, Color.CornflowerBlue, 0.5f) with { A = 0 } * Projectile.Opacity;
public float TrailWidth(float completionRatio, Vector2 vertexPos)
+23 -6
View File
@@ -51,11 +51,15 @@ namespace CalamityMod.Projectiles.Melee
float sineWave = (float)Math.Cos(trailTimer * frequency);
// Calculate offset based on the pattern of the sinewave and subtract the proj's dimensions to be accurate
Vector2 offsetLeft = (perpendicular * amplitude * sineWave) - new Vector2(Projectile.width, Projectile.height);
Vector2 offsetRight = (-perpendicular * amplitude * sineWave) - new Vector2(Projectile.width, Projectile.height);
Vector2 offsetLeft = (perpendicular * amplitude * sineWave);
Vector2 offsetRight = (-perpendicular * amplitude * sineWave);
oldPositionsLeft.Add(Projectile.Center + offsetLeft);
oldPositionsRight.Add(Projectile.Center + offsetRight);
Vector2 adjustedOffsetLeft = offsetLeft - new Vector2(Projectile.width, Projectile.height);
Vector2 adjustedOffsetRight = offsetRight - new Vector2(Projectile.width, Projectile.height);
// Store newest trail positions as points to render later
oldPositionsLeft.Add(Projectile.Center + adjustedOffsetLeft);
oldPositionsRight.Add(Projectile.Center + adjustedOffsetRight);
// The timer will now correctly decrease once per AI update.
middleStreakTimer--;
@@ -72,9 +76,22 @@ namespace CalamityMod.Projectiles.Melee
GeneralParticleHandler.SpawnParticle(spark2);
}
// Chance to spawn small light particles along the trail
if (trailTimer % 7 == 0 && Main.rand.NextBool())
{
// Use the unmodified offsets to align particle positions w/ the prim trails
Vector2 purpleTrailOrigin = Projectile.Center + offsetLeft;
Vector2 blueTrailOrigin = Projectile.Center + offsetRight;
// Remove old positions after 120
int maxTrailLength = 120;
Particle purpleLightEmission = new SquishyLightParticle(purpleTrailOrigin, -Projectile.velocity.RotatedByRandom(MathHelper.PiOver4 * 0.5f) * Main.rand.NextFloat(2f, 4f), Main.rand.NextFloat(0.3f, 0.6f), Color.MediumPurple, Main.rand.Next(18, 46), 1, 1.5f);
Particle blueLightEmission = new SquishyLightParticle(blueTrailOrigin, -Projectile.velocity.RotatedByRandom(MathHelper.PiOver4 * 0.5f) * Main.rand.NextFloat(2f, 4f), Main.rand.NextFloat(0.3f, 0.6f), Color.CornflowerBlue, Main.rand.Next(18, 46), 1, 1.5f);
GeneralParticleHandler.SpawnParticle(blueLightEmission);
GeneralParticleHandler.SpawnParticle(purpleLightEmission);
}
// Remove old positions after 150
int maxTrailLength = 150;
if (oldPositionsLeft.Count > maxTrailLength)
oldPositionsLeft.RemoveAt(0);
if (oldPositionsRight.Count > maxTrailLength)
@@ -12,7 +12,7 @@ using CalamityMod.Sounds;
namespace CalamityMod.Projectiles.Melee
{
public class LucreciaProj : BaseSwordHoldoutProjectile, ILocalizedModType
public class LucreciaHoldout : BaseSwordHoldoutProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override bool useMeleeSpeed => true;
@@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Melee
public override int CooldownTime { get; set; }
public override int swingTime { get; set; }
public override bool AlternateSwings { get => base.AlternateSwings; set => base.AlternateSwings = value; }
public override float lineCollisionLength => 82;
public override float lineCollisionLength => 158;
public bool helixFired = false;
public bool gotEnergyThisSwing = false;
@@ -34,8 +34,8 @@ namespace CalamityMod.Projectiles.Melee
public bool sparkTriggered = false;
public int standardStartupTime = 8;
public int standardSwingTime = 14;
public int standardCooldownTime = 7;
public int standardSwingTime = 10;
public int standardCooldownTime = 12;
private bool IsThrusting => Projectile.localAI[0] == 1;
public bool IsAlternateThrust { get; set; }
public int thrustStartupTime = 33;
@@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee
public override void Defaults()
{
Projectile.extraUpdates = 6;
Projectile.extraUpdates = 3;
Projectile.noEnchantmentVisuals = true;
Projectile.Opacity = 0.2f; // Starting point, fades in quickly upon startup
Projectile.width = Projectile.height = 54;
@@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee
if (player.altFunctionUse == 2)
{
// Check for energy before the projectile exists
if (calamityPlayer.lucreciaEnergy < 100)
if (calamityPlayer.darklightEnergy < 100)
{
Projectile.Kill();
return;
@@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Melee
RotateInCooldown = 1f;
Projectile.knockBack = 15f;
calamityPlayer.lucreciaEnergy = 0; // Remove energy for startup
calamityPlayer.darklightEnergy = 0; // Remove energy for startup
}
else
{
@@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Melee
if (inStartup)
{
trailFXTriggered = false; // Reset bool just in case
Projectile.Opacity += 0.01f; // Fade in
Projectile.Opacity += 0.02f; // Fade in
Projectile.scale = baseScale * MathHelper.Lerp(1f, 0.85f, MathF.Pow(StartupCompletion, 0.3f));
if (StartupCompletion >= 0.12f && !playedAlternateThrustStartupWhoosh)
@@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Melee
playedAlternateThrustStartupWhoosh = true;
}
// Every 8 ticks during this part of startup, release a sparkle.
// Every 8 ticks during this part of startup, release a sparkle and a smear effect.
if (StartupCompletion > 0.12f && StartupCompletion < 0.44f)
{
if (timer % 8 == 0)
@@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Melee
Particle sparkle = new CritSpark(pos, new Vector2(7f, 0).RotatedBy(Projectile.rotation), Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f);
GeneralParticleHandler.SpawnParticle(sparkle);
}
Particle smear = new CircularSmearVFX(player.Center, Color.CornflowerBlue * 0.25f, Projectile.rotation, Projectile.scale * 1.25f);
Particle smear = new CircularSmearVFX(player.Center, Color.CornflowerBlue * 0.35f, Projectile.rotation, Projectile.scale * 1.25f);
GeneralParticleHandler.SpawnParticle(smear);
}
@@ -140,21 +140,27 @@ namespace CalamityMod.Projectiles.Melee
float eased = 0.5f - 0.5f * MathF.Cos(MathHelper.Pi * t);
thrustSpinRotation = eased * MathHelper.TwoPi;
// Adjust arm rotation along with the spin
float baseAngle = player.Center.DirectionTo(Main.MouseWorld).ToRotation();
float totalRotation = baseAngle + (thrustSpinRotation * player.direction);
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, totalRotation - MathHelper.PiOver2);
// Pull back
if (StartupCompletion >= 0.5f)
{
float easedPullback = MathF.Pow((StartupCompletion - 0.5f) * 2f, 0.3f);
OffsetDistance = (int)MathHelper.Lerp(44, 34, easedPullback);
}
else
{
OffsetDistance = 44;
OffsetDistance = 50;
}
}
else if (inCooldown)
{
Projectile.Opacity -= 0.0135f;
Projectile.Opacity -= 0.025f;
// During cooldown, pull back slightly
Projectile.scale = baseScale * MathHelper.Lerp(1.4f, 1.25f, CooldownCompletion);
@@ -176,7 +182,6 @@ namespace CalamityMod.Projectiles.Melee
Vector2 mousePosition = Main.MouseWorld;
Vector2 fireDirection = Vector2.Normalize(mousePosition - player.Center);
// Fire the bigass projectile
if (!trailFXTriggered)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center, fireDirection * 5, ModContent.ProjectileType<LucreciaDNATrailCreator>(), Projectile.damage * 8, Projectile.knockBack, Projectile.owner, 0f, 0f);
@@ -210,7 +215,7 @@ namespace CalamityMod.Projectiles.Melee
{
if (inStartup)
{
Projectile.Opacity += 0.01f; // Fade in
Projectile.Opacity += 0.02f; // Fade in
gotEnergyThisSwing = false;
helixFired = false;
Projectile.scale = baseScale * MathHelper.Lerp(0.625f, 0.8f, StartupCompletion);
@@ -219,7 +224,7 @@ namespace CalamityMod.Projectiles.Melee
else if (inCooldown)
{
helixFired = false;
Projectile.Opacity -= 0.09f;
Projectile.Opacity -= 0.1f;
Projectile.scale = baseScale * MathHelper.Lerp(0.85f, 0.625f, CooldownCompletion);
}
@@ -239,18 +244,21 @@ namespace CalamityMod.Projectiles.Melee
var fireDirection = Vector2.Normalize(mousePosition - player.Center);
var helixSpeed = 12f;
var helixVelocity = fireDirection * helixSpeed;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center + fireDirection * 3, helixVelocity, ModContent.ProjectileType<LucreciaSmallProjectile>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center + fireDirection * 3, helixVelocity, ModContent.ProjectileType<LucreciaBolt>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
SoundStyle projectile = new("CalamityMod/Sounds/Item/LucreciaBoltFire");
SoundEngine.PlaySound(projectile with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.06f, 0.1f) }, Projectile.Center);
}
// Matched easing from SwingFunction
var t = MathHelper.Clamp(SwingCompletion, 0f, 1f);
var parabola = 1f - MathF.Pow(t - 0.5f, 2f) * 4f;
float easedMovement = MathF.Pow(t, 0.4f);
var parabola = 1f - MathF.Pow(easedMovement - 0.5f, 2f) * 4f;
OffsetDistance = (int)MathHelper.Lerp(36 * 1f, 36 * 1.435f, parabola);
var upPhase = t <= 0.5f ? t / 0.5f : (1f - t) / 0.5f;
var eased = MathF.Pow(upPhase, 2.6f);
Projectile.scale = baseScale * MathHelper.Lerp(0.8f, 1.4f, eased);
var upPhase = easedMovement <= 0.5f ? easedMovement * 0.5f : (1f - easedMovement) * 0.5f;
var scaleEase = MathF.Pow(upPhase, 2.6f);
Projectile.scale = baseScale * MathHelper.Lerp(0.8f, 1.4f, scaleEase);
// Every 5 ticks during swing, release a particle
if (t > 0.05f && t < 0.5f)
@@ -288,13 +296,16 @@ namespace CalamityMod.Projectiles.Melee
if (modplayer.swingNum % 2 == 1)
swingDirection *= -1;
var parabolicFactorPrimary = 1f - MathF.Pow(SwingCompletion - 0.5f, 2f) * 4f;
parabolicFactorPrimary = MathHelper.Clamp(parabolicFactorPrimary, 0f, 1f);
Projectile.localAI[0] = parabolicFactorPrimary;
float easedCompletion = MathF.Pow(SwingCompletion, 0.4f);
var startAnglePrimary = -swingWidth / 2.15f;
var endAnglePrimary = swingWidth / 2.15f;
var trueAnglePrimary = MathHelper.Lerp(startAnglePrimary, endAnglePrimary, SwingCompletion);
var trueAnglePrimary = MathHelper.Lerp(startAnglePrimary, endAnglePrimary, easedCompletion);
// Tie arc's path to easedCompletion
var parabolicFactorPrimary = 1f - MathF.Pow(easedCompletion - 0.5f, 2f) * 4f;
parabolicFactorPrimary = MathHelper.Clamp(parabolicFactorPrimary, 0f, 1f);
Projectile.localAI[0] = parabolicFactorPrimary;
return MathHelper.ToRadians(trueAnglePrimary * -swingDirection);
}
@@ -311,9 +322,9 @@ namespace CalamityMod.Projectiles.Melee
var player = Main.player[Projectile.owner];
var modPlayer = player.Calamity();
// +22 energy on hit
modPlayer.lucreciaEnergy += 22;
modPlayer.lucreciaEnergy = Math.Min(modPlayer.lucreciaEnergy, Lucrecia.MaxEnergy);
// +25 energy on hit
modPlayer.darklightEnergy += 25;
modPlayer.darklightEnergy = Math.Min(modPlayer.darklightEnergy, Lucrecia.MaxEnergy);
// On-hit cut FX
int points = 2;
Binary file not shown.