From ba834ed742b8d0333e0b44c510817c41a457cea0 Mon Sep 17 00:00:00 2001 From: mashiyu Date: Mon, 25 Mar 2019 19:41:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=96=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luafight/Modules/Battle/Logic/Base/Effect.lua | 35 ++++++++++++++++--- luafight/Modules/Battle/Logic/Base/Skill.lua | 8 +++-- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/luafight/Modules/Battle/Logic/Base/Effect.lua b/luafight/Modules/Battle/Logic/Base/Effect.lua index 8fef33fb6..2ab5587a9 100644 --- a/luafight/Modules/Battle/Logic/Base/Effect.lua +++ b/luafight/Modules/Battle/Logic/Base/Effect.lua @@ -217,10 +217,10 @@ local effectList = { local f2 = args[3] * (1 + caster:GetRoleData(RoleDataName.Hit) / (1 + target:GetRoleData(RoleDataName.Dodge))) local rid = args[4] local f3 = args[5] - --caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval) - --if caster.camp == 0 and target.camp == 1 then - -- BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval) - --end + caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval) + if caster.camp == 0 and target.camp == 1 then + BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval) + end BattleLogic.WaitForTrigger(interval, function () local layer if target.BuffMgr:HasBuff(BuffName.Brand, function (buff) @@ -486,6 +486,33 @@ local effectList = { BattleUtil.CalDamage(caster, target, dt, f1) end) end, + --造成[a]到[b]次[c]%的[d]伤害,对[e]造成额外[f]%伤害 + --a[int],b[int],c[float],d[伤害类型],e[职业],f[float] + [29] = function(caster, target, args, interval) + local i1 = args[1] + local i2 = args[2] + local f1 = args[3] + local dt = args[4] + local pt = args[5] + local f2 = args[6] + + local count = Random.RangeInt(i1, i2) + local d = interval / count + if caster.camp == 0 and target.camp == 1 then + BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, d) + end + for i=1, count do + BattleLogic.WaitForTrigger(d * (i-1), function () + caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, d) + BattleLogic.WaitForTrigger(d, function () + if target.professionId == pt then + f1 = f1 + f2 + end + BattleUtil.CalDamage(caster, target, dt, f1) + end) + end) + end + end, } return effectList \ No newline at end of file diff --git a/luafight/Modules/Battle/Logic/Base/Skill.lua b/luafight/Modules/Battle/Logic/Base/Skill.lua index 1e0c373fd..8ed67aace 100644 --- a/luafight/Modules/Battle/Logic/Base/Skill.lua +++ b/luafight/Modules/Battle/Logic/Base/Skill.lua @@ -2,7 +2,6 @@ local effect = require("Modules/Battle/Logic/Base/Effect") local floor = math.floor local max = math.max local min = math.min -local gameFrameRate = BattleLogic.GameFrameRate --local BattleConst = BattleConst --local RoleDataName = RoleDataName --local BattleEventName = BattleEventName @@ -150,10 +149,15 @@ end function Skill:Dispose() local effectGroup + local effect while self.effectList.size > 0 do effectGroup = self.effectList.buffer[self.effectList.size] for k=1, #effectGroup[3] do - effectPool:Put(effectGroup[3][k]) + effect = effectGroup[3][k] + for j=1, #effect[2] do + effect[2][j] = nil + end + effectPool:Put(effect) effectGroup[3][k] = nil end effectGroupPool:Put(effectGroup)