From a2635081af948634e924a1030a7297b17639eb7e Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Wed, 29 Jul 2020 13:41:15 +0900 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E9=81=BF=E4=B8=8D=E7=81=AD=E6=95=88?= =?UTF-8?q?=E6=9E=9C=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 | 24 ++++++++++--------- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 11 +++++++++ .../~Lua/Modules/Battle/Logic/RoleLogic.lua | 13 ++++++---- .../Modules/Battle/Test/BattleTestPanel.lua | 2 +- 4 files changed, 34 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 48c50c1c89..8c59073815 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -40,6 +40,7 @@ end + --被动技能表 local passivityList = { --发动技能时,[a]的概率将[b]*[c]算作[d]计算 @@ -1562,7 +1563,7 @@ local passivityList = { -- buff.cover = true -- 可以叠加 -- buff.clear = false -- 不可驱散 -- role:AddBuff(buff) - if skill and not skill.isAdd and defRole:IsDead() then + if skill and not skill.isAdd and defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then role:AddRage(i1, CountTypeName.Add) end end @@ -1780,7 +1781,7 @@ local passivityList = { local ct = args[3] -- 释放技能后 local onRoleHit = function(defRole) - if defRole:IsDead() then + if defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct) -- buff.cover = true role:AddBuff(buff) @@ -1984,7 +1985,8 @@ local passivityList = { local i1 = args[1] -- 释放技能后 local onRoleHit = function(target) - if target:IsDead() and BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)==false then + LogError("target "..target.roleId .. " ".. target.star) + if target:IsDead() and BattleUtil.CheckIsNoDead(target) then for i = 1, i1 do role:AddSkill(BattleSkillType.Normal, false, true, nil) end @@ -2030,7 +2032,7 @@ local passivityList = { local f1 = args[1] -- 释放技能后 local onRoleHit = function(target) - if target:IsDead() then + if target:IsDead() and BattleUtil.CheckIsNoDead(target) then local treat = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.MaxHp), f1)) BattleUtil.CalTreat(role, role, treat) end @@ -2219,7 +2221,7 @@ local passivityList = { local f1 = args[1] -- 释放技能后 local onRoleHit = function(target) - if target:IsDead() then + if target:IsDead() and BattleUtil.CheckIsNoDead(target) then local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add) role:AddBuff(buff) end @@ -2374,7 +2376,7 @@ local passivityList = { -- 击杀数量累加 local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) - if skill and defRole:IsDead() then + if skill and defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then killNum = killNum + 1 end end @@ -2753,7 +2755,7 @@ local passivityList = { local dot = args[1] local f1 = args[2] local function onHit(target) - if target:IsDead() then + if target:IsDead() and BattleUtil.CheckIsNoDead(target) then local maxHp = role:GetRoleData(RoleDataName.MaxHp) local value = floor(BattleUtil.ErrorCorrection(maxHp* f1)) BattleUtil.ApplyTreat(role, role, value) @@ -2888,7 +2890,7 @@ local passivityList = { local i1 = args[1] local onHit = function(target, damage, bCrit, finalDmg) - if target:IsDead() then + if target:IsDead() and BattleUtil.CheckIsNoDead(target) then role:AddRage(i1, CountTypeName.Add) end end @@ -3209,7 +3211,7 @@ local passivityList = { local dt = args[2] -- 直接伤害后 local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isAdd and target:IsDead() then + if skill and not skill.isAdd and target:IsDead() and BattleUtil.CheckIsNoDead(target) then local list = RoleManager.Query(function(v) return v.camp ~= role.camp end) BattleUtil.SortByHpFactor(list, 1) local index = 0 @@ -3483,7 +3485,7 @@ local passivityList = { local f1 = args[1] local onRoleHit = function(target) - if target:IsDead() then + if target:IsDead() and BattleUtil.CheckIsNoDead(target) then local target = RoleManager.GetAliveAggro(role) BattleUtil.CalDamage(nil, role, target, 1, f1) end @@ -3767,7 +3769,7 @@ local passivityList = { [197] = function(role, args) local f1 = args[1] local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) - if skill and skill.type == BattleSkillType.Special and target:IsDead() then + if skill and skill.type == BattleSkillType.Special and target:IsDead() and BattleUtil.CheckIsNoDead(target) then BattleUtil.RandomAction(f1, function() role:AddRage(target.Rage, CountTypeName.Add) end) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index a78ce33ca0..c8169a8160 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -341,6 +341,17 @@ function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageTy return BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType) end + +--检测是否有是金翅大鹏有不灭效果 +function BattleUtil.CheckIsNoDead(target) + if target then + return target:IsAssignHeroAndHeroStar(10086,10)==false and BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)==false + end + return false +end + + + function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType) if damage < 0 then damage = 0 end local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/RoleLogic.lua index c92d8981c5..b220110269 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/RoleLogic.lua @@ -27,7 +27,7 @@ function RoleLogic:Init(uid, data, position) self.uid = uid self.position = position self.roleData = data - + self.roleId=data.roleId self.data:Init(self, data.property) self.isDead = self:GetRoleData(RoleDataName.Hp) <= 0 self.isRealDead = self.isDead @@ -37,7 +37,7 @@ function RoleLogic:Init(uid, data, position) self.element = data.element self.professionId = data.professionId self.star = data.star or 1 - + LogError("英雄uid".. self.roleId .." " .. self.star) self.shield:Clear() --护盾列表 self.exCalDmgList:Clear() --额外计算伤害列表 self.buffFilter:Clear() --buff屏蔽列表 @@ -219,8 +219,13 @@ function RoleLogic:RemovePropertyTransfer(index, tran) end end - - +-- 是否为指定id,指定星级的英雄 by:王振兴 2020/07/29 +function RoleLogic:IsAssignHeroAndHeroStar(id,star) +if self.roleId==id and self.star==star then + return true +end +return false +end function RoleLogic:AddBuff(buff) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua index b879409d46..04766d6f20 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua @@ -265,7 +265,7 @@ function this.RefreshFightData(type) data.element = roleData.PropertyName data.professionId = roleData.Profession data.quality = roleData.Quality - data.star = roleData.Star + data.star = 10 data.type = 1 local paskill = string.split(role.passivity, "#") data.passivity = BattleManager.GetPassivityData(paskill) or {}