1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-09 01:29:33 +08:00
parent ffe3ff18bf
commit 2860bcfa5c
12 changed files with 319 additions and 64 deletions

View File

@@ -247,21 +247,24 @@ func (f *FightC) collectPlayerActions(ourID, oppID uint32) map[uint32]action.Bat
//fmt.Println("玩家执行动作:", pid, paction.Priority())
case <-timeout:
f.handleTimeout(ourID, oppID, actions)
return actions
r := f.handleTimeout(ourID, oppID, actions)
if r {
return actions
}
}
}
return actions
}
// 超时处理逻辑
func (f *FightC) handleTimeout(ourID, oppID uint32, actions map[uint32]action.BattleActionI) {
func (f *FightC) handleTimeout(ourID, oppID uint32, actions map[uint32]action.BattleActionI) bool {
if f.Info.Status == info.BattleMode.FIGHT_WITH_NPC {
// f.WinnerId = 0
go f.Our.GetAction() //boss出手后获取出招
return false
} else {
var pid uint32
for _, pid = range []uint32{ourID, oppID} {
@@ -275,6 +278,7 @@ func (f *FightC) handleTimeout(ourID, oppID uint32, actions map[uint32]action.Ba
f.WinnerId = f.GetInputByPlayer(f.getPlayerByID(pid), false).Player.GetInfo().UserID
f.Reason = info.BattleOverReason.PlayerOVerTime
f.closefight = true
return true
}
}