支援间隔

This commit is contained in:
chenxi 2023-04-19 12:23:56 +08:00
parent fa4e1ebd3c
commit 37476932d7
7 changed files with 85 additions and 45 deletions

View File

@ -182,10 +182,6 @@ local buff = {
} }
}, },
[33]={ [33]={
["name"]="heal_normal_attack",
["buff_type"]=1
},
[34]={
["name"]="stun", ["name"]="stun",
["buff_type"]=8, ["buff_type"]=8,
["icon"]="stun", ["icon"]="stun",
@ -193,60 +189,60 @@ local buff = {
4001 4001
} }
}, },
[35]={ [34]={
["name"]="shield", ["name"]="shield",
["buff_type"]=2, ["buff_type"]=2,
["fx_continued"]={ ["fx_continued"]={
4001 4001
} }
}, },
[36]={ [35]={
["name"]="atkp_add", ["name"]="atkp_add",
["buff_type"]=1 ["buff_type"]=1
}, },
[37]={ [36]={
["name"]="normal_attack_dec", ["name"]="normal_attack_dec",
["buff_type"]=1, ["buff_type"]=1,
["fx_continued"]={ ["fx_continued"]={
4001 4001
} }
}, },
[38]={ [37]={
["name"]="normal_attack_add", ["name"]="normal_attack_add",
["buff_type"]=1, ["buff_type"]=1,
["fx_continued"]={ ["fx_continued"]={
4001 4001
} }
}, },
[39]={ [38]={
["name"]="block", ["name"]="block",
["buff_type"]=1 ["buff_type"]=1
}, },
[40]={ [39]={
["name"]="hpp_add", ["name"]="hpp_add",
["buff_type"]=1 ["buff_type"]=1
}, },
[41]={ [40]={
["name"]="crit_add", ["name"]="crit_add",
["buff_type"]=1 ["buff_type"]=1
}, },
[42]={ [41]={
["name"]="crit_time_add", ["name"]="crit_time_add",
["buff_type"]=1 ["buff_type"]=1
}, },
[43]={ [42]={
["name"]="exp_time_add", ["name"]="exp_time_add",
["buff_type"]=7 ["buff_type"]=7
}, },
[44]={ [43]={
["name"]="cured_add", ["name"]="cured_add",
["buff_type"]=1 ["buff_type"]=1
}, },
[45]={ [44]={
["name"]="add_skill", ["name"]="add_skill",
["buff_type"]=7 ["buff_type"]=7
}, },
[46]={ [45]={
["name"]="skill_fire_times", ["name"]="skill_fire_times",
["buff_type"]=7 ["buff_type"]=7
} }
@ -285,25 +281,24 @@ local keys = {
["atkp_purple_add"]=buff[30], ["atkp_purple_add"]=buff[30],
["wavehealp"]=buff[31], ["wavehealp"]=buff[31],
["heal"]=buff[32], ["heal"]=buff[32],
["heal_normal_attack"]=buff[33], ["stun"]=buff[33],
["stun"]=buff[34], ["shield"]=buff[34],
["shield"]=buff[35], ["atkp_add"]=buff[35],
["atkp_add"]=buff[36], ["normal_attack_dec"]=buff[36],
["normal_attack_dec"]=buff[37], ["normal_attack_add"]=buff[37],
["normal_attack_add"]=buff[38], ["block"]=buff[38],
["block"]=buff[39], ["hpp_add"]=buff[39],
["hpp_add"]=buff[40], ["crit_add"]=buff[40],
["crit_add"]=buff[41], ["crit_time_add"]=buff[41],
["crit_time_add"]=buff[42], ["exp_time_add"]=buff[42],
["exp_time_add"]=buff[43], ["cured_add"]=buff[43],
["cured_add"]=buff[44], ["add_skill"]=buff[44],
["add_skill"]=buff[45], ["skill_fire_times"]=buff[45]
["skill_fire_times"]=buff[46]
} }
} }
local config = { local config = {
data=buff, data=buff,
keys=keys, keys=keys,
count=46 count=45
} }
return config return config

