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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user