战斗任务数据

This commit is contained in:
xiekaidong 2023-05-19 18:00:03 +08:00
parent 1f3fa74d39
commit f6d5546d2b
8 changed files with 50 additions and 2 deletions

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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()

View File

@ -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