also removed the unnecessary speed blaster dash code c+p
This commit is contained in:
Altixal committed 2024-04-30 01:01:13 +07:00
1 parent e0258aef9e
commit 239ea48a08
6 files changed
+65 -73

No files matched your search

+2 -14
View File
@@ -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;
+5 -24
View File
@@ -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
+12 -11
View File
@@ -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<ElementalSawLingering>(), 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);
}
}
@@ -208,8 +208,7 @@ Buzzkill: {
'''
Hold <left> 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 <left> 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 <left> 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 <right> 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 <right> 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 <right> 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 <right> 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
'''
}
+1 -1
View File
@@ -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);
}
+32 -11
View File
@@ -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<ElementalSawBullet>(), (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<ElementalSawBullet>(), (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<Laceration>(), 180);
target.AddBuff(ModContent.BuffType<ElementalMix>(), 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;