From c188e6980074a9fe5a9117a4e0d129112573c8b1 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 01 九月 2025 20:03:15 +0800 Subject: [PATCH] 129 【战斗】战斗系统-服务端(修复主线战斗片段断点bug;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py | 39 ++++++++++++++++++--------------------- 1 files changed, 18 insertions(+), 21 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py index 6e2a448..157ee4a 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py @@ -44,7 +44,7 @@ import json TimelineSet = 10000 # 单回合最大时间轴 -PosNumMax = 10 # 最大站位编号 +PosNumMax = 7 # 最大站位编号 ActionNumStart = -1 # 起始行动位置编号,一般是从1开始,如果有加主公、红颜等则扣除相应位置值,如从0或-1开始 # 回合战斗流程状态 @@ -1054,15 +1054,12 @@ batFaction = turnFight.getBatFaction(faction) batLineup = batFaction.getBatlineup(num) for posNum in range(batLineup.actionNum, PosNumMax + 1): - turnTimeline += 1 # 每个武将位算一个时间节点 - if turnTimeline <= curTimeline: - # 该时间节点已经处理过了 - GameWorld.DebugLog("该时间节点已经处理过了! turnTimeline=%s <= %s" % (turnTimeline, curTimeline)) - continue - + # 每个武将位算一个时间节点 + #GameWorld.DebugLog("武将节点: faction=%s,posNum=%s,curTimeline=%s" % (faction, posNum, curTimeline)) if posNum not in batLineup.posObjIDDict: batLineup.actionNum = posNum + 1 - curTimeline = turnFight.setTimeline(turnTimeline, True) + curTimeline = turnFight.setTimeline(curTimeline + 1, True) + #GameWorld.DebugLog("空位节点: faction=%s,posNum=%s,curTimeline=%s" % (faction, posNum, curTimeline)) continue objID = batLineup.posObjIDDict[posNum] @@ -1071,11 +1068,11 @@ # 玩家自己阵营,预判可否行动 if checkBreakpoint and faction == ChConfig.Def_FactionA and batObj: if batObj.CanAction(): - GameWorld.DebugLog("玩家武将已经行动过了,且有下一个可行动的武将,断点: curTimeline=%s,nextPosNum=%s" % (curTimeline, posNum)) + GameWorld.DebugLog("玩家阵容下一个可行动的武将,断点: curTimeline=%s,nextPosNum=%s" % (curTimeline, posNum)) return batLineup.actionNum = posNum + 1 - curTimeline = turnFight.setTimeline(turnTimeline) + curTimeline = turnFight.setTimeline(curTimeline + 1) TurnFightHeroTurnStart(turnFight, batObj, turnNum) if not OnObjAction(turnFight, batObj): continue @@ -1083,23 +1080,23 @@ if not checkBreakpoint and faction == ChConfig.Def_FactionA: checkBreakpoint = True + break + if turnFight.actionIndex >= len(turnFight.actionSortList) - 1: turnFight.actionIndex = 0 else: turnFight.actionIndex += 1 # 回合结束 - turnTimeline += 1 # 每回合结束算一个时间节点 - if curTimeline < turnTimeline: - curTimeline = turnFight.setTimeline(turnTimeline) - for faction, num in turnFight.actionSortList: - GameWorld.DebugLog("回合结束逻辑: turnNum=%s,faction=%s, num=%s" % (turnNum, faction, num)) - batFaction = turnFight.getBatFaction(faction) - batLineup = batFaction.getBatlineup(num) - for objID in batLineup.posObjIDDict.values(): - batObj = batObjMgr.getBatObj(objID) - TurnFightPerTurnBigEnd(turnFight, batObj, turnNum) - + curTimeline = turnFight.setTimeline(curTimeline + 1) # 每回合结束算一个时间节点 + for faction, num in turnFight.actionSortList: + GameWorld.DebugLog("回合结束逻辑: turnNum=%s,faction=%s, num=%s" % (turnNum, faction, num)) + batFaction = turnFight.getBatFaction(faction) + batLineup = batFaction.getBatlineup(num) + for objID in batLineup.posObjIDDict.values(): + batObj = batObjMgr.getBatObj(objID) + TurnFightPerTurnBigEnd(turnFight, batObj, turnNum) + if turnFight.checkOverByKilled(): break -- Gitblit v1.8.0