副本战斗
This commit is contained in:
parent
9d648fb450
commit
59289536d1
@ -10,7 +10,7 @@ function BattleControllerDungeonGold:getChapterConfig()
|
||||
end
|
||||
|
||||
function BattleControllerDungeonGold:getChapterId()
|
||||
return 1 -- Todo
|
||||
return ModuleManager.DungeonData:getCurFightChapterId()
|
||||
end
|
||||
|
||||
function BattleControllerDungeonGold:controllBattleEnd()
|
||||
@ -55,22 +55,22 @@ function BattleControllerDungeonGold:postWaveOver(atkDead, isQuit)
|
||||
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT
|
||||
end
|
||||
|
||||
-- local duration = self.waveDurationTime
|
||||
-- local totalTime = self.totalDurationTime
|
||||
-- local startTimes = DataManager.ChapterData:getChapterFightCount(self.chapterId)
|
||||
-- local isFirstWin = false
|
||||
-- if not DataManager.ChapterData:getChapterPassed(self.chapterId) and self.victory then
|
||||
-- isFirstWin = true
|
||||
-- end
|
||||
local duration = self.waveDurationTime
|
||||
local totalTime = self.totalDurationTime
|
||||
local startTimes = DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_GOLD, self.chapterId)
|
||||
local isFirstWin = false
|
||||
if DataManager.DungeonData:getPassedMaxId(ModuleManager.MODULE_KEY.DUNGEON_GOLD) < self.chapterId and self.victory then
|
||||
isFirstWin = true
|
||||
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
|
||||
|
||||
function BattleControllerDungeonGold:postFightStart()
|
||||
-- local unlockMaxChapter = DataManager.ChapterData:getNewChapterId()
|
||||
-- BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.STAGE, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.ChapterData:getChapterFightCount(self.chapterId))
|
||||
local unlockMaxChapter = DataManager.DungeonData:getUnlockMaxId(ModuleManager.MODULE_KEY.DUNGEON_GOLD)
|
||||
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_GOLD, self.chapterId))
|
||||
end
|
||||
|
||||
return BattleControllerDungeonGold
|
||||
@ -10,12 +10,12 @@ function BattleControllerDungeonShards:getChapterConfig()
|
||||
end
|
||||
|
||||
function BattleControllerDungeonShards:getChapterId()
|
||||
return 1 -- Todo
|
||||
return ModuleManager.DungeonData:getCurFightChapterId()
|
||||
end
|
||||
|
||||
function BattleControllerDungeonShards:controllBattleEnd()
|
||||
self.combatReport = {
|
||||
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD,
|
||||
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS,
|
||||
wave = self.waveIndex,
|
||||
victory = self.victory,
|
||||
}
|
||||
@ -33,7 +33,7 @@ function BattleControllerDungeonShards:controllBattleEnd()
|
||||
if not self.victory then
|
||||
self.combatReport.wave = self.combatReport.wave - 1
|
||||
end
|
||||
-- ModuleManager.ChapterManager:endFight(self.chapterId, self.combatReport, self.gotMysteryBoxIndexs, self.taskProgress)
|
||||
ModuleManager.ChapterManager:reqEndChallengeShards(self.chapterId, self.combatReport, self.gotMysteryBoxIndexs, self.taskProgress)
|
||||
end
|
||||
|
||||
function BattleControllerDungeonShards:postWaveOver(atkDead, isQuit)
|
||||
@ -52,22 +52,22 @@ function BattleControllerDungeonShards:postWaveOver(atkDead, isQuit)
|
||||
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT
|
||||
end
|
||||
|
||||
-- local duration = self.waveDurationTime
|
||||
-- local totalTime = self.totalDurationTime
|
||||
-- local startTimes = DataManager.ChapterData:getChapterFightCount(self.chapterId)
|
||||
-- local isFirstWin = false
|
||||
-- if not DataManager.ChapterData:getChapterPassed(self.chapterId) and self.victory then
|
||||
-- isFirstWin = true
|
||||
-- end
|
||||
local duration = self.waveDurationTime
|
||||
local totalTime = self.totalDurationTime
|
||||
local startTimes = DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_SHARDS, self.chapterId)
|
||||
local isFirstWin = false
|
||||
if DataManager.DungeonData:getPassedMaxId(ModuleManager.MODULE_KEY.DUNGEON_SHARDS) < self.chapterId and self.victory then
|
||||
isFirstWin = true
|
||||
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
|
||||
|
||||
function BattleControllerDungeonShards:postFightStart()
|
||||
-- local unlockMaxChapter = DataManager.ChapterData:getNewChapterId()
|
||||
-- BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.STAGE, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.ChapterData:getChapterFightCount(self.chapterId))
|
||||
local unlockMaxChapter = DataManager.DungeonData:getUnlockMaxId(ModuleManager.MODULE_KEY.DUNGEON_SHARDS)
|
||||
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_SHARDS, self.chapterId))
|
||||
end
|
||||
|
||||
return BattleControllerDungeonShards
|
||||
@ -54,7 +54,7 @@ function DungeonManager:reqChallengeGold(id)
|
||||
return
|
||||
end
|
||||
|
||||
local parmas = {}
|
||||
local parmas = {chapter_gold_id = id}
|
||||
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterGoldChallengeStartReq, parmas, {}, self.respChallengeGold, BIReport.ITEM_GET_TYPE.DUNGEON_GOLD_CHALLENGE)
|
||||
end
|
||||
|
||||
@ -62,6 +62,8 @@ end
|
||||
function DungeonManager:respChallengeGold(result)
|
||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||
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
|
||||
|
||||
@ -139,7 +141,7 @@ function DungeonManager:reqChallengeShards(id)
|
||||
return
|
||||
end
|
||||
|
||||
local parmas = {}
|
||||
local parmas = {chapter_shards_id = id}
|
||||
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterShardsChallengeStartReq, parmas, {}, self.respChallengeShards, BIReport.ITEM_GET_TYPE.DUNGEON_SHARDS_CHALLENGE)
|
||||
end
|
||||
|
||||
@ -147,17 +149,19 @@ end
|
||||
function DungeonManager:respChallengeShards(result)
|
||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||
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
|
||||
|
||||
-- 请求结算碎片副本
|
||||
function DungeonManager:reqEndChallengeShards()
|
||||
function DungeonManager:reqEndChallengeShards(id, combatReport, taskProgress, totalDamage, remainingHp)
|
||||
local parmas = {
|
||||
win = true,
|
||||
total_damage = nil,
|
||||
chapter_Shards_id = nil,
|
||||
task_stat = nil,
|
||||
combatReport = nil,
|
||||
total_damage = totalDamage,
|
||||
chapter_shards_id = id,
|
||||
task_stat = taskProgress,
|
||||
combatReport = combatReport,
|
||||
}
|
||||
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterShardsChallengeSettlementReq, parmas, {}, self.respEndChallengeShards, BIReport.ITEM_GET_TYPE.DUNGEON_SHARDS_END)
|
||||
end
|
||||
|
||||
@ -318,4 +318,12 @@ function DungeonData:getBanner(moduleKey)
|
||||
return self.dataDungeons[moduleKey]:getBanner()
|
||||
end
|
||||
|
||||
function DungeonData:setCurFightChapterId(chapterId)
|
||||
self.curFightchapterId = chapterId or 1
|
||||
end
|
||||
|
||||
function DungeonData:getCurFightChapterId()
|
||||
return self.curFightchapterId or 1
|
||||
end
|
||||
|
||||
return DungeonData
|
||||
Loading…
x
Reference in New Issue
Block a user