From fe40f1881045b901bd5e7365673e3a2b677f7e7f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 30 十二月 2025 18:07:49 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(吕布所有技能;优化效果5501支持同国层级;7002效果支持配置学习x技能生效;增加效果5511;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5501.py | 7 +++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5511.py | 53 ++++++++++++++++++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py | 18 +++++++--
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuffs/BuffAtkType_1003.py | 3 -
4 files changed, 75 insertions(+), 6 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5501.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5501.py
index 478798a..516eda3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5501.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5501.py
@@ -22,6 +22,7 @@
skillID = curEffect.GetEffectValue(0) # 技能ID,为0时释放本技能
setLayerCnt = curEffect.GetEffectValue(1) # 指定buff层级
byTagStateList = curEffect.GetEffectValue(2) # 或根据目标xx状态 [状态1, 状态2, ...]总层级
+ bySameCountryLayerEx = curEffect.GetEffectValue(3) # 触发来源是同国时额外增加层级
if byTagStateList:
layerTotal = 0
tagBuffMgr = tagObj.GetBuffManager()
@@ -33,6 +34,12 @@
layerTotal += buff.GetLayer()
setLayerCnt = layerTotal
+ if bySameCountryLayerEx:
+ if "byFriendObj" in kwargs:
+ byFriendObj = kwargs.pop("byFriendObj") # 直接取出,防止传递
+ if batObj.GetCountry() == byFriendObj.GetCountry():
+ setLayerCnt += bySameCountryLayerEx
+
if setLayerCnt <= 0:
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5511.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5511.py
new file mode 100644
index 0000000..7dba1f7
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveTrigger/PassiveEff_5511.py
@@ -0,0 +1,53 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Skill.PassiveTrigger.PassiveEff_5511
+#
+# @todo:触发释放技能(验证自己buff层级)
+# @author hxp
+# @date 2025-12-30
+# @version 1.0
+#
+# 详细描述: 触发释放技能(验证自己buff层级)
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2025-12-30 18:30"""
+#-------------------------------------------------------------------------------
+
+import TurnBuff
+import GameWorld
+import TurnSkill
+
+def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
+ buffState = curEffect.GetEffectValue(0) # buff状态
+ needLayers = curEffect.GetEffectValue(1) # 达到多少层可释放
+ passiveSkillID = curEffect.GetEffectValue(2) # 释放技能ID
+ if not buffState or not needLayers or not passiveSkillID:
+ return
+
+ curBuff = batObj.GetBuffManager().FindBuffByState(buffState)
+ if not curBuff:
+ return
+ buffLayers = curBuff.GetLayer()
+
+ if buffLayers < needLayers:
+ GameWorld.DebugLogEx("buff状态层数不足不触发5511! buffState=%s,buffLayers=%s < %s", buffState, buffLayers, needLayers)
+ return
+
+ #noUseXP = curEffect.GetEffectValue(4) # 怒气时是否不消耗怒气
+ #if noUseXP:
+ # kwargs["noUseXP"] = 1
+ if not TurnSkill.OnUsePassiveSkill(turnFight, batObj, tagObj, passiveSkillID, connBuff=connBuff, **kwargs):
+ return
+
+ delLayers = curEffect.GetEffectValue(3) # 扣除层数,0不扣除
+ if delLayers > 0:
+ updLayer = buffLayers - delLayers
+ TurnBuff.DoBuffLayerChange(turnFight, batObj, curBuff, updLayer, connSkill)
+
+ return True
+
+def DoBuffEffectLogic(turnFight, batObj, tagObj, effBuff, curEffect, connSkill, connBuff, **kwargs):
+ effSkill = effBuff.GetSkillData().GetIpyData()
+ return DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuffs/BuffAtkType_1003.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuffs/BuffAtkType_1003.py
index 9865cb6..be40ea6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuffs/BuffAtkType_1003.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnBuffs/BuffAtkType_1003.py
@@ -42,8 +42,7 @@
GameWorld.DebugLog("计算护盾值(%s):skillID=%s,calcType=%s,baseValue=%s,skillPer=%s,aShieldPer=%s,dShieldPerDef=%s,angerOverflow=%s"
% (shieldValue, skillID, calcType, baseValue, skillPer, aShieldPer, dShieldPerDef, angerOverflow))
# 均摊
- hurtShareEff = curSkill.GetEffectByID(ChConfig.SkillEff_HurtShare)
- if hurtShareEff:
+ if TurnSkill.HaveShareEff(attacker, curSkill):
tagCnt = max(1, len(curSkill.GetTagObjList()))
shieldValue = shieldValue / tagCnt
GameWorld.DebugLogEx(" 目标均摊盾值: shieldValue=%s,tagCnt=%s", shieldValue, tagCnt)
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 8fd79b3..e8ba14f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/TurnSkill.py
@@ -2206,14 +2206,25 @@
GameWorld.DebugLogEx(" 伤害最高限制: hurtValue=%s,hurtAtkPerMax=%s,aAtk=%s", hurtValue, hurtAtkPerMax, aAtk)
# 均摊
- hurtShareEff = curSkill.GetEffectByID(ChConfig.SkillEff_HurtShare)
- if hurtShareEff:
+ if HaveShareEff(atkObj, curSkill):
tagCnt = max(1, len(curSkill.GetTagObjList()))
hurtValue = hurtValue / tagCnt
GameWorld.DebugLogEx(" 目标均摊伤害: hurtValue=%s,tagCnt=%s", hurtValue, tagCnt)
hurtValue = max(1, int(hurtValue)) # 负值、保底防范,放最后
return hurtValue, hurtTypes
+
+def HaveShareEff(atkObj, curSkill):
+ ## 玩家技能是否有分摊效果: 均摊伤害/治疗/承伤盾值
+ hurtShareEff = curSkill.GetEffectByID(ChConfig.SkillEff_HurtShare)
+ if not hurtShareEff:
+ return False
+ needLearnSkillID = hurtShareEff.GetEffectValue(0)
+ if needLearnSkillID:
+ if not atkObj.GetSkillManager().FindSkillByID(needLearnSkillID):
+ GameWorld.DebugLogEx("所需技能未学习,分摊效果不生效! skillID=%s,needLearnSkillID=%s", curSkill.GetSkillID(), needLearnSkillID)
+ return False
+ return True
def GetAddSkillPer(turnFight, atkObj, defObj, curSkill):
## 获取额外增加的技能万分比
@@ -2832,8 +2843,7 @@
cureHP = int(cureHP * multiValue)
GameWorld.DebugLogEx(" 治疗倍值: cureHP=%s,multiValue=%s", cureHP, multiValue)
- hurtShareEff = curSkill.GetEffectByID(ChConfig.SkillEff_HurtShare)
- if hurtShareEff:
+ if HaveShareEff(userObj, curSkill):
tagCnt = max(1, len(curSkill.GetTagObjList()))
cureHP = cureHP / tagCnt
GameWorld.DebugLogEx(" 目标均摊治疗: cureHP=%s,tagCnt=%s", cureHP, tagCnt)
--
Gitblit v1.8.0