From 18d8d200565fea436c2b3f5952e5c42081b908b3 Mon Sep 17 00:00:00 2001 From: panw Date: Wed, 8 Apr 2026 10:38:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4=E6=80=AA?= =?UTF-8?q?=E7=89=A9=E6=B3=A2=E6=AC=A1=E9=85=8D=E7=BD=AE=E4=B8=8E=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=90=8C=E9=98=B5=E8=90=A5=E9=97=B4=E8=B7=9D=E8=AE=A1?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整第一波怪物配置,将原近战Boss与近战小怪替换为近战Boss与远程小怪 - 增加怪物槽位及同阵营单位的横向间距,提升视觉清晰度 - 优化同阵营单位间距计算逻辑,为Boss单位提供更大的间隔空间 --- assets/script/game/hero/MoveComp.ts | 15 +++++++++++++-- assets/script/game/map/MissionMonComp.ts | 2 +- assets/script/game/map/RogueConfig.ts | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/assets/script/game/hero/MoveComp.ts b/assets/script/game/hero/MoveComp.ts index f210bf21..8220f657 100644 --- a/assets/script/game/hero/MoveComp.ts +++ b/assets/script/game/hero/MoveComp.ts @@ -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)); } diff --git a/assets/script/game/map/MissionMonComp.ts b/assets/script/game/map/MissionMonComp.ts index 19660619..69986e82 100644 --- a/assets/script/game/map/MissionMonComp.ts +++ b/assets/script/game/map/MissionMonComp.ts @@ -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; /** 最大槽位数 */ diff --git a/assets/script/game/map/RogueConfig.ts b/assets/script/game/map/RogueConfig.ts index 3e6c41b2..adf8c35e 100644 --- a/assets/script/game/map/RogueConfig.ts +++ b/assets/script/game/map/RogueConfig.ts @@ -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: [