【战斗】==============被动313修改

dev_chengFeng
wangzhenxing 2021-04-25 19:50:54 +08:00
parent 9874f5b42a
commit 324c93e93f
2 changed files with 12 additions and 33 deletions

View File

@ -6836,37 +6836,24 @@ local passivityList = {
-- 根据生命百分比添加被动 血量百分比[a],被动id[b],...(后面没有的不配)
-- a[float],b[int],c[float],d[int],e[float],f[int],g[float],h[int]
[313] = function(role, args)
local p1 = args[1]
local pass1 = args[2]
local p2 = args[3]
local pass2 = args[4]
local p3 =args[5]
local pass3 = args[6]
local p4 =args[7]
local pass4 = args[8]
--已经添加过的被动id
local passTable={}
if pass1 and p1 then
table.insert(passTable,{pass1,p1})
end
if pass2 and p2 then
table.insert(passTable, {pass2,p2})
end
if pass3 and p3 then
table.insert(passTable,{pass3,p3})
end
if pass4 and p4 then
table.insert(passTable,{pass4,p4})
for i = 1, #args do
if i%2==0 then
table.insert(passTable,{args[i],args[i-1]})
end
end
local len=BattleUtil.LengthOfTable(passTable)
local addIds={}
if BattleUtil.LengthOfTable(addIds)>= len then
return
end
-- 释放技能后
local onRoleBeDamaged = function(caster, damage)
local ft = role:GetRoleData(RoleDataName.Hp)/role:GetRoleData(RoleDataName.MaxHp)
for key, value in pairs(passTable) do
if ft<value and not BattleUtil.ChecklistIsContainValue(passTable,key) then
role:AddPassiveById(key)
table.insert(addIds,key)
if ft<value[2] and not BattleUtil.ChecklistIsContainValue(addIds,value[1]) then
role:AddPassiveById(value[1])
table.insert(addIds,value[1])
end
end
end

View File

@ -116,18 +116,10 @@ function RoleLogic:AddPassiveById(id)
if not value then
return
end
local args={}
local skills = string.split(value,"#")
if not skills then
return
end
for i = 1, #skills do
args[i]=skills[i]
end
-- 被动生效
BattleUtil.Passivity[id](self, args,id,config.Judge)
BattleUtil.Passivity[config.Type](self,value,id,config.Judge)
-- 加入被动列表
table.insert(self.passiveList, {id, args,id,args})
table.insert(self.passiveList, {id, value,id,config.judge})
end
-- 添加一个被动技能
function RoleLogic:AddPassive(id, args, isRepeat)