back_recharge
wangyuan 2019-10-21 14:25:32 +08:00
parent b9b8eaba39
commit 53821ad34c
3 changed files with 83 additions and 45 deletions

View File

@ -1722,6 +1722,60 @@ local effectList = {
buffRandomAction(f4, target, Buff.Create(caster, BuffName.DOT, f2, f2/f3, d1, dt, f1))
end)
end,
--造成[a]%的[b]伤害,若暴击,[g][c]%概率改变我方随机1人[d]属性[e]%,持续[f]秒。
--a[float],b[伤害类型],c[float],d[属性],e[float],f[int],g[改变类型]
[92] = function(caster, target, args, interval)
local f4 = args[1]
local dt = args[2]
local f3 = args[3]
local pro1 = args[4]
local f1 = args[5]
local f2 = args[6]
local ct = args[7]
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
BattleLogic.WaitForTrigger(interval, function ()
local dmg, crit = BattleUtil.CalDamage(caster, target, dt, f4)
if crit then
buffRandomAction(f3, target, Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro1], f1, ct))
end
end)
end,
--造成[a]%的[b]伤害,若暴击,[c]概率驱散[d]个0表示所有[e]状态。
--a[float],b[伤害类型],c[float],d[int],e[状态类型]
[93] = function(caster, target, args, interval)
local f1 = args[1]
local dt = args[2]
local f2 = args[3]
local i1 = args[4]
local ct = args[5]
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
BattleLogic.WaitForTrigger(interval, function ()
local dmg, crit = BattleUtil.CalDamage(caster, target, dt, f1)
if crit then
BattleUtil.RandomAction(f2, function ()
local count = 0
BattleLogic.BuffMgr:ClearBuff(target, function (buff)
local flag = false
if ct == 1 then --持续恢复
flag = buff.type == BuffName.HOT
elseif ct == 2 then --护盾
flag = buff.type == BuffName.Shield
elseif ct == 3 then --增益状态
flag = buff.isBuff == true
elseif ct == 4 then --减益状态
flag = buff.isDeBuff == true
elseif ct == 5 then --持续伤害
flag = buff.type == BuffName.DOT
end
if flag then
count = count + 1
end
return (i1 == 0 or count <= i1) and flag
end)
end)
end
end)
end
}
return effectList

View File

@ -25,7 +25,7 @@ end
function Skill:Init(role, effectData, type) --type 0 异妖 1 点技 2 滑技
local isTeamSkill = type == 0
if type == 0 then --异妖
self.cd = effectData[1] % 100 --异妖技能的cd数据为类型*100 + cd
self.cd = effectData[1] % 100 --异妖技能的cd数据为类型*100 + 站位
self.randomInStage2 = 0
elseif type == 1 then --点技
self.cd = 0 --点技 cd为0

View File

