战斗同步
parent
b9f2d0d096
commit
c224a55bfd
|
@ -84,7 +84,11 @@ local effectList = {
|
||||||
local f2 = args[3]
|
local f2 = args[3]
|
||||||
local ct = args[4]
|
local ct = args[4]
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro1], f1, ct))
|
local buff = Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro1], f1, ct)
|
||||||
|
if f2 == 0 then
|
||||||
|
buff.cover = true
|
||||||
|
end
|
||||||
|
target:AddBuff(buff)
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
--持续恢复[a]*[b]%生命,持续[c]秒
|
--持续恢复[a]*[b]%生命,持续[c]秒
|
||||||
|
@ -181,7 +185,7 @@ local effectList = {
|
||||||
local f2 = args[4]
|
local f2 = args[4]
|
||||||
casterBulletEffect(caster, target, interval)
|
casterBulletEffect(caster, target, interval)
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
if target.professionId == i1 then
|
if target.roleData.professionId == i1 then
|
||||||
f1 = f1 + f2
|
f1 = f1 + f2
|
||||||
end
|
end
|
||||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||||
|
@ -282,7 +286,7 @@ local effectList = {
|
||||||
casterBulletEffect(caster, target, interval)
|
casterBulletEffect(caster, target, interval)
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
local dmg = floor(caster:GetRoleData(propertyList[dt]) * f1)
|
local dmg = floor(caster:GetRoleData(propertyList[dt]) * f1)
|
||||||
if target.professionId == i1 then
|
if target.roleData.professionId == i1 then
|
||||||
BattleUtil.RandomAction(f2, function ()
|
BattleUtil.RandomAction(f2, function ()
|
||||||
target.isFlagCrit = true
|
target.isFlagCrit = true
|
||||||
BattleUtil.CalDamage(caster, target, dmg)
|
BattleUtil.CalDamage(caster, target, dmg)
|
||||||
|
@ -485,7 +489,7 @@ local effectList = {
|
||||||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, d, target)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, d, target)
|
||||||
BattleLogic.WaitForTrigger(d, function ()
|
BattleLogic.WaitForTrigger(d, function ()
|
||||||
if target.professionId == pt then
|
if target.roleData.professionId == pt then
|
||||||
f1 = f1 + f2
|
f1 = f1 + f2
|
||||||
end
|
end
|
||||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||||
|
@ -579,7 +583,7 @@ local effectList = {
|
||||||
local f2 = args[4]
|
local f2 = args[4]
|
||||||
local ct = args[5]
|
local ct = args[5]
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
if target.professionId == pt then
|
if target.roleData.professionId == pt then
|
||||||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro1], f1, ct))
|
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro1], f1, ct))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
@ -695,15 +699,22 @@ local effectList = {
|
||||||
local f2 = args[2]
|
local f2 = args[2]
|
||||||
local f3 = args[3]
|
local f3 = args[3]
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
|
local brand = Buff.Create(caster, BuffName.Brand, f3, "weak")
|
||||||
|
brand.exDmg = f2
|
||||||
|
brand.coverFunc = function (oldBuff)
|
||||||
|
brand.exDmg = brand.exDmg + oldBuff.exDmg
|
||||||
|
end
|
||||||
local trigger = function(atkRole, damagingFunc, damageType)
|
local trigger = function(atkRole, damagingFunc, damageType)
|
||||||
BattleUtil.RandomAction(f1, function ()
|
BattleUtil.RandomAction(f1, function ()
|
||||||
damagingFunc(f2)
|
damagingFunc(brand.exDmg)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
target.Event:AddEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
target.Event:AddEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||||||
target:AddBuff(Buff.Create(caster, BuffName.Brand, f3, "weak", function ()
|
brand.endFunc = function ()
|
||||||
|
brand.exDmg = nil
|
||||||
target.Event:RemoveEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
target.Event:RemoveEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||||||
end))
|
end
|
||||||
|
target:AddBuff(brand)
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
--瞬间恢复[a]的生命
|
--瞬间恢复[a]的生命
|
||||||
|
@ -714,20 +725,22 @@ local effectList = {
|
||||||
BattleUtil.CalTreat(caster, target, i1)
|
BattleUtil.CalTreat(caster, target, i1)
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
--造成[a]%的[b]伤害,计算伤害时,额外计算[c]%的[d]和[e]%的[f]
|
--造成[a]%的[b]伤害,计算伤害时额外计算[c]%的[d][e]和[f]%的[g][h]
|
||||||
--a[float],b[伤害类型],c[float],d[属性],e[float],f[属性]
|
--a[float],b[伤害类型],c[float],d[属性],e[改变类型],f[float],g[属性],h[改变类型]
|
||||||
[44] = function(caster, target, args, interval)
|
[44] = function(caster, target, args, interval)
|
||||||
local f1 = args[1]
|
local f1 = args[1]
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
local f2 = args[3]
|
local f2 = args[3]
|
||||||
local pro1 = args[4]
|
local pro1 = args[4]
|
||||||
local f3 = args[5]
|
local ct1 = args[5]
|
||||||
local pro2 = args[6]
|
local f3 = args[6]
|
||||||
|
local pro2 = args[7]
|
||||||
|
local ct2 = args[8]
|
||||||
|
|
||||||
casterBulletEffect(caster, target, interval)
|
casterBulletEffect(caster, target, interval)
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
local proTran1 = {proName = propertyList[pro1], tranProName = propertyList[pro1], tranFactor = f2}
|
local proTran1 = {proName = propertyList[pro1], tranProName = propertyList[pro1], tranFactor = f2, changeType = ct1}
|
||||||
local proTran2 = {proName = propertyList[pro2], tranProName = propertyList[pro2], tranFactor = f3}
|
local proTran2 = {proName = propertyList[pro2], tranProName = propertyList[pro2], tranFactor = f3, changeType = ct2}
|
||||||
caster.proTranList:Add(proTran1)
|
caster.proTranList:Add(proTran1)
|
||||||
caster.proTranList:Add(proTran2)
|
caster.proTranList:Add(proTran2)
|
||||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||||
|
@ -776,7 +789,7 @@ local effectList = {
|
||||||
local f3 = args[5]
|
local f3 = args[5]
|
||||||
casterBulletEffect(caster, target, interval)
|
casterBulletEffect(caster, target, interval)
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
if target.professionId == pt then
|
if target.roleData.professionId == pt then
|
||||||
BattleUtil.CalDamage(caster, target, dt, f1+f3, f2)
|
BattleUtil.CalDamage(caster, target, dt, f1+f3, f2)
|
||||||
else
|
else
|
||||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||||
|
@ -807,15 +820,17 @@ local effectList = {
|
||||||
end
|
end
|
||||||
local OnSkillCast, OnSkillCastEnd
|
local OnSkillCast, OnSkillCastEnd
|
||||||
OnSkillCast = function(skill)
|
OnSkillCast = function(skill)
|
||||||
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
|
||||||
caster.Event:RemoveEvent(BattleEventName.SkillCast, OnSkillCast)
|
caster.Event:RemoveEvent(BattleEventName.SkillCast, OnSkillCast)
|
||||||
|
caster.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||||||
|
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||||||
end
|
end
|
||||||
OnSkillCastEnd = function(skill)
|
OnSkillCastEnd = function(skill)
|
||||||
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延迟一帧移除事件,防止触发帧和结束帧为同一帧时,被动未移除
|
||||||
caster.Event:RemoveEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
caster.Event:RemoveEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||||||
|
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
caster.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast)
|
caster.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast)
|
||||||
caster.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
--造成[a]%的[b]伤害,如果目标受到此次伤害前,生命低于最大生命[c]%,则直接击杀。
|
--造成[a]%的[b]伤害,如果目标受到此次伤害前,生命低于最大生命[c]%,则直接击杀。
|
||||||
|
@ -833,38 +848,47 @@ local effectList = {
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
--增加[c]层缚灵印记,每层印记[f]改变[d]属性[e]%,[i]改变[g]属性[h]%,最大[j]层(0为无限)
|
--增加[c]层缚灵印记,每层使受到的伤害增加[d],减少[e]%的受治疗效果,最大[f]层(0为无限)
|
||||||
--c[int],d[属性],e[float],f[改变类型],g[属性],h[float],i[改变类型],j[int]
|
--c[int],d[float],e[float],f[int]
|
||||||
[51] = function(caster, target, args, interval)
|
[51] = function(caster, target, args, interval)
|
||||||
local i1 = args[1]
|
local i1 = args[1]
|
||||||
local pro1 = args[2]
|
local f2 = args[2]
|
||||||
local f2 = args[3]
|
local f3 = args[3]
|
||||||
local ct1 = args[4]
|
local i2 = args[4]
|
||||||
local pro2 = args[5]
|
|
||||||
local f3 = args[6]
|
|
||||||
local ct2 = args[7]
|
|
||||||
local i2 = args[8]
|
|
||||||
local flag = "fuling"..caster.uid
|
local flag = "fuling"..caster.uid
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
local changeBuff1 = Buff.Create(target, BuffName.PropertyChange, 0, propertyList[pro1], f2*i1, ct1)
|
for i=1, i1 do
|
||||||
changeBuff1.cover = true
|
local brand
|
||||||
changeBuff1.maxLayer = i2
|
brand = Buff.Create(caster, BuffName.Brand, 0, flag)
|
||||||
|
brand.exDmg = f2
|
||||||
|
brand.exHeal = f3
|
||||||
|
brand.maxLayer = i2
|
||||||
|
brand.coverFunc = function (oldBuff)
|
||||||
|
if i2 == 0 or oldBuff.layer < i2 then
|
||||||
|
brand.exDmg = brand.exDmg + oldBuff.exDmg
|
||||||
|
brand.exHeal = brand.exHeal + oldBuff.exHeal
|
||||||
|
else
|
||||||
|
brand.exDmg = oldBuff.exDmg
|
||||||
|
brand.exHeal = oldBuff.exHeal
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local trigger = function(atkRole, damagingFunc, damageType)
|
||||||
|
damagingFunc(brand.exDmg)
|
||||||
|
end
|
||||||
|
local OnPassiveBeTreated = function(treatingFunc)
|
||||||
|
treatingFunc(-brand.exHeal)
|
||||||
|
end
|
||||||
|
|
||||||
local changeBuff2 = Buff.Create(target, BuffName.PropertyChange, 0, propertyList[pro2], f3*i1, ct2)
|
target.Event:AddEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||||||
changeBuff2.cover = true
|
target.Event:AddEvent(BattleEventName.PassiveBeTreated, OnPassiveBeTreated)
|
||||||
changeBuff2.maxLayer = i2
|
brand.endFunc = function ()
|
||||||
|
brand.exDmg = nil
|
||||||
target:AddBuff(changeBuff1)
|
brand.exHeal = nil
|
||||||
target:AddBuff(changeBuff2)
|
target.Event:RemoveEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||||||
|
target.Event:RemoveEvent(BattleEventName.PassiveBeTreated, OnPassiveBeTreated)
|
||||||
local brandBuff
|
end
|
||||||
brandBuff = Buff.Create(caster, BuffName.Brand, 0, flag, function ()
|
target:AddBuff(brand)
|
||||||
brandBuff.linkBuff1 = nil
|
end
|
||||||
brandBuff.linkBuff2 = nil
|
|
||||||
end)
|
|
||||||
brandBuff.linkBuff1 = changeBuff1
|
|
||||||
brandBuff.linkBuff2 = changeBuff2
|
|
||||||
target:AddBuff(brandBuff)
|
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
--造成[a]%的[b]伤害,引爆目标身上所有缚灵印记,每层造成攻击*[c]的真实伤害。
|
--造成[a]%的[b]伤害,引爆目标身上所有缚灵印记,每层造成攻击*[c]的真实伤害。
|
||||||
|
@ -910,7 +934,7 @@ local effectList = {
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
--[e]改变[a]属性[b]%的[c],持续[d]秒
|
--[e]改变[a]属性*[b]%的[c],持续[d]秒
|
||||||
--a[属性],b[float],c[属性],d[int],e[改变类型]
|
--a[属性],b[float],c[属性],d[int],e[改变类型]
|
||||||
[54] = function(caster, target, args, interval)
|
[54] = function(caster, target, args, interval)
|
||||||
local pro1 = args[1]
|
local pro1 = args[1]
|
||||||
|
@ -919,7 +943,7 @@ local effectList = {
|
||||||
local f2 = args[4]
|
local f2 = args[4]
|
||||||
local ct = args[5]
|
local ct = args[5]
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro1], floor(caster:GetRoleData(propertyList[pro2]) * f1), ct))
|
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro2], floor(caster:GetRoleData(propertyList[pro1]) * f1), ct))
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
--清除[a]状态
|
--清除[a]状态
|
||||||
|
@ -957,9 +981,9 @@ local effectList = {
|
||||||
local i1 = args[2]
|
local i1 = args[2]
|
||||||
casterBulletEffect(caster, target, interval)
|
casterBulletEffect(caster, target, interval)
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
local damage = BattleUtil.ApplyDamage(caster, target, floor(caster:GetRoleData(RoleDataName.Hp) * f1))
|
local damage = BattleUtil.ApplyDamage(caster, target, floor(target:GetRoleData(RoleDataName.Hp) * f1))
|
||||||
local arr = BattleUtil.ChooseTarget(caster, 10110)
|
local arr = BattleUtil.ChooseTarget(caster, 10110)
|
||||||
local count = math.min(#arr, i1)
|
local count = min(#arr, i1)
|
||||||
local heal = floor(damage / count)
|
local heal = floor(damage / count)
|
||||||
for i=1, count do
|
for i=1, count do
|
||||||
BattleUtil.CalTreat(caster, arr[i], heal)
|
BattleUtil.CalTreat(caster, arr[i], heal)
|
||||||
|
|
|
@ -41,7 +41,7 @@ local passivityList = {
|
||||||
for i=1, skill.effectList.size do
|
for i=1, skill.effectList.size do
|
||||||
duration = max(duration, skill.effectList.buffer[i].duration)
|
duration = max(duration, skill.effectList.buffer[i].duration)
|
||||||
end
|
end
|
||||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], duration + BattleLogic.GameDeltaTime * 2)
|
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], 2, duration + BattleLogic.GameDeltaTime * 2)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast)
|
role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast)
|
||||||
|
@ -203,7 +203,7 @@ local passivityList = {
|
||||||
local OnRoleBeDamagedBefore = function(atkRole, func, damageType)
|
local OnRoleBeDamagedBefore = function(atkRole, func, damageType)
|
||||||
if damageType == dt then
|
if damageType == dt then
|
||||||
BattleUtil.RandomAction(f1, function ()
|
BattleUtil.RandomAction(f1, function ()
|
||||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], BattleLogic.GameDeltaTime)
|
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], 2, BattleLogic.GameDeltaTime)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -292,7 +292,7 @@ local passivityList = {
|
||||||
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
|
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
|
||||||
if damageType == dt then
|
if damageType == dt then
|
||||||
BattleUtil.RandomAction(f1, function ()
|
BattleUtil.RandomAction(f1, function ()
|
||||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], f3)
|
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], 2, f3)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -331,7 +331,7 @@ local passivityList = {
|
||||||
|
|
||||||
local OnSkillCastEnd = function(skill)
|
local OnSkillCastEnd = function(skill)
|
||||||
BattleUtil.RandomAction(f1, function ()
|
BattleUtil.RandomAction(f1, function ()
|
||||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], f3)
|
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], 2, f3)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||||||
|
@ -375,7 +375,6 @@ local passivityList = {
|
||||||
--a[float]
|
--a[float]
|
||||||
[19] = function(role, args)
|
[19] = function(role, args)
|
||||||
local f1 = args[1]
|
local f1 = args[1]
|
||||||
|
|
||||||
role.data:AddValue(RoleDataName.CureFacter, f1)
|
role.data:AddValue(RoleDataName.CureFacter, f1)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
@ -733,7 +732,7 @@ local passivityList = {
|
||||||
local f1 = args[2]
|
local f1 = args[2]
|
||||||
|
|
||||||
local OnBeHit = function(atkRole)
|
local OnBeHit = function(atkRole)
|
||||||
if atkRole.professionId == i1 then
|
if atkRole.roleData.professionId == i1 then
|
||||||
BattleUtil.CalTreat(role, role, f1)
|
BattleUtil.CalTreat(role, role, f1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,9 @@ function Brand:OnEnd()
|
||||||
--log("Brand:OnEnd")
|
--log("Brand:OnEnd")
|
||||||
if self.endFunc then
|
if self.endFunc then
|
||||||
self.endFunc()
|
self.endFunc()
|
||||||
|
self.endFunc = nil
|
||||||
end
|
end
|
||||||
|
self.coverFunc = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--只有当cover字段为true时触发,返回true则被新效果覆盖
|
--只有当cover字段为true时触发,返回true则被新效果覆盖
|
||||||
|
@ -40,6 +42,9 @@ function Brand:OnCover(newBuff)
|
||||||
newBuff.layer = math.min(self.layer + 1, newBuff.maxLayer)
|
newBuff.layer = math.min(self.layer + 1, newBuff.maxLayer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if newBuff.coverFunc then
|
||||||
|
newBuff.coverFunc(self)
|
||||||
|
end
|
||||||
return b
|
return b
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ function Shield:SetData(...)
|
||||||
self.shieldValue, --护盾值
|
self.shieldValue, --护盾值
|
||||||
self.dmgReboundFactor = ... --伤害反弹系数
|
self.dmgReboundFactor = ... --伤害反弹系数
|
||||||
self.damageSum = 0 --记录承受的伤害
|
self.damageSum = 0 --记录承受的伤害
|
||||||
|
self.isBuff = true
|
||||||
end
|
end
|
||||||
|
|
||||||
--初始化后调用一次
|
--初始化后调用一次
|
||||||
|
|
|
@ -37,6 +37,7 @@ BattleEventName = {
|
||||||
SkillCastEnd = indexAdd(),
|
SkillCastEnd = indexAdd(),
|
||||||
|
|
||||||
PassiveTreating = indexAdd(),
|
PassiveTreating = indexAdd(),
|
||||||
|
PassiveBeTreated = indexAdd(),
|
||||||
PassiveBeDamaging = indexAdd(),
|
PassiveBeDamaging = indexAdd(),
|
||||||
PassiveDamaging = indexAdd(),
|
PassiveDamaging = indexAdd(),
|
||||||
PassiveCriting = indexAdd(),
|
PassiveCriting = indexAdd(),
|
||||||
|
|
|
@ -295,7 +295,8 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor)
|
||||||
|
|
||||||
--加入被动效果
|
--加入被动效果
|
||||||
local treatingFunc = function(exFactor) baseTreat = floor(baseTreat * (exFactor + 1) + 0.5) end
|
local treatingFunc = function(exFactor) baseTreat = floor(baseTreat * (exFactor + 1) + 0.5) end
|
||||||
castRole.Event:DispatchEvent(BattleEventName.PassiveTreating, treatingFunc)
|
castRole.Event:DispatchEvent(BattleEventName.PassiveTreating, treatingFunc, targetRole)
|
||||||
|
targetRole.Event:DispatchEvent(BattleEventName.PassiveBeTreated, treatingFunc, castRole)
|
||||||
|
|
||||||
local treat = min(baseTreat, maxHp - hp)
|
local treat = min(baseTreat, maxHp - hp)
|
||||||
if treat > 0 then
|
if treat > 0 then
|
||||||
|
|
|
@ -235,7 +235,17 @@ function RoleLogic:GetRoleData(property)
|
||||||
for i=1, self.proTranList.size do
|
for i=1, self.proTranList.size do
|
||||||
item = self.proTranList.buffer[i]
|
item = self.proTranList.buffer[i]
|
||||||
if item.proName == property then
|
if item.proName == property then
|
||||||
tarPro = tarPro + BattleUtil.ErrorCorrection(self.data:GetData(item.tranProName) * item.tranFactor)
|
local value
|
||||||
|
if item.changeType == 1 then --加算
|
||||||
|
value = item.tranFactor
|
||||||
|
elseif item.changeType == 2 then --乘加算(百分比属性加算)
|
||||||
|
value = BattleUtil.ErrorCorrection(self.data:GetData(item.tranProName) * item.tranFactor)
|
||||||
|
elseif item.changeType == 3 then --减算
|
||||||
|
value = -item.tranFactor
|
||||||
|
elseif item.changeType == 4 then --乘减算(百分比属性减算)
|
||||||
|
value = -BattleUtil.ErrorCorrection(self.data:GetData(item.tranProName) * item.tranFactor)
|
||||||
|
end
|
||||||
|
tarPro = tarPro + value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return tarPro
|
return tarPro
|
||||||
|
@ -243,8 +253,8 @@ end
|
||||||
|
|
||||||
--proA替换的属性,factor系数,proB被替换的属性, duration持续时间
|
--proA替换的属性,factor系数,proB被替换的属性, duration持续时间
|
||||||
--读取proB属性时,得到的值为proB + proA * factor
|
--读取proB属性时,得到的值为proB + proA * factor
|
||||||
function RoleLogic:AddPropertyTransfer(proA, factor, proB, duration)
|
function RoleLogic:AddPropertyTransfer(proA, factor, proB, ct, duration)
|
||||||
local proTran = {proName = proB, tranProName = proA, tranFactor = factor}
|
local proTran = {proName = proB, tranProName = proA, tranFactor = factor, changeType = ct}
|
||||||
self.proTranList:Add(proTran)
|
self.proTranList:Add(proTran)
|
||||||
local index = self.proTranList.size
|
local index = self.proTranList.size
|
||||||
BattleLogic.WaitForTrigger(duration, function ()
|
BattleLogic.WaitForTrigger(duration, function ()
|
||||||
|
|
Loading…
Reference in New Issue