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