From 75dac27b4e1d2cc22f7ca6356d258eb47f7e9e38 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 07 一月 2026 17:56:09 +0800
Subject: [PATCH] 412 【挑战】定军阁-服务端(定军阁功能专享属性支持;优化主阵容属性支持专有功能属性,不影响通用主阵容属性、战力,专享阵容与主阵容相同,只是属性、战力可能不一样;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 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 7af48b6..cc9639b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -584,25 +584,26 @@
         lineupInfo = lineupDict.get("%s" % ShareDefine.Lineup_Main, {})
     return lineupInfo
 
-def GetPlayerLineupFightPower(curPlayer, lineupID):
+def GetPlayerLineupFightPower(curPlayer, lineupID=ShareDefine.Lineup_Main):
     ## 获取玩家阵容战力,一般用于直接获取阵容战力记录用
     return GetPlayerLineup(curPlayer, lineupID).fightPower
-def GetPlayerLineup(curPlayer, lineupID):
+def GetPlayerLineup(curPlayer, lineupID=ShareDefine.Lineup_Main, exclusiveMapID=0):
     ## 获取玩家阵容
     olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
-    lineup = olPlayer.GetLineup(lineupID)
+    lineup = olPlayer.GetLineup(lineupID, exclusiveMapID=exclusiveMapID)
     if lineup.IsEmpty():
         GameWorld.DebugLogEx("玩家没有目标阵容默认取主阵容! lineupID=%s", lineupID, curPlayer.GetPlayerID())
         lineup = olPlayer.GetLineup(ShareDefine.Lineup_Main)
     return lineup
 
-def GetPlayerLineupInfo(curPlayer, lineupID):
+def GetPlayerLineupInfo(curPlayer, lineupID, exclusiveMapID=0):
     ## 获取玩家阵容信息,可用于战斗或查看缓存,因为可能取玩家的缓存进行对战,所以统一使用json格式,前端通用
     # @param lineupID: 阵容ID
+    # @param exclusiveMapID: 专享阵容的地图ID,如定军阁
     # @return: 阵容全部信息json字典,前端通用格式
     
     playerID = curPlayer.GetPlayerID()
-    lineup = GetPlayerLineup(curPlayer, lineupID)
+    lineup = GetPlayerLineup(curPlayer, lineupID, exclusiveMapID)
     if lineup.IsEmpty():
         return {}
     
@@ -1100,11 +1101,6 @@
         if FBCommon.CheckCanEnterFBComm(curPlayer, mapID, funcLineID, fbIpyData, fbLineIpyData) != ShareDefine.EntFBAskRet_OK:
             return
         
-    # 攻防方所使用的阵容ID
-    atkLineupID, defLineupID = FBLogic.GetFBPlayerLineupID(curPlayer, mapID, funcLineID)
-    if atkLineupID not in ShareDefine.LineupList or defLineupID not in ShareDefine.LineupList:
-        return
-    
     if CheckFightCD(curPlayer, tick, "TurnFightReqTick"):
         return
     
@@ -1112,9 +1108,10 @@
     playerServerID = GameWorld.GetPlayerServerID(curPlayer)
     guid = GameWorld.GetGUID()
     
-    atkLineupInfo = GetPlayerLineupInfo(curPlayer, atkLineupID)
+    atkLineupID = ShareDefine.Lineup_Main # 进攻方默认使用主阵容
+    atkLineupInfo = GetPlayerLineupInfo(curPlayer, atkLineupID, mapID)
     if not atkLineupInfo:
-        GameWorld.DebugLogEx("玩家没有该阵容数据! atkLineupID=%s", atkLineupID, playerID)
+        GameWorld.DebugLogEx("玩家没有该阵容数据! atkLineupID=%s,mapID=%s", atkLineupID, mapID, playerID)
         return
     
     # 玩家
@@ -1127,6 +1124,7 @@
             PlayerControl.NotifyCode(curPlayer, "TagNoViewCache")
             return
         
+        defLineupID = ChConfig.MapLineIDDict.get(mapID, ShareDefine.Lineup_Main)
         defLineupInfo = GetCacheLineupInfo(tagViewCache, defLineupID)
         if not defLineupInfo:
             GameWorld.DebugLogEx("目标玩家没有该阵容数据! tagPlayerID=%s,defLineupID=%s", tagPlayerID, defLineupID, playerID)

--
Gitblit v1.8.0