fix(mission): 修复回合开始前未选英雄直接开战的问题

调整关卡战斗阶段切换逻辑,新增MissionPhase.Battle相位守卫,避免未选择英雄就自动进入战斗导致玩家判负;同时调整mission.prefab的UI布局参数适配新逻辑
This commit is contained in:
pan
2026-09-11 15:46:03 +08:00
parent ab32b0e09d
commit a6dbda13b1
2 changed files with 14 additions and 12 deletions

View File

@@ -3131,7 +3131,7 @@
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 589.929, "y": 902.919,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -3588,7 +3588,7 @@
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 331.679, "y": 644.669,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -3661,7 +3661,7 @@
"_top": 535, "_top": 535,
"_bottom": 645, "_bottom": 645,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": -308.321, "_verticalCenter": 4.668999999999983,
"_isAbsLeft": true, "_isAbsLeft": true,
"_isAbsRight": true, "_isAbsRight": true,
"_isAbsTop": true, "_isAbsTop": true,
@@ -3766,7 +3766,7 @@
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 70.17200000000003, "y": 383.162,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -4620,7 +4620,7 @@
"_top": 340.279, "_top": 340.279,
"_bottom": -521.315, "_bottom": -521.315,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": -569.828, "_verticalCenter": -256.838,
"_isAbsLeft": true, "_isAbsLeft": true,
"_isAbsRight": true, "_isAbsRight": true,
"_isAbsTop": true, "_isAbsTop": true,
@@ -5384,8 +5384,8 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 230, "x": 0,
"y": 1110, "y": 980,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -6711,11 +6711,11 @@
"__prefab": { "__prefab": {
"__id__": 320 "__id__": 320
}, },
"_alignFlags": 33, "_alignFlags": 17,
"_target": null, "_target": null,
"_left": 310, "_left": 310,
"_right": 30, "_right": 30,
"_top": 20, "_top": 150,
"_bottom": 638.669, "_bottom": 638.669,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
@@ -6868,7 +6868,6 @@
"time_label": { "time_label": {
"__id__": 305 "__id__": 305
}, },
"phase_label": null,
"tooltip": { "tooltip": {
"__id__": 240 "__id__": 240
}, },

View File

@@ -995,8 +995,11 @@ export class MissionComp extends CCComp {
this.isBossWave = true; // 单场 Boss 战,恒为 Boss 战(超时阈值/预警走 Boss 档) this.isBossWave = true; // 单场 Boss 战,恒为 Boss 战(超时阈值/预警走 Boss 档)
if (wave > 1) { if (wave > 1 && this.currentPhase === MissionPhase.Battle) {
// 在新一回合到来时,先进入 BattleEnd,2秒后自动进入下一回合的准备阶段 // 战斗中回合更迭:先进入 BattleEnd,2秒后自动进入下一回合的准备阶段。
// Why: NewWave 现在仅在 SectionStart(Prepare 阶段,等待三选一)时派发,
// 不加相位守卫会把"下一节/再来一次"从 Prepare 强切 BattleEnd,
// 导致玩家还没选英雄就自动开战,场上无英雄直接判负
this.changePhase(MissionPhase.BattleEnd); this.changePhase(MissionPhase.BattleEnd);
} else { } else {
// 第1回合不需要结束上一回合,延迟一点播放提示,避免被开始游戏的loading遮挡 // 第1回合不需要结束上一回合,延迟一点播放提示,避免被开始游戏的loading遮挡