From 8363bfa77030134a400ba31f930fb75f8583c3fc Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 20 一月 2026 10:49:37 +0800
Subject: [PATCH] 423 【内政】命格系统-服务端(命格伤害类技能算触发的武将身上,去除命格结算统计;buff类施法主体还是命格;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5022.py |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py                       |    4 ++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6005.py |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py                     |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5507.py |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py                    |    4 +---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py                      |   28 +++++++++++++++++-----------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                             |    2 +-
 8 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py
index 602c494..3ecda4f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BattleObj.py
@@ -999,7 +999,7 @@
     def GetTFGUID(self): return self.tfGUID # 所属的某场战斗
     def SetTFGUID(self, tfGUID): self.tfGUID = tfGUID
     def GetTurnFight(self): return TurnAttack.GetTurnFightMgr().getTurnFight(self.tfGUID)
-    def GetBatLineup(self):
+    def GetTFBatLineup(self):
         if not self._batLineup:
             turnFight = self.GetTurnFight()
             batFaction = turnFight.getBatFaction(self.faction)
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 7fe52c2..1fe65d0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -2185,9 +2185,7 @@
             facDRLineupInfo[str(num)] = batLineup.lineupInfo
             GameWorld.DebugLogEx("阵容明细: faction=%s,num=%s", faction, num)
             posObjIDList = [[posNum, objID] for posNum, objID in batLineup.posObjIDDict.items()]
-            mgObj = batLineup.minggeObj # 命格
-            if mgObj:
-                posObjIDList.append([mgObj.GetPosNum(), mgObj.GetID()])
+            # 命格不算战斗单位,主体视为触发的武将
             # 灵兽
             for posNum, objID in posObjIDList:
                 batObj = batObjMgr.getBatObj(objID)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 76b1ecd..7f9b175 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -1494,7 +1494,7 @@
                      }
 
 # 伤害型技能
-Def_HurtSkill_List = [Def_SkillType_Atk, Def_SkillType_LstPlsBuffAtk, Def_SkillType_PassiveLstPlsBuffAtk]
+Def_HurtSkill_List = [Def_SkillType_Atk, Def_SkillType_AtkEx, Def_SkillType_LstPlsBuffAtk, Def_SkillType_PassiveLstPlsBuffAtk]
 
 
 #持续型技能列表
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5022.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5022.py
index c5a57de..0180071 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5022.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5022.py
@@ -31,7 +31,7 @@
         if ruleType == 100:
             country = calcRule[1] if len(calcRule) > 1 else 0
             onlyAlive = calcRule[2] if len(calcRule) > 2 else 0
-            batLineup = batObj.GetBatLineup()
+            batLineup = batObj.GetTFBatLineup()
             countryCnt = 0
             batObjMgr = BattleObj.GetBatObjMgr()
             for objID in batLineup.posObjIDDict.values():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5507.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5507.py
index 1099427..5fd4533 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5507.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5507.py
@@ -29,7 +29,7 @@
     tagHero = tagObj
     if effHeroID:
         if searchFrom:
-            batLineup = batObj.GetBatLineup()
+            batLineup = batObj.GetTFBatLineup()
             tagHero = batLineup.getHeroObj(effHeroID)
             
         if not tagHero:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6005.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6005.py
index fe3a8d9..7c5a1b1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6005.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6005.py
@@ -17,6 +17,6 @@
 
 def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, connSkill, **skillkwargs):
     addPer = curEffect.GetEffectValue(0) # 每层增加的万分比
-    batLineup = attacker.GetBatLineup()
+    batLineup = attacker.GetTFBatLineup()
     deadCnt = batLineup.getDeadObjCnt()
     return deadCnt * addPer
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py
index 4497f1d..94ca2a3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py
@@ -253,7 +253,7 @@
     if curBuffState and IsControlledHardState(curBuffState):
         TurnPassive.OnTriggerPassiveEffect(turnFight, batObj, ChConfig.TriggerWay_BeControlledHard, tagObj=buffOwner, connSkill=buffSkill, connBuff=buff)
         batObjMgr = BattleObj.GetBatObjMgr()
-        ownerBatLineup = buffOwner.GetBatLineup()
+        ownerBatLineup = buffOwner.GetTFBatLineup()
         for lineupObjID in ownerBatLineup.posObjIDDict.values():
             lineupObj = batObjMgr.getBatObj(lineupObjID)
             if not lineupObj.IsAlive():
