From e80aa0f81f59070d748e1a20410805f0a87bd381 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期日, 14 十二月 2025 17:34:07 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(关银屏所有技能;增加触发类型44-敌军行动后 45-友军行动后;增加效果6022 6023 6024)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5023.py | 23 ++++---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6022.py | 22 +++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6023.py | 32 ++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6024.py | 30 ++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py | 13 ++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py | 20 +++++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 15 +++-
7 files changed, 137 insertions(+), 18 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 8bcaf33..80c54ba 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -1978,6 +1978,19 @@
break
TurnPassive.OnTriggerPassiveEffect(turnFight, curBatObj, ChConfig.TriggerWay_HeroActionEnd)
+ batObjMgr = BattleObj.GetBatObjMgr()
+ for faction in [ChConfig.Def_FactionA, ChConfig.Def_FactionB]:
+ batFaction = turnFight.getBatFaction(faction)
+ for lineupNum in batFaction.lineupDict.keys():
+ batLineup = batFaction.getBatlineup(lineupNum)
+ for lineupObjID in batLineup.posObjIDDict.values():
+ lineupObj = batObjMgr.getBatObj(lineupObjID)
+ if not lineupObj.IsAlive():
+ continue
+ if lineupObj.GetFaction() != curBatObj.GetFaction():
+ TurnPassive.OnTriggerPassiveEffect(turnFight, lineupObj, ChConfig.TriggerWay_EnemyAction, curBatObj)
+ else:
+ TurnPassive.OnTriggerPassiveEffect(turnFight, lineupObj, ChConfig.TriggerWay_FriendAction, curBatObj)
return True
def SetObjKilled(turnFight, gameObj, killer=None, useSkill=None):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 9aa13c5..1b60b04 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -932,7 +932,8 @@
HurtAtkType_PoisonCureSuck, # 吸血毒奶 11
HurtAtkType_HarmSelf, # 自残 12
HurtAtkType_CaorenProtect, # 本次伤害有受曹仁防护标记 13
-) = range(14)
+HurtAtkType_IgnoreShield, # 无视承伤盾 14
+) = range(15)
#伤害类型
(
@@ -4003,7 +4004,9 @@
TriggerWay_Revive, # 复活时 41
TriggerWay_BigTurnStartByDead, # 大回合开始时(死亡后有效) 42
TriggerWay_WhenDie, # 死亡时(自己) 43
-) = range(1, 1 + 43)
+TriggerWay_EnemyAction, # 敌方行动后 44
+TriggerWay_FriendAction, # 友方行动后(包含自己) 45
+) = range(1, 1 + 45)
# 不加载的被动触发方式,一般用于本技能固定触发逻辑用的
TriggerWayNoLoadList = [TriggerWay_CurSkillEff, TriggerWay_CurSkillEffLst]
@@ -4018,7 +4021,7 @@
# 被动效果ID,属性类的直接使用属性ID当做效果ID
PassiveEff_AddBuffLayerByWeight = 6001 # 根据权重随机添加buff层数 数值1-[[权重,层级], ...]
-PassiveEff_ChangeHurtType = 6002 # 变更本次伤害类型
+PassiveEff_ChangeHurtType = 6002 # 变更本次伤害类型(可验证目标状态)
PassiveEff_ChangeHurtMulti = 6003 # 变更伤害倍值(可增可减)
PassiveEff_AddSkillPer = 6004 # 增加本次技能万分比(验证目标状态)
PassiveEff_AddSkillPerByDeadTeammate = 6005 # 增加本次技能万分比(按队友死亡数)
@@ -4038,9 +4041,13 @@
PassiveEff_AddBatDamPerByTagLostHP = 6019 # 战斗增伤(按目标已损失生命)
PassiveEff_AddSkillPerByBuffState = 6020 # 增加技能系数(验证由buff状态触发的)
PassiveEff_AddBuffLayer = 6021 # 添加buff层级时额外增加x层
+PassiveEff_IgnoreShield = 6022 # 穿盾效果,无视护盾值
+PassiveEff_ChangeHurtTypeByBuff = 6023 # 变更本次伤害类型(可验证由xx状态buff触发的)
+PassiveEff_ReduceLayer5023 = 6024 # 减少5023效果所需的buff状态层数
# 被动效果ID有触发值时就返回的
-PassiveEffHappenValueList = [PassiveEff_ChangeHurtType, PassiveEff_ImmuneControlBuff, PassiveEff_MustSuperHit, PassiveEff_SkillInvalid]
+PassiveEffHappenValueList = [PassiveEff_ChangeHurtType, PassiveEff_ImmuneControlBuff, PassiveEff_MustSuperHit, PassiveEff_SkillInvalid,
+ PassiveEff_IgnoreShield]
# 被动效果ID触发值取最大值的
PassiveEffValueMaxList = [PassiveEff_ChangeHurtMulti]
# 被动效果ID触发值取最小值的
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5023.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5023.py
index 9168eeb..f06ae15 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5023.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5023.py
@@ -18,12 +18,13 @@
import TurnBuff
import GameWorld
import TurnSkill
+import TurnPassive
+import ChConfig
def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
buffState = curEffect.GetEffectValue(0)
needLayers = curEffect.GetEffectValue(1) # 达到多少层时才消耗
- delLayers = curEffect.GetEffectValue(2) # 扣除层数
- exSkillID = curEffect.GetEffectValue(3) # 释放技能ID
+ exSkillID = curEffect.GetEffectValue(2) # 释放技能ID
if not buffState or not needLayers:
return
@@ -31,14 +32,18 @@
if not curBuff:
return
buffLayers = curBuff.GetLayer()
- if buffLayers < needLayers:
- GameWorld.DebugLog("buff状态层数不足不触发! buffState=%s,buffLayers=%s < %s" % (buffState, buffLayers, needLayers))
- return
- updLayer = buffLayers - delLayers
- GameWorld.DebugLog("扣除buff层释放技能: buffState=%s,buffLayers=%s,delLayers=%s" % (buffState, buffLayers, delLayers))
- if delLayers:
- TurnBuff.DoBuffLayerChange(turnFight, batObj, curBuff, updLayer, connSkill)
+ reduecLayer = TurnPassive.GetTriggerEffectValue(turnFight, batObj, tagObj, ChConfig.PassiveEff_ReduceLayer5023, connSkillTypeID=curBuff.GetSkillTypeID(), reduceBuffState=buffState)
+ if reduecLayer:
+ needLayers = max(0, needLayers - reduecLayer)
+ GameWorld.DebugLogEx("减少5023效果所需消耗的buff层级! buffState=%s,reduecLayer=%s,needLayers=%s", buffState, reduecLayer, needLayers)
+ if buffLayers < needLayers:
+ GameWorld.DebugLogEx("buff状态层数不足不触发! buffState=%s,buffLayers=%s < %s", buffState, buffLayers, needLayers)
+ return
+ updLayer = buffLayers - needLayers
+ GameWorld.DebugLogEx("消耗buff层释放技能: buffState=%s,buffLayers=%s,delLayers=%s,updLayer=%s", buffState, buffLayers, needLayers, updLayer)
+ TurnBuff.DoBuffLayerChange(turnFight, batObj, curBuff, updLayer, connSkill)
+
if exSkillID:
TurnSkill.OnUsePassiveSkill(turnFight, batObj, tagObj, exSkillID, connBuff=connBuff)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6022.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6022.py
new file mode 100644
index 0000000..4246cd7
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6022.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Skill.PassiveTrigger.PassiveEff_6022
+#
+# @todo:穿盾效果,无视护盾值
+# @author hxp
+# @date 2025-12-14
+# @version 1.0
+#
+# 详细描述: 穿盾效果,无视护盾值
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2025-12-14 17:30"""
+#-------------------------------------------------------------------------------
+
+import GameWorld
+
+def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, connSkill, **skillkwargs):
+ GameWorld.DebugLogEx("穿盾效果,无视护盾值")
+ return 1
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6023.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6023.py
new file mode 100644
index 0000000..3d0bdba
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6023.py
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Skill.PassiveTrigger.PassiveEff_6023
+#
+# @todo:变更本次伤害类型
+# @author hxp
+# @date 2025-12-14
+# @version 1.0
+#
+# 详细描述: 变更本次伤害类型
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2025-12-14 17:30"""
+#-------------------------------------------------------------------------------
+
+import GameWorld
+
+def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, connSkill, **skillkwargs):
+ byBuffState = curEffect.GetEffectValue(1) # 验证由xx状态buff触发的
+ if byBuffState and connSkill:
+ byBuff = connSkill.GetByBuff()
+ if not byBuff:
+ #GameWorld.DebugLogEx("非由buff触发的不变更")
+ return
+ if byBuff.GetCurBuffState() != byBuffState:
+ GameWorld.DebugLogEx("非由该buff状态触发的不变更! buffState=%s != %s" % (byBuff.GetCurBuffState(), byBuffState))
+ return
+
+ attrValue = curEffect.GetEffectValue(0)
+ return attrValue
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6024.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6024.py
new file mode 100644
index 0000000..1da99ed
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_6024.py
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Skill.PassiveTrigger.PassiveEff_6024
+#
+# @todo:减少5023效果所需的buff状态层数
+# @author hxp
+# @date 2025-12-14
+# @version 1.0
+#
+# 详细描述: 减少5023效果所需的buff状态层数
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2025-12-14 17:30"""
+#-------------------------------------------------------------------------------
+
+#import GameWorld
+
+def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, connSkill, **skillkwargs):
+ if "reduceBuffState" not in skillkwargs:
+ return
+ reduceBuffState = skillkwargs["reduceBuffState"]
+ effBuffState = curEffect.GetEffectValue(0) # buff状态
+ if effBuffState != reduceBuffState:
+ #GameWorld.DebugLogEx("减少所需消耗的buff层状态不一致! reduceBuffState=%s != effBuffState(%s)", reduceBuffState, effBuffState)
+ return
+ reduceLayer = curEffect.GetEffectValue(1) # 减少所需层数
+ #GameWorld.DebugLogEx("减少所需消耗的buff层! reduceBuffState=%s,reduceLayer=%s", reduceBuffState, reduceLayer)
+ return reduceLayer
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 28703f6..9b56267 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
@@ -1809,6 +1809,8 @@
batType = curSkill.GetBatType()
changeHurtType = TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_ChangeHurtType, curSkill)
+ if not changeHurtType:
+ changeHurtType = TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_ChangeHurtTypeByBuff, curSkill)
if changeHurtType == 1:
ignoreDef = True
GameWorld.DebugLogEx("强制变更本次伤害为无视防御! skillID=%s", skillID)
@@ -2127,8 +2129,10 @@
defObj, hurtValue, hurtTypes, immuneHurt = hurtInfo[:4]
isEx = hurtInfo[4] if len(hurtInfo) > 4 else 0 # 是否是额外目标
- lostHP = DoLostHP(turnFight, atkObj, defObj, hurtValue, curSkill, lostType, hpCanNegative=True, immuneHurt=immuneHurt)
-
+ lostHP, ignoreShield = DoLostHP(turnFight, atkObj, defObj, hurtValue, curSkill, lostType, hpCanNegative=True, immuneHurt=immuneHurt)
+ if ignoreShield:
+ hurtTypes |= pow(2, ChConfig.HurtAtkType_IgnoreShield)
+
#伤害结构体
defID = defObj.GetID()
if isEx:
@@ -2415,9 +2419,10 @@
@param hpCanNegative: 扣除后的生命是否允许负值
@param immuneHurt: 免疫的伤害值
@param isSkillSelfTag: 是否技能自身的直接目标,如平摊伤害目标、溅射伤害目标这种就不算直接目标
- @return: lostHP
+ @return: lostHP, ignoreShield
'''
+ ignoreShield = None
if immuneHurt > 0:
buffMgr = defObj.GetBuffManager()
wudiBuffList = buffMgr.FindBuffListByState(ChConfig.BatObjState_Wudi)
@@ -2432,7 +2437,7 @@
defObj.GetID(), buff.GetBuffID(), buffSkillID, buffValue, immuneHurt, updBuffValue, lostType)
if hurtValue <= 0:
- return 0
+ return 0, ignoreShield
atkID = atkObj.GetID()
defID = defObj.GetID()
@@ -2443,6 +2448,11 @@
shieldBuffList = []
buffMgr = defObj.GetBuffManager()
for buff in buffMgr.FindBuffListByState(ChConfig.BatObjState_DamShield):
+ if ignoreShield == None:
+ if TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_IgnoreShield, curSkill):
+ ignoreShield = True # 无视承伤盾
+ break
+ ignoreShield = False
skillData = buff.GetSkillData()
remainTime = buff.GetRemainTime() # 剩余回合
if not skillData.GetLastTime():
@@ -2494,7 +2504,7 @@
GameWorld.DebugLogEx(" 扣血: atkID=%s,defID=%s,hurtValue=%s,lostType=%s,lostHP=%s,dHP=%s,updHP=%s/%s",
atkID, defID, hurtValue, lostType, lostHP, dHP, defObj.GetHP(), defObj.GetMaxHP())
TurnAttack.AddTurnObjHurtValue(atkObj, defObj, hurtValue, lostHP, skillID, lostType)
- return lostHP
+ return lostHP, ignoreShield
def CalcBounceHP(turnFight, atkObj, defObj, hurtObj, curSkill):
'''计算反弹反弹伤害
--
Gitblit v1.8.0