From ee82685a9cf068539a065cc46403c6ef1c2d3889 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 02 四月 2024 18:34:37 +0800
Subject: [PATCH] 10019 【砍树】回合战斗(复活、多倍攻击、被动触发效果5010、5011、释放方式49、50、优化释放方式43) 1. 支持神通技能复活,区分灵宠触发复活或主角自身复活; 2. 新增被动触发效果5010,攻击有X%的概率造成X倍伤害,同个技能支持同时配置多个不同概率不同倍值;NPC支持多倍攻击; 3. 新增被动触发效果5011,回合战斗开始前触发; 4. 新增换血攻击释放方式49:消耗自身x%当前生命值,扣除敌方等额生命值,最高不超过自身x%攻击; 5. 新增结算灼烧释放方式50;优化原灼烧效果1034,支持结算灼烧伤害加成; 6. 优化原释放方式43:偷取对方属性,支持配置不超过自身属性百分比;NPC支持偷属性;优化原buff效果1015,

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_43.py |   46 +++++++++++++++++++++++++++++++++++-----------
 1 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_43.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_43.py
index 9460df8..c1937b5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_43.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_43.py
@@ -17,30 +17,54 @@
 import BaseAttack
 import BuffSkill
 import IPY_GameWorld
-import SkillCommon
 import EffGetSet
+import GameWorld
+import SkillCommon
 
 
-def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
+def UseBuff(attacker, defender, curSkill, tick, tagRoundPosX, tagRoundPosY):
+#def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
     if not defender:
         return
-    if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
-        return
     
+    atkObjType = attacker.GetGameObjType()
+    defObjType = defender.GetGameObjType()
+    
+    attrIndexAllowList = [] # 存在NPC,仅允许偷取的属性类型
+    if atkObjType != IPY_GameWorld.gotPlayer or defObjType != IPY_GameWorld.gotPlayer:
+        attrIndexAllowList = [ChConfig.TYPE_Calc_AttrMaxHP, ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax,
+                              ChConfig.TYPE_Calc_AttrDEF, ChConfig.TYPE_Calc_AttrAtkSpeed]
+        
+    #GameWorld.DebugLog("偷取目标属性: atkID=%s,defID=%s,attrIndexAllowList=%s" % (attacker.GetID(), defender.GetID(), attrIndexAllowList))
     addBuffValueList = []
     # 效果ID | 属性项,万分率
-    # 最多吸收目标3种属性 存入buffvalue
+    # 最多吸收目标3种属性 存入buffvalue,固定前3个效果
+    # A值-属性ID B值-吸取万分率 C值-最高不超过自身属性万分率,配0不限制
     for i in range(3):
-        attrIndex = curSkill.GetEffect(i).GetEffectValue(0)
+        effect = curSkill.GetEffect(i)
+        attrIndex = effect.GetEffectValue(0)
         if not attrIndex:
-            break
-        curValue = EffGetSet.GetValueByEffIndex(defender, attrIndex)
-        curValue = int(curValue * curSkill.GetEffect(i).GetEffectValue(1) / ChConfig.Def_MaxRateValue)
+            continue
+        if attrIndexAllowList and attrIndex not in attrIndexAllowList:
+            continue
         
-        addBuffValueList.append(curValue)
+        attrRate = effect.GetEffectValue(1)
+        tagValue = EffGetSet.GetValueByEffIndex(defender, attrIndex)
+        addValue = int(tagValue * attrRate / float(ChConfig.Def_MaxRateValue))
+        
+        maxRate = effect.GetEffectValue(2)
+        curValue = EffGetSet.GetValueByEffIndex(attacker, attrIndex)
+        if maxRate:
+            maxValue = int(curValue * maxRate / float(ChConfig.Def_MaxRateValue))
+            addValue = min(addValue, maxValue)
+            
+        addBuffValueList.append(addValue)
+        GameWorld.DebugLog("偷取目标属性: atkID=%s,defID=%s,attrIndex=%s,attrRate=%s,addValue=%s,tagValue=%s,curValue=%s,maxRate=%s" 
+                           % (attacker.GetID(), defender.GetID(), attrIndex, attrRate, addValue, tagValue, curValue, maxRate))
         
     buffType = SkillCommon.GetBuffType(curSkill)
     BuffSkill.DoAddBuff(attacker, buffType, curSkill, tick, addBuffValueList, attacker)
     
+    return True
     #处理技能触发和攻击成功逻辑
-    return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
+    #return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)

--
Gitblit v1.8.0