From 0dcd7650a642a7b26fe65e14cc5f5b3947757e30 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 16 九月 2025 16:59:10 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(王异技能;支持被动增加暴击率;支持被动变更伤害类型;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py                       |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnPassive.py                    |   21 ++++++----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6002.py |   25 ++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py                      |   13 +++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                             |   11 +++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py |    2 
 6 files changed, 60 insertions(+), 14 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 98578b9..a5525f8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -4286,6 +4286,17 @@
 TriggerSrc_SkillSelf = 3    # 本技能有效
 TriggerSrc_BuffSelf = 4     # 本buff有效
 
+# 被动效果ID,属性类的直接使用属性ID当做效果ID
+PassiveEff_AddBuffLayerByWeight = 6001 # 根据权重随机添加buff层数 数值1-[[权重,层级], ...]
+PassiveEff_ChangeHurtType = 6002 # 变更伤害类型: 值1-伤害类型;值2-可附加验证处于xx状态 [状态1, 状态2, ...]
+
+# 被动效果ID有触发值时就返回的
+PassiveEffHappenValueList = [PassiveEff_ChangeHurtType]
+# 被动效果ID触发值取最大值的
+PassiveEffValueMaxList = []
+# 被动效果ID触发值取最小值的
+PassiveEffValueMinList = []
+
 (
 TriggerType_BeSuperHit, # 被暴击触发技能 1
 TriggerType_BuffState,  # 进入4012的某个状态触发技能
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6002.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6002.py
new file mode 100644
index 0000000..f315b77
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6002.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Skill.PassiveTrigger.PassiveEff_6002
+#
+# @todo:变更本次伤害类型
+# @author hxp
+# @date 2025-09-16
+# @version 1.0
+#
+# 详细描述: 变更本次伤害类型
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2025-09-16 17:00"""
+#-------------------------------------------------------------------------------
+
+def GetHappenValue(attacker, defender, curEffect, effSkill, **skillkwargs):
+    checkInStateList = curEffect.GetEffectValue(1)
+    if checkInStateList:
+        if not defender.CheckInState(checkInStateList):
+            return
+        
+    attrValue = curEffect.GetEffectValue(0)
+    return attrValue
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py
index 2cdd501..cc3df06 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_Attr.py
@@ -20,7 +20,7 @@
     checkInStateList = curEffect.GetEffectValue(2)
     if checkInStateList:
         if not defender.CheckInState(checkInStateList):
-            return 0
+            return
         
     attrValue = curEffect.GetEffectValue(0)
     calcType = curEffect.GetEffectValue(1)
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 f9a02dc..1fb3da3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuff.py
@@ -63,7 +63,7 @@
     skillTypeID = buffSkill.GetSkillTypeID()
     buffRepeat = buffSkill.GetBuffRepeat()
     addLayerCnt = buffSkill.GetLayerCnt()
-    addLayerEff = buffSkill.GetEffectByID(6001)
+    addLayerEff = buffSkill.GetEffectByID(ChConfig.PassiveEff_AddBuffLayerByWeight)
     if addLayerEff:
         addLayerCnt = GameWorld.GetResultByWeightList(addLayerEff.GetEffectValues(), addLayerCnt)
         
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnPassive.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnPassive.py
index 9891021..d8537a5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnPassive.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnPassive.py
@@ -162,15 +162,18 @@
             if value is None:
                 continue
             
-            #if triggerType in TriggerValueMaxList:
-            #    curValue = max(curValue, value) # 取最大值
-            #elif triggerType in TriggerValueMinList:
-            #    if not curValue:
-            #        curValue = value
-            #    elif value > 0:
-            #        curValue = min(curValue, value) # 取最小值
-            #else:
-            curValue += value
+            if effID in ChConfig.PassiveEffHappenValueList:
+                if value:
+                    return value
+            elif effID in ChConfig.PassiveEffValueMaxList:
+                curValue = max(curValue, value) # 取最大值
+            elif effID in ChConfig.PassiveEffValueMinList:
+                if not curValue:
+                    curValue = value
+                elif value > 0:
+                    curValue = min(curValue, value) # 取最小值
+            else:
+                curValue += value
             #if skillTypeID not in Def_PassiveSkillValueNoCD:
             #    if curSkill.GetCoolDownTime():
             #        SkillCommon.SetSkillRemainTime(curSkill, 0, tick, attacker)
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 fc67868..e3dda5b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
@@ -1011,13 +1011,19 @@
 def CalcHurtHP(turnFight, atkObj, defObj, curSkill, atkSkillValue, atkSkillPer, **kwargs):
     '''计算伤害,默认按攻击计算
     '''
+    
+    skillID = curSkill.GetSkillID()
     pmType = GetPMType(atkObj, curSkill)
     ignoreDef = IsIgnoreDef(curSkill)
     
+    changeHurtType = TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_ChangeHurtType, curSkill)
+    if changeHurtType == 1:
+        ignoreDef = True
+        GameWorld.DebugLog("强制变更本次伤害为无视防御! skillID=%s" % skillID)
+        
     atkID = atkObj.GetID()
     defID = defObj.GetID()
     
-    skillID = curSkill.GetSkillID()
     isTurnNormalSkill = SkillCommon.isTurnNormalSkill(curSkill)
     isAngerSkill = SkillCommon.isAngerSkill(curSkill)
     isDot = ("damageoftime" in kwargs)
@@ -1051,7 +1057,7 @@
     isSuperHit, isParry, isStun = False, False, False
     aSuperDamPer, dSuperDamPerDef = 0, 0
     if not isDot:
-        isSuperHit = CanSuperHit(atkObj, defObj) # 是否暴击
+        isSuperHit = CanSuperHit(turnFight, atkObj, defObj, curSkill) # 是否暴击
         isParry = (isTurnNormalSkill and CanParry(turnFight, atkObj, defObj, curSkill)) # 是否格挡,仅针对普攻
         isStun = CanStun(turnFight, atkObj, defObj, curSkill) # 是否击晕
         
@@ -1140,8 +1146,9 @@
     hurtValue = max(1, int(hurtValue)) # 负值、保底防范
     return hurtValue, hurtTypes
 
-def CanSuperHit(atkObj, defObj):
+def CanSuperHit(turnFight, atkObj, defObj, curSkill):
     aSuperHitRate = atkObj.GetBatAttrValue(ChConfig.AttrID_SuperHitRate)
+    aSuperHitRate += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.AttrID_SuperHitRate, curSkill)
     dSuperHitRateDef = defObj.GetBatAttrValue(ChConfig.AttrID_SuperHitRateDef)
     happenRate = eval(IpyGameDataPY.GetFuncCompileCfg("SuperHitCfg", 1))
     if GameWorld.CanHappen(happenRate):

--
Gitblit v1.8.0