Spam punish multiplier

This commit is contained in:
2024-10-26 23:51:17 -07:00
parent de3873f590
commit 3dd0e0f439

View File

@@ -10,6 +10,7 @@ public class Teo : MonoBehaviour
public float swingDistance = 10; public float swingDistance = 10;
public float damageStrength = 10; public float damageStrength = 10;
public float attackCooldownSeconds = 10; public float attackCooldownSeconds = 10;
public float spamPunishMultiplier = 0.5F;
public float dashDistance = 5F; public float dashDistance = 5F;
public float dashCooldownSeconds = 5; public float dashCooldownSeconds = 5;
public float lastAttackTime = 0; public float lastAttackTime = 0;
@@ -69,9 +70,12 @@ public class Teo : MonoBehaviour
) continue; ) continue;
// Apply a multiplier to damageStrength based on attack cooldown. // Apply a multiplier to damageStrength based on attack cooldown.
// If multiplier > 1, just do damageStrength // If multiplier > 1, just do damageStrength
// Fuck readability, it's a one liner now float damageAmount = damageStrength * (Time.fixedTime - lastAttackTime)/attackCooldownSeconds;
Debug.Log(Mathf.Min(damageStrength * (Time.fixedTime - lastAttackTime)/attackCooldownSeconds, damageStrength)); ratbot.Damage(
ratbot.Damage(Mathf.Min(damageStrength * (Time.fixedTime - lastAttackTime)/attackCooldownSeconds, damageStrength)); (damageAmount > damageStrength)
? damageStrength
: damageAmount * spamPunishMultiplier
);
} }
} }
IEnumerator Dash() { IEnumerator Dash() {