mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
refactor(战斗系统): 优化攻击逻辑和碰撞处理
- 将蓄力攻击逻辑提取为独立方法 chargeUp 以提高代码复用性 - 调整攻击动画的等待时间,增加蓄力效果 - 添加碰撞反弹处理并重置冲刺状态 - 优化冲刺逻辑,在不可冲刺时提前终止
This commit is contained in:
@@ -39,7 +39,8 @@ func attack(type: int):
|
||||
var anchor = currentFocusedBoss.position
|
||||
var radius = 600
|
||||
await sprintTo(anchor + Vector2(0, -radius), 0.1)
|
||||
await TickTool.millseconds(2000)
|
||||
await TickTool.millseconds(500)
|
||||
await chargeUp()
|
||||
var count = 10.0
|
||||
for i in count:
|
||||
await sprintTo(anchor + Vector2.from_angle(deg_to_rad(i / count * 360.0 - 90)) * radius, 0.5)
|
||||
@@ -51,4 +52,5 @@ func attack(type: int):
|
||||
):
|
||||
if bullet is YangyiBullet:
|
||||
bullet.look_at(anchor)
|
||||
await TickTool.millseconds(3000)
|
||||
await TickTool.millseconds(2000)
|
||||
await chargeUp()
|
||||
|
||||
Reference in New Issue
Block a user