[战斗]==============添加效果127 任务初始化时被动排序

dev_chengFeng
wangzhenxing 2021-03-24 16:50:55 +08:00
parent bf3ae927c8
commit 21be2f29dd
3 changed files with 14 additions and 2 deletions

View File

@ -2388,6 +2388,17 @@ local effectList = {
end end
end) end)
end, end,
--[a]% 的概率 放逐 目标[b]回合
--a[float],b[int]
[127] = function(caster, target, args, interval, skill)
local pro = args[1]
local round = args[2]
BattleLogic.WaitForTrigger(interval, function ()
BattleUtil.RandomAction(pro, function ()
target:AddBuff(Buff.Create(caster, BuffName.Exile, round))
end)
end)
end,
} }
return effectList return effectList

View File

@ -80,7 +80,7 @@ local _ConditionConfig = {
local r = Random.Range01() local r = Random.Range01()
-- 判断概率 -- 判断概率
if isEnough then if isEnough then
return r>rand/10000 return rand/10000>r
end end
return false return false
end, end,

View File

@ -84,6 +84,7 @@ function RoleLogic:Init(uid, data, position)
self.type = BattleUnitType.Role self.type = BattleUnitType.Role
self.passiveList = {} self.passiveList = {}
if data.passivity and #data.passivity > 0 then if data.passivity and #data.passivity > 0 then
table.sort(data.passivity,function(a,b)return a[1] < b[1] end)
for i = 1, #data.passivity do for i = 1, #data.passivity do
local v = data.passivity[i] local v = data.passivity[i]
local passivityId=v[1] local passivityId=v[1]
@ -96,7 +97,7 @@ function RoleLogic:Init(uid, data, position)
if BattleUtil.Passivity[id] then if BattleUtil.Passivity[id] then
BattleUtil.Passivity[id](self, args,passivityId,judge) BattleUtil.Passivity[id](self, args,passivityId,judge)
-- 加入被动列表 -- 加入被动列表
table.insert(self.passiveList, {id, args}) table.insert(self.passiveList, {id, args,passivityId})
end end
end end
end end