slightly slower fire rate, change fire rate name

This commit is contained in:
Ian Woods 2026-06-29 19:50:22 -07:00
parent c5cba2dcd7
commit d53a2a47e2
4 changed files with 8 additions and 8 deletions

View file

@ -55,7 +55,7 @@ namespace TD.Combat
private EnemyHealth currentTarget;
// Attack cooldown decrements each server frame. When ≤ 0 and a target
// is in range, the tower fires and the timer resets to 1 / FireRate.
// is in range, the tower fires and the timer resets to 1 / AttacksPerSecond.
private float attackCooldown;
// Cached on OnNetworkSpawn — avoids GetComponent every Update.
@ -129,7 +129,7 @@ namespace TD.Combat
if (!IsServer) return;
TowerDefinition def = towerInstance?.Definition;
if (def == null || def.Range <= 0f || def.FireRate <= 0f) return;
if (def == null || def.Range <= 0f || def.AttacksPerSecond <= 0f) return;
// Only fire during active gameplay.
var ms = MatchState.Instance;
@ -252,7 +252,7 @@ namespace TD.Combat
attackCooldown -= Time.deltaTime;
if (attackCooldown > 0f) return;
float effectiveFireRate = def.FireRate
float effectiveFireRate = def.AttacksPerSecond
* (GetOwnerBuffManager()?.GetMultiplier(BuffStat.AttackSpeed) ?? 1f);
attackCooldown = 1f / effectiveFireRate;
Fire(def);