From 9b026aee7db0db3e7c0f5efa354be73372a12a2a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 21 一月 2026 14:07:26 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(PK攻击顺序规则调整: PVE固定玩家先手,PVP先手排序优先级: 总先攻值 > 战力 > 挑战方先手; )

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 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 2dd7d0e..71b9a4b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
+++ b/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)

--
Gitblit v1.8.0