【战斗】=============被动56,被动283,被动324修改 不灭修改

dev_chengFeng
wangzhenxing 2021-06-17 14:12:34 +08:00
parent b1425236af
commit 27b3d6e5c7
2 changed files with 22 additions and 12 deletions

View File

@ -1019,21 +1019,23 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.RoleHit, OnDamage,nil,nil,role)
end,
--造成暴击时,额外造成目标最大生命值[a]%的伤害。
--技能造成暴击时,额外造成目标最大生命值[a]%的伤害。
--a[float]
[56] = function(role, args,id,judge)
local f1 = args[1]
local lastTrigger = 0
local OnRoleCrit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
lastTrigger = lastTrigger + 1
if lastTrigger > 1 then --加入限定避免循环触发
return
end
local ar1 = floor(BattleUtil.FP_Mul(defRole:GetRoleData(RoleDataName.MaxHp), f1))
-- lastTrigger = lastTrigger + 1
-- if lastTrigger > 1 then --加入限定避免循环触发
-- return
-- end
if skill and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra or skill.type==BattleSkillType.DeadSkill ) then
local ar1 = floor(BattleUtil.FP_Mul(defRole:GetRoleData(RoleDataName.MaxHp), f1))
--local ar2 = BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.Attack), 2.5)
BattleUtil.FinalDamage(nil, role, defRole, ar1)
lastTrigger = 0
BattleUtil.FinalDamage(nil, role, defRole, ar1)
--lastTrigger = 0
end
end
role.Event:AddEvent(BattleEventName.RoleCrit, OnRoleCrit,nil,nil,role)
end,
@ -6287,7 +6289,8 @@ local passivityList = {
--查找敌方燃烧数量
if num==10 then
num=0
local arr=RoleManager.Query(function (v) return v.camp~=role.camp end)
local arr=skill:GetDirectTargets()
-- local arr=RoleManager.Query(function (v) return v.camp~=role.camp end)
for i = 1, #arr do
local aaa=BattleLogic.BuffMgr:HasBuff(arr[i], BuffName.DOT, function (buff) return buff.damageType==1 end)
if aaa then
@ -7373,7 +7376,7 @@ local passivityList = {
return
end
--释放者死亡或释放着被沉默
if caster:IsDead() or caster.ctrl_slient then
if caster:IsRealDead() or caster.ctrl_slient then
return
end
local num=role.SuperSkillRage-role.Rage

View File

@ -17,22 +17,28 @@ function NoDead:onPassiveDamaging(func, target, damage, skill)
local dd = BattleUtil.CountValue(damage, self.damageFactor, self.factorCT) - damage
if func then
func(-math.floor(BattleUtil.ErrorCorrection(dd))-self.recordDamage)
self.recordDamage=0
end
end
end
-- 记录承受伤害
function NoDead:OnRoleBeHit(atkRole, damage, bCrit, finalDmg, damageType, skill,isDirect)
if skill and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra ) and atkRole.camp~=self.target.camp then
if skill and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra or skill.type==BattleSkillType.DeadSkill ) and atkRole.camp~=self.target.camp then
self.recordDamage=self.recordDamage+math.floor(damage*0.1)
end
end
function NoDead:OnSkillCastEnd(skill)
if skill and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra ) then
self.recordDamage=0
end
end
--初始化后调用一次
function NoDead:OnStart()
--
self.target.Event:AddEvent(BattleEventName.PassiveDamaging, self.onPassiveDamaging, self)
self.target.Event:AddEvent(BattleEventName.SkillCastEnd,self.OnSkillCastEnd,self)
if self.target.star>=11 then
self.target.Event:AddEvent(BattleEventName.RoleBeHit,self.OnRoleBeHit,self)
end
@ -51,6 +57,7 @@ end
--效果结束时调用一次
function NoDead:OnEnd()
self.target.Event:RemoveEvent(BattleEventName.PassiveDamaging, self.onPassiveDamaging, self)
self.target.Event:RemoveEvent(BattleEventName.SkillCastEnd,self.OnSkillCastEnd,self)
if self.target.star>=11 then
self.target.Event:RemoveEvent(BattleEventName.RoleBeHit,self.OnRoleBeHit,self)
end