From 32df7d95160c06f273c47787f6bb8b1a4a37a0a6 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 6 Jun 2023 15:25:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../battle/controller/battle_controller.lua | 20 +++++++++---------- .../battle_controller_daily_challenge.lua | 4 ++-- .../controller/battle_controller_stage.lua | 4 ++-- .../module/battle/helper/battle_scheduler.lua | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) 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