【战斗】==============被动313修改
parent
9874f5b42a
commit
324c93e93f
|
@ -6836,37 +6836,24 @@ local passivityList = {
|
||||||
-- 根据生命百分比添加被动 血量百分比[a],被动id[b],...(后面没有的不配)
|
-- 根据生命百分比添加被动 血量百分比[a],被动id[b],...(后面没有的不配)
|
||||||
-- a[float],b[int],c[float],d[int],e[float],f[int],g[float],h[int]
|
-- a[float],b[int],c[float],d[int],e[float],f[int],g[float],h[int]
|
||||||
[313] = function(role, args)
|
[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={}
|
local passTable={}
|
||||||
if pass1 and p1 then
|
for i = 1, #args do
|
||||||
table.insert(passTable,{pass1,p1})
|
if i%2==0 then
|
||||||
end
|
table.insert(passTable,{args[i],args[i-1]})
|
||||||
if pass2 and p2 then
|
end
|
||||||
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})
|
|
||||||
end
|
end
|
||||||
local len=BattleUtil.LengthOfTable(passTable)
|
local len=BattleUtil.LengthOfTable(passTable)
|
||||||
local addIds={}
|
local addIds={}
|
||||||
|
if BattleUtil.LengthOfTable(addIds)>= len then
|
||||||
|
return
|
||||||
|
end
|
||||||
-- 释放技能后
|
-- 释放技能后
|
||||||
local onRoleBeDamaged = function(caster, damage)
|
local onRoleBeDamaged = function(caster, damage)
|
||||||
local ft = role:GetRoleData(RoleDataName.Hp)/role:GetRoleData(RoleDataName.MaxHp)
|
local ft = role:GetRoleData(RoleDataName.Hp)/role:GetRoleData(RoleDataName.MaxHp)
|
||||||
for key, value in pairs(passTable) do
|
for key, value in pairs(passTable) do
|
||||||
if ft<value and not BattleUtil.ChecklistIsContainValue(passTable,key) then
|
if ft<value[2] and not BattleUtil.ChecklistIsContainValue(addIds,value[1]) then
|
||||||
role:AddPassiveById(key)
|
role:AddPassiveById(value[1])
|
||||||
table.insert(addIds,key)
|
table.insert(addIds,value[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -116,18 +116,10 @@ function RoleLogic:AddPassiveById(id)
|
||||||
if not value then
|
if not value then
|
||||||
return
|
return
|
||||||
end
|
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
|
end
|
||||||
-- 添加一个被动技能
|
-- 添加一个被动技能
|
||||||
function RoleLogic:AddPassive(id, args, isRepeat)
|
function RoleLogic:AddPassive(id, args, isRepeat)
|
||||||
|
|
Loading…
Reference in New Issue