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/TurnSkill.py |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

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