From ba6661c0f8c2fb823ebb505ff9b67f866a120597 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Mon, 18 Jan 2021 14:31:54 +0900 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=E8=A2=AB=E5=8A=A8154=E4=BF=AE=E6=94=B9=20=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?300=E8=A2=AB=E5=8A=A8=20=20=20Hot=20=E6=B7=BB=E5=8A=A0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=B2=BB=E7=96=97=E9=87=8F=E7=9A=84=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E5=A4=8D=E6=B4=BB=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Base/Passivity.lua | 50 +++++++++++++++---- .../~Lua/Modules/Battle/Logic/Buff/HOT.lua | 8 +++ .../Modules/Battle/Logic/Role/RoleLogic.lua | 9 ++++ 3 files changed, 58 insertions(+), 9 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 6072752648..b118d55849 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -2955,15 +2955,17 @@ local passivityList = { if deadRole==role then return end - if deadRole.camp == role.camp then - if ele and v1 and deadRole.element==ele then - f1=v1 + BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延时一帧做处理,我方场上所有单位都结算死亡以后,再处理299被动回血 + if deadRole.camp == role.camp and not role:IsDead() then + if ele and v1 and deadRole.element==ele then + f1=v1 + end + counter = counter + 1 + if counter == i1 then + deadRole:SetRelive(f1) + end end - counter = counter + 1 - if counter == i1 then - deadRole:SetRelive(f1) - end - end + end) end BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead, onRoleRealDead) end, @@ -6176,7 +6178,6 @@ local passivityList = { end if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then local list = skill:GetDirectTargetsNoMiss() - LogError(LengthOfTable(list)) if list then local isHave=false for key, value in pairs(list) do @@ -6246,6 +6247,37 @@ local passivityList = { role.Event:AddEvent(BattleEventName.RoleDead, OnDead) end, + --修改持续效果的治疗值为[a] [b]属性的[c]% + --a[int] b[float] + [300]=function(role,args,id,judge) + local pro=args[1] + local v1=args[2] + + local onSkillCastEnd = function(skill) + if not skill or skill.type~= BattleSkillType.Special then + return + end + if skill and judge==1 and not skill.isTriggerJudge then + return + end + BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延迟一帧移除事件,才能抓到添加效果字典里面的效果 + local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro]) * v1)) + if tv and tv<=0 then + return + end + local list=skill:GetDirectTargetsNoMiss() + for _, role1 in ipairs(list) do + BattleLogic.BuffMgr:QueryBuff(role1, function(buff) + if buff.type == BuffName.HOT and buff.caster == role and buff.roundDuration>1 and buff.startRound==BattleLogic.GetCurRound() then + buff:ChangeHealValue(tv) + end + end) + end + end) + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillCastEnd) + end, + } return passivityList \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/HOT.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/HOT.lua index 5817a06598..d441181461 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/HOT.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/HOT.lua @@ -10,12 +10,20 @@ function HOT:SetData(...) self.sort = 1 -- 最先计算回血 end + --初始化后调用一次 function HOT:OnStart() self.target.Event:DispatchEvent(BattleEventName.RoleBeHealed, self.caster) end +--修改持续加血效果的加血值 +function HOT:ChangeHealValue(newValue) + if newValue then + self.healValue=newValue + end +end + --间隔N帧触发,返回true时表示继续触发,返回false立刻触发OnEnd function HOT:OnTrigger() diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index 80e76a863b..071d3aeed0 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -557,6 +557,15 @@ function RoleLogic:SetRelive(hpf, caster) self.reliveHPF = hpf or 1 self.reliveCaster = caster RoleManager.AddReliveRole(self) + local maxHp = self.data:GetData(RoleDataName.MaxHp) + local reHp = floor(self.reliveHPF * maxHp) + self.data:SetValue(RoleDataName.Hp, reHp) + -- 发送复活事件 + --self.Event:DispatchEvent(BattleEventName.RoleRelive, self) + --BattleLogic.Event:DispatchEvent(BattleEventName.RoleRelive, self) + -- 复活的血量算做加血 + BattleLogic.Event:DispatchEvent(BattleEventName.RecordTreat, self.reliveCaster or self, self, reHp) + return true end return false end