slightly slower fire rate, change fire rate name
This commit is contained in:
parent
c5cba2dcd7
commit
d53a2a47e2
4 changed files with 8 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue