【技能】=========149 150 修改提交

dev_chengFeng
wangzhenxing 2022-03-18 16:29:03 +08:00
parent 9e010245fe
commit 3e5b67ddf6
1 changed files with 17 additions and 8 deletions

View File

@ -2918,13 +2918,12 @@ local effectList = {
end)
end,
--造成[a]%的[b]伤害,造成技能总伤害的[c]%用于医疗生命值最低的队友(治疗队友数为集中敌人数)。
--a[float],b[伤害类型],c[float] ,d[int]
--造成[a]%的[b]伤害并记录技能总伤害
--a[float],b[伤害类型]
[149] = function(caster, target, args, interval, skill)
local f1 = args[1]
local dt = args[2]
local f2 = args[3]
local num = args[4]
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
BattleLogic.WaitForTrigger(interval, function ()
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType,curSkill)
@ -2935,16 +2934,26 @@ local effectList = {
target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
BattleUtil.CalDamage(skill, caster, target, dt, f1)
target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
end)
end,
--造成技能总伤害的[a]%平分给生命值最低的[b]队友
--a[float],b[int]
[150] = function(caster, target, args, interval, skill)
local f1 = args[1]
local num = args[2]
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
BattleLogic.WaitForTrigger(interval, function ()
local OnSkillEnd
OnSkillEnd=function(skill)
if skill.skillDamage==0 then
return
end
local hp=BattleUtil.ErrorCorrection(skill.skillDamage*f1/num)
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
BattleUtil.SortByHpFactor(arr, 1)
for i = 1, #arr do
if not BattleUtil.ChecklistIsContainValue(skill.targets,arr[i]) then
f2 = BattleUtil.CheckSkillDamageHeal(f2, caster, arr[i])
BattleUtil.ApplyTreat(caster, arr[i], floor(skill.skillDamage*f2))
table.insert(skill.targets,arr[i])
break
if i<=num then
BattleUtil.ApplyTreat(caster, arr[i], hp)
end
end
caster.Event:RemoveEvent(BattleEventName.SkillCastEnd,OnSkillEnd)