[战斗]============被动338,339提交
parent
e2f381b11a
commit
59f131e824
|
@ -7844,8 +7844,65 @@ local passivityList = {
|
|||
end
|
||||
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundStart, onRoundStart,nil,nil,role)
|
||||
end,
|
||||
-- 受到直接伤害的[a]%转换为护甲
|
||||
-- a[float]
|
||||
[338] = function(role, args)
|
||||
local f1 = args[1]
|
||||
local onBeHit = function(caster, damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果角色死亡就不会反弹伤害
|
||||
if role:IsDead() then
|
||||
return
|
||||
end
|
||||
--不是真实伤害
|
||||
if not skill and not isDirect then
|
||||
return
|
||||
end
|
||||
|
||||
local rDamage = f1 * damage
|
||||
role:AddBuff(Buff.Create(role, BuffName.Shield,0, ShieldTypeName.NormalReduce, rDamage, 0))
|
||||
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleBeHit, onBeHit,nil,nil,role)
|
||||
end,
|
||||
--每次行动未造成击杀,则该行动主目标造成其[a][b]%的间接伤害
|
||||
[339] = function(role, args)
|
||||
local p1 = args[1]
|
||||
local v1 = args[2]
|
||||
local isNoDie=true
|
||||
--获取主目标
|
||||
local onSkillCast = function(skill)
|
||||
if not skill then
|
||||
return
|
||||
end
|
||||
if skill and not skill.isTriggerJudge and judge==1 then
|
||||
return
|
||||
end
|
||||
local list=skill:GetDirectTargets()
|
||||
local target=RoleManager.GetAggroHero(role,list)
|
||||
if target and BattleUtil.LengthOfTable(target)>0 then
|
||||
role.curMainTarget=target[1]
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCastBefore, onSkillCast,nil,nil,role)
|
||||
|
||||
local onRoleKill=function(defRole,skill)
|
||||
isNoDie=false
|
||||
end
|
||||
local onTurnStar=function(role)
|
||||
|
||||
role.Event:AddEvent(BattleEventName.RoleKill,onRoleKill,nil,nil,role)
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleTurnStart, onTurnStar,nil,nil,role)
|
||||
|
||||
local onTurnEnd=function(role)
|
||||
role.Event:RemoveEvent(BattleEventName.RoleKill,onRoleKill,nil,nil,role)
|
||||
if isNoDie then
|
||||
local damage=floor(BattleUtil.FP_Mul(role.curMainTarget:GetRoleData(p1),v1))
|
||||
BattleUtil.FinalDamage(nil,role,role.curMainTarget,damage)
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleTurnEnd, onTurnStar,nil,nil,role)
|
||||
end,
|
||||
}
|
||||
return passivityList
|
|
@ -29,6 +29,7 @@ function RoleLogic:Init(uid, data, position)
|
|||
self.isDead = self:GetRoleData(RoleDataName.Hp) <= 0
|
||||
self.isRealDead = self.isDead
|
||||
self.killDamage = 0 --致死伤害
|
||||
self.killRole=nil --击杀英雄
|
||||
self.camp = data.camp --阵营 0:我方 1:敌方
|
||||
self.name = data.name
|
||||
self.element = data.element
|
||||
|
|
|
@ -62,7 +62,6 @@ function Skill:Cast(func)
|
|||
self.castDoneFunc = func
|
||||
self.isTriggePassivity=false
|
||||
self.triggerPassivityId={}
|
||||
|
||||
-- 技能效果生效
|
||||
if self.effectCaster then
|
||||
--放技能前判断是否有目标,没有就不会放技能,直接执行技能回调 by 王振兴 2021/03/26
|
||||
|
@ -88,7 +87,11 @@ function Skill:Cast(func)
|
|||
--技能的施法时间计算,根据当前目标id关联的持续时间,取其中时间最长的一个
|
||||
local duration = self.hitTime + self.continueTime
|
||||
-- 结算时间向后延长0.2秒,避免在效果结算完成前就结束了技能释放
|
||||
BattleLogic.WaitForTrigger(duration + 0.8, function()
|
||||
local time=0.8
|
||||
if self.id==1282 then
|
||||
time=2.5
|
||||
end
|
||||
BattleLogic.WaitForTrigger(duration + time, function()
|
||||
self.owner.Event:DispatchEvent(BattleEventName.SkillCastEnd, self)
|
||||
BattleLogic.Event:DispatchEvent(BattleEventName.SkillCastEnd, self)
|
||||
|
||||
|
|
Loading…
Reference in New Issue