副本战斗

This commit is contained in:
xiekaidong 2023-06-12 17:58:40 +08:00
parent 9d648fb450
commit 59289536d1
4 changed files with 45 additions and 33 deletions

View File

@ -10,7 +10,7 @@ function BattleControllerDungeonGold:getChapterConfig()
end end
function BattleControllerDungeonGold:getChapterId() function BattleControllerDungeonGold:getChapterId()
return 1 -- Todo return ModuleManager.DungeonData:getCurFightChapterId()
end end
function BattleControllerDungeonGold:controllBattleEnd() function BattleControllerDungeonGold:controllBattleEnd()
@ -55,22 +55,22 @@ function BattleControllerDungeonGold:postWaveOver(atkDead, isQuit)
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT
end end
-- local duration = self.waveDurationTime local duration = self.waveDurationTime
-- local totalTime = self.totalDurationTime local totalTime = self.totalDurationTime
-- local startTimes = DataManager.ChapterData:getChapterFightCount(self.chapterId) local startTimes = DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_GOLD, self.chapterId)
-- local isFirstWin = false local isFirstWin = false
-- if not DataManager.ChapterData:getChapterPassed(self.chapterId) and self.victory then if DataManager.DungeonData:getPassedMaxId(ModuleManager.MODULE_KEY.DUNGEON_GOLD) < self.chapterId and self.victory then
-- isFirstWin = true isFirstWin = true
-- end end
-- local isFianlStep = self.waveIndex >= self.maxWaveIndex local isFianlStep = self.waveIndex >= self.maxWaveIndex
-- BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.STAGE, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount) BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end end
function BattleControllerDungeonGold:postFightStart() function BattleControllerDungeonGold:postFightStart()
-- local unlockMaxChapter = DataManager.ChapterData:getNewChapterId() local unlockMaxChapter = DataManager.DungeonData:getUnlockMaxId(ModuleManager.MODULE_KEY.DUNGEON_GOLD)
-- BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.STAGE, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.ChapterData:getChapterFightCount(self.chapterId)) BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_GOLD, self.chapterId))
end end
return BattleControllerDungeonGold return BattleControllerDungeonGold

View File

@ -10,12 +10,12 @@ function BattleControllerDungeonShards:getChapterConfig()
end end
function BattleControllerDungeonShards:getChapterId() function BattleControllerDungeonShards:getChapterId()
return 1 -- Todo return ModuleManager.DungeonData:getCurFightChapterId()
end end
function BattleControllerDungeonShards:controllBattleEnd() function BattleControllerDungeonShards:controllBattleEnd()
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS,
wave = self.waveIndex, wave = self.waveIndex,
victory = self.victory, victory = self.victory,
} }
@ -33,7 +33,7 @@ function BattleControllerDungeonShards:controllBattleEnd()
if not self.victory then if not self.victory then
self.combatReport.wave = self.combatReport.wave - 1 self.combatReport.wave = self.combatReport.wave - 1
end end
-- ModuleManager.ChapterManager:endFight(self.chapterId, self.combatReport, self.gotMysteryBoxIndexs, self.taskProgress) ModuleManager.ChapterManager:reqEndChallengeShards(self.chapterId, self.combatReport, self.gotMysteryBoxIndexs, self.taskProgress)
end end
function BattleControllerDungeonShards:postWaveOver(atkDead, isQuit) function BattleControllerDungeonShards:postWaveOver(atkDead, isQuit)
@ -52,22 +52,22 @@ function BattleControllerDungeonShards:postWaveOver(atkDead, isQuit)
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT
end end
-- local duration = self.waveDurationTime local duration = self.waveDurationTime
-- local totalTime = self.totalDurationTime local totalTime = self.totalDurationTime
-- local startTimes = DataManager.ChapterData:getChapterFightCount(self.chapterId) local startTimes = DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_SHARDS, self.chapterId)
-- local isFirstWin = false local isFirstWin = false
-- if not DataManager.ChapterData:getChapterPassed(self.chapterId) and self.victory then if DataManager.DungeonData:getPassedMaxId(ModuleManager.MODULE_KEY.DUNGEON_SHARDS) < self.chapterId and self.victory then
-- isFirstWin = true isFirstWin = true
-- end end
-- local isFianlStep = self.waveIndex >= self.maxWaveIndex local isFianlStep = self.waveIndex >= self.maxWaveIndex
-- BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.STAGE, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount) BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end end
function BattleControllerDungeonShards:postFightStart() function BattleControllerDungeonShards:postFightStart()
-- local unlockMaxChapter = DataManager.ChapterData:getNewChapterId() local unlockMaxChapter = DataManager.DungeonData:getUnlockMaxId(ModuleManager.MODULE_KEY.DUNGEON_SHARDS)
-- BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.STAGE, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.ChapterData:getChapterFightCount(self.chapterId)) BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_SHARDS, self.chapterId))
end end
return BattleControllerDungeonShards return BattleControllerDungeonShards

