技能加速
This commit is contained in:
parent
8fc0090b76
commit
54174019ee
@ -348,7 +348,12 @@ local skill = {
|
||||
["name_act"]="skill01",
|
||||
["fx_self"]=300008,
|
||||
["fx_target"]=4,
|
||||
["fx_target_delay"]=1100
|
||||
["fx_target_delay"]=1100,
|
||||
["bullet_time"]={
|
||||
866,
|
||||
3000,
|
||||
700
|
||||
}
|
||||
},
|
||||
[2200121]={
|
||||
["energy"]=10,
|
||||
@ -394,7 +399,12 @@ local skill = {
|
||||
["name_act"]="skill01",
|
||||
["fx_self"]=300008,
|
||||
["fx_target"]=4,
|
||||
["fx_target_delay"]=1100
|
||||
["fx_target_delay"]=1100,
|
||||
["bullet_time"]={
|
||||
866,
|
||||
3000,
|
||||
700
|
||||
}
|
||||
},
|
||||
[2300110]={
|
||||
["position"]=2,
|
||||
@ -1053,7 +1063,7 @@ local skill = {
|
||||
["link"]=1,
|
||||
["position"]=4,
|
||||
["method"]=2,
|
||||
["skill_type"]=1,
|
||||
["skill_type"]=4,
|
||||
["boardrange"]={
|
||||
{
|
||||
["type"]=1,
|
||||
|
||||
@ -59,7 +59,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=3,
|
||||
["weight"]=3000,
|
||||
["qlt"]=3,
|
||||
["qlt"]=2,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="atkp_red_add",
|
||||
@ -73,7 +73,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=2,
|
||||
["weight"]=2000,
|
||||
["qlt"]=4,
|
||||
["qlt"]=3,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="atkp_red_add",
|
||||
@ -101,7 +101,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=3,
|
||||
["weight"]=3000,
|
||||
["qlt"]=3,
|
||||
["qlt"]=2,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="atkp_yellow_add",
|
||||
@ -115,7 +115,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=2,
|
||||
["weight"]=2000,
|
||||
["qlt"]=4,
|
||||
["qlt"]=3,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="atkp_yellow_add",
|
||||
@ -143,7 +143,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=3,
|
||||
["weight"]=3000,
|
||||
["qlt"]=3,
|
||||
["qlt"]=2,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="atkp_green_add",
|
||||
@ -157,7 +157,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=2,
|
||||
["weight"]=2000,
|
||||
["qlt"]=4,
|
||||
["qlt"]=3,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="atkp_green_add",
|
||||
@ -185,7 +185,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=3,
|
||||
["weight"]=3000,
|
||||
["qlt"]=3,
|
||||
["qlt"]=2,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="atkp_blue_add",
|
||||
@ -199,7 +199,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=2,
|
||||
["weight"]=2000,
|
||||
["qlt"]=4,
|
||||
["qlt"]=3,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="atkp_blue_add",
|
||||
@ -227,7 +227,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=3,
|
||||
["weight"]=3000,
|
||||
["qlt"]=3,
|
||||
["qlt"]=2,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="atkp_purple_add",
|
||||
@ -241,7 +241,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=2,
|
||||
["weight"]=2000,
|
||||
["qlt"]=4,
|
||||
["qlt"]=3,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="atkp_purple_add",
|
||||
@ -255,7 +255,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=1,
|
||||
["weight"]=1500,
|
||||
["qlt"]=3,
|
||||
["qlt"]=4,
|
||||
["type"]=9,
|
||||
["effect"]={
|
||||
{
|
||||
@ -345,7 +345,7 @@ local skill_rogue = {
|
||||
["universal"]=1,
|
||||
["limit_times"]=3,
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["qlt"]=3,
|
||||
["type"]=5,
|
||||
["attr"]={
|
||||
["type"]="cured_add",
|
||||
@ -400,7 +400,7 @@ local skill_rogue = {
|
||||
[29]={
|
||||
["universal"]=1,
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["qlt"]=3,
|
||||
["type"]=9,
|
||||
["effect"]={
|
||||
{
|
||||
@ -681,11 +681,11 @@ local skill_rogue = {
|
||||
[200102]={
|
||||
["limit_times"]=1,
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["qlt"]=3,
|
||||
["type"]=7,
|
||||
["parameter"]={
|
||||
1,
|
||||
40000
|
||||
30000
|
||||
},
|
||||
["skill_position"]=3,
|
||||
["icon"]="64"
|
||||
@ -718,11 +718,11 @@ local skill_rogue = {
|
||||
[200201]={
|
||||
["limit_times"]=1,
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["qlt"]=3,
|
||||
["type"]=7,
|
||||
["parameter"]={
|
||||
1,
|
||||
40000
|
||||
30000
|
||||
},
|
||||
["skill_position"]=2,
|
||||
["icon"]="65"
|
||||
@ -772,7 +772,7 @@ local skill_rogue = {
|
||||
[200301]={
|
||||
["limit_times"]=1,
|
||||
["weight"]=1000,
|
||||
["qlt"]=4,
|
||||
["qlt"]=3,
|
||||
["type"]=2,
|
||||
["skill_position"]=4,
|
||||
["boardrange"]={
|
||||
@ -787,7 +787,7 @@ local skill_rogue = {
|
||||
["limit_times"]=1,
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["type"]=11,
|
||||
["type"]=3,
|
||||
["skill_position"]=4,
|
||||
["effect"]={
|
||||
{
|
||||
@ -825,7 +825,7 @@ local skill_rogue = {
|
||||
[200401]={
|
||||
["limit_times"]=1,
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["qlt"]=3,
|
||||
["type"]=7,
|
||||
["parameter"]={
|
||||
1,
|
||||
@ -837,7 +837,7 @@ local skill_rogue = {
|
||||
[200402]={
|
||||
["limit_times"]=1,
|
||||
["weight"]=1000,
|
||||
["qlt"]=4,
|
||||
["qlt"]=3,
|
||||
["type"]=8,
|
||||
["parameter"]={
|
||||
1,
|
||||
@ -849,7 +849,7 @@ local skill_rogue = {
|
||||
[200403]={
|
||||
["limit_times"]=1,
|
||||
["weight"]=2000,
|
||||
["qlt"]=3,
|
||||
["qlt"]=4,
|
||||
["type"]=1,
|
||||
["parameter"]={
|
||||
5200121
|
||||
@ -928,7 +928,7 @@ local skill_rogue = {
|
||||
[200601]={
|
||||
["limit_times"]=1,
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["qlt"]=3,
|
||||
["type"]=7,
|
||||
["parameter"]={
|
||||
1,
|
||||
@ -1025,7 +1025,7 @@ local skill_rogue = {
|
||||
[200703]={
|
||||
["limit_times"]=1,
|
||||
["weight"]=1000,
|
||||
["qlt"]=3,
|
||||
["qlt"]=4,
|
||||
["type"]=2,
|
||||
["skill_position"]=2,
|
||||
["boardrange"]={
|
||||
@ -1070,7 +1070,7 @@ local skill_rogue = {
|
||||
[200802]={
|
||||
["limit_times"]=1,
|
||||
["weight"]=3000,
|
||||
["qlt"]=2,
|
||||
["qlt"]=3,
|
||||
["type"]=7,
|
||||
["parameter"]={
|
||||
1,
|
||||
|
||||
@ -162,7 +162,7 @@ local skill_rogue = {
|
||||
["desc"]="元素链接随机消除元素增加<color=#3cff28>2</color>个"
|
||||
},
|
||||
[200302]={
|
||||
["desc"]="被元素链接技能消除的元素造成的伤害提升<color=#3cff28>10%</color>"
|
||||
["desc"]="元素链接使用时本次普攻伤害提升<color=#3cff28>10%</color>"
|
||||
},
|
||||
[200303]={
|
||||
["desc"]="元素链接随机消除元素增加<color=#3cff28>2</color>个"
|
||||
@ -186,7 +186,7 @@ local skill_rogue = {
|
||||
["desc"]="舞步消散上下可多消<color=#3cff28>1</color>格"
|
||||
},
|
||||
[200502]={
|
||||
["desc"]="跟舞步消散连接线上的元素伤害增加<color=#3cff28>10%</color>"
|
||||
["desc"]="舞步消散使用时本次普攻伤害提升<color=#3cff28>10%</color>"
|
||||
},
|
||||
[200503]={
|
||||
["desc"]="每有1个元素连接舞步消散则本回合格挡增加<color=#3cff28>2%</color>"
|
||||
@ -198,7 +198,7 @@ local skill_rogue = {
|
||||
["desc"]="快速治愈的<color=#3cff28>恢复量提升</color>"
|
||||
},
|
||||
[200602]={
|
||||
["desc"]="跟快速治愈连接线上的元素伤害增加<color=#3cff28>10%</color>"
|
||||
["desc"]="快速治愈使用时本次普攻伤害提升<color=#3cff28>10%</color>"
|
||||
},
|
||||
[200603]={
|
||||
["desc"]="连接快速治愈的每一击都将<color=#3cff28>恢复</color>生命值"
|
||||
@ -210,7 +210,7 @@ local skill_rogue = {
|
||||
["desc"]="巨剑连斩被连接消除其上下左右<color=#3cff28>4</color>个元素"
|
||||
},
|
||||
[200702]={
|
||||
["desc"]="跟巨剑连斩连接线上的元素伤害增加<color=#3cff28>10%</color>"
|
||||
["desc"]="巨剑连斩使用时本次普攻伤害提升<color=#3cff28>10%</color>"
|
||||
},
|
||||
[200703]={
|
||||
["desc"]="巨剑连斩被连接消除其斜方向的<color=#3cff28>4</color>个元素"
|
||||
|
||||
@ -16,19 +16,14 @@ local tutorial = {
|
||||
},
|
||||
[10020]={
|
||||
["next_id"]=10030,
|
||||
["type"]=4,
|
||||
["finish"]=1,
|
||||
["finish_parameter"]=1
|
||||
},
|
||||
[10030]={
|
||||
["next_id"]=10040,
|
||||
["delay"]=1.0,
|
||||
["type"]=3,
|
||||
["txt"]="tutorial_txt_1",
|
||||
["txt_offset"]={
|
||||
0,
|
||||
110
|
||||
},
|
||||
["target_name"]="battle_skill_select_ui(Clone)/skill_node/skill_select_cell_1",
|
||||
["target_name"]="battle_ui(Clone)/bg_2/battle_select_skill_comp/skill_node/skill_select_cell_1",
|
||||
["arrow_direction"]=1,
|
||||
["arrow_offset"]={
|
||||
0,
|
||||
@ -40,8 +35,8 @@ local tutorial = {
|
||||
25
|
||||
}
|
||||
},
|
||||
[10040]={
|
||||
["next_id"]=10050,
|
||||
[10030]={
|
||||
["next_id"]=10040,
|
||||
["type"]=6,
|
||||
["finish"]=4,
|
||||
["target_element"]={
|
||||
@ -52,13 +47,13 @@ local tutorial = {
|
||||
44
|
||||
}
|
||||
},
|
||||
[10050]={
|
||||
["next_id"]=10060,
|
||||
[10040]={
|
||||
["next_id"]=10050,
|
||||
["type"]=4,
|
||||
["finish"]=3
|
||||
},
|
||||
[10060]={
|
||||
["next_id"]=10070,
|
||||
[10050]={
|
||||
["next_id"]=10060,
|
||||
["delay"]=1.0,
|
||||
["type"]=6,
|
||||
["finish"]=4,
|
||||
@ -70,12 +65,12 @@ local tutorial = {
|
||||
34
|
||||
}
|
||||
},
|
||||
[10070]={
|
||||
["next_id"]=10080,
|
||||
[10060]={
|
||||
["next_id"]=10070,
|
||||
["type"]=4,
|
||||
["finish"]=3
|
||||
},
|
||||
[10080]={
|
||||
[10070]={
|
||||
["delay"]=1.0,
|
||||
["type"]=6,
|
||||
["finish"]=4,
|
||||
@ -425,6 +420,6 @@ local tutorial = {
|
||||
}
|
||||
}
|
||||
local config = {
|
||||
data=tutorial,count=33
|
||||
data=tutorial,count=32
|
||||
}
|
||||
return config
|
||||
@ -68,6 +68,9 @@ function BattleUnitComp:_initBase()
|
||||
self.isMove = false
|
||||
self.deadTime = 0
|
||||
self.attackTime = 0
|
||||
self.skillSlowDownTime = nil -- 开始攻击后,x秒后开始子弹时间
|
||||
self.skillSlowDownDuration = 0 -- 子弹时间持续的时间
|
||||
self.skillSlowDownScale = 1 -- 子弹时间减慢的倍率
|
||||
self.currAttackDuration = 0
|
||||
self.currAttackKeyTime = 0
|
||||
self.switchTime = 0
|
||||
@ -668,6 +671,7 @@ end
|
||||
function BattleUnitComp:enterAssistingAttackState()
|
||||
self.attackOver = false
|
||||
self.attackTime = 0
|
||||
self.skillSlowDownTime = nil
|
||||
self.isMove = false
|
||||
local skill = self.unitEntity:getAssistingSkill()
|
||||
skill:startUse()
|
||||
@ -710,8 +714,17 @@ function BattleUnitComp:enterSkillAttackState()
|
||||
local skill
|
||||
if self.normalSkillCount > 0 then
|
||||
skill = self.unitEntity:getNormalSkill(true)
|
||||
self.skillSlowDownTime = nil
|
||||
else
|
||||
skill = self.currActiveSkill
|
||||
local slowDownBulletTimeParams = skill:getSlowDownBulletTimeParams()
|
||||
if slowDownBulletTimeParams and #slowDownBulletTimeParams == 3 then
|
||||
self.skillSlowDownTime = slowDownBulletTimeParams[1] / TIME_FACTOR
|
||||
self.skillSlowDownScale = slowDownBulletTimeParams[2] / DEFAULT_FACTOR
|
||||
self.skillSlowDownDuration = slowDownBulletTimeParams[3] / TIME_FACTOR
|
||||
else
|
||||
self.skillSlowDownTime = nil
|
||||
end
|
||||
end
|
||||
skill:startUse()
|
||||
if skill:getMoveType() == BattleConst.SKILL_MOVE_TYPE.MOVE then
|
||||
@ -727,7 +740,6 @@ function BattleUnitComp:enterSkillAttackState()
|
||||
end
|
||||
else
|
||||
self.isMove = false
|
||||
self.attackTime = 0
|
||||
local attackName = skill:getSkillAttackName()
|
||||
if self.normalSkillCount > 0 then
|
||||
self:attackAndSpeedUp()
|
||||
@ -739,6 +751,18 @@ function BattleUnitComp:enterSkillAttackState()
|
||||
end
|
||||
end
|
||||
|
||||
function BattleUnitComp:checkSkillSlowDown(dt)
|
||||
if self.skillSlowDownTime == nil then
|
||||
return
|
||||
end
|
||||
self.skillSlowDownTime = self.skillSlowDownTime - dt
|
||||
if self.skillSlowDownTime >= 0 then
|
||||
return
|
||||
end
|
||||
self.skillSlowDownTime = nil
|
||||
self.battleController:setSkillSlowDown(self.skillSlowDownScale, self.skillSlowDownDuration)
|
||||
end
|
||||
|
||||
function BattleUnitComp:exitSkillAttackState()
|
||||
end
|
||||
|
||||
@ -758,6 +782,7 @@ function BattleUnitComp:updateSkillAttack(dt)
|
||||
self.baseObject:setLocalPosition(self.positionX, 0, 0)
|
||||
return
|
||||
end
|
||||
self:checkSkillSlowDown(dt)
|
||||
self.attackTime = self.attackTime + dt
|
||||
if self.attackTime >= self.currAttackDuration then
|
||||
self.attackOver = true
|
||||
@ -878,24 +903,33 @@ end
|
||||
function BattleUnitComp:attackAndSpeedUp()
|
||||
self.attackCount = self.attackCount + 1
|
||||
if self.attackCount == 3 then
|
||||
DataManager.BattleData:addTimeSpeed()
|
||||
self.battleController:addTimeSpeed()
|
||||
elseif self.attackCount == 5 then
|
||||
DataManager.BattleData:addTimeSpeed()
|
||||
self.battleController:addTimeSpeed()
|
||||
end
|
||||
end
|
||||
|
||||
function BattleUnitComp:doNextSkillAttack()
|
||||
self.attackTime = 0
|
||||
local slowDownBulletTimeParams = self.currActiveSkill:getSlowDownBulletTimeParams()
|
||||
if slowDownBulletTimeParams and #slowDownBulletTimeParams == 3 then
|
||||
self.skillSlowDownTime = slowDownBulletTimeParams[1] / TIME_FACTOR
|
||||
self.skillSlowDownScale = slowDownBulletTimeParams[2] / DEFAULT_FACTOR
|
||||
self.skillSlowDownDuration = slowDownBulletTimeParams[3] / TIME_FACTOR
|
||||
else
|
||||
self.skillSlowDownTime = nil
|
||||
end
|
||||
local attackName = self.currActiveSkill:getSkillAttackName()
|
||||
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
|
||||
self:playAnimation(attackName, false, false)
|
||||
self:playSkillFx(self.currActiveSkill)
|
||||
DataManager.BattleData:resetTimeSpeed()
|
||||
self.battleController:resetTimeSpeed()
|
||||
end
|
||||
|
||||
function BattleUnitComp:doNextNormalAttack()
|
||||
self.attackTime = 0
|
||||
self.skillSlowDownTime = nil
|
||||
local skill = self.unitEntity:getNormalSkill(true)
|
||||
skill:startUse()
|
||||
local attackName = skill:getSkillAttackName()
|
||||
@ -910,6 +944,7 @@ function BattleUnitComp:doNextAttack()
|
||||
self.attackTime = 0
|
||||
local attackName = nil
|
||||
if self.normalSkillCount > 0 then
|
||||
self.skillSlowDownTime = nil
|
||||
local skill = self.unitEntity:getNormalSkill(true)
|
||||
skill:startUse()
|
||||
attackName = skill:getSkillAttackName()
|
||||
@ -923,6 +958,14 @@ function BattleUnitComp:doNextAttack()
|
||||
self:moveBackToInitPosition()
|
||||
end
|
||||
elseif self.currActiveSkill then
|
||||
local slowDownBulletTimeParams = self.currActiveSkill:getSlowDownBulletTimeParams()
|
||||
if slowDownBulletTimeParams and #slowDownBulletTimeParams == 3 then
|
||||
self.skillSlowDownTime = slowDownBulletTimeParams[1] / TIME_FACTOR
|
||||
self.skillSlowDownScale = slowDownBulletTimeParams[2] / DEFAULT_FACTOR
|
||||
self.skillSlowDownDuration = slowDownBulletTimeParams[3] / TIME_FACTOR
|
||||
else
|
||||
self.skillSlowDownTime = nil
|
||||
end
|
||||
self.currActiveSkill:startUse()
|
||||
attackName = self.currActiveSkill:getSkillAttackName()
|
||||
if attackName then
|
||||
@ -930,7 +973,7 @@ function BattleUnitComp:doNextAttack()
|
||||
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
|
||||
self:playAnimation(attackName, false, false)
|
||||
self:playSkillFx(self.currActiveSkill)
|
||||
DataManager.BattleData:resetTimeSpeed()
|
||||
self.battleController:resetTimeSpeed()
|
||||
else
|
||||
self:moveBackToInitPosition()
|
||||
end
|
||||
@ -942,6 +985,7 @@ end
|
||||
function BattleUnitComp:enterNormalAttackState()
|
||||
self.attackOver = false
|
||||
self.attackTime = 0
|
||||
self.skillSlowDownTime = nil
|
||||
local skill = self.unitEntity:getNormalSkill(true)
|
||||
skill:startUse()
|
||||
if skill:getMoveType() == BattleConst.SKILL_MOVE_TYPE.MOVE then
|
||||
@ -957,7 +1001,6 @@ function BattleUnitComp:enterNormalAttackState()
|
||||
end
|
||||
else
|
||||
self.isMove = false
|
||||
self.attackTime = 0
|
||||
local attackName = skill:getSkillAttackName()
|
||||
self.currAttackDuration = self:getAnimationDuration(attackName)
|
||||
self.currAttackKeyTime = self:getAnimationKeyFrameTime(attackName)
|
||||
|
||||
@ -334,6 +334,25 @@ function BattleController:battleStart()
|
||||
self:enterNextWave()
|
||||
end
|
||||
|
||||
function BattleController:addTimeSpeed()
|
||||
if self.skillSlowDownDuration then
|
||||
return
|
||||
end
|
||||
DataManager.BattleData:addTimeSpeed()
|
||||
end
|
||||
|
||||
function BattleController:resetTimeSpeed()
|
||||
DataManager.BattleData:resetTimeSpeed()
|
||||
if self.skillSlowDownDuration then
|
||||
self.skillSlowDownDuration = nil
|
||||
end
|
||||
end
|
||||
|
||||
function BattleController:setSkillSlowDown(timeScale, duration)
|
||||
self.skillSlowDownDuration = duration
|
||||
DataManager.BattleData:setSkillTimeSpeed(timeScale)
|
||||
end
|
||||
|
||||
function BattleController:setTimeScale(timeScale)
|
||||
GFunc.setDOTweenTimeScale(GConst.DOTWEEN_IDS.BATTLE, timeScale)
|
||||
BattleScheduler:setTimeScale(timeScale)
|
||||
@ -1954,6 +1973,7 @@ function BattleController:_tick(dt)
|
||||
end
|
||||
end
|
||||
self:checkDelayEffectText(dt)
|
||||
self:checkSkillSlowDown(dt)
|
||||
self:tick(dt)
|
||||
end
|
||||
|
||||
@ -1992,6 +2012,18 @@ function BattleController:endBattleAndExit()
|
||||
ModuleManager.BattleManager:exitBattle()
|
||||
end
|
||||
|
||||
function BattleController:checkSkillSlowDown(dt)
|
||||
if self.skillSlowDownDuration == nil then
|
||||
return
|
||||
end
|
||||
self.skillSlowDownDuration = self.skillSlowDownDuration - dt
|
||||
if self.skillSlowDownDuration >= 0 then
|
||||
return
|
||||
end
|
||||
self.skillSlowDownDuration = nil
|
||||
self:resetTimeSpeed()
|
||||
end
|
||||
|
||||
function BattleController:checkDelayEffectText(dt)
|
||||
if self.delayEffectTextCount <= 0 then
|
||||
return
|
||||
|
||||
@ -10,6 +10,11 @@ local BATTLE_BOARD_SKILL_ENTITY = require "app/userdata/battle/skill/battle_boar
|
||||
|
||||
local ATTR_TYPE = GConst.ATTR_TYPE
|
||||
local DEFAULT_FACTOR = BattleConst.DEFAULT_FACTOR
|
||||
local TIME_SPEED_LEVEL_0 = 0
|
||||
local TIME_SPEED_LEVEL_1 = 1
|
||||
local TIME_SPEED_LEVEL_2 = 2
|
||||
local TIME_SPEED_LEVEL_3 = 3
|
||||
local TIME_SPEED_LEVEL_SKILL = 100
|
||||
|
||||
function BattleData:init()
|
||||
self:clear()
|
||||
@ -32,36 +37,37 @@ end
|
||||
|
||||
function BattleData:pauseBattle()
|
||||
self.cacheSpeed = self.data.timeSpeed
|
||||
self:setTimeSpeed(0)
|
||||
self.cacheTimeScale = self.timeScale
|
||||
self:setTimeSpeed(TIME_SPEED_LEVEL_0)
|
||||
end
|
||||
|
||||
function BattleData:resumeBattle()
|
||||
if self.cacheSpeed == nil then
|
||||
return
|
||||
end
|
||||
if self.data.timeSpeed ~= 0 then
|
||||
if self.data.timeSpeed ~= TIME_SPEED_LEVEL_0 then
|
||||
return
|
||||
end
|
||||
self:setTimeSpeed(self.cacheSpeed or 1)
|
||||
self:setTimeSpeed(self.cacheSpeed or TIME_SPEED_LEVEL_1, self.cacheTimeScale)
|
||||
end
|
||||
|
||||
function BattleData:resetTimeSpeed()
|
||||
if self.cacheSpeed then -- 目前处于暂停状态
|
||||
self.cacheSpeed = 1
|
||||
self.cacheSpeed = TIME_SPEED_LEVEL_1
|
||||
return
|
||||
end
|
||||
if self.data.timeSpeed <= 1 then
|
||||
if self.data.timeSpeed <= TIME_SPEED_LEVEL_1 then
|
||||
return
|
||||
end
|
||||
self:setTimeSpeed(1)
|
||||
self:setTimeSpeed(TIME_SPEED_LEVEL_1)
|
||||
end
|
||||
|
||||
function BattleData:addTimeSpeed()
|
||||
if self.data.timeSpeed >= 3 then
|
||||
if self.data.timeSpeed >= TIME_SPEED_LEVEL_3 then
|
||||
return
|
||||
end
|
||||
if self.cacheSpeed then -- 目前处于暂停状态
|
||||
if self.cacheSpeed < 3 then
|
||||
if self.cacheSpeed < TIME_SPEED_LEVEL_3 then
|
||||
self.cacheSpeed = self.cacheSpeed + 1
|
||||
end
|
||||
return
|
||||
@ -70,20 +76,24 @@ function BattleData:addTimeSpeed()
|
||||
self:setTimeSpeed(timeSpeed)
|
||||
end
|
||||
|
||||
function BattleData:setTimeSpeed(timeSpeed)
|
||||
function BattleData:setSkillTimeSpeed(timeScale)
|
||||
self:setTimeSpeed(TIME_SPEED_LEVEL_SKILL, timeScale)
|
||||
end
|
||||
|
||||
function BattleData:setTimeSpeed(timeSpeed, timeScale)
|
||||
if timeSpeed == self.data.timeSpeed then
|
||||
return
|
||||
end
|
||||
if timeSpeed == 0 then
|
||||
if timeSpeed == TIME_SPEED_LEVEL_0 then
|
||||
self.timeScale = 0
|
||||
elseif timeSpeed == 1 then
|
||||
elseif timeSpeed == TIME_SPEED_LEVEL_1 then
|
||||
self.timeScale = BattleConst.TIME_SCALE.LEVEL_1
|
||||
elseif timeSpeed == 2 then
|
||||
elseif timeSpeed == TIME_SPEED_LEVEL_2 then
|
||||
self.timeScale = BattleConst.TIME_SCALE.LEVEL_2
|
||||
elseif timeSpeed == 3 then
|
||||
elseif timeSpeed == TIME_SPEED_LEVEL_3 then
|
||||
self.timeScale = BattleConst.TIME_SCALE.LEVEL_3
|
||||
else
|
||||
self.timeScale = BattleConst.TIME_SCALE.LEVEL_1
|
||||
self.timeScale = timeScale or BattleConst.TIME_SCALE.LEVEL_1
|
||||
end
|
||||
self.data.timeSpeed = timeSpeed
|
||||
end
|
||||
|
||||
@ -218,4 +218,9 @@ function BattleSkillEntity:clearRecordData()
|
||||
end
|
||||
end
|
||||
|
||||
-- 子弹时间参数
|
||||
function BattleSkillEntity:getSlowDownBulletTimeParams()
|
||||
return self.skillInfo.bullet_time
|
||||
end
|
||||
|
||||
return BattleSkillEntity
|
||||
Loading…
x
Reference in New Issue
Block a user