refactor(map): 移除首波战斗倒计时相关逻辑
移除用于第一波战斗的倒计时功能,包括常量 BATTLE_COUNTDOWN_SECONDS 及相关方法 startBattleCountdownIfNeeded 和 finishBattleCountdown。同时清理了 waveSystemStart 中不必要的调度取消。
This commit is contained in:
@@ -22,7 +22,6 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
private static readonly MON_SLOT_START_X = 30;
|
private static readonly MON_SLOT_START_X = 30;
|
||||||
private static readonly MON_SLOT_X_INTERVAL = 60;
|
private static readonly MON_SLOT_X_INTERVAL = 60;
|
||||||
private static readonly MON_DROP_HEIGHT = 280;
|
private static readonly MON_DROP_HEIGHT = 280;
|
||||||
private static readonly BATTLE_COUNTDOWN_SECONDS = 3;
|
|
||||||
@property({ tooltip: "是否启用调试日志" })
|
@property({ tooltip: "是否启用调试日志" })
|
||||||
private debugMode: boolean = false;
|
private debugMode: boolean = false;
|
||||||
@property({ tooltip: "每波基础普通怪数量" })
|
@property({ tooltip: "每波基础普通怪数量" })
|
||||||
@@ -94,7 +93,6 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
this.bossSpawnedInWave = false
|
this.bossSpawnedInWave = false
|
||||||
this.MonQueue = []
|
this.MonQueue = []
|
||||||
this.resetSlotSpawnData()
|
this.resetSlotSpawnData()
|
||||||
this.unschedule(this.finishBattleCountdown)
|
|
||||||
this.startNextWave()
|
this.startNextWave()
|
||||||
mLogger.log(this.debugMode, 'MissionMonComp', "[MissionMonComp] Starting Wave System");
|
mLogger.log(this.debugMode, 'MissionMonComp', "[MissionMonComp] Starting Wave System");
|
||||||
}
|
}
|
||||||
@@ -153,7 +151,6 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
this.waveSpawnTimer = this.waveSpawnCd;
|
this.waveSpawnTimer = this.waveSpawnCd;
|
||||||
this.nextAssignSlotIndex = 0;
|
this.nextAssignSlotIndex = 0;
|
||||||
this.primeWaveInitialBurst();
|
this.primeWaveInitialBurst();
|
||||||
this.startBattleCountdownIfNeeded();
|
|
||||||
oops.message.dispatchEvent(GameEvent.NewWave, {
|
oops.message.dispatchEvent(GameEvent.NewWave, {
|
||||||
wave: this.currentWave,
|
wave: this.currentWave,
|
||||||
total: this.waveTargetCount,
|
total: this.waveTargetCount,
|
||||||
@@ -227,23 +224,6 @@ export class MissionMonCompComp extends CCComp {
|
|||||||
this.waveSpawnedCount += burstCount;
|
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() {
|
private resetSlotSpawnData() {
|
||||||
this.slotSpawnQueues = Array.from(
|
this.slotSpawnQueues = Array.from(
|
||||||
{ length: MissionMonCompComp.MON_SLOT_COUNT },
|
{ length: MissionMonCompComp.MON_SLOT_COUNT },
|
||||||
|
|||||||
Reference in New Issue
Block a user