战斗波次加密

This commit is contained in:
xiekaidong 2023-09-01 10:41:55 +08:00
parent b6b342c435
commit 0498aaf75f
12 changed files with 91 additions and 68 deletions

View File

@ -108,7 +108,7 @@ function BattleBaseController:refreshWave()
if not self.battleUI then if not self.battleUI then
return return
end end
self.battleUI:refreshWave(self.waveIndex) self.battleUI:refreshWave(self:getWaveIndex())
end end
-- 战斗结束 -- 战斗结束
@ -154,7 +154,7 @@ function BattleBaseController:getMinEliminationCount()
end end
function BattleBaseController:getNextMonsterId(waveIndex) function BattleBaseController:getNextMonsterId(waveIndex)
waveIndex = waveIndex or self.waveIndex + 1 waveIndex = waveIndex or self:getWaveIndex() + 1
local config = self:getChapterConfig()[self.chapterId] local config = self:getChapterConfig()[self.chapterId]
local monsterId = config.monster[waveIndex] local monsterId = config.monster[waveIndex]
return monsterId return monsterId
@ -705,9 +705,8 @@ function BattleBaseController:initAtkUnits(callback)
end end
function BattleBaseController:initDefUnits(callback) function BattleBaseController:initDefUnits(callback)
local config = self:getChapterConfig()[self.chapterId] local initIndex = self:getWaveIndex()
local initIndex = self.waveIndex if initIndex <= 0 then
if self.waveIndex <= 0 then
initIndex = 1 initIndex = 1
end end
local monsterId = self:getNextMonsterId(initIndex) local monsterId = self:getNextMonsterId(initIndex)
@ -874,6 +873,22 @@ function BattleBaseController:setTimeScale(timeScale)
BattleHelper:setTimeScale(timeScale) BattleHelper:setTimeScale(timeScale)
end end
function BattleBaseController:addWaveIndex(wave)
local origin = self:getWaveIndex()
self.waveIndex = GFunc.encryptNumber(origin + wave)
end
function BattleBaseController:setWaveIndex(wave)
self.waveIndex = GFunc.encryptNumber(wave)
end
function BattleBaseController:getWaveIndex()
if self.waveIndex <= 0 then
return 0
end
return GFunc.decryptNumber(self.waveIndex)
end
function BattleBaseController:_findNextDefUnit() function BattleBaseController:_findNextDefUnit()
if self.isBossWave then -- 如果上一波是boss波次则重新生成棋盘 if self.isBossWave then -- 如果上一波是boss波次则重新生成棋盘
self:putBoardCacheSkill(function() self:putBoardCacheSkill(function()
@ -889,16 +904,17 @@ end
---- start 回合步骤 ---- start 回合步骤
function BattleBaseController:enterNextWave() function BattleBaseController:enterNextWave()
if self.waveIndex ~= 0 and self.curWaveMonsterDead then local waveIndex = self:getWaveIndex()
if waveIndex ~= 0 and self.curWaveMonsterDead then
if self.isBossWave then if self.isBossWave then
self:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.KILL_BOSS, 1) self:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.KILL_BOSS, 1)
else else
self:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.KILL_NORMAL_MONSTER, 1) self:addTaskProgress(BattleConst.BATTLE_TASK_FIELD.KILL_NORMAL_MONSTER, 1)
end end
self:setTaskProgress(BattleConst.BATTLE_TASK_FIELD.PASS_WAVE, self.waveIndex) self:setTaskProgress(BattleConst.BATTLE_TASK_FIELD.PASS_WAVE, waveIndex)
end end
if self.waveIndex >= self.maxWaveIndex then if waveIndex >= self.maxWaveIndex then
self.victory = self.curWaveMonsterDead self.victory = self.curWaveMonsterDead
self:postWaveOver(not self.curWaveMonsterDead) self:postWaveOver(not self.curWaveMonsterDead)
self:battleEnd() self:battleEnd()
@ -913,14 +929,15 @@ function BattleBaseController:enterNextWave()
return return
end end
if self.waveIndex ~= 0 then -- 第一波 if waveIndex ~= 0 then -- 第一波
self:postWaveOver(false) self:postWaveOver(false)
end end
self.curWaveMonsterDead = false self.curWaveMonsterDead = false
self.waveIndex = self.waveIndex + 1 self:addWaveIndex(1)
self:refreshWave(self.waveIndex) waveIndex = self:getWaveIndex()
if self.waveIndex == 1 then -- 第一波 self:refreshWave(waveIndex)
if waveIndex == 1 then -- 第一波
self.needWaitingBoardOver = true self.needWaitingBoardOver = true
self:generateBoard(true) self:generateBoard(true)
else else
@ -952,7 +969,7 @@ function BattleBaseController:enterNextWaveBySnapshot(snapShot)
end end
self.curWaveMonsterDead = false self.curWaveMonsterDead = false
self:refreshWave(self.waveIndex) self:refreshWave(self:getWaveIndex())
self.needWaitingBoardOver = true self.needWaitingBoardOver = true
self:generateBoard(true, snapShot) self:generateBoard(true, snapShot)
@ -977,7 +994,8 @@ function BattleBaseController:enterRoundBegin()
self:resetSideActionCount() self:resetSideActionCount()
self:setCurActionSide(SIDE_ATK) self:setCurActionSide(SIDE_ATK)
self.needWaitingBoardOver = nil self.needWaitingBoardOver = nil
self.waveRoundCount[self.waveIndex] = (self.waveRoundCount[self.waveIndex] or 0) + 1 local waveIndex = self:getWaveIndex()
self.waveRoundCount[waveIndex] = (self.waveRoundCount[waveIndex] or 0) + 1
self.battleUI:enterShowBoardAni(function() self.battleUI:enterShowBoardAni(function()
self:enterEliminationBegin() self:enterEliminationBegin()
end) end)
@ -1157,7 +1175,7 @@ function BattleBaseController:checkTeamIsDead(callback)
self:onDefDead(function() self:onDefDead(function()
self.defTeam:removeAllBuff() self.defTeam:removeAllBuff()
if self.battleData:getDefTeam():getIsDead() then if self.battleData:getDefTeam():getIsDead() then
if self.waveIndex >= self.maxWaveIndex then if self:getWaveIndex() >= self.maxWaveIndex then
if callback() then if callback() then
callback() callback()
end end
@ -1591,7 +1609,7 @@ function BattleBaseController:tryShowSelectSkillComp(needDelay, onlyCommonSkill)
self.battleUI:showSelectSkillComp(skillList, onlyCommonSkill) self.battleUI:showSelectSkillComp(skillList, onlyCommonSkill)
end end
BIReport:postShowFightSkillSelect(self.battleType, self.battleData, skillList, self.chapterId, self.totalDurationTime, self.waveIndex) BIReport:postShowFightSkillSelect(self.battleType, self.battleData, skillList, self.chapterId, self.totalDurationTime, self:getWaveIndex())
end end
@ -2335,7 +2353,7 @@ function BattleBaseController:onSelectSkill(skillId, value, pos, side)
side = side or self:getCurActionSide() side = side or self:getCurActionSide()
self:dealSelectSkill(skillId, value, side) self:dealSelectSkill(skillId, value, side)
BIReport:postFightSkillSelect(self.battleType, self.battleData, {skillId}, self.chapterId, self.totalDurationTime, self.waveIndex) BIReport:postFightSkillSelect(self.battleType, self.battleData, {skillId}, self.chapterId, self.totalDurationTime, self:getWaveIndex())
local elementType = ModuleManager.HeroManager:getSkillRoguePosition(skillId) local elementType = ModuleManager.HeroManager:getSkillRoguePosition(skillId)
if elementType then if elementType then
@ -3061,7 +3079,7 @@ function BattleBaseController:battleEnd()
-- 处理战斗任务 -- 处理战斗任务
if self.victory then if self.victory then
self:setTaskProgress(GConst.BattleConst.BATTLE_TASK_FIELD.KILLS_BOSS_TURN, self.waveRoundCount[self.waveIndex]) self:setTaskProgress(GConst.BattleConst.BATTLE_TASK_FIELD.KILLS_BOSS_TURN, self.waveRoundCount[self:getWaveIndex()])
end end
local teamEntity = self.battleData:getAtkTeam() local teamEntity = self.battleData:getAtkTeam()

View File

@ -52,9 +52,9 @@ end
function BattleControllerArena:controllBattleEnd() function BattleControllerArena:controllBattleEnd()
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.ARENA, battleType = GConst.BattleConst.BATTLE_TYPE.ARENA,
wave = self.waveIndex, wave = self:getWaveIndex(),
victory = self.victory, victory = self.victory,
round = self.waveRoundCount[self.waveIndex] or 0 round = self.waveRoundCount[self:getWaveIndex()] or 0
} }
local atkReport = {} local atkReport = {}
local teamEntity = self.battleData:getAtkTeam() local teamEntity = self.battleData:getAtkTeam()
@ -119,14 +119,14 @@ function BattleControllerArena:postWaveOver(atkDead, isQuit)
local totalTime = self.totalDurationTime local totalTime = self.totalDurationTime
local startTimes = DataManager.ArenaData:getTotalFightCount() local startTimes = DataManager.ArenaData:getTotalFightCount()
local isFirstWin = false local isFirstWin = false
local isFianlStep = self.waveIndex >= self.maxWaveIndex local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.ARENA, self.battleData, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount) BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.ARENA, self.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end end
function BattleControllerArena:postFightStart() function BattleControllerArena:postFightStart()
local startTimes = DataManager.ArenaData:getTotalFightCount() local startTimes = DataManager.ArenaData:getTotalFightCount()
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.ARENA, self.waveIndex, self.chapterId, self.chapterId, startTimes) BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.ARENA, self:getWaveIndex(), self.chapterId, self.chapterId, startTimes)
end end
function BattleControllerArena:getAtkMinRow() function BattleControllerArena:getAtkMinRow()