View File

@ -54,7 +54,7 @@ function DungeonManager:reqChallengeGold(id)
return return
end end
local parmas = {} local parmas = {chapter_gold_id = id}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterGoldChallengeStartReq, parmas, {}, self.respChallengeGold, BIReport.ITEM_GET_TYPE.DUNGEON_GOLD_CHALLENGE) self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterGoldChallengeStartReq, parmas, {}, self.respChallengeGold, BIReport.ITEM_GET_TYPE.DUNGEON_GOLD_CHALLENGE)
end end
@ -62,6 +62,8 @@ end
function DungeonManager:respChallengeGold(result) function DungeonManager:respChallengeGold(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.DungeonData:onFightCountReduce(ModuleManager.MODULE_KEY.DUNGEON_GOLD) DataManager.DungeonData:onFightCountReduce(ModuleManager.MODULE_KEY.DUNGEON_GOLD)
DataManager.DungeonData:setCurFightChapterId(result.reqData.chapter_gold_id)
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD)
end end
end end
@ -139,7 +141,7 @@ function DungeonManager:reqChallengeShards(id)
return return
end end
local parmas = {} local parmas = {chapter_shards_id = id}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterShardsChallengeStartReq, parmas, {}, self.respChallengeShards, BIReport.ITEM_GET_TYPE.DUNGEON_SHARDS_CHALLENGE) self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterShardsChallengeStartReq, parmas, {}, self.respChallengeShards, BIReport.ITEM_GET_TYPE.DUNGEON_SHARDS_CHALLENGE)
end end
@ -147,17 +149,19 @@ end
function DungeonManager:respChallengeShards(result) function DungeonManager:respChallengeShards(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.DungeonData:onFightCountReduce(ModuleManager.MODULE_KEY.DUNGEON_SHARDS) DataManager.DungeonData:onFightCountReduce(ModuleManager.MODULE_KEY.DUNGEON_SHARDS)
DataManager.DungeonData:setCurFightChapterId(result.reqData.chapter_shards_id)
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS)
end end
end end
-- 请求结算碎片副本 -- 请求结算碎片副本
function DungeonManager:reqEndChallengeShards() function DungeonManager:reqEndChallengeShards(id, combatReport, taskProgress, totalDamage, remainingHp)
local parmas = { local parmas = {
win = true, win = true,
total_damage = nil, total_damage = totalDamage,
chapter_Shards_id = nil, chapter_shards_id = id,
task_stat = nil, task_stat = taskProgress,
combatReport = nil, combatReport = combatReport,
} }
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterShardsChallengeSettlementReq, parmas, {}, self.respEndChallengeShards, BIReport.ITEM_GET_TYPE.DUNGEON_SHARDS_END) self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterShardsChallengeSettlementReq, parmas, {}, self.respEndChallengeShards, BIReport.ITEM_GET_TYPE.DUNGEON_SHARDS_END)
end end

View File

@ -318,4 +318,12 @@ function DungeonData:getBanner(moduleKey)
return self.dataDungeons[moduleKey]:getBanner() return self.dataDungeons[moduleKey]:getBanner()
end end
function DungeonData:setCurFightChapterId(chapterId)
self.curFightchapterId = chapterId or 1
end
function DungeonData:getCurFightChapterId()
return self.curFightchapterId or 1
end
return DungeonData return DungeonData