From f2b6ff14125c15a19233780de0835675bc0352f5 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 2 Mar 2023 17:54:57 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=E8=A2=AB=E5=8A=A8441=20=20=20455=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Base/Passivity.lua | 71 ++++++++++++++----- 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index dd2f7dfb49..7dde8d856d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -11516,28 +11516,67 @@ local passivityList = { if t6 then table.insert(types,t6) end + + -- local heros={} + -- local onSkillCast = function(skill) + -- if skill and not skill.isTriggerJudge and judge==1 then + -- return + -- end + -- if skill.type == BattleSkillType.Special then + -- local list = skill:GetDirectTargets() + -- for key, value in pairs(list) do + -- table.insert(heros,list) + -- end + -- LogError("#heros=========="..#heros) + -- end + -- end + + -- role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast,nil,nil,role) + + -- 释放技能后 - local onSkillEnd = function(skill) + -- local onSkillEnd = function(skill) + -- if skill and not skill.isTriggerJudge and judge==1 then + -- return + -- end + -- local heros + -- if skill.type == BattleSkillType.Special then + -- heros = skill:GetDirectTargetsNoMiss() + -- end + -- if heros then + -- for i = 1, #heros do + -- -- BattleUtil.CalRage(role, list[i], i1, CountTypeName.Sub) + -- local isAdd=false + -- for key, value in pairs(types) do + -- if not isAdd and BattleLogic.BuffMgr:HasBuff(heros[i],value) then + -- BattleUtil.CalRage(role, heros[i], v1, CountTypeName.Sub) + -- isAdd=true + -- end + -- end + -- end + -- heros={} + -- end + -- end + -- role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd,nil,nil,role) + + + local OnPassiveDamaging = function(damagingFunc, defRole, damage,skill) if skill and not skill.isTriggerJudge and judge==1 then return end - if skill.type == BattleSkillType.Special then - local list = skill:GetDirectTargetsNoMiss() - if list then - for i = 1, #list do - -- BattleUtil.CalRage(role, list[i], i1, CountTypeName.Sub) - local isAdd=false - for key, value in pairs(types) do - if not isAdd and BattleLogic.BuffMgr:HasBuff(list[i],value) then - BattleUtil.CalRage(role, list[i], v1, CountTypeName.Sub) - isAdd=true - end - end - end + if skill.type~=BattleSkillType.Special then + return + end + local isAdd=false + for key, value in pairs(types) do + if not isAdd and BattleLogic.BuffMgr:HasBuff(defRole,value) then + BattleUtil.CalRage(role, defRole, v1, CountTypeName.Sub) + isAdd=true end end end - role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd,nil,nil,role) + + role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging,nil,nil,role) end, --敌方处于[a]类型[b]状态的单位死亡,有[c]*己方[d]阵营存活数的概率,将效果转移,持续[e]回合给目标周围有[f][g][h][i]类型效果的神将 --a[int],b[int],c[int],d[int],e[float],f[int] @@ -11944,7 +11983,7 @@ local passivityList = { if triggerTime==0 then return end - local dd = BattleUtil.CountValue(damage,p2, CountTypeName.SubPencent) - damage + local dd = BattleUtil.CountValue(damage,(1-p2), CountTypeName.SubPencent) - damage --LogError("dd========="..dd) damagingFunc(-floor(dd)) -- triggerTime=0