View File

@ -89,9 +89,10 @@ end
-- 怪物攻击力加成 -- 怪物攻击力加成
function BattleControllerBossRush:getMonsterAtkAddition() function BattleControllerBossRush:getMonsterAtkAddition()
if not self.lastAtkWaveIndex ~= self.waveIndex then local waveIndex = self:getWaveIndex()
self.lastAtkWaveIndex = self.waveIndex if not self.lastAtkWaveIndex ~= waveIndex then
return self.monsterAtkAddition * (self.waveIndex + 1) self.lastAtkWaveIndex = waveIndex
return self.monsterAtkAddition * (waveIndex + 1)
else else
return self.monsterAtkAddition * self.lastAtkWaveIndex return self.monsterAtkAddition * self.lastAtkWaveIndex
end end
@ -99,16 +100,18 @@ end
-- 怪物血量加成 -- 怪物血量加成
function BattleControllerBossRush:getMonsterHpAddition() function BattleControllerBossRush:getMonsterHpAddition()
if not self.lastHpWaveIndex ~= self.waveIndex then local waveIndex = self:getWaveIndex()
self.lastHpWaveIndex = self.waveIndex if not self.lastHpWaveIndex ~= waveIndex then
return self.monsterHpAddition * (self.waveIndex + 1) self.lastHpWaveIndex = waveIndex
return self.monsterHpAddition * (waveIndex + 1)
else else
return self.monsterHpAddition * self.lastHpWaveIndex return self.monsterHpAddition * self.lastHpWaveIndex
end end
end end
function BattleControllerBossRush:enterNextWave(...) function BattleControllerBossRush:enterNextWave(...)
if self.waveIndex >= 1 and self.waveIndex <= 60 then local waveIndex = self:getWaveIndex()
if waveIndex >= 1 and waveIndex <= 60 then
self.battleData:addBattleLvCount(1) self.battleData:addBattleLvCount(1)
end end
BattleController.enterNextWave(self, ...) BattleController.enterNextWave(self, ...)
@ -116,7 +119,7 @@ end
function BattleControllerBossRush:getNextMonsterId(waveIndex) function BattleControllerBossRush:getNextMonsterId(waveIndex)
self:getInitBoard() self:getInitBoard()
waveIndex = waveIndex or self.waveIndex + 1 waveIndex = waveIndex or self:getWaveIndex() + 1
local config = self:getChapterConfig()[self.chapterId] local config = self:getChapterConfig()[self.chapterId]
local monsterId = config.monster[waveIndex] local monsterId = config.monster[waveIndex]
return self.monsterList[monsterId] return self.monsterList[monsterId]
@ -131,7 +134,7 @@ end
function BattleControllerBossRush:controllBattleEnd() function BattleControllerBossRush:controllBattleEnd()
-- self.combatReport = { -- self.combatReport = {
-- battleType = GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH, -- battleType = GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH,
-- wave = self.waveIndex, -- wave = self:getWaveIndex(),
-- victory = self.victory, -- victory = self.victory,
-- } -- }
-- local atkReport = {} -- local atkReport = {}
@ -178,13 +181,13 @@ function BattleControllerBossRush:postWaveOver(atkDead, isQuit)
-- local startTimes = DataManager.DailyChallengeData:getTotalFightCount() -- local startTimes = DataManager.DailyChallengeData:getTotalFightCount()
-- local isFirstWin = false -- TODO 策划说不需要 因为系数在变 -- local isFirstWin = false -- TODO 策划说不需要 因为系数在变
-- local isFianlStep = self.waveIndex >= self.maxWaveIndex -- local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
-- BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH, self.battleData, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount) -- BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH, self.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end end
function BattleControllerBossRush:postFightStart() function BattleControllerBossRush:postFightStart()
-- BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH, self.waveIndex, self.chapterId, nil, 1) -- BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH, self:getWaveIndex(), self.chapterId, nil, 1)
end end
return BattleControllerBossRush return BattleControllerBossRush

