【战斗】=====查找逻辑修改
parent
0cef7683ba
commit
a60c74720c
|
@ -181,9 +181,6 @@ end
|
|||
|
||||
-- 根据属性排序
|
||||
function BattleUtil.SortByProp(arr, prop, sort)
|
||||
if sort==0 then
|
||||
return arr
|
||||
end
|
||||
BattleUtil.Sort(arr, function(a, b)
|
||||
local r1 = a:GetRoleData(prop)
|
||||
local r2 = b:GetRoleData(prop)
|
||||
|
@ -379,7 +376,9 @@ function BattleUtil.ChooseTarget(role, chooseId)
|
|||
if chooseWeight == 0 or role.ctrl_blind then --致盲时排序无效
|
||||
BattleUtil.RandomList(arr)
|
||||
elseif chooseWeight == 1 then -- 生命值
|
||||
BattleUtil.SortByProp(arr, RoleDataName.Hp, sort)
|
||||
if sort~=0 then
|
||||
BattleUtil.SortByProp(arr, RoleDataName.Hp, sort)
|
||||
end
|
||||
elseif chooseWeight == 2 then -- 血量百分比
|
||||
BattleUtil.SortByHpFactor(arr, sort)
|
||||
--选血量百分比最低的 不选择有不灭的,如果伤害要选有不灭的 需处理
|
||||
|
|
Loading…
Reference in New Issue