Speed Blaster Boost cooldown
This commit is contained in:
1 parent
da31af9faf
commit
e4206e067b
8 files changed
+28
-10
No files matched your search
@@ -79,7 +79,6 @@ namespace CalamityMod.CalPlayer
|
||||
public bool killSpikyBalls = false;
|
||||
public float KameiTrailXScale = 0.1f;
|
||||
public int KameiBladeUseDelay = 0;
|
||||
public int SpeedBlasterDashDelayCooldown = 0;
|
||||
public Vector2[] OldPositions = new Vector2[4];
|
||||
public double contactDamageReduction = 0D;
|
||||
public double projectileDamageReduction = 0D;
|
||||
@@ -3033,10 +3032,11 @@ namespace CalamityMod.CalPlayer
|
||||
//Right click dash on Speed Blaster
|
||||
if (sBlasterDashActivated == true)
|
||||
{
|
||||
if ((Player.controlUp || Player.controlDown || Player.controlLeft || Player.controlRight) && !Player.pulley && Player.grappling[0] == -1 && !Player.tongued && !Player.mount.Active && SpeedBlasterDashDelayCooldown == SpeedBlaster.DashCooldown && Player.dashDelay == 0)
|
||||
if ((Player.controlUp || Player.controlDown || Player.controlLeft || Player.controlRight) && !Player.pulley && Player.grappling[0] == -1 && !Player.tongued && !Player.mount.Active && Player.HasCooldown(Cooldowns.SpeedBlasterBoost.ID) && Player.dashDelay == 0)
|
||||
{
|
||||
SpeedBlasterDashStarted = true;
|
||||
}
|
||||
sBlasterDashActivated = false;
|
||||
}
|
||||
|
||||
if (Player.Calamity().SpeedBlasterDashStarted || (Player.dashDelay != 0 && Player.Calamity().LastUsedDashID == SpeedBlasterDash.ID))
|
||||
|
||||
@@ -1361,8 +1361,6 @@ namespace CalamityMod.CalPlayer
|
||||
phantomicBulwarkCooldown--;
|
||||
if (KameiBladeUseDelay > 0)
|
||||
KameiBladeUseDelay--;
|
||||
if (SpeedBlasterDashDelayCooldown > 0)
|
||||
SpeedBlasterDashDelayCooldown--;
|
||||
if (galileoCooldown > 0)
|
||||
galileoCooldown--;
|
||||
if (dragonRageCooldown > 0)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Localization;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public class SpeedBlasterBoost : CooldownHandler
|
||||
{
|
||||
public static new string ID => "SpeedBlasterBoost";
|
||||
public override bool ShouldDisplay => true;
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
|
||||
public override string Texture => "CalamityMod/Cooldowns/SpeedBlasterBoost";
|
||||
public override Color OutlineColor => new Color(207, 207, 207);
|
||||
public override Color CooldownStartColor => new Color(235, 33, 130);
|
||||
public override Color CooldownEndColor => new Color(39, 227, 208);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 359 B |
Binary file not shown.
|
After Width: | Height: | Size: 213 B |
Binary file not shown.
|
After Width: | Height: | Size: 175 B |
@@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.Calamity().SpeedBlasterDashDelayCooldown > 0 && player.altFunctionUse == 2)
|
||||
if (player.HasCooldown(Cooldowns.SpeedBlasterBoost.ID) && player.altFunctionUse == 2)
|
||||
{
|
||||
SoundEngine.PlaySound(Empty, player.Center);
|
||||
return false;
|
||||
@@ -67,14 +67,14 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-1, -6);
|
||||
|
||||
// Increased fire rate after dashing
|
||||
public override float UseSpeedMultiplier(Player player) => player.Calamity().SpeedBlasterDashDelayCooldown > 0 ? FireRatePowerup : 1f;
|
||||
public override float UseSpeedMultiplier(Player player) => player.HasCooldown(Cooldowns.SpeedBlasterBoost.ID) ? FireRatePowerup : 1f;
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
// Reposition all shots to the gun's tip
|
||||
Vector2 newPos = position + new Vector2(38f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation());
|
||||
|
||||
// Big dashing shot
|
||||
if (player.altFunctionUse == 2 && player.Calamity().SpeedBlasterDashDelayCooldown == 0)
|
||||
if (player.altFunctionUse == 2 && !(player.HasCooldown(Cooldowns.SpeedBlasterBoost.ID)))
|
||||
{
|
||||
// Switches the color of the next shots, including this one
|
||||
if (ColorValue >= 4f)
|
||||
@@ -85,7 +85,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Projectile.NewProjectile(source, newPos, velocity, type, (int)(damage * DashShotDamageMult), knockback, player.whoAmI, ColorValue, 3f);
|
||||
|
||||
// Activate the dash and cooldown
|
||||
player.Calamity().SpeedBlasterDashDelayCooldown = DashCooldown;
|
||||
player.AddCooldown(Cooldowns.SpeedBlasterBoost.ID, DashCooldown);
|
||||
player.Calamity().sBlasterDashActivated = true;
|
||||
|
||||
// If moving, emit particles to signal the dash
|
||||
@@ -102,8 +102,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Add inaccuracy to regular shots; powered up shots are more accurate
|
||||
Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(player.Calamity().SpeedBlasterDashDelayCooldown > 0 ? 3f : 15f));
|
||||
float ShotMode = player.Calamity().SpeedBlasterDashDelayCooldown > 0 ? 2f : 0f;
|
||||
Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(player.HasCooldown(Cooldowns.SpeedBlasterBoost.ID) ? 3f : 15f));
|
||||
float ShotMode = player.HasCooldown(Cooldowns.SpeedBlasterBoost.ID) ? 2f : 0f;
|
||||
Projectile.NewProjectile(source, newPos, newVel, type, damage, knockback, player.whoAmI, ColorValue, ShotMode);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,7 @@ Cooldowns: {
|
||||
SandsmokeBombActive: Sandsmoke Bomb Duration
|
||||
SandsmokeBombCooldown: Sandsmoke Bomb Cooldown
|
||||
SilvaRevive: Silva Revive Cooldown
|
||||
SpeedBlasterBoost: Speed Blaster Boost
|
||||
SpongeDurability: Sponge Barrier Durability
|
||||
SpongeRecharge: Sponge Barrier Recharge
|
||||
TarragonCloak: Tarragon Cloak Cooldown
|
||||
|
||||
Reference in new issue
Block a user