| | |
| | | self.nextTurnFight(msgDict)
|
| | | return
|
| | |
|
| | | def nextTurnFight(self, msgDict={}):
|
| | | def nextTurnFight(self, msgDict={}, resetByNextTeam=False):
|
| | | ## 一般用于玩家发起的战斗,在需要保留玩家阵容属性及状态的情况下,重置回合进入下一场战斗
|
| | | self.turnNum = 1
|
| | | self.enterLogic = False
|
| | |
| | | self.timeline = 0
|
| | | self.startTime = time.time()
|
| | | self.costTime = 0
|
| | | if resetByNextTeam:
|
| | | ResetByNextTeam(self)
|
| | | return
|
| | |
|
| | | def haveNextLineup(self):
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def ResetByNextTeam(turnFight):
|
| | | ## 切换下一小队时重置相关,目前设置仅保留血量、怒气、已被击杀的不复活,其他重置
|
| | | |
| | | batFaction = turnFight.getBatFaction(ChConfig.Def_FactionA)
|
| | | if not batFaction:
|
| | | return
|
| | | GameWorld.DebugLog("切换小队重置玩家阵容武将...")
|
| | | batLineup = batFaction.getBatlineup(1) # 只处理玩家阵容
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | for objID in batLineup.posObjIDDict.values():
|
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | if not batObj:
|
| | | continue
|
| | | objName = GetObjName(batObj)
|
| | | if not batObj.IsAlive():
|
| | | GameWorld.DebugLog(" 已被击杀不处理! %s" % (objName))
|
| | | continue
|
| | | GameWorld.DebugLog(" 重置武将: %s, HP:%s/%s, XP:%s" % (objName, batObj.GetHP(), batObj.GetMaxHP(), batObj.GetXP()))
|
| | | |
| | | # 清除buff
|
| | | buffMgr = batObj.GetBuffManager()
|
| | | buffMgr.ClearBuff()
|
| | | |
| | | # 重置CD
|
| | | |
| | | # 重刷属性、被动
|
| | | TurnBuff.RefreshBuffAttr(batObj)
|
| | | TurnPassive.RefreshPassive(batObj)
|
| | | |
| | | return
|
| | |
|
| | | #// B4 10 回合制战斗 #tagCMTurnFight
|
| | | #
|
| | | #struct tagCMTurnFight
|
| | |
| | | turnFight.lineupIndex = index
|
| | | GameWorld.DebugLog("对战NPC阵容: index=%s, lineupID=%s" % (index, lineupID))
|
| | | if index > 0:
|
| | | turnFight.nextTurnFight()
|
| | | turnFight.nextTurnFight(resetByNextTeam=True)
|
| | | turnFight.setFactionLineup(ChConfig.Def_FactionB, {1:GetNPCLineupInfo(lineupID, strongerLV, difficulty)})
|
| | | turnFight.sortActionQueue()
|
| | | turnFight.startFight()
|
| | |
| | | if nextLineupID:
|
| | | GameWorld.DebugLog("---开始进入下一小队: lineupIndex=%s,nextLineupID=%s,%s" % (turnFight.lineupIndex, nextLineupID, turnFight.lineupIDList))
|
| | |
|
| | | turnFight.nextTurnFight()
|
| | | turnFight.nextTurnFight(resetByNextTeam=True)
|
| | | # 切换小队时,玩家阵容不需要处理,保留状态
|
| | | turnFight.setFactionLineup(ChConfig.Def_FactionB, {1:GetNPCLineupInfo(nextLineupID, turnFight.strongerLV, turnFight.difficulty)})
|
| | | turnFight.sortActionQueue()
|