From f6d5546d2bf78f96beed6eace4328a65cb841ff8 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Fri, 19 May 2023 18:00:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=96=97=E4=BB=BB=E5=8A=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/config/skill.lua | 2 ++ lua/app/module/battle/battle_const.lua | 11 ++++++++++ .../battle/controller/battle_controller.lua | 21 +++++++++++++++++++ .../controller/battle_controller_stage.lua | 2 +- .../helper/battle_instructions_helper.lua | 7 +++++++ .../skill/battle_grid_effect_handle.lua | 1 + lua/app/module/battle/team/battle_team.lua | 3 +++ lua/app/module/chapter/chapter_manager.lua | 5 ++++- 8 files changed, 50 insertions(+), 2 deletions(-) diff --git a/lua/app/config/skill.lua b/lua/app/config/skill.lua index 35ff9e77..47de8128 100644 --- a/lua/app/config/skill.lua +++ b/lua/app/config/skill.lua @@ -206,6 +206,7 @@ local skill = { ["fx_target_delay"]=900 }, [1200121]={ + ["energy"]=10, ["position"]=1, ["effect_type"]=2, ["trigger"]=3, @@ -221,6 +222,7 @@ local skill = { ["skill_position"]=1 }, [1200122]={ + ["energy"]=10, ["position"]=1, ["effect_type"]=2, ["trigger"]=3, diff --git a/lua/app/module/battle/battle_const.lua b/lua/app/module/battle/battle_const.lua index c90b971a..e4167fdb 100644 --- a/lua/app/module/battle/battle_const.lua +++ b/lua/app/module/battle/battle_const.lua @@ -735,4 +735,15 @@ BattleConst.LINE_SFX = "assets/prefabs/effects/battle/sfx_piece_line_b01.prefab" BattleConst.CHANGE_ELEMENT_SFX = "assets/prefabs/effects/battle/sfx_skill_b02.prefab" BattleConst.LINK_SMOKE = "assets/prefabs/effects/battle/sfx_piece_smoke_b01.prefab" +BattleConst.BATTLE_TASK_FIELD = { + SKILL_BOX_OPEN = "skill_box", -- 技能宝箱打开次数(神灯) + KILL_BOSS = "kills_boss", -- boss击杀数量 + KILL_NORMAL_MONSTER = "kills_monster", -- 击杀小怪数量 + ELIMINATION_COUNT = "clear_elements", -- 累计消除元素个数 + LINK_COUNT_OVER_6 = "clear_6_combo", -- 6连消个数 + LINK_COUNT_OVER_8 = "clear_8_combo", -- 8连消个数 + COMBO_OVER_10 = "clear_10_combo", -- 10连击以上次数 + BOARD_SKILL_RELEASE_COUNT = "skills_cast", -- 释放技能次数 +} + return BattleConst \ No newline at end of file diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 75d6aae0..6501cf6c 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -199,6 +199,7 @@ function BattleController:init(params) self.eliminateCount = 0 self.eliminateTotalCount = 0 self.realTime = 0 + self.taskProgress = {} self.chapterId = self:getChapterId() self.waveIndex = 0 @@ -415,6 +416,14 @@ function BattleController:enterNextWave() return end + if self.waveIndex ~= 0 then + if self.isBossWave then + self:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.KILL_BOSS, 1) + else + self:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.KILL_NORMAL_MONSTER, 1) + end + end + if self.waveIndex >= self.maxWaveIndex then self.victory = true self:postWaveOver(false) @@ -869,6 +878,7 @@ function BattleController:onLinkOver() local skillEntity if skillId then skillEntity = self.battleData:getSkillEntityBySkillId(skillId) + self:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.BOARD_SKILL_RELEASE_COUNT, 1) end local aniSequence, influenceElementTypeMap, lineCount, elementTypeMap, linkElementType, effectGridMap = self:calculateCurElimination() @@ -2312,6 +2322,17 @@ function BattleController:addBattleExp(exp) self.battleData:addExp(exp) end +function BattleController:addTaskProgress(fieldName, count) + if not count then + return + end + self.taskProgress[fieldName] = (self.taskProgress[fieldName] or 0) + count +end + +function BattleController:getTaskProgress() + return self.taskProgress +end + function BattleController:_tick(dt) self.realTime = self.realTime + dt if self.isPause then diff --git a/lua/app/module/battle/controller/battle_controller_stage.lua b/lua/app/module/battle/controller/battle_controller_stage.lua index 8e7ed497..f6560b12 100644 --- a/lua/app/module/battle/controller/battle_controller_stage.lua +++ b/lua/app/module/battle/controller/battle_controller_stage.lua @@ -180,7 +180,7 @@ function BattleControllerStage:controllBattleEnd() if not self.victory then self.combatReport.wave = self.combatReport.wave - 1 end - ModuleManager.ChapterManager:endFight(self.chapterId, self.combatReport, self.gotMysteryBoxIndexs) + ModuleManager.ChapterManager:endFight(self.chapterId, self.combatReport, self.gotMysteryBoxIndexs, self.taskProgress) end function BattleController:postWaveOver(atkDead, isQuit) diff --git a/lua/app/module/battle/helper/battle_instructions_helper.lua b/lua/app/module/battle/helper/battle_instructions_helper.lua index 163fa8d6..23bd12b5 100644 --- a/lua/app/module/battle/helper/battle_instructions_helper.lua +++ b/lua/app/module/battle/helper/battle_instructions_helper.lua @@ -243,6 +243,13 @@ BattleInstructionsHelper.generateInstructions = function(skillEntity, elementTyp -- table.insert(assistingList, obj) -- end end + battleController:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.ELIMINATION_COUNT, elementTypeCount) + if lineCount >= 6 then + battleController:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.LINK_COUNT_OVER_6, 1) + end + if lineCount >= 8 then + battleController:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.LINK_COUNT_OVER_8, 1) + end -- 攻击 BattleInstructionsHelper._generateAttackInstructions(instructions, skillEntity, elementType, elementTypeCount) diff --git a/lua/app/module/battle/skill/battle_grid_effect_handle.lua b/lua/app/module/battle/skill/battle_grid_effect_handle.lua index 6137c42d..ee4b1966 100644 --- a/lua/app/module/battle/skill/battle_grid_effect_handle.lua +++ b/lua/app/module/battle/skill/battle_grid_effect_handle.lua @@ -40,6 +40,7 @@ local function _selectCommonSkill(entity, gridEntities, battleController, onlyCh if onlyCheck then return end + battleController:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.SKILL_BOX_OPEN, 1) battleController.battleData:addCommonSelectSkillCount() end diff --git a/lua/app/module/battle/team/battle_team.lua b/lua/app/module/battle/team/battle_team.lua index 6c887cf6..e476f447 100644 --- a/lua/app/module/battle/team/battle_team.lua +++ b/lua/app/module/battle/team/battle_team.lua @@ -539,6 +539,9 @@ function BattleTeam:addCombo() end self.comboCount = self.comboCount + 1 self.battleController:showCombo(self.comboCount) + if self.comboCount == 10 then + self.battleController:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.COMBO_OVER_10, 1) + end end function BattleTeam:onActionOver() diff --git a/lua/app/module/chapter/chapter_manager.lua b/lua/app/module/chapter/chapter_manager.lua index 831a3aae..7accd381 100644 --- a/lua/app/module/chapter/chapter_manager.lua +++ b/lua/app/module/chapter/chapter_manager.lua @@ -48,7 +48,7 @@ function ChapterManager:startFightFinish(result) end end -function ChapterManager:endFight(id, combatReport, gotMysteryBoxIndexs) +function ChapterManager:endFight(id, combatReport, gotMysteryBoxIndexs, taskProgress) local mystery_box_idx = {} if gotMysteryBoxIndexs then for index, _ in pairs(gotMysteryBoxIndexs) do @@ -62,6 +62,9 @@ function ChapterManager:endFight(id, combatReport, gotMysteryBoxIndexs) pass_wave = combatReport.wave, combatReport = combatReport, } + for fieldName, value in pairs(taskProgress) do + parmas[fieldName] = value + end self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterSettlementReq, parmas, {}, self.endFightFinish, BIReport.ITEM_GET_TYPE.CHAPTER_FIGHT_END) end