@@ -553,7 +553,7 @@
         
     # 重新添加本阵营有效光环
     batObjMgr = BattleObj.GetBatObjMgr()
-    batLineup = batObj.GetBatLineup()
+    batLineup = batObj.GetTFBatLineup()
     for tagObjID in batLineup.posObjIDDict.values():
         tagObj = batObjMgr.getBatObj(tagObjID)
         if not tagObj.IsAlive():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
index 51f1029..221cfc5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
@@ -65,6 +65,19 @@
         return
     
     skillType = useSkill.GetSkillType()
+    byBatObj = kwargs.pop("byBatObj", None)
+    if useSkill.GetFuncType() == ChConfig.Def_SkillFuncType_MinggeSkill:
+        if useSkill.GetSkillType() in ChConfig.Def_HurtSkill_List:
+            if not byBatObj:
+                return
+            GameWorld.DebugLogEx("命格攻击类技能施法方算触发者! mgObjID=%s,byObjID=%s,skillID=%s", curBatObj.GetID(), byBatObj.GetID(), skillID)
+            curBatObj = byBatObj
+        else:
+            # 因为命格攻击类技能修改了施法者,后续如果有子技能触发会变成还是变更后的施法者,导致命格全体buff可能存在多个施法来源,可能导致bug
+            batLineup = curBatObj.GetTFBatLineup()
+            curBatObj = batLineup.getMinggeObj()
+            GameWorld.DebugLogEx("命格非攻击类技能强制施法者为命格自己! mgObjID=%s,skillID=%s", curBatObj.GetID(), skillID)
+            
     byTriggerWay = kwargs["byTriggerWay"] if "byTriggerWay" in kwargs else 0 # 不使用参数名 triggerWay, 防止传递过程中参数混乱
     if not curBatObj.IsAlive():
         if skillType == ChConfig.Def_SkillType_Revive:
@@ -615,7 +628,7 @@
     row = inRowNum # 目标玩家所在横排
     
     batObjMgr = BattleObj.GetBatObjMgr()
-    batLineup = tagObj.GetBatLineup()
+    batLineup = tagObj.GetTFBatLineup()
     aimObjList = []
     for col in colNumList:
         pNum = (row - 1) * ChConfig.TurnFightCols + col
@@ -644,7 +657,7 @@
     col = inColNum # 目标玩家所在纵排
     
     batObjMgr = BattleObj.GetBatObjMgr()
-    batLineup = tagObj.GetBatLineup()
+    batLineup = tagObj.GetTFBatLineup()
     aimObjList = []
     for row in range(1, 1 + ChConfig.TurnFightRows):
         pNum = (row - 1) * ChConfig.TurnFightCols + col
@@ -1588,7 +1601,7 @@
         
     # 曹仁防护触发,暂写死
     for tagObj in caorenProtectList:
-        tagBatLineup = tagObj.GetBatLineup()
+        tagBatLineup = tagObj.GetTFBatLineup()
         caorenObj = tagBatLineup.getHeroObj(ChConfig.HeroID_Caoren) # 获取被防护目标阵容的曹仁
         if not caorenObj or not caorenObj.IsAlive():
             continue
@@ -1603,7 +1616,7 @@
     triggerOne = False
     batType = useSkill.GetBatType()
     isAttackDirect = (isUseSkill and SkillCommon.isAttackDirectSkill(useSkill)) # 是否直接攻击
-    curBatLineup = curObj.GetBatLineup()
+    curBatLineup = curObj.GetTFBatLineup()
     curMGObj = curBatLineup.getMinggeObj()
     for tagObj in tagObjListAll:
         tagID = tagObj.GetID()
@@ -2075,13 +2088,6 @@
     '''
     
     skillID = curSkill.GetSkillID()
-    # 命格攻击类技能,取触发者为施法方,因为部分战斗属性需要取施法方的,如最终增伤等
-    if curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_MinggeSkill:
-        byBatObj = curSkill.GetByBatObj()
-        if byBatObj:
-            GameWorld.DebugLogEx("命格攻击类技能计算伤害属性取触发者! mgObjID=%s,byObjID=%s,skillID=%s", atkObj.GetID(), byBatObj.GetID(), skillID)
-            atkObj = byBatObj
-            
     #mapID = turnFight.mapID
     pmType = GetPMType(atkObj, curSkill)
     ignoreDef = IsIgnoreDef(curSkill)

--
Gitblit v1.8.0