Anticheese for the sashes

No it doesn't PREVENT cheese, but it does make it not so easy to do and shouldn't effect normal use much
This commit is contained in:
Xyk committed 2025-04-04 14:42:13 -07:00
1 parent 48b35b2b92
commit 8e37d6f092
6 files changed
+44 -27

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@
#region Dashes and Dodges
// Dash cooldowns (in frames)
internal const int UniversalDashCooldown = 30;
internal const int UniversalSashDashCooldown = 23;
internal const int UniversalSashDashCooldown = 30;
internal const int UniversalShieldSlamCooldown = 30;
internal const int UniversalShieldBonkCooldown = 30;
internal const int OnShieldBonkCooldown = 30;
+5 -3
View File
@@ -783,9 +783,11 @@ namespace CalamityMod.CalPlayer
public int gloveLevel = 0;
public bool alreadyHasFrogLeg = false; // Unused, intended to prevent Frog Leg tinker stacking
public bool eTalisman = false;
/// <summary> Counter variable used for spawning Statis' Void Sash's scythes when dashing. </summary>
public int statisTimer = 0;
public bool statisNinjaBelt = false;
/// <summary> Used to keep track of how many dashes in the same direction you make to prevent dashing away from bosses forever at max efficency. </summary>
public int statisPenaltyTimer = 0;
public int statisAnticheese = 0;
public int statisTimerMax => (int)(Utils.Remap(statisAnticheese, 1, 6, 120, 50, true));
public bool voidSashVisuals = true;
public bool statisVoidSash = false;
public bool nucleogenesis = false;
@@ -2877,7 +2879,7 @@ namespace CalamityMod.CalPlayer
scuttlerCooldown = 0;
rogueCrownCooldown = 0;
wingProjectileCooldown = 0;
statisTimer = 0;
statisPenaltyTimer = -1;
hallowedRuneCooldown = 0;
sulphurBubbleCooldown = 0;
ladHearts = 0;
+7 -2
View File
@@ -1963,8 +1963,13 @@ namespace CalamityMod.CalPlayer
if (vortexBoosterStealthDelay == 1)
Player.vortexStealthActive = true;
}
if (statisTimer > 0 && Player.dashDelay >= 0)
statisTimer = 0;
if (statisPenaltyTimer > 0)
statisPenaltyTimer--;
if (statisPenaltyTimer == 0 && statisAnticheese > 0)
{
statisAnticheese--;
statisPenaltyTimer = statisTimerMax;
}
if (hallowedRuneCooldown > 0)
hallowedRuneCooldown--;
if (sulphurBubbleCooldown > 0)
+16 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Dusts;
using System;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
@@ -14,11 +15,25 @@ namespace CalamityMod.CalPlayer.Dashes
public override DashCollisionType CollisionType => DashCollisionType.NoCollision;
public override bool IsOmnidirectional => false;
public int Time = 0;
public int lastDashDir = 0;
public override float CalculateDashSpeed(Player player) => (50f * player.moveSpeed);
public override void OnDashEffects(Player player)
{
if (Math.Sign(player.velocity.X) == lastDashDir && lastDashDir != 0)
{
player.Calamity().statisPenaltyTimer = player.Calamity().statisTimerMax;
if (player.Calamity().statisAnticheese < 6)
player.Calamity().statisAnticheese++;
}
else
player.Calamity().statisAnticheese = 0;
if (player.Calamity().statisAnticheese > 1)
player.velocity.X *= Utils.Remap(player.Calamity().statisAnticheese, 1, 6, 0.9f, 0.3f, true);
lastDashDir = Math.Sign(player.velocity.X);
lastDashDir = Math.Sign(player.velocity.X);
Time = 0;
for (int i = 0; i < 15; i++)
{
+13 -20
View File
@@ -21,14 +21,26 @@ namespace CalamityMod.CalPlayer.Dashes
public override bool IsOmnidirectional => false;
public int Time = 0;
public bool AngleSwap = true;
public Vector2 aimVel;
public bool strongVisuals = true;
public int lastDashDir = 0;
public override float CalculateDashSpeed(Player player) => (75f * player.moveSpeed);
public override void OnDashEffects(Player player)
{
if (Math.Sign(player.velocity.X) == lastDashDir && lastDashDir != 0)
{
player.Calamity().statisPenaltyTimer = player.Calamity().statisTimerMax;
if (player.Calamity().statisAnticheese < 6)
player.Calamity().statisAnticheese++;
}
else
player.Calamity().statisAnticheese = 0;
if (player.Calamity().statisAnticheese > 1)
player.velocity.X *= Utils.Remap(player.Calamity().statisAnticheese, 1, 6, 0.9f, 0.3f, true);
lastDashDir = Math.Sign(player.velocity.X);
strongVisuals = player.Calamity().voidSashVisuals;
Time = 0;
aimVel = player.velocity;
@@ -96,25 +108,6 @@ namespace CalamityMod.CalPlayer.Dashes
SignusMetaball.SpawnParticle(fxPlace, fxVelocity * Main.rand.NextFloat(5, 8), 50f * Main.rand.NextFloat(0.7f, 1f), 8, new Vector2(0.8f, 1.2f), 0.18f, 0);
}
}
// Periodically release scythes.
player.Calamity().statisTimer++;
if (Main.myPlayer == player.whoAmI && player.Calamity().statisTimer % 2 == 0 && false)
{
int scytheDamage = (int)player.GetBestClassDamage().ApplyTo(250);
int scythe = Projectile.NewProjectile(player.GetSource_FromAI(), player.Center, player.velocity.RotatedBy(player.direction * (AngleSwap ? 30 : -30), default) * 0.1f - player.velocity / 2f, ModContent.ProjectileType<CosmicScythe>(), scytheDamage, 5f, player.whoAmI); ;
if (scythe.WithinBounds(Main.maxProjectiles))
{
Main.projectile[scythe].DamageType = DamageClass.Generic;
Main.projectile[scythe].usesIDStaticNPCImmunity = true;
Main.projectile[scythe].idStaticNPCHitCooldown = 10;
}
AngleSwap = !AngleSwap;
}
player.velocity.X *= 0.912f;
}
}
@@ -1697,6 +1697,7 @@ StatisNinjaBelt: {
10% increased movement speed, 32% increased jump speed, allows auto-jump, and negates fall damage
Increases movement acceleration and deceleration by 1.6x
Grants the ability to swim, climb walls, and dodge attacks
Consecutive dashes in the same direction reduce dash speed
'''
HoldShiftTooltip: "{$Common.DodgeInformation}"
}
@@ -1710,6 +1711,7 @@ StatisVoidSash: {
Increases movement acceleration and deceleration by 1.85x
Grants the ability to swim, climb walls, and dodge attacks
Visual effects are reduced if visibility is disabled
Consecutive dashes in the same direction reduce dash speed
'''
HoldShiftTooltip: "{$Common.DodgeInformation}"
}