1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(战斗系统): 优化Kernyr角色的攻击逻辑和碰撞形状

- 将Yangyi子弹的碰撞形状从矩形改为圆形
- 为EntityBase添加攻击互斥状态管理
- 调整Kernyr的攻击冷却时间和互斥规则
- 重写Kernyr的AI攻击逻辑和特殊攻击2的实现
This commit is contained in:
2026-03-28 08:29:22 +08:00
parent bbb4540ec4
commit cc0899a264
3 changed files with 35 additions and 11 deletions
+9
View File
@@ -59,6 +59,8 @@ var attackCooldownMap = {
var attackCooldowner = {
0: CooldownTimer.new()
}
var attackMutexes: Array[int] = []
var attackingStates: Array[int] = []
var inventory = {
ItemStore.ItemType.BASEBALL: 200,
ItemStore.ItemType.BASKETBALL: 200,
@@ -340,12 +342,19 @@ func tryAttack(type: int, needChargeUp: bool = false):
charginup = true
await EffectController.create(ComponentManager.getEffect("AttackStar"), damageAnchor.global_position).shot()
charginup = false
for attackingState in attackingStates:
if attackingState in attackMutexes:
return false
if isPlayer() and !isSummon():
attackingStates.append(type)
if await weapon.tryAttack(self ):
weapon.playSound("attack")
attackingStates.erase(type)
else:
attackingStates.append(type)
if await attack(type):
playSound("attack" + str(type))
attackingStates.erase(type)
return state
func trySprint():
trailing = true