View File

@ -85,7 +85,7 @@ end
function BattleControllerDailyChallenge:controllBattleEnd() function BattleControllerDailyChallenge:controllBattleEnd()
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE, battleType = GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE,
wave = self.waveIndex, wave = self:getWaveIndex(),
victory = self.victory, victory = self.victory,
} }
local atkReport = {} local atkReport = {}
@ -132,13 +132,13 @@ function BattleControllerDailyChallenge:postWaveOver(atkDead, isQuit)
local startTimes = DataManager.DailyChallengeData:getTotalFightCount() local startTimes = DataManager.DailyChallengeData:getTotalFightCount()
local isFirstWin = false -- TODO 策划说不需要 因为系数在变 local isFirstWin = false -- TODO 策划说不需要 因为系数在变
local isFianlStep = self.waveIndex >= self.maxWaveIndex local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE, self.battleData, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount) BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE, self.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end end
function BattleControllerDailyChallenge:postFightStart() function BattleControllerDailyChallenge:postFightStart()
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE, self.waveIndex, self.chapterId, nil, 1) BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE, self:getWaveIndex(), self.chapterId, nil, 1)
end end
return BattleControllerDailyChallenge return BattleControllerDailyChallenge

View File

@ -17,7 +17,7 @@ end
function BattleControllerDungeonArmor:controllBattleEnd() function BattleControllerDungeonArmor:controllBattleEnd()
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR, battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR,
wave = self.waveIndex, wave = self:getWaveIndex(),
victory = self.victory, victory = self.victory,
} }
local atkReport = {} local atkReport = {}
@ -62,16 +62,16 @@ function BattleControllerDungeonArmor:postWaveOver(atkDead, isQuit)
isFirstWin = true isFirstWin = true
end end
local isFianlStep = self.waveIndex >= self.maxWaveIndex local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR, self.battleData, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount) BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR, self.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end end
function BattleControllerDungeonArmor:postFightStart() function BattleControllerDungeonArmor:postFightStart()
local armorData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR) local armorData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR)
local startTimes = armorData:getChapterFightCount(self.chapterId) local startTimes = armorData:getChapterFightCount(self.chapterId)
local unlockMaxChapter = armorData:getPassedMaxId() + 1 local unlockMaxChapter = armorData:getPassedMaxId() + 1
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR, self.waveIndex, self.chapterId, unlockMaxChapter, startTimes) BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR, self:getWaveIndex(), self.chapterId, unlockMaxChapter, startTimes)
end end
return BattleControllerDungeonArmor return BattleControllerDungeonArmor

