refactor(rogue): 重构关卡刷怪与流程为一关一局模式
1. 将原10小节/关改为5小节/关,固定节类型为1-3普通节、4精英节、5Boss节 2. 调整刷怪逻辑:普通节3只小怪立即全刷,移除定时分批刷怪 3. 统一怪物入场方式为从右侧屏幕外贴地跑入,移除高空掉落动画 4. 移除小节间结算弹窗,改为自动连战,节间仅播放背景滚动过渡 5. 简化结算逻辑,仅保留通关/失败两种结算类型,移除小节胜利分支 6. 重构关卡进度存储,仅保存章节关卡,小节恒从1开始
This commit is contained in:
@@ -4,14 +4,14 @@
|
||||
*
|
||||
* 职责:
|
||||
* 1. 按小节配置刷怪:监听 SectionStart 事件,从 StageSpawningEngine 获取怪物列表。
|
||||
* 2. 普通关:前 3 只立即刷,后续每 2s 刷 1 只(共 9 只),均从高处掉落入场。
|
||||
* 3. 精英关:3 只精英同时刷出。
|
||||
* 4. Boss 关:2 精英先刷,Boss 延迟 1s 刷出。
|
||||
* 5. 维护小节刷怪计数,供 MissionComp 检测小节结束。
|
||||
* 2. 普通节:3 只小怪立即刷出;精英节:3 只精英同刷;Boss 节:2 小怪 + 1 Boss(延迟 1s)。
|
||||
* 3. 怪物统一从右侧屏幕外跑入(贴地向左推进),不再高空掉落。
|
||||
* 4. 维护小节刷怪计数,供 MissionComp 检测小节结束。
|
||||
*
|
||||
* 关键设计:
|
||||
* - 怪物按类型落排(近战/Boss→前排、远程/刺客→中排、辅助/召唤→后排),与英雄三排镜像对应。
|
||||
* - 实际推进由统一 MoveComp 在战斗中向敌人移动自然形成,不再使用固定网格点。
|
||||
* - 出生 X 取目标排 X + 右侧偏移(屏幕外),dropToY=GAME_LINE(无下落),
|
||||
* MoveComp.targetX 指向目标排 X,落地即 moving=true 自然从右跑入。
|
||||
* - 槽位索引仅用于 monGrid 寻路与 SCastSystem 索敌定位。
|
||||
*/
|
||||
import { _decorator, v3, Vec3 } from "cc";
|
||||
@@ -36,8 +36,8 @@ const { ccclass, property } = _decorator;
|
||||
export class MissionMonCompComp extends CCComp {
|
||||
// ======================== 常量 ========================
|
||||
|
||||
/** 怪物出生掉落高度(码):从高处砸落入场,落地时震退范围内英雄 */
|
||||
private static readonly MON_DROP_HEIGHT = 400;
|
||||
/** 怪物出生右侧偏移(码):目标排 X 再加该偏移,使出生点位于屏幕右侧外,贴地从右跑入 */
|
||||
private static readonly MON_SPAWN_OFFSET_X = 380;
|
||||
|
||||
/**
|
||||
* 怪物类型 → 编队优先级(与英雄 HRole 枚举值升序一致):
|
||||
@@ -207,9 +207,10 @@ export class MissionMonCompComp extends CCComp {
|
||||
let scale = -1;
|
||||
|
||||
const basePos = MissionMonCompComp.MON_POSITIONS[posIndex % MissionMonCompComp.MON_POSITIONS.length];
|
||||
const spawnX = this.resolveSpawnX(posIndex);
|
||||
const landingX = this.resolveSpawnX(posIndex);
|
||||
const landingY = basePos.y;
|
||||
const spawnPos: Vec3 = v3(spawnX, landingY + MissionMonCompComp.MON_DROP_HEIGHT, 0);
|
||||
// 出生点位于目标排右侧屏幕外(dropToY=landingY 无下落),落地即 moving=true 从右跑入
|
||||
const spawnPos: Vec3 = v3(landingX + MissionMonCompComp.MON_SPAWN_OFFSET_X, landingY, 0);
|
||||
this.globalSpawnOrder = (this.globalSpawnOrder + 1) % 999;
|
||||
|
||||
// 技能套装注入:通过 _testSkills 通道传递给 Mon.load()
|
||||
@@ -227,6 +228,8 @@ export class MissionMonCompComp extends CCComp {
|
||||
const move = mon.get(MoveComp);
|
||||
if (move) {
|
||||
move.spawnOrder = this.globalSpawnOrder;
|
||||
// 推进目标指向目标排 X,而非出生点(出生点在屏幕外)
|
||||
move.targetX = landingX;
|
||||
}
|
||||
|
||||
// 应用引擎计算好的最终属性
|
||||
|
||||
Reference in New Issue
Block a user