From 8c259bc674b04448e005e9dd36083c2f723f0ca3 Mon Sep 17 00:00:00 2001 From: walkpan Date: Tue, 31 Mar 2026 22:42:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor(map):=20=E7=A7=BB=E9=99=A4=E9=A6=96?= =?UTF-8?q?=E6=B3=A2=E6=88=98=E6=96=97=E5=80=92=E8=AE=A1=E6=97=B6=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除用于第一波战斗的倒计时功能,包括常量 BATTLE_COUNTDOWN_SECONDS 及相关方法 startBattleCountdownIfNeeded 和 finishBattleCountdown。同时清理了 waveSystemStart 中不必要的调度取消。 --- assets/script/game/map/MissionMonComp.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/assets/script/game/map/MissionMonComp.ts b/assets/script/game/map/MissionMonComp.ts index a679ee24..f0cfa03a 100644 --- a/assets/script/game/map/MissionMonComp.ts +++ b/assets/script/game/map/MissionMonComp.ts @@ -22,7 +22,6 @@ export class MissionMonCompComp extends CCComp { private static readonly MON_SLOT_START_X = 30; private static readonly MON_SLOT_X_INTERVAL = 60; private static readonly MON_DROP_HEIGHT = 280; - private static readonly BATTLE_COUNTDOWN_SECONDS = 3; @property({ tooltip: "是否启用调试日志" }) private debugMode: boolean = false; @property({ tooltip: "每波基础普通怪数量" }) @@ -94,7 +93,6 @@ export class MissionMonCompComp extends CCComp { this.bossSpawnedInWave = false this.MonQueue = [] this.resetSlotSpawnData() - this.unschedule(this.finishBattleCountdown) this.startNextWave() mLogger.log(this.debugMode, 'MissionMonComp', "[MissionMonComp] Starting Wave System"); } @@ -153,7 +151,6 @@ export class MissionMonCompComp extends CCComp { this.waveSpawnTimer = this.waveSpawnCd; this.nextAssignSlotIndex = 0; this.primeWaveInitialBurst(); - this.startBattleCountdownIfNeeded(); oops.message.dispatchEvent(GameEvent.NewWave, { wave: this.currentWave, total: this.waveTargetCount, @@ -227,23 +224,6 @@ export class MissionMonCompComp extends CCComp { this.waveSpawnedCount += burstCount; } - private startBattleCountdownIfNeeded() { - if (this.currentWave !== 1) return; - smc.mission.pause = true; - smc.mission.stop_mon_action = true; - const dropDuration = Math.max(0.18, Math.min(0.38, MissionMonCompComp.MON_DROP_HEIGHT / 1200)); - const lockDuration = dropDuration + MissionMonCompComp.BATTLE_COUNTDOWN_SECONDS; - this.unschedule(this.finishBattleCountdown); - this.scheduleOnce(this.finishBattleCountdown, lockDuration); - } - - private finishBattleCountdown = () => { - if (!smc.mission.play) return; - if (!smc.mission.in_fight) return; - smc.mission.pause = false; - smc.mission.stop_mon_action = false; - } - private resetSlotSpawnData() { this.slotSpawnQueues = Array.from( { length: MissionMonCompComp.MON_SLOT_COUNT },