View File

@ -19,7 +19,7 @@ end
function BattleControllerDungeonGold:enterRoundBegin(...) function BattleControllerDungeonGold:enterRoundBegin(...)
local nextWaveRound = 0 local nextWaveRound = 0
if self.dungeonGoldMaxRoundCount then if self.dungeonGoldMaxRoundCount then
nextWaveRound = (self.waveRoundCount[self.waveIndex] or 0) + 1 nextWaveRound = (self.waveRoundCount[self:getWaveIndex()] or 0) + 1
if self.dungeonGoldMaxRoundCount < nextWaveRound then -- 超过最大回合, 直接结算 if self.dungeonGoldMaxRoundCount < nextWaveRound then -- 超过最大回合, 直接结算
self.victory = false self.victory = false
self:postWaveOver(false) self:postWaveOver(false)
@ -46,7 +46,7 @@ function BattleControllerDungeonGold:controllBattleEnd()
local remainRound = self.dungeonGoldMaxRoundCount - (self.waveRoundCount[1] or 0) local remainRound = self.dungeonGoldMaxRoundCount - (self.waveRoundCount[1] or 0)
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD,
wave = self.waveIndex, wave = self:getWaveIndex(),
victory = self.victory, victory = self.victory,
remainRound = remainRound, remainRound = remainRound,
} }
@ -94,14 +94,14 @@ function BattleControllerDungeonGold:postWaveOver(atkDead, isQuit)
isFirstWin = true isFirstWin = true
end end
local isFianlStep = self.waveIndex >= self.maxWaveIndex local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, self.battleData, 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.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end end
function BattleControllerDungeonGold:postFightStart() function BattleControllerDungeonGold:postFightStart()
local unlockMaxChapter = DataManager.DungeonData:getUnlockMaxId(ModuleManager.MODULE_KEY.DUNGEON_GOLD) 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)) BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, self:getWaveIndex(), self.chapterId, unlockMaxChapter, DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_GOLD, self.chapterId))
end end
return BattleControllerDungeonGold return BattleControllerDungeonGold

