[战斗]======被动412 提交

dev_chengFeng
wangzhenxing 2021-12-23 14:37:19 +08:00
parent e6d1ac6ef0
commit 76d9e596b4
2 changed files with 56 additions and 2 deletions

View File

@ -10607,7 +10607,57 @@ local passivityList = {
end
BattleLogic.Event:AddEvent(BattleEventName.RecordBuff, buffBeAdd,nil,nil,role)
end,
--我方神将阵亡后,为随机1个存活神将添加[a]类型[b]效果,持续[c]回合,每场战斗最多触发[d]次,每回合最多触发[e]次
--a[int],b[int],c[int],d[int],e[int]
[412]=function(role,args,id,judge)
local t1=args[1]
local t2=args[2]
local r1=args[3]
local t3=args[4]
local t4=args[5]
local maxTime=0
local rTime=0
if PassiveManager.passiveCountList[role.camp][id] and PassiveManager.passiveCountList[role.camp][id] > 0 then
return
end
PassiveManager.passiveCountList[role.camp][id] = 1
local RoleVanish=function(deader)
BattleLogic.WaitForTrigger(2,function()
if deader.camp~=role.camp then
return
end
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function ()
if maxTime>=t3 then
return
end
if rTime>=t4 then
return
end
local arr=RoleManager.Query(function(v) return v.camp==role.camp and not BattleUtil.CheckIsNoDead(v) end)
if arr==nil or #arr==0 then
return
end
local index = Random.RangeInt(1, #arr)
if arr[index] then
-- local caster=RoleManager.GetRole()
-- caster:Init(role.uid,role.roleData,role.position)
-- caster.type=BattleUnitType.Monster
local buff=Buff.Create(deader,t1,r1,t2,0)
arr[index]:AddBuff(buff)
maxTime=maxTime+1
rTime=rTime+1
end
end)
end)
end
--即使被放逐也会同样生效
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead,RoleVanish)
local onBattleRoundChange = function(func, caster)
rTime=0
end
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, onBattleRoundChange)
end,
}

View File

@ -51,6 +51,10 @@ function this.AddRole(roleData, position)
BattleLogic.Event:DispatchEvent(BattleEventName.AddRole, role)
end
end
function this.GetRole()
local role = rolePool:Get()
return role
end
--
@ -117,7 +121,7 @@ function this.CheckDead()
for _, pos in ipairs(removePos) do
table.insert(RealDeadList,_DeadRoleList[pos])
BattleLogic.WaitForTrigger(1,function()
BattleLogic.Event:DispatchEvent(BattleEventName.RoleIsVanish,RealDeadList)
BattleLogic.Event:DispatchEvent(BattleEventName.RoleIsVanish,RealDeadList,_DeadRoleList[pos])
end)
_DeadRoleList[pos] = nil
end