@ -25,8 +25,6 @@ local playerTeamDummyRole = {camp = 0, Event = BattleEvent.New(), isTeam = true,
local enemyTeamDummyRole = {camp = 1, Event = BattleEvent.New(), isTeam = true, curSkill = nil, isDebug = false}
local playerTeamSkillList = {}
local enemyTeamSkillList = {}
local playerTeamSkillIndex
local enemyTeamSkillIndex
local fightData
local record
@ -88,8 +86,6 @@ function BattleLogic.Init(maxTime, data, optionData)
curBuffId = 0
curFrame = 0
playerMP = 0
enemyMP = 0
stage = 0
playerTeamDummyRole.isDebug = false
@ -110,10 +106,7 @@ function BattleLogic.StartOrder()
BattleLogic.CurOrder = BattleLogic.CurOrder + 1
stage = 0
curStageFrame = 0
teamSkillCastIndex = 1
playerTeamSkillIndex = 1
enemyTeamSkillIndex = 1
if BattleLogic.CurOrder == 1 then
for i=1, #fightData.playerData do
@ -123,13 +116,16 @@ function BattleLogic.StartOrder()
BattleLogic.AddRole(fightData.enemyData[BattleLogic.CurOrder][i], i)
end
for i=1, #playerTeamSkillList do
skillPool:Put(playerTeamSkillList[i])
playerTeamSkillList[i]=nil
for i=1,3 do
if playerTeamSkillList[i] then
skillPool:Put(playerTeamSkillList[i])
playerTeamSkillList[i]=nil
end
end
for i=1, #fightData.playerData.teamSkill do
playerTeamSkillList[i] = skillPool:Get()
playerTeamSkillList[i]:Init(playerTeamDummyRole, fightData.playerData.teamSkill[i], 0)
local skill = skillPool:Get()
skill:Init(playerTeamDummyRole, fightData.playerData.teamSkill[i], 0)
playerTeamSkillList[skill.cd] = skill
end
for i=1, #fightData.playerData.teamPassive do
for j=1, #fightData.playerData.teamPassive[i] do
@ -143,13 +139,16 @@ function BattleLogic.StartOrder()
end
end
for i=1, #enemyTeamSkillList do
skillPool:Put(enemyTeamSkillList[i])
enemyTeamSkillList[i]=nil
for i=1,3 do
if enemyTeamSkillList[i] then
skillPool:Put(enemyTeamSkillList[i])
enemyTeamSkillList[i]=nil
end
end
for i=1, #fightData.enemyData[BattleLogic.CurOrder].teamSkill do
enemyTeamSkillList[i] = skillPool:Get()
enemyTeamSkillList[i]:Init(enemyTeamDummyRole, fightData.enemyData[BattleLogic.CurOrder].teamSkill[i], 0)
local skill = skillPool:Get()
skill:Init(enemyTeamDummyRole, fightData.enemyData[BattleLogic.CurOrder].teamSkill[i], 0)
enemyTeamSkillList[skill.cd] = skill
end
for i=1, #fightData.enemyData[BattleLogic.CurOrder].teamPassive do
for j=1, #fightData.enemyData[BattleLogic.CurOrder].teamPassive[i] do
@ -190,6 +189,10 @@ function BattleLogic.StartOrder()
end
end
function BattleLogic.GetTeamSkill(camp, pos)
return camp == 0 and playerTeamSkillList[pos] or enemyTeamSkillList[pos]
end
function BattleLogic.GetTeamSkillCastSlider()
if playerTeamDummyRole.isDebug then
return 0
@ -372,22 +375,15 @@ function BattleLogic.Update()
end
if teamSkillCastIndex <= #teamSkillCastTime and curStageFrame > teamSkillCastTime[teamSkillCastIndex] then
if not playerTeamDummyRole.isDebug and playerTeamSkillList[teamSkillCastIndex] then
playerTeamSkillList[teamSkillCastIndex]:Cast()
end
if not enemyTeamDummyRole.isDebug and enemyTeamSkillList[teamSkillCastIndex] then
enemyTeamSkillList[teamSkillCastIndex]:Cast()
end
teamSkillCastIndex = teamSkillCastIndex + 1
end
if playerTeamSkillIndex < teamSkillCastIndex then
if not playerTeamDummyRole.isDebug and playerTeamSkillList[playerTeamSkillIndex] then
playerTeamSkillList[playerTeamSkillIndex]:Cast()
playerTeamSkillIndex = playerTeamSkillIndex + 1
end
end
if enemyTeamSkillIndex < teamSkillCastIndex then
if not enemyTeamDummyRole.isDebug and enemyTeamSkillList[enemyTeamSkillIndex] then
enemyTeamSkillList[enemyTeamSkillIndex]:Cast()
enemyTeamSkillIndex = enemyTeamSkillIndex + 1
end
end
local index = 1
while index <= tbActionList.size do
local action = tbActionList.buffer[index]
@ -479,26 +475,14 @@ end
function BattleLogic.CastTeamSkill(camp)
if camp == 0 then
local teamSkill = playerTeamSkillList[playerTeamSkillIndex]
local teamSkill = playerTeamSkillList[teamSkillCastIndex]
if teamSkill then
teamSkill:Cast()
if playerTeamSkillIndex == #playerTeamSkillList then
playerTeamSkillIndex = 1
else
playerTeamSkillIndex = playerTeamSkillIndex + 1
end
playerMP = 0
end
else
local teamSkill = enemyTeamSkillList[enemyTeamSkillIndex]
local teamSkill = enemyTeamSkillList[teamSkillCastIndex]
if teamSkill then
teamSkill:Cast()
if enemyTeamSkillIndex == #enemyTeamSkillList then
enemyTeamSkillIndex = 1
else
enemyTeamSkillIndex = enemyTeamSkillIndex + 1
end
enemyMP = 0
end
end
end