View File

@ -16,7 +16,7 @@ end
function BattleControllerDungeonShards:controllBattleEnd() function BattleControllerDungeonShards:controllBattleEnd()
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS,
wave = self.waveIndex, wave = self:getWaveIndex(),
victory = self.victory, victory = self.victory,
} }
local atkReport = {} local atkReport = {}
@ -62,14 +62,14 @@ function BattleControllerDungeonShards:postWaveOver(atkDead, isQuit)
isFirstWin = true isFirstWin = true
end end
local isFianlStep = self.waveIndex >= self.maxWaveIndex local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, self.battleData, 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.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end end
function BattleControllerDungeonShards:postFightStart() function BattleControllerDungeonShards:postFightStart()
local unlockMaxChapter = DataManager.DungeonData:getUnlockMaxId(ModuleManager.MODULE_KEY.DUNGEON_SHARDS) 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)) BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, self:getWaveIndex(), self.chapterId, unlockMaxChapter, DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_SHARDS, self.chapterId))
end end
return BattleControllerDungeonShards return BattleControllerDungeonShards

View File

@ -17,7 +17,7 @@ end
function BattleControllerDungeonWeapon:controllBattleEnd() function BattleControllerDungeonWeapon:controllBattleEnd()
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON,
wave = self.waveIndex, wave = self:getWaveIndex(),
victory = self.victory, victory = self.victory,
} }
local atkReport = {} local atkReport = {}
@ -62,16 +62,16 @@ function BattleControllerDungeonWeapon:postWaveOver(atkDead, isQuit)
isFirstWin = true isFirstWin = true
end end
local isFianlStep = self.waveIndex >= self.maxWaveIndex local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, self.battleData, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount) BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, self.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end end
function BattleControllerDungeonWeapon:postFightStart() function BattleControllerDungeonWeapon:postFightStart()
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON) local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
local startTimes = weaponData:getChapterFightCount(self.chapterId) local startTimes = weaponData:getChapterFightCount(self.chapterId)
local unlockMaxChapter = weaponData:getPassedMaxId() + 1 local unlockMaxChapter = weaponData:getPassedMaxId() + 1
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, self.waveIndex, self.chapterId, unlockMaxChapter, startTimes) BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, self:getWaveIndex(), self.chapterId, unlockMaxChapter, startTimes)
end end
return BattleControllerDungeonWeapon return BattleControllerDungeonWeapon

