diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 6e2e4840..f9bf5b89 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -255,8 +255,8 @@ end function BattleController:init(params) params = params or {} self.battleType = params.battleType or GConst.BattleConst.BATTLE_TYPE.STAGE - self.battleStartTime = Time:getServerTime() - self.waveStartTime = Time:getServerTime() + self.waveDurationTime = 0 + self.totalDurationTime = 0 self.eliminateCount = 0 self.eliminateTotalCount = 0 self.realTime = 0 @@ -446,8 +446,8 @@ function BattleController:battleStart() self.atkTeam:prepare() self.defTeam:prepare() self.isBattleStart = true - self.tickSid = BattleScheduler:scheduleGlobal(function(dt) - self:_tick(dt) + self.tickSid = BattleScheduler:scheduleGlobal(function(dt, originDt) + self:_tick(dt, originDt) end, 0) self:enterNextWave() end @@ -538,7 +538,7 @@ function BattleController:enterNextWave() self.defTeam:prepare() end - self.waveStartTime = Time:getServerTime() + self.waveDurationTime = 0 self.eliminateCount = 0 self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss() @@ -1219,8 +1219,7 @@ function BattleController:tryShowSelectSkillComp(needDelay, onlyCommonSkill) self.battleUI:showSelectSkillComp(skillList, onlyCommonSkill) end - local totalTime = Time:getServerTime() - self.battleStartTime - BIReport:postShowFightSkillSelect(self.battleType, skillList, self.chapterId, totalTime, self.waveIndex) + BIReport:postShowFightSkillSelect(self.battleType, skillList, self.chapterId, self.totalDurationTime, self.waveIndex) end function BattleController:fillBoard(isRoundBeginCheck) @@ -1885,8 +1884,7 @@ function BattleController:onSelectSkill(skillId, value, pos) entity:gotUpSKill(skillId) end - local totalTime = Time:getServerTime() - self.battleStartTime - BIReport:postFightSkillSelect(self.battleType, {skillId}, self.chapterId, totalTime, self.waveIndex) + BIReport:postFightSkillSelect(self.battleType, {skillId}, self.chapterId, self.totalDurationTime, self.waveIndex) local elementType = ModuleManager.HeroManager:getSkillRoguePosition(skillId) @@ -2525,8 +2523,10 @@ function BattleController:reduceFillWaitingCount() self.waitingFillCount = self.waitingFillCount - 1 end -function BattleController:_tick(dt) +function BattleController:_tick(dt, originDt) self.realTime = self.realTime + dt + self.waveDurationTime = self.waveDurationTime + originDt + self.totalDurationTime = self.totalDurationTime + originDt if self.isPause then return end diff --git a/lua/app/module/battle/controller/battle_controller_daily_challenge.lua b/lua/app/module/battle/controller/battle_controller_daily_challenge.lua index 5c85f3ce..26213ac7 100644 --- a/lua/app/module/battle/controller/battle_controller_daily_challenge.lua +++ b/lua/app/module/battle/controller/battle_controller_daily_challenge.lua @@ -257,8 +257,8 @@ function BattleControllerDailyChallenge:postWaveOver(atkDead, isQuit) waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT end - local duration = Time:getServerTime() - self.waveStartTime - local totalTime = Time:getServerTime() - self.battleStartTime + local duration = self.waveDurationTime + local totalTime = self.totalDurationTime local startTimes = DataManager.DailyChallengeData:getTotalFightCount() local isFirstWin = false -- TODO 策划说不需要 因为系数在变 diff --git a/lua/app/module/battle/controller/battle_controller_stage.lua b/lua/app/module/battle/controller/battle_controller_stage.lua index d661eb72..fe9e04cf 100644 --- a/lua/app/module/battle/controller/battle_controller_stage.lua +++ b/lua/app/module/battle/controller/battle_controller_stage.lua @@ -219,8 +219,8 @@ function BattleControllerStage:postWaveOver(atkDead, isQuit) waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT end - local duration = Time:getServerTime() - self.waveStartTime - local totalTime = Time:getServerTime() - self.battleStartTime + 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 diff --git a/lua/app/module/battle/helper/battle_scheduler.lua b/lua/app/module/battle/helper/battle_scheduler.lua index d2e5addc..f7633d5c 100644 --- a/lua/app/module/battle/helper/battle_scheduler.lua +++ b/lua/app/module/battle/helper/battle_scheduler.lua @@ -47,7 +47,7 @@ function BattleScheduler:update(dt) info.tick = info.tick - info.inter info.waitRemove = true if info.func then - local s = info.func(inter) + local s = info.func(inter, dt) local stop = not info.rep or s if stop then self.dirty = true