From 239ea48a08def2ade5fac598d695d3efb8f32116 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Tue, 30 Apr 2024 01:01:13 +0700 Subject: [PATCH] extras also removed the unnecessary speed blaster dash code c+p --- CalPlayer/CalamityPlayer.cs | 16 +------ CalPlayer/CalamityPlayerDashEffects.cs | 29 +++---------- Items/Weapons/Ranged/ElementalSaw.cs | 23 +++++----- ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 25 +++++------ Projectiles/Ranged/ElementalSawHoldout.cs | 2 +- Projectiles/Ranged/ElementalSawProj.cs | 43 ++++++++++++++----- 6 files changed, 65 insertions(+), 73 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a0d3ebadb6..07c96a31bb 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4256,20 +4256,8 @@ namespace CalamityMod.CalPlayer if (weakPetrification) WeakPetrification(); - // Disable vanilla dashes during god slayer dash - if (godSlayerDashHotKeyPressed) - { - // Set the player to have no registered vanilla dashes. - Player.dashType = 0; - - // Prevent the possibility of Shield of Cthulhu invulnerability exploits. - Player.eocHit = -1; - if (Player.eocDash != 0) - Player.eocDash = 0; - } - - // Disable vanilla dashes during god slayer dash - if (SpeedBlasterDashStarted) + // Disable vanilla dashes during God Slayer or Speed Blaster dashes + if (godSlayerDashHotKeyPressed || SpeedBlasterDashStarted) { // Set the player to have no registered vanilla dashes. Player.dashType = 0; diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs index 302f69fc37..ab84009495 100644 --- a/CalPlayer/CalamityPlayerDashEffects.cs +++ b/CalPlayer/CalamityPlayerDashEffects.cs @@ -13,8 +13,7 @@ namespace CalamityMod.CalPlayer { public partial class CalamityPlayer : ModPlayer { - public int VerticalGodslayerDashTimer; - public int VerticalSpeedBlasterDashTimer; + public int VerticalOmnidashTimer; private string dashID; //private backing variable @@ -106,16 +105,9 @@ namespace CalamityMod.CalPlayer } } - if (Player.dashDelay > 0) //Speed Blaster - { - VerticalSpeedBlasterDashTimer = 0; - LastUsedDashID = string.Empty; - return; - } - if (Player.dashDelay > 0) { - VerticalGodslayerDashTimer = 0; + VerticalOmnidashTimer = 0; LastUsedDashID = string.Empty; return; } @@ -139,21 +131,10 @@ namespace CalamityMod.CalPlayer // Handle mid-dash effects. UsedDash.MidDashEffects(Player, ref dashSpeed, ref dashSpeedDecelerationFactor, ref runSpeedDecelerationFactor); - if (UsedDash.IsOmnidirectional && VerticalGodslayerDashTimer < 25) + if (UsedDash.IsOmnidirectional && VerticalOmnidashTimer < 25) { - VerticalGodslayerDashTimer++; - if (VerticalGodslayerDashTimer >= 25) - { - Player.dashDelay = dashDelayToApply; - // Stop the player from going flying - Player.velocity *= 0.2f; - } - } - - if (UsedDash.IsOmnidirectional && VerticalSpeedBlasterDashTimer < 25) - { - VerticalSpeedBlasterDashTimer++; - if (VerticalSpeedBlasterDashTimer >= 25) + VerticalOmnidashTimer++; + if (VerticalOmnidashTimer >= 25) { Player.dashDelay = dashDelayToApply; // Stop the player from going flying diff --git a/Items/Weapons/Ranged/ElementalSaw.cs b/Items/Weapons/Ranged/ElementalSaw.cs index c131ac4e8f..22d0067a95 100644 --- a/Items/Weapons/Ranged/ElementalSaw.cs +++ b/Items/Weapons/Ranged/ElementalSaw.cs @@ -90,28 +90,29 @@ namespace CalamityMod.Items.Weapons.Ranged { if (!player.HasCooldown(ElementalSawBoost.ID)) { - player.AddCooldown(ElementalSawBoost.ID, DashCooldown); - player.Calamity().sBlasterDashActivated = true; - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/MeatySlash"), player.Center); - // Throws a lingering saw at the cursor float mouseDist = Vector2.Distance(player.Center, Main.MouseWorld) / 20f; Projectile.NewProjectile(source, player.Center, velocity.SafeNormalize(Vector2.UnitY) * mouseDist, ModContent.ProjectileType(), damage, knockback, Main.myPlayer); + player.AddCooldown(ElementalSawBoost.ID, DashCooldown); + player.Calamity().sBlasterDashActivated = true; + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/MeatySlash"), player.Center); + // If moving, make particle effects when the dash activates if (player.velocity != Vector2.Zero) { - int particleAmt = 7; - for (int c = 0; c < particleAmt; c++) + for (int c = 0; c < 9; c++) { - Color sparkColor = Color.Lerp(new Color(122, 240, 58), new Color(32, 186, 171), c / (particleAmt - 1)); - Particle spark = new CritSpark(player.Center, player.velocity.RotatedByRandom(MathHelper.ToRadians(13f)) * Main.rand.NextFloat(-2.1f, -4.5f), Color.White, sparkColor, 2f, 45, 2.25f, 2f); + Vector2 sparkVel = player.velocity.SafeNormalize(Vector2.UnitY).RotatedByRandom(MathHelper.ToRadians(45f)) * Main.rand.NextFloat(-28f, -36f); + Color sparkColor = Color.Lerp(new Color(150, 255, 60), new Color(60, 255, 220), c / 8f); + Particle spark = new CritSpark(player.Center, sparkVel, Color.White, sparkColor, 2f, 45, 2.25f, 2f); GeneralParticleHandler.SpawnParticle(spark); } - for (int e = 0; e < particleAmt; e++) + for (int e = 0; e < 7; e++) { - Color sparkColor2 = Color.Lerp(new Color(122, 240, 58), new Color(32, 186, 171), e / (particleAmt - 1)); - Particle spark2 = new NanoParticle(player.Center, player.velocity.RotatedByRandom(MathHelper.ToRadians(-MathHelper.PiOver4)) * Main.rand.NextFloat(0.25f, 0.5f), sparkColor2, 1.5f, 45, Main.rand.NextBool(3)); + Vector2 sparkVel2 = player.velocity.SafeNormalize(Vector2.UnitY).RotatedByRandom(MathHelper.ToRadians(36f)) * Main.rand.NextFloat(-4f, -6f); + Color sparkColor2 = Color.Lerp(new Color(150, 255, 60), new Color(60, 255, 220), e / 6f); + Particle spark2 = new NanoParticle(player.Center, sparkVel2, sparkColor2, 1.5f, 45, Main.rand.NextBool(3)); GeneralParticleHandler.SpawnParticle(spark2); } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 72447f79f5..f15297c9a5 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -208,8 +208,7 @@ Buzzkill: { ''' Hold to rev up a buzzsaw that deals close-range damage Release to fire the buzzsaw, which bounces off tiles and lacerates foes - Charging increases the damage and pierce of fired buzzsaws - Does not consume ammo + Revving up the saws increase their damage and allow them to pierce more enemies 'Not to be confused with the Sawed-On Shotgun' ''' } @@ -447,20 +446,21 @@ ElementalSaw: { ''' [MAIN] [ALT] - Does not consume ammo ''' MainInfo: ''' Hold to rev up an elemental buzzsaw that deals close-range damage - Release to fire the buzzsaw, which bounces off tiles and lacerates foes - Fired buzzsaws return to the player after exhausting pierce or shortly after hitting - Charging increases damage of fired buzzsaws and allows them to pierce more before returning + Release to fire the buzzsaw to pierce through and lacerate foes + Fired buzzsaws bounce off tiles and return to the player after winding down + When returning, the saws release extra homing bolts depending on the number of enemy hits + Revving up the saws increase their damage and allow them to pierce more enemies ''' AltInfo: ''' - Press to eject a lingering buzzsaw towards the cursor which propels you while moving - This ability has a cooldown of {0} seconds - While under cooldown, buzzsaws loosely follow the cursor and release homing bolts while returning + Press to eject a lingering buzzsaw towards the cursor that fires homing bolts + Using this ability rapidly propels you in the direction you are moving + This ability has a {0} second cooldown + During this cooldown, buzzsaws have homing and constantly release homing bolts while returning ''' } @@ -1163,9 +1163,10 @@ SpeedBlaster: { Tooltip: ''' Rapidly fires phosphorescent paintball shots - Press to eject a powerful glob which propels you while moving - This ability has a cooldown of {0} seconds - While under cooldown, you fire more rapidly with greater accuracy + Press to eject a powerful paint stream of a different color + Using this ability rapidly propels you in the direction you are moving + This ability has a {0} second cooldown + During this cooldown, you fire more rapidly with greater accuracy ''' } diff --git a/Projectiles/Ranged/ElementalSawHoldout.cs b/Projectiles/Ranged/ElementalSawHoldout.cs index 10a67a9908..39f30c7a29 100644 --- a/Projectiles/Ranged/ElementalSawHoldout.cs +++ b/Projectiles/Ranged/ElementalSawHoldout.cs @@ -180,7 +180,7 @@ namespace CalamityMod.Projectiles.Ranged { Vector2 smokeVelocity = Vector2.UnitY * Main.rand.NextFloat(-7f, -12f); smokeVelocity = smokeVelocity.RotatedByRandom(MathHelper.Pi / 8f); - Color smokeColor = Main.rand.NextBool() ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Color.Gray; + Color smokeColor = Main.rand.NextBool() ? Main.DiscoColor : Color.Gray; Particle fullChargeSmoke = new HeavySmokeParticle(GunTipPosition + Main.rand.NextVector2CircularEdge(3f, 3f), smokeVelocity, smokeColor, 30, 0.65f, 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), true); GeneralParticleHandler.SpawnParticle(fullChargeSmoke); } diff --git a/Projectiles/Ranged/ElementalSawProj.cs b/Projectiles/Ranged/ElementalSawProj.cs index 3c3e161807..c8aef844cc 100644 --- a/Projectiles/Ranged/ElementalSawProj.cs +++ b/Projectiles/Ranged/ElementalSawProj.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged // While empowered, the saws while slightly home in on the cursor if (Empowered && !Returning && Time > 30) { - float homingTurnSpeed = 0.11f; + float homingTurnSpeed = 0.18f; Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.SafeDirectionTo(Main.MouseWorld).ToRotation(), homingTurnSpeed).ToRotationVector2() * ElementalSaw.ShootSpeed; } @@ -99,15 +99,22 @@ namespace CalamityMod.Projectiles.Ranged // Spawns a burst of homing bolts when it starts returning, based on how many tiles and enemies it hit if (ReturnTimer == ReturnDelay + 30) { - int boltPairs = Math.Min(Projectile.numHits, MaxBoltPairs); - for (int b = 0; b < boltPairs; b++) + int boltCount = Math.Min(Projectile.numHits, MaxBoltPairs) * 2; + for (int b = 0; b < boltCount; b++) { - for (int p = 0; p < 2; p++) - { - Vector2 randBoltVelocity = Main.rand.NextVector2Unit() * 9f; - if (Main.myPlayer == Projectile.owner) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, randBoltVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0f, Main.myPlayer); - } + Vector2 randBoltVelocity = Main.rand.NextVector2Unit() * 9f; + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, randBoltVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0f, Main.myPlayer); + } + + // Extra burst of sparks for cool points + float sparkCount = 6f + 5f * SawLevel; + for (float i = 0f; i < sparkCount; i++) + { + Vector2 velocity = Main.rand.NextVector2Unit() * (12f + 10f * SawLevel); + float sparkScale = 1f + 0.25f * SawLevel; // Bloom effect is double the spark's size + Particle sparkle = new CritSpark(Projectile.Center, velocity, Color.White, Color.Lime, sparkScale, 30, 0.1f, sparkScale, Main.rand.NextFloat(0f, 0.01f)); + GeneralParticleHandler.SpawnParticle(sparkle); } } @@ -146,6 +153,16 @@ namespace CalamityMod.Projectiles.Ranged } } } + else + { + // A bit of dust while travelling + if (Main.rand.NextBool()) + { + Color dustColor = Empowered ? Main.DiscoColor : new Color(Main.DiscoR, 255, 60); + Dust trail = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowTorch, Projectile.velocity.X * 0.05f, Projectile.velocity.Y * 0.05f, 150, dustColor, 1.2f); + trail.noGravity = true; + } + } // Rainbow smear particles which follow the path of the slashes if (Empowered) @@ -207,7 +224,7 @@ namespace CalamityMod.Projectiles.Ranged GeneralParticleHandler.SpawnParticle(collisionSparks); } - SoundEngine.PlaySound(Main.zenithWorld ? TileCollideGFB : SoundID.Item178 with { Pitch = 0.15f * Projectile.numHits }, Projectile.Center); // Placeholder sound + SoundEngine.PlaySound(Main.zenithWorld ? TileCollideGFB : SoundID.Item178 with { Pitch = 0.1f * Projectile.numHits }, Projectile.Center); // Placeholder sound if (Projectile.velocity.X != oldVelocity.X) Projectile.velocity.X = -oldVelocity.X; if (Projectile.velocity.Y != oldVelocity.Y) @@ -228,7 +245,11 @@ namespace CalamityMod.Projectiles.Ranged { target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 90); - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice") with { Pitch = 0.15f * Projectile.numHits }, Projectile.Center); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice") with { Pitch = 0.1f * Projectile.numHits }, Projectile.Center); + + // Hits slow down the forward-firing saw + if (!Returning && !Empowered) + Projectile.velocity *= 0.5f; if (Projectile.numHits < 1) ReturnTimer = 1;