From 2b13d5f833c003e7b1f6547a8e6c66533c507566 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 23 九月 2025 14:22:03 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(黄月英技能; 增加效果友方某个武将额外行动一次5014;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py                    |    6 +++---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5014.py |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py                      |    4 ++--
 3 files changed, 54 insertions(+), 5 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 be4346b..64127de 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -1514,7 +1514,7 @@
                            % (curID, tagID, skillID, hurtValue, lostHP, curBatObj.GetHP()))
     return
 
-def OnObjAction(turnFight, curBatObj):
+def OnObjAction(turnFight, curBatObj, isExtra=False):
     ## 战斗单位行动
     if not curBatObj:
         return
@@ -1530,12 +1530,12 @@
     # 是否可行动状态判断
     canAction = curBatObj.CanAction()
     if not canAction:
-        GameWorld.DebugLog("★回合%s %s 当前状态不可行动!" % (turnNum, objName))
+        GameWorld.DebugLog("★回合%s %s 当前状态不可行动! isExtra=%s" % (turnNum, objName, isExtra))
         return
     
     atk = curBatObj.GetAtk()
     curXP = curBatObj.GetXP()
-    GameWorld.DebugLog("★回合%s %s 行动 : atk=%s,curHP=%s/%s,curXP=%s" % (turnNum, objName, atk, curHP, curBatObj.GetMaxHP(), curXP))
+    GameWorld.DebugLog("★回合%s %s %s行动 : atk=%s,curHP=%s/%s,curXP=%s" % (turnNum, objName, "额外" if isExtra else "", atk, curHP, curBatObj.GetMaxHP(), curXP))
     turnFight.syncObjAction(turnNum, objID)
     
     TurnPassive.OnTriggerPassiveEffect(turnFight, curBatObj, ChConfig.TriggerWay_HeroActionStart)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5014.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5014.py
new file mode 100644
index 0000000..b56481f
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5014.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Skill.PassiveTrigger.PassiveEff_5014
+#
+# @todo:友方某个武将额外行动一次
+# @author hxp
+# @date 2025-09-23
+# @version 1.0
+#
+# 详细描述: 友方某个武将额外行动一次
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2025-09-23 14:30"""
+#-------------------------------------------------------------------------------
+
+import BattleObj
+import TurnAttack
+
+def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
+    sortRule = curEffect.GetEffectValue(0) # 倒序排序规则(0-按战力;1-按攻击)
+    
+    faction = batObj.GetFaction()
+    lineupNum = batObj.GetLineupNum()
+    batFaction = turnFight.getBatFaction(faction)
+    batLineup = batFaction.getBatlineup(lineupNum)
+    
+    objList = []
+    batObjMgr = BattleObj.GetBatObjMgr()
+    for objID in batLineup.posObjIDDict.values():
+        batObj = batObjMgr.getBatObj(objID)
+        if not batObj:
+            continue
+        objList.append(batObj)
+        
+    if sortRule == 0:
+        objList.sort(key=lambda o:(o.GetFightPower()), reverse=True)
+    elif sortRule == 1:
+        objList.sort(key=lambda o:(o.GetAtk()), reverse=True)
+    else:
+        pass
+    
+    for curBatObj in objList:
+        if TurnAttack.OnObjAction(turnFight, curBatObj, True):
+            return True
+        
+    return False
+
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 21b75cf..1bc08e6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
@@ -90,7 +90,7 @@
     oneActionUseCnt = turnFight.SetOneActionUseSkillCnt(objID, oneActionUseCnt + 1)
     
     bySkillID = bySkill.GetSkillID() if bySkill else 0
-    GameWorld.DebugLog("●使用技能: curID=%s,skillID=%s,tagCnt=%s,batType=%s,bySkillID=%s,HP:%s/%s,oneActionUseCnt=%s" 
+    GameWorld.DebugLog("◆使用技能: curID=%s,skillID=%s,tagCnt=%s,batType=%s,bySkillID=%s,HP:%s/%s,oneActionUseCnt=%s" 
                        % (objID, skillID, len(tagObjList), batType, bySkillID, curBatObj.GetHP(), curBatObj.GetMaxHP(), oneActionUseCnt))
     # 以下为技能可以使用的处理,之后的逻辑默认技能使用成功
     
@@ -931,7 +931,7 @@
                 continue
             
         effID = curEffect.GetEffectID()
-        GameWorld.DebugLog("◆执行额外技能效果: %s, triggerWay=%s,effIgnoreObjIDList=%s" % (effID, triggerWay, effIgnoreObjIDList))
+        GameWorld.DebugLog("●执行额外技能效果: %s, triggerWay=%s,effIgnoreObjIDList=%s" % (effID, triggerWay, effIgnoreObjIDList))
         if effID == 5010:
             # 额外技能效果
             __doUseEnhanceSkill(turnFight, curObj, useSkill, curEffect, effIgnoreObjIDList)

--
Gitblit v1.8.0