129 【战斗】战斗系统-服务端(PK攻击顺序规则调整: PVE固定玩家先手,PVP先手排序优先级: 总先攻值 > 战力 > 挑战方先手; )
1个文件已修改
12 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -321,19 +321,27 @@
    
    def sortActionQueue(self):
        ## 刷新出手顺序队列
        batObjMgr = BattleObj.GetBatObjMgr()
        sortList = []
        for batFaction in self.factionDict.values():
            faction = batFaction.faction
            for num, batLineup in batFaction.lineupDict.items():
                isPlayer = 1 if batLineup.ownerID else 0 # 玩家阵容优先攻击
                atkSpeed = 0
                for objID in batLineup.getBatHeroObjIDList():
                    batObj = batObjMgr.getBatObj(objID)
                    if not batObj:
                        continue
                    atkSpeed += batObj.GetBatAttrValue(ChConfig.AttrID_AtkSpeed)
                fightPower = batLineup.fightPower
                sortValue = -(faction * 10 + num)
                sortList.append([isPlayer, fightPower, sortValue, faction, num])
                sortList.append([isPlayer, atkSpeed, fightPower, sortValue, faction, num])
        sortList.sort(reverse=True) # 战力高的先手
        
        self.actionIndex = 0
        self.actionSortList = []
        for _, _, _, faction, num in sortList:
        for sortInfo in sortList:
            faction, num = sortInfo[-2:]
            self.actionSortList.append([faction, num])
            
        GameWorld.DebugLogEx("阵容战力排序[isPlayer, fp, sortV, f, n]: %s", sortList)