From 54174019eebf59cb89b85eeeddd4ceaefffa018e Mon Sep 17 00:00:00 2001 From: chenxi Date: Wed, 26 Apr 2023 14:17:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E8=83=BD=E5=8A=A0=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/config/skill.lua | 16 +++++- lua/app/config/skill_rogue.lua | 50 ++++++++--------- lua/app/config/strings/cn/skill_rogue.lua | 8 +-- lua/app/config/tutorial.lua | 29 ++++------ .../battle/component/battle_unit_comp.lua | 55 +++++++++++++++++-- .../battle/controller/battle_controller.lua | 32 +++++++++++ lua/app/userdata/battle/battle_data.lua | 38 ++++++++----- .../battle/skill/battle_skill_entity.lua | 5 ++ 8 files changed, 164 insertions(+), 69 deletions(-) diff --git a/lua/app/config/skill.lua b/lua/app/config/skill.lua index cc00b901..32441237 100644 --- a/lua/app/config/skill.lua +++ b/lua/app/config/skill.lua @@ -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, diff --git a/lua/app/config/skill_rogue.lua b/lua/app/config/skill_rogue.lua index eab9049e..bd1f7f7a 100644 --- a/lua/app/config/skill_rogue.lua +++ b/lua/app/config/skill_rogue.lua @@ -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, diff --git a/lua/app/config/strings/cn/skill_rogue.lua b/lua/app/config/strings/cn/skill_rogue.lua index afa894d3..28df91ae 100644 --- a/lua/app/config/strings/cn/skill_rogue.lua +++ b/lua/app/config/strings/cn/skill_rogue.lua @@ -162,7 +162,7 @@ local skill_rogue = { ["desc"]="元素链接随机消除元素增加2个" }, [200302]={ - ["desc"]="被元素链接技能消除的元素造成的伤害提升10%" + ["desc"]="元素链接使用时本次普攻伤害提升10%" }, [200303]={ ["desc"]="元素链接随机消除元素增加2个" @@ -186,7 +186,7 @@ local skill_rogue = { ["desc"]="舞步消散上下可多消1格" }, [200502]={ - ["desc"]="跟舞步消散连接线上的元素伤害增加10%" + ["desc"]="舞步消散使用时本次普攻伤害提升10%" }, [200503]={ ["desc"]="每有1个元素连接舞步消散则本回合格挡增加2%" @@ -198,7 +198,7 @@ local skill_rogue = { ["desc"]="快速治愈的恢复量提升" }, [200602]={ - ["desc"]="跟快速治愈连接线上的元素伤害增加10%" + ["desc"]="快速治愈使用时本次普攻伤害提升10%" }, [200603]={ ["desc"]="连接快速治愈的每一击都将恢复生命值" @@ -210,7 +210,7 @@ local skill_rogue = { ["desc"]="巨剑连斩被连接消除其上下左右4个元素" }, [200702]={ - ["desc"]="跟巨剑连斩连接线上的元素伤害增加10%" + ["desc"]="巨剑连斩使用时本次普攻伤害提升10%" }, [200703]={ ["desc"]="巨剑连斩被连接消除其斜方向的4个元素" diff --git a/lua/app/config/tutorial.lua b/lua/app/config/tutorial.lua index 71556c5c..2441d69e 100644 --- a/lua/app/config/tutorial.lua +++ b/lua/app/config/tutorial.lua @@ -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 \ No newline at end of file diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 11ae2725..4edb85ec 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -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) diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 5e8a3b55..fa92b06e 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -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 diff --git a/lua/app/userdata/battle/battle_data.lua b/lua/app/userdata/battle/battle_data.lua index c13c1932..94662af2 100644 --- a/lua/app/userdata/battle/battle_data.lua +++ b/lua/app/userdata/battle/battle_data.lua @@ -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 diff --git a/lua/app/userdata/battle/skill/battle_skill_entity.lua b/lua/app/userdata/battle/skill/battle_skill_entity.lua index 75771547..de8cc71b 100644 --- a/lua/app/userdata/battle/skill/battle_skill_entity.lua +++ b/lua/app/userdata/battle/skill/battle_skill_entity.lua @@ -218,4 +218,9 @@ function BattleSkillEntity:clearRecordData() end end +-- 子弹时间参数 +function BattleSkillEntity:getSlowDownBulletTimeParams() + return self.skillInfo.bullet_time +end + return BattleSkillEntity \ No newline at end of file