From 33efb7bc2a759a2d83f6e8b65db3c326584d622a Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 27 May 2021 23:33:03 +0800 Subject: [PATCH] =?UTF-8?q?=20=E3=80=90=E4=BF=AE=E8=A1=8C=E3=80=91?= =?UTF-8?q?=E4=BA=A2=E9=BE=99=E6=9C=89=E6=82=94=EF=BC=8C=E4=B8=9C=E9=99=B5?= =?UTF-8?q?=E5=9C=A3=E6=AF=8D=E5=A4=A7=E6=8B=9B=E6=B2=A1=E6=9C=89=E7=9C=A9?= =?UTF-8?q?=E6=99=95=E6=95=8C=E6=96=B9=EF=BC=8C=E6=B2=A1=E5=9B=9E=E6=80=92?= =?UTF-8?q?=20=20=E3=80=90=E4=BF=AE=E8=A1=8C=E3=80=91=E4=BA=A2=E9=BE=99?= =?UTF-8?q?=E6=9C=89=E6=82=94=E7=A5=9E=E5=8D=B0=EF=BC=8C=E8=BE=BE=E6=91=A9?= =?UTF-8?q?=E8=BF=9E=E7=BB=AD=E8=BF=BD=E5=87=BB=EF=BC=8C=E8=BF=9E=E7=BB=AD?= =?UTF-8?q?=E6=B2=A1=E7=9C=A9=E6=99=95=EF=BC=8C=E5=8F=AA=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E5=9B=9E=E4=BA=86=E6=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Base/Passivity.lua | 40 +++++++++++-------- 1 file changed, 24 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 7533c25a1e..e2a666d773 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -6956,26 +6956,34 @@ local passivityList = { [318] = function(role, args) local f1 = args[1] local ctrlNum=0 - local isCtrl=false - -- 死亡数量 - local onRoleAddBuffMiss = function(buff) - if buff then - if buff.type==BuffName.Control and buff.caster==role then - isCtrl=true - ctrlNum=ctrlNum+1 - end + + local onBuffCaster = function(buff) + LogGreen("buff type = ".. buff.type) + if buff.type == BuffName.Control then + ctrlNum = ctrlNum + 1 end end - BattleLogic.Event:AddEvent(BattleEventName.RoleAddBuffFail, onRoleAddBuffMiss,nil,nil,role) + + local onSkillCastStart= function(skill) + if skill.owner == role then + ctrlNum = 0 + role.Event:AddEvent(BattleEventName.BuffCaster, onBuffCaster,nil,nil,role) + end + end + local onSkillCastEnd= function(skill) - local maxNum=#skill:GetDirectTargets() - if isCtrl and ctrlNum>=maxNum then - BattleUtil.CalRage(role, role,f1, CountTypeName.Add) + if skill.owner == role then + if ctrlNum == 0 then + if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then + BattleUtil.CalRage(role, role,f1, CountTypeName.Add) + end + end + role.Event:RemoveEvent(BattleEventName.BuffCaster, onBuffCaster,nil,nil,role) end - isCtrl=false - ctrlNum=0 end - role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillCastEnd,nil,nil,role) + -- 这里使用BattleLogic.Event,因为有的技能效果是在人物技能释放完成后生效的 + BattleLogic.Event:AddEvent(BattleEventName.SkillCast,onSkillCastStart,nil,nil,role) + BattleLogic.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillCastEnd,nil,nil,role) end, --死亡时,按剩余怒气乘[a]平均分给存活队友,每人至少[b]点,按站位优先 --a[int],b[int] @@ -7027,7 +7035,7 @@ local passivityList = { local function onRoundChange(round) if round==curRound+1 then p1=args[1] - time=0 + time=0 end curRound=round end