View File

@ -290,7 +290,8 @@ function BattleControllerPVP:checkDefBoard()
end end
function BattleControllerPVP:enterRoundBegin(...) function BattleControllerPVP:enterRoundBegin(...)
local nextWaveRound = (self.waveRoundCount[self.waveIndex] or 0) + 1 local waveIndex = self:getWaveIndex()
local nextWaveRound = (self.waveRoundCount[waveIndex] or 0) + 1
if self:getMaxRoundCount() < nextWaveRound then -- 超过最大回合, 直接结算 if self:getMaxRoundCount() < nextWaveRound then -- 超过最大回合, 直接结算
self.victory = false self.victory = false
self:postWaveOver(false) self:postWaveOver(false)
@ -298,13 +299,13 @@ function BattleControllerPVP:enterRoundBegin(...)
return return
end end
local isFirstWaveFirstRound = false local isFirstWaveFirstRound = false
if self.waveIndex == 1 and nextWaveRound == 1 then if waveIndex == 1 and nextWaveRound == 1 then
isFirstWaveFirstRound = true isFirstWaveFirstRound = true
end end
self:resetSideActionCount() self:resetSideActionCount()
self:setCurActionSide(SIDE_ATK) self:setCurActionSide(SIDE_ATK)
self.needWaitingBoardOver = nil self.needWaitingBoardOver = nil
self.waveRoundCount[self.waveIndex] = (self.waveRoundCount[self.waveIndex] or 0) + 1 self.waveRoundCount[waveIndex] = (self.waveRoundCount[waveIndex] or 0) + 1
self.battleUI:enterShowBoardAni(function() self.battleUI:enterShowBoardAni(function()
self:takeGridEffect() self:takeGridEffect()
self:enterEliminationBegin() self:enterEliminationBegin()
@ -317,7 +318,7 @@ function BattleControllerPVP:refreshWave()
if not self.battleUI then if not self.battleUI then
return return
end end
self.battleUI:refreshWave(self.waveRoundCount[self.waveIndex] or 0) self.battleUI:refreshWave(self.waveRoundCount[self:getWaveIndex()] or 0)
end end
return BattleControllerPVP return BattleControllerPVP

View File

@ -57,7 +57,7 @@ end
function BattleControllerStage:controllBattleEnd() function BattleControllerStage:controllBattleEnd()
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.STAGE, battleType = GConst.BattleConst.BATTLE_TYPE.STAGE,
wave = self.waveIndex, wave = self:getWaveIndex(),
victory = self.victory, victory = self.victory,
} }
local atkReport = {} local atkReport = {}
@ -101,14 +101,14 @@ function BattleControllerStage:postWaveOver(atkDead, isQuit)
isFirstWin = true isFirstWin = true
end end
local isFianlStep = self.waveIndex >= self.maxWaveIndex local isFianlStep = self:getWaveIndex() >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.STAGE, self.battleData, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount) BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.STAGE, self.battleData, self.chapterId, self:getWaveIndex(), duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end end
function BattleControllerStage:postFightStart() function BattleControllerStage:postFightStart()
local unlockMaxChapter = DataManager.ChapterData:getNewChapterId() local unlockMaxChapter = DataManager.ChapterData:getNewChapterId()
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.STAGE, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.ChapterData:getChapterFightCount(self.chapterId)) BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.STAGE, self:getWaveIndex(), self.chapterId, unlockMaxChapter, DataManager.ChapterData:getChapterFightCount(self.chapterId))
end end
return BattleControllerStage return BattleControllerStage