View File

@ -1,9 +1,12 @@
local const = { local const = {
["element_combo"]={ ["element_combo"]={
["value"]=2 ["value"]=2
},
["support_interval"]={
["value"]=500
} }
} }
local config = { local config = {
data=const,count=1 data=const,count=2
} }
return config return config

View File

@ -196,10 +196,10 @@ local skill = {
}, },
[14]={ [14]={
["effect_type"]=2, ["effect_type"]=2,
["trigger"]=3, ["trigger"]=5,
["effect"]={ ["effect"]={
{ {
["type"]="heal_normal_attack", ["type"]="heal",
["num"]=500, ["num"]=500,
["ratio"]=10000, ["ratio"]=10000,
["round"]=1 ["round"]=1

View File

@ -72,6 +72,7 @@ BattleConst.UNIT_STATE = {
SWITCH_IN = 7, -- 入场 SWITCH_IN = 7, -- 入场
SWITCH_OUT = 8, -- 离场 SWITCH_OUT = 8, -- 离场
ASSISTING_ATTACK = 9, -- 协助攻击 ASSISTING_ATTACK = 9, -- 协助攻击
WAIT = 10, -- 等待
} }
BattleConst.MATCH_DMG_ADDITION_NAME = { BattleConst.MATCH_DMG_ADDITION_NAME = {

View File

@ -222,7 +222,7 @@ function BattleUnitComp:beforeAttack()
self:checkPassiveEvent(PASSIVE_EVENT.ON_UNI_ATTACK_START, self) self:checkPassiveEvent(PASSIVE_EVENT.ON_UNI_ATTACK_START, self)
end end
function BattleUnitComp:useAssistingSkill(count, callback) function BattleUnitComp:useAssistingSkill(count, delay, callback)
local skill = self.unitEntity:getAssistingSkill() local skill = self.unitEntity:getAssistingSkill()
if skill == nil then if skill == nil then
callback() callback()
@ -232,10 +232,22 @@ function BattleUnitComp:useAssistingSkill(count, callback)
local attrName = GConst.MATCH_ATTACK_NAME[self:getMatchType()] local attrName = GConst.MATCH_ATTACK_NAME[self:getMatchType()]
self.assistingDmgAddCount = self.unitEntity:addAttr(attrName, count*DEFAULT_FACTOR, true) self.assistingDmgAddCount = self.unitEntity:addAttr(attrName, count*DEFAULT_FACTOR, true)
self.actionOverCallback = callback self.actionOverCallback = callback
if not self:changeState(UNIT_STATE.ASSISTING_ATTACK) then if delay > 0 then
self.actionOverCallback = nil self.waitTime = delay
self.unitEntity:addAttr(attrName, -self.assistingDmgAddCount, false) self.waitingState = UNIT_STATE.ASSISTING_ATTACK
callback() if not self:changeState(UNIT_STATE.WAIT) then
if not self:changeState(UNIT_STATE.ASSISTING_ATTACK) then
self.actionOverCallback = nil
self.unitEntity:addAttr(attrName, -self.assistingDmgAddCount, false)
callback()
end
end
else
if not self:changeState(UNIT_STATE.ASSISTING_ATTACK) then
self.actionOverCallback = nil
self.unitEntity:addAttr(attrName, -self.assistingDmgAddCount, false)
callback()
end
end end
end end
@ -341,6 +353,8 @@ function BattleUnitComp:changeState(state)
self:exitSwitchInState() self:exitSwitchInState()
elseif self.currState == UNIT_STATE.SWITCH_OUT then elseif self.currState == UNIT_STATE.SWITCH_OUT then
self:exitSwitchOutState() self:exitSwitchOutState()
elseif self.currState == UNIT_STATE.WAIT then
self:exitWaitState()
end end
-- 进入目标状态 -- 进入目标状态
self.currState = state self.currState = state
@ -350,18 +364,20 @@ function BattleUnitComp:changeState(state)
self:enterNormalAttackState() self:enterNormalAttackState()
elseif state == UNIT_STATE.SKILL_ATTACK then elseif state == UNIT_STATE.SKILL_ATTACK then
self:enterSkillAttackState() self:enterSkillAttackState()
elseif self.currState == UNIT_STATE.ASSISTING_ATTACK then elseif state == UNIT_STATE.ASSISTING_ATTACK then
self:enterAssistingAttackState() self:enterAssistingAttackState()
elseif state == UNIT_STATE.DEAD then elseif state == UNIT_STATE.DEAD then
self:enterDeadState() self:enterDeadState()
elseif self.currState == UNIT_STATE.BORN then elseif state == UNIT_STATE.BORN then
self:enterBornState() self:enterBornState()
elseif self.currState == UNIT_STATE.ENTER_BATTLEFIELD then elseif state == UNIT_STATE.ENTER_BATTLEFIELD then
self:enterEnterBattlefieldState() self:enterEnterBattlefieldState()
elseif self.currState == UNIT_STATE.SWITCH_IN then elseif state == UNIT_STATE.SWITCH_IN then
self:enterSwitchInState() self:enterSwitchInState()
elseif self.currState == UNIT_STATE.SWITCH_OUT then elseif state == UNIT_STATE.SWITCH_OUT then
self:enterSwitchOutState() self:enterSwitchOutState()
elseif state == UNIT_STATE.WAIT then
self:enterWaitState()
end end
return true return true
end end
@ -498,6 +514,19 @@ function BattleUnitComp:updateHurt(dt)
end end
end end
function BattleUnitComp:enterWaitState()
end
function BattleUnitComp:exitWaitState()
end
function BattleUnitComp:updateWaitState(dt)
self.waitTime = self.waitTime - dt
if self.waitTime < 0 then
self:changeState(self.waitingState)
end
end
function BattleUnitComp:enterAssistingAttackState() function BattleUnitComp:enterAssistingAttackState()
self.attackOver = false self.attackOver = false
self.attackTime = 0 self.attackTime = 0
@ -989,6 +1018,8 @@ function BattleUnitComp:tick(dt)
self:updateSwitchInState(dt) self:updateSwitchInState(dt)
elseif self.currState == UNIT_STATE.SWITCH_OUT then elseif self.currState == UNIT_STATE.SWITCH_OUT then
self:updateSwitchOutState(dt) self:updateSwitchOutState(dt)
elseif self.currState == UNIT_STATE.WAIT then
self:updateWaitState(dt)
end end
end end

View File

@ -30,6 +30,13 @@ function BattleHelper:random(min, max)
return min + self.seed*(max - min + 1)//233280 return min + self.seed*(max - min + 1)//233280
end end
function BattleHelper:getSupportInterval()
if self.supportInterval == nil then
self.supportInterval = GFunc.getConstIntValue("support_interval")/1000
end
return self.supportInterval
end
function BattleHelper:loadBattleHeroModel(id, parent, callback) function BattleHelper:loadBattleHeroModel(id, parent, callback)
local pool = self.characterPools[id] local pool = self.characterPools[id]
if pool and #pool > 0 then if pool and #pool > 0 then

View File

@ -1,4 +1,5 @@
local BattleBuffHandle = require "app/module/battle/helper/battle_buff_handle" local BattleBuffHandle = require "app/module/battle/helper/battle_buff_handle"
local BattleHelper = require "app/module/battle/helper/battle_helper"
local BattleTeam = class("BattleTeam") local BattleTeam = class("BattleTeam")
@ -88,11 +89,13 @@ function BattleTeam:useAssistingSkill(assistingList, callback)
callback() callback()
end end
end end
local delay = 0
for _, v in ipairs(assistingList) do for _, v in ipairs(assistingList) do
local unit = self.unitMap[v.skillMatch] local unit = self.unitMap[v.skillMatch]
if unit then if unit then
unit:resetBeforeAttack() unit:resetBeforeAttack()
unit:useAssistingSkill(v.count, finish) unit:useAssistingSkill(v.count, delay, finish)
delay = delay + BattleHelper:getSupportInterval()
else else
finish() finish()
end end