1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 15:01:53 +08:00

feat(战斗系统): 添加攻击速度属性支持

在Weapon.gd中根据实体攻击速度调整冷却时间
在CooldownTimer.gd中新增speedScale属性和centralTime方法
This commit is contained in:
2025-10-01 08:22:37 +08:00
parent 813ecfcf69
commit 76e87ac90e
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -2,12 +2,15 @@ class_name CooldownTimer
var cooldown: float = 100
var lastStart: int = 0
var speedScale: float = 1
func _init(cd: float = 100):
cooldown = cd
func centralTime():
return cooldown / speedScale
func isCooldowned():
return timeSinceLastStart() >= cooldown
return timeSinceLastStart() >= centralTime()
func start():
var state = isCooldowned()
if state: