战斗波次加密

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

View File

@ -52,9 +52,9 @@ end
function BattleControllerArena:controllBattleEnd()
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.ARENA,
wave = self.waveIndex,
wave = self:getWaveIndex(),
victory = self.victory,
round = self.waveRoundCount[self.waveIndex] or 0
round = self.waveRoundCount[self:getWaveIndex()] or 0
}
local atkReport = {}
local teamEntity = self.battleData:getAtkTeam()
@ -119,14 +119,14 @@ function BattleControllerArena:postWaveOver(atkDead, isQuit)
local totalTime = self.totalDurationTime
local startTimes = DataManager.ArenaData:getTotalFightCount()
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
function BattleControllerArena:postFightStart()
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
function BattleControllerArena:getAtkMinRow()

View File

@ -89,9 +89,10 @@ end
-- 怪物攻击力加成
function BattleControllerBossRush:getMonsterAtkAddition()
if not self.lastAtkWaveIndex ~= self.waveIndex then
self.lastAtkWaveIndex = self.waveIndex
return self.monsterAtkAddition * (self.waveIndex + 1)
local waveIndex = self:getWaveIndex()
if not self.lastAtkWaveIndex ~= waveIndex then
self.lastAtkWaveIndex = waveIndex
return self.monsterAtkAddition * (waveIndex + 1)
else
return self.monsterAtkAddition * self.lastAtkWaveIndex
end
@ -99,16 +100,18 @@ end
-- 怪物血量加成
function BattleControllerBossRush:getMonsterHpAddition()
if not self.lastHpWaveIndex ~= self.waveIndex then
self.lastHpWaveIndex = self.waveIndex
return self.monsterHpAddition * (self.waveIndex + 1)
local waveIndex = self:getWaveIndex()
if not self.lastHpWaveIndex ~= waveIndex then
self.lastHpWaveIndex = waveIndex
return self.monsterHpAddition * (waveIndex + 1)
else
return self.monsterHpAddition * self.lastHpWaveIndex
end
end
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)
end
BattleController.enterNextWave(self, ...)
@ -116,7 +119,7 @@ end
function BattleControllerBossRush:getNextMonsterId(waveIndex)
self:getInitBoard()
waveIndex = waveIndex or self.waveIndex + 1
waveIndex = waveIndex or self:getWaveIndex() + 1
local config = self:getChapterConfig()[self.chapterId]
local monsterId = config.monster[waveIndex]
return self.monsterList[monsterId]
@ -131,7 +134,7 @@ end
function BattleControllerBossRush:controllBattleEnd()
-- self.combatReport = {
-- battleType = GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH,
-- wave = self.waveIndex,
-- wave = self:getWaveIndex(),
-- victory = self.victory,
-- }
-- local atkReport = {}
@ -178,13 +181,13 @@ function BattleControllerBossRush:postWaveOver(atkDead, isQuit)
-- local startTimes = DataManager.DailyChallengeData:getTotalFightCount()
-- 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
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
return BattleControllerBossRush

View File

@ -85,7 +85,7 @@ end
function BattleControllerDailyChallenge:controllBattleEnd()
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE,
wave = self.waveIndex,
wave = self:getWaveIndex(),
victory = self.victory,
}
local atkReport = {}
@ -132,13 +132,13 @@ function BattleControllerDailyChallenge:postWaveOver(atkDead, isQuit)
local startTimes = DataManager.DailyChallengeData:getTotalFightCount()
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
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
return BattleControllerDailyChallenge

View File

@ -17,7 +17,7 @@ end
function BattleControllerDungeonArmor:controllBattleEnd()
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR,
wave = self.waveIndex,
wave = self:getWaveIndex(),
victory = self.victory,
}
local atkReport = {}
@ -62,16 +62,16 @@ function BattleControllerDungeonArmor:postWaveOver(atkDead, isQuit)
isFirstWin = true
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
function BattleControllerDungeonArmor:postFightStart()
local armorData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR)
local startTimes = armorData:getChapterFightCount(self.chapterId)
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
return BattleControllerDungeonArmor

View File

@ -19,7 +19,7 @@ end
function BattleControllerDungeonGold:enterRoundBegin(...)
local nextWaveRound = 0
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 -- 超过最大回合, 直接结算
self.victory = false
self:postWaveOver(false)
@ -46,7 +46,7 @@ function BattleControllerDungeonGold:controllBattleEnd()
local remainRound = self.dungeonGoldMaxRoundCount - (self.waveRoundCount[1] or 0)
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD,
wave = self.waveIndex,
wave = self:getWaveIndex(),
victory = self.victory,
remainRound = remainRound,
}
@ -94,14 +94,14 @@ function BattleControllerDungeonGold:postWaveOver(atkDead, isQuit)
isFirstWin = true
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
function BattleControllerDungeonGold:postFightStart()
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
return BattleControllerDungeonGold

View File

@ -16,7 +16,7 @@ end
function BattleControllerDungeonShards:controllBattleEnd()
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS,
wave = self.waveIndex,
wave = self:getWaveIndex(),
victory = self.victory,
}
local atkReport = {}
@ -62,14 +62,14 @@ function BattleControllerDungeonShards:postWaveOver(atkDead, isQuit)
isFirstWin = true
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
function BattleControllerDungeonShards:postFightStart()
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
return BattleControllerDungeonShards

View File

@ -17,7 +17,7 @@ end
function BattleControllerDungeonWeapon:controllBattleEnd()
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON,
wave = self.waveIndex,
wave = self:getWaveIndex(),
victory = self.victory,
}
local atkReport = {}
@ -62,16 +62,16 @@ function BattleControllerDungeonWeapon:postWaveOver(atkDead, isQuit)
isFirstWin = true
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
function BattleControllerDungeonWeapon:postFightStart()
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
local startTimes = weaponData:getChapterFightCount(self.chapterId)
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
return BattleControllerDungeonWeapon

View File

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

View File

@ -57,7 +57,7 @@ end
function BattleControllerStage:controllBattleEnd()
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.STAGE,
wave = self.waveIndex,
wave = self:getWaveIndex(),
victory = self.victory,
}
local atkReport = {}
@ -101,14 +101,14 @@ function BattleControllerStage:postWaveOver(atkDead, isQuit)
isFirstWin = true
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
function BattleControllerStage:postFightStart()
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
return BattleControllerStage

View File

@ -52,7 +52,7 @@ function BattleSnapshotHelper:snapshotBattleInfo(battleBaseController)
end
battleBaseController.snapShotInfo.curBoardIndex = battleBaseController.curBoardIndex
battleBaseController.snapShotInfo.chapterId = battleBaseController.chapterId -- 当前战斗关卡
battleBaseController.snapShotInfo.waveIndex = battleBaseController.waveIndex -- 当前波次
battleBaseController.snapShotInfo.waveIndex = battleBaseController:getWaveIndex() -- 当前波次
battleBaseController.snapShotInfo.gotMysteryBoxIndexs = table.clearOrCreate(battleBaseController.snapShotInfo.gotMysteryBoxIndexs) -- 神秘宝箱索引
for k, v in pairs(battleBaseController.gotMysteryBoxIndexs) do
battleBaseController.snapShotInfo.gotMysteryBoxIndexs[tostring(k)] = v
@ -168,7 +168,7 @@ function BattleSnapshotHelper:dealSnapshotBattleBaseInfo(battleBaseController, s
end
battleBaseController.chapterId = snapInfo.chapterId
battleBaseController.waveIndex = snapInfo.waveIndex
battleBaseController:setWaveIndex(snapInfo.waveIndex)
battleBaseController.maxWaveIndex = battleBaseController:getMaxWave()
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 hpp = math.floor(battleBaseController.battleData:getAtkTeam():getHpPercent() * 100 + 0.0001)
local bossRoundCount = 0
if battleBaseController.waveIndex >= battleBaseController.maxWaveIndex then -- 最后一波
bossRoundCount = battleBaseController.waveRoundCount[battleBaseController.waveIndex] or 0
local waveIndex = battleBaseController:getWaveIndex()
if waveIndex >= battleBaseController.maxWaveIndex then -- 最后一波
bossRoundCount = battleBaseController.waveRoundCount[waveIndex] or 0
end
local totalRound = 0
for wave, round in pairs(battleBaseController.waveRoundCount) do