refactor: 调整怪物波次配置与优化同阵营间距计算

- 调整第一波怪物配置,将原近战Boss与近战小怪替换为近战Boss与远程小怪
- 增加怪物槽位及同阵营单位的横向间距,提升视觉清晰度
- 优化同阵营单位间距计算逻辑,为Boss单位提供更大的间隔空间
This commit is contained in:
panw
2026-04-08 10:38:40 +08:00
parent e7b0d55e36
commit 18d8d20056
3 changed files with 16 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
private readonly heroFrontAnchorX = -50;
private readonly monFrontAnchorX = 50;
/** 常规同阵营横向最小间距 */
private readonly allySpacingX = 60;
private readonly allySpacingX = 65;
/** 纵向判定为同排的最大 Y 差 */
private readonly minSpacingY = 30;
/** 渲染层级重排节流,避免每帧排序 */
@@ -246,7 +246,18 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
});
const slotIndex = Math.max(0, laneAllies.findIndex(entity => entity === self));
const frontAnchorX = model.fac === FacSet.MON ? this.monFrontAnchorX : this.heroFrontAnchorX;
const targetX = frontAnchorX - forwardDir * slotIndex * this.allySpacingX;
let totalSpacing = 0;
for (let i = 1; i <= slotIndex; i++) {
const prevAttrs = laneAllies[i - 1].get(HeroAttrsComp);
const currAttrs = laneAllies[i].get(HeroAttrsComp);
const isPrevBoss = prevAttrs?.is_boss;
const isCurrBoss = currAttrs?.is_boss;
const spacing = (isPrevBoss || isCurrBoss) ? 100 : this.allySpacingX;
totalSpacing += spacing;
}
const targetX = frontAnchorX - forwardDir * totalSpacing;
return Math.max(moveMinX, Math.min(moveMaxX, targetX));
}

View File

@@ -59,7 +59,7 @@ export class MissionMonCompComp extends CCComp {
/** 第一个槽位的 X 坐标起点 */
private static readonly MON_SLOT_START_X = 50;
/** 槽位间的 X 间距 */
private static readonly MON_SLOT_X_INTERVAL = 60;
private static readonly MON_SLOT_X_INTERVAL = 65;
/** 怪物出生掉落高度 */
private static readonly MON_DROP_HEIGHT = 280;
/** 最大槽位数 */

View File

@@ -122,8 +122,8 @@ export const WaveSlotConfig: { [wave: number]: IWaveSlot[] } = {
/** 第 1 波2 近战 + 1 近战Boss(默认占3格) */
1: [
{ type: MonType.Melee, count: 2 },
{ type: MonType.MeleeBoss, count: 1 }
{ type: MonType.MeleeBoss, count: 1 },
{ type: MonType.Long, count: 2 },
],
/** 第 2波2 近战 + 1 远程Boss(默认占3格) */
2: [