diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index 74522a32e6..d426f66a53 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -829,6 +829,14 @@ function this.GetBattleSorting() end end +-- 判断是否是战斗测试 +function this.IsBattleTestPanel() + if UIManager.IsOpen(UIName.BattleTestPanel) then + return true + end +end + + -- 获取战斗背景 function this.GetBattleBg(fightType) local index = 1 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 82a67a3d2f..5ce34118de 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -5286,7 +5286,7 @@ local passivityList = { --受到敌方技能攻击 if atkRole.camp~=role.camp and skill and skill.type~=BattleSkillType.Monster and skill.type~=BattleSkillType.Normal then BattleUtil.RandomAction(pro, function () - local list = RoleManager.GetNeighbor(atk+Role, 1) + local list = RoleManager.GetNeighbor(atkRole, 1) -- table.insert(list,defRole) for i=1, #list do --如果目标身上没有灼烧效果 @@ -5367,8 +5367,17 @@ local passivityList = { end local list = RoleManager.Query(function(v) return v.camp ~= role.camp end) list=BattleUtil.SortByProp(list, RoleDataName.Hp, 1) - if list and list[1] then - BattleUtil.RandomControl(pro2*num, con, role,list[1],time) + --获取主目标 + local targets=skill:GetDirectTargets() + local aaa=nil + for key, value in pairs(list) do + if value and not BattleUtil.ChecklistIsContainValue(targets,value) then + aaa=value + break + end + end + if aaa then + BattleUtil.RandomControl(pro2*num, con, role,aaa,time) end end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Immune.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Immune.lua index 6e812f039a..fe826bb0ee 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Immune.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Immune.lua @@ -65,8 +65,8 @@ function Immune:OnEnd() immune = immune2 elseif self.immuneType == 3 then --免疫无敌盾 immune = immune3 - elseif self.immuneType == 3 then--自定义免疫 - mmune=immune4 + elseif self.immuneType == 4 then--自定义免疫 + immune=immune4 immune4=nil end for i = 1, self.target.buffFilter.size do diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua index 2308c764da..1e65a206ea 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Shield.lua @@ -38,7 +38,7 @@ function Shield:OnTrigger() end -- 计算护盾 -function Shield:CountShield(damage, atkRole) +function Shield:CountShield(damage, atkRole,skill) self.atk = atkRole local finalDamage = 0 if self.shieldType == ShieldTypeName.NormalReduce then @@ -54,10 +54,14 @@ function Shield:CountShield(damage, atkRole) end elseif self.shieldType == ShieldTypeName.RateReduce then - local reduceDamage = math.floor(BattleUtil.ErrorCorrection(damage * self.shieldValue)) - finalDamage = damage - reduceDamage - self.damageSum = self.damageSum + reduceDamage - + --减伤盾只减伤直接伤害,和史弘毅对接的 2020/11/14 by王振兴 + if skill then + local reduceDamage = math.floor(BattleUtil.ErrorCorrection(damage * self.shieldValue)) + finalDamage = damage - reduceDamage + self.damageSum = self.damageSum + reduceDamage + else + finalDamage=damage + end elseif self.shieldType == ShieldTypeName.AllReduce then finalDamage = 0 --TODO 计算吸血 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index fd213ded25..657da1a841 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -282,10 +282,10 @@ function BattleUtil.CalHit(atkRole, defRole) end -- 计算护盾 -function BattleUtil.CalShield(atkRole, defRole, damage) +function BattleUtil.CalShield(atkRole, defRole, damage,skill) for i=1, defRole.shield.size do local buff = defRole.shield.buffer[i] - damage = buff:CountShield(damage, atkRole) + damage = buff:CountShield(damage, atkRole,skill) end return damage end @@ -370,7 +370,8 @@ function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageTy BattleLogic.Event:DispatchEvent(BattleEventName.PassiveDamaging, damagingFunc, atkRole, defRole, damage, skill, dotType, bCrit) -- 计算护盾减伤 - damage = BattleUtil.CalShield(atkRole, defRole, damage) + + damage = BattleUtil.CalShield(atkRole, defRole, damage,skill) -- 造成的最终伤害 local damagingFunc = function(dmgDeduction) @@ -416,6 +417,8 @@ function BattleUtil.GetExtraSkillbyId(id) return ExtraReleaseSkill.skill3 elseif id==4 then return ExtraReleaseSkill.skill4 + elseif id==5 then + return ExtraReleaseSkill.skill5 end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua index f33a71b53b..a18f0a91f0 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Test/BattleTestPanel.lua @@ -273,7 +273,7 @@ function this:OnOpen() end) - this.SkillOption:GetComponent("Canvas").sortingOrder = BattleManager.GetBattleSorting() + 200 + this.SkillOption:GetComponent("Canvas").sortingOrder = BattleManager.GetBattleSorting() + 20 end -- 设置数据 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index 53beb6719f..01c93269e3 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -374,6 +374,9 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, d = dmg count = 1 end + if BattleManager.IsBattleTestPanel() then + LogYellow(string.format("目标阵营:%s, 位置:%s, 总伤害:%s, 伤害段数:%s,每段伤害:%s", self.camp, self.role.position, dmg, count, d)) + end if count ~= 1 then -- 后续伤害延迟打出 self:LoopFunc(space, count - 1, function() @@ -386,6 +389,9 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill) end else + if BattleManager.IsBattleTestPanel() then + LogYellow(string.format("目标阵营:%s, 位置:%s, 总伤害:%s", self.camp, self.role.position, dmg)) + end self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill) end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index 89f792434a..8846da3d5d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -418,6 +418,9 @@ function PlayerView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType d = dmg count = 1 end + if BattleManager.IsBattleTestPanel() then + LogYellow(string.format("目标阵营:%s, 位置:%s, 总伤害:%s, 伤害段数:%s,每段伤害:%s", self.camp, self.role.position, dmg, count, d)) + end if count ~= 1 then -- 后续伤害延迟打出 self:LoopFunc(space, count - 1, function() @@ -430,6 +433,9 @@ function PlayerView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill) end else + if BattleManager.IsBattleTestPanel() then + LogYellow(string.format("目标阵营:%s, 位置:%s, 总伤害:%s", self.camp, self.role.position, dmg)) + end self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill) end end