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

feat(战斗系统): 改进攻击逻辑和Kernyr角色技能

重构tryAttack方法,将needChargeUp参数改为更灵活的chargeConfig配置
优化Kernyr角色的攻击2技能,改为持续旋转发射子弹
This commit is contained in:
2026-03-28 10:30:23 +08:00
parent 2105de1131
commit 0a3dbd64ef
2 changed files with 30 additions and 15 deletions
+8 -1
View File
@@ -325,7 +325,7 @@ func useEnergy(value: float):
energy -= finalEnergy(value)
energyChanged.emit(energy, false)
return state
func tryAttack(type: int, needChargeUp: bool = false):
func tryAttack(type: int, chargeConfig: Variant = false):
var weapon: Weapon
if isPlayer() and !isSummon():
if len(weapons) > type:
@@ -343,6 +343,13 @@ func tryAttack(type: int, needChargeUp: bool = false):
cooldownTimer.cooldown = attackCooldownMap.get(type, defaultCooldownUnit)
state = cooldownTimer.start()
if state:
var needChargeUp: bool
if chargeConfig is bool:
needChargeUp = chargeConfig
elif chargeConfig is Array:
needChargeUp = type in chargeConfig
else:
needChargeUp = false
if needChargeUp:
await chargeUp()
for attackingState in attackingStates: