From 3e36a537b3becb015dd30832e3a3584d53d74c13 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Wed, 1 Sep 2021 18:40:32 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D=20?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E9=80=89=E6=8B=A9=E9=80=BB=E8=BE=91=20?= =?UTF-8?q?=E7=94=9F=E5=91=BD=E7=99=BE=E5=88=86=E6=AF=94=E6=9C=80=E4=BD=8E?= =?UTF-8?q?=20=E4=B8=8D=E9=80=89=E6=9C=89=E4=B8=8D=E7=81=AD=E7=9A=84=20=20?= =?UTF-8?q?=20=20=20=E6=98=BE=E7=A4=BA=E5=B1=82=EF=BC=9A=E6=AD=BB=E4=BA=A1?= =?UTF-8?q?=E5=90=8E=E6=80=92=E6=B0=94=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=20=20=E8=A2=AB=E5=8A=A899=20=20307=20=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E9=80=89=E6=8B=A9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/Logic/Base/Passivity.lua | 4 ++-- .../~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua | 12 ++++++++++++ .../~Lua/Modules/Battle/View/Unit/EnemyView.lua | 3 ++- .../~Lua/Modules/Battle/View/Unit/PlayerView.lua | 3 ++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index b8f3f488b9..1820250173 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -1741,7 +1741,7 @@ local passivityList = { end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.RoleHit, OnHit) - local arr = RoleManager.Query(function (r) return r.camp == role.camp and r.deadFilter end) + local arr = RoleManager.NoOrder(function (r) return r.camp == role.camp and r.deadFilter end) BattleUtil.SortByHpFactor(arr, 1) -- 检测技能伤害���疗加成 local f = BattleUtil.CheckSkillDamageHeal(f1, role, arr[1]) @@ -6998,7 +6998,7 @@ local passivityList = { -- end -- LogYellow("307 1") if skill and (skill.type==BattleSkillType.Special or skill.type== BattleSkillType.Extra or skill.type== BattleSkillType.Monster) then --技能造成的直接伤害 - local list = RoleManager.Query(function(v) return v.camp == role.camp end) + local list = RoleManager.NoOrder(function(v) return v.camp == role.camp end) BattleUtil.SortByHpFactor(list, 1) -- LogYellow("307 2") if list[1] then diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index cff44ba4a4..058d725fb7 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -202,6 +202,16 @@ function BattleUtil.SortByHpFactorAndHp(arr, sort) end) return arr end + +--移除队列有不灭的单位 +function BattleUtil.RemoveNoDeadRole(arr) + for i = 1, #arr do + local role=arr[i] + if BattleLogic.BuffMgr:HasBuff(role,BuffName.NoDead) then + table.removebyvalue(arr,role) + end + end +end --按怒气排序 function BattleUtil.SortByRage(arr, sort) BattleUtil.Sort(arr, function(a, b) @@ -352,6 +362,8 @@ function BattleUtil.ChooseTarget(role, chooseId) BattleUtil.SortByProp(arr, RoleDataName.Hp, sort) elseif chooseWeight == 2 then -- 血量百分比 BattleUtil.SortByHpFactor(arr, sort) + --选血量百分比最低的 不选择有不灭的,如果伤害要选有不灭的 需处理 + BattleUtil.RemoveNoDeadRole(arr) elseif chooseWeight == 3 then -- 攻击力 BattleUtil.SortByProp(arr, RoleDataName.Attack, sort) elseif chooseWeight == 4 then -- 防御 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index fd45a1f471..c6dcb5bd58 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -521,7 +521,8 @@ function EnemyView:OnDead() end self.hpSlider.fillAmount = 0 self.hpPassSlider.fillAmount = 0 - self.rageSlider.fillAmount = 0 + --死亡后不把怒气条显示清空,处理触发不灭怒气不足四点 怒气条清空 2021/09/01 + --self.rageSlider.fillAmount = 0 self.rageText.text = "" end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index e58ea83f8b..44dd5e83ec 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -563,7 +563,8 @@ function PlayerView:OnDead() end self.hpSlider.fillAmount = 0 self.hpPassSlider.fillAmount = 0 - self.rageSlider.fillAmount = 0 + --死亡后不把怒气条显示清空,处理触发不灭怒气不足四点 怒气条清空 2021/09/01 + --self.rageSlider.fillAmount = 0 self.rageText.text = "" end