View File

@ -52,7 +52,7 @@ function BattleSnapshotHelper:snapshotBattleInfo(battleBaseController)
end end
battleBaseController.snapShotInfo.curBoardIndex = battleBaseController.curBoardIndex battleBaseController.snapShotInfo.curBoardIndex = battleBaseController.curBoardIndex
battleBaseController.snapShotInfo.chapterId = battleBaseController.chapterId -- 当前战斗关卡 battleBaseController.snapShotInfo.chapterId = battleBaseController.chapterId -- 当前战斗关卡
battleBaseController.snapShotInfo.waveIndex = battleBaseController.waveIndex -- 当前波次 battleBaseController.snapShotInfo.waveIndex = battleBaseController:getWaveIndex() -- 当前波次
battleBaseController.snapShotInfo.gotMysteryBoxIndexs = table.clearOrCreate(battleBaseController.snapShotInfo.gotMysteryBoxIndexs) -- 神秘宝箱索引 battleBaseController.snapShotInfo.gotMysteryBoxIndexs = table.clearOrCreate(battleBaseController.snapShotInfo.gotMysteryBoxIndexs) -- 神秘宝箱索引
for k, v in pairs(battleBaseController.gotMysteryBoxIndexs) do for k, v in pairs(battleBaseController.gotMysteryBoxIndexs) do
battleBaseController.snapShotInfo.gotMysteryBoxIndexs[tostring(k)] = v battleBaseController.snapShotInfo.gotMysteryBoxIndexs[tostring(k)] = v
@ -168,7 +168,7 @@ function BattleSnapshotHelper:dealSnapshotBattleBaseInfo(battleBaseController, s
end end
battleBaseController.chapterId = snapInfo.chapterId battleBaseController.chapterId = snapInfo.chapterId
battleBaseController.waveIndex = snapInfo.waveIndex battleBaseController:setWaveIndex(snapInfo.waveIndex)
battleBaseController.maxWaveIndex = battleBaseController:getMaxWave() battleBaseController.maxWaveIndex = battleBaseController:getMaxWave()
if snapInfo.gotMysteryBoxIndexs then if snapInfo.gotMysteryBoxIndexs then

View File

@ -323,8 +323,9 @@ function DungeonArmorEntity:formatTaskByController(battleBaseController, chapter
local pass = self:getPassedMaxId() >= chapterId and 1 or 0 local pass = self:getPassedMaxId() >= chapterId and 1 or 0
local hpp = math.floor(battleBaseController.battleData:getAtkTeam():getHpPercent() * 100 + 0.0001) local hpp = math.floor(battleBaseController.battleData:getAtkTeam():getHpPercent() * 100 + 0.0001)
local bossRoundCount = 0 local bossRoundCount = 0
if battleBaseController.waveIndex >= battleBaseController.maxWaveIndex then -- 最后一波 local waveIndex = battleBaseController:getWaveIndex()
bossRoundCount = battleBaseController.waveRoundCount[battleBaseController.waveIndex] or 0 if waveIndex >= battleBaseController.maxWaveIndex then -- 最后一波
bossRoundCount = battleBaseController.waveRoundCount[waveIndex] or 0
end end
local totalRound = 0 local totalRound = 0
for wave, round in pairs(battleBaseController.waveRoundCount) do for wave, round in pairs(battleBaseController.waveRoundCount) do