feat: 增强踢人逻辑与BOSS脚本支持
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
优化踢人超时处理和僵尸连接清理,支持BOSS动作脚本并增加测试,修复事件匹配与战斗循环中的并发问题。
This commit is contained in:
@@ -2,6 +2,8 @@ package input
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/player"
|
||||
configmodel "blazing/modules/config/model"
|
||||
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
)
|
||||
@@ -22,6 +24,16 @@ func (our *Input) GetAction() {
|
||||
|
||||
return t.HookAction()
|
||||
})
|
||||
|
||||
if aiPlayer, ok := our.Player.(*player.AI_player); ok && aiPlayer.BossScript != "" {
|
||||
scriptBoss := &configmodel.BossConfig{Script: aiPlayer.BossScript}
|
||||
nextByScript, err := scriptBoss.RunHookActionScript(next)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
next = nextByScript
|
||||
}
|
||||
|
||||
if !next {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user