From 8af04d61e0753311ba74a00a89d8732f55ef755b Mon Sep 17 00:00:00 2001 From: walkpan Date: Sun, 15 Mar 2026 21:54:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=88=98=E6=96=97):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E8=BF=91=E6=88=98=E5=8D=95=E4=BD=8D=E5=90=8E=E6=92=A4=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=B9=B6=E8=B0=83=E6=95=B4=E8=BF=9C=E7=A8=8B=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E6=94=BB=E5=87=BB=E8=B7=9D=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除所有单位类型在距离过近时的后撤行为,简化移动逻辑 - 远程单位现在只在距离过远时前进,不再因过近而后撤 - 调整远程单位长距离攻击的起始位置从240增加到300 - 保持战斗系统的核心行为不变,仅优化移动决策逻辑 --- assets/script/game/common/config/heroSet.ts | 22 ++++++++++----------- assets/script/game/hero/MoveComp.ts | 22 ++++++--------------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index de3433fc..db0bccc6 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -47,23 +47,23 @@ export const getMonList = ()=>{ } export const HeroPos={ - 0:{pos:v3(-240,BoxSet.GAME_LINE,0)}, + 0:{pos:v3(-360,BoxSet.GAME_LINE,0)}, 1:{pos:v3(0,BoxSet.GAME_LINE,0)}, 2:{pos:v3(0,BoxSet.GAME_LINE,0)}, } export const MonSet = { - 0:{pos:v3(240,BoxSet.GAME_LINE+10,0)}, - 1:{pos:v3(240,BoxSet.GAME_LINE-10,0)}, - 2:{pos:v3(300,BoxSet.GAME_LINE+10,0)}, - 3:{pos:v3(300,BoxSet.GAME_LINE-10,0)}, - 4:{pos:v3(320,BoxSet.GAME_LINE+10,0)}, - 5:{pos:v3(320,BoxSet.GAME_LINE-10,0)}, + 0:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, + 1:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, + 2:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, + 3:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, + 4:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, + 5:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, 6:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, 7:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, - 8:{pos:v3(400,BoxSet.GAME_LINE+10,0)}, - 9:{pos:v3(400,BoxSet.GAME_LINE-10,0)}, - 10:{pos:v3(440,BoxSet.GAME_LINE+10,0)}, - 11:{pos:v3(440,BoxSet.GAME_LINE-10,0)}, + 8:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, + 9:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, + 10:{pos:v3(360,BoxSet.GAME_LINE+10,0)}, + 11:{pos:v3(360,BoxSet.GAME_LINE-10,0)}, } export enum MonStart { diff --git a/assets/script/game/hero/MoveComp.ts b/assets/script/game/hero/MoveComp.ts index a321644a..deeb1736 100644 --- a/assets/script/game/hero/MoveComp.ts +++ b/assets/script/game/hero/MoveComp.ts @@ -128,15 +128,11 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate const currentX = view.node.position.x; const enemyX = enemy.node.position.x; const dist = Math.abs(currentX - enemyX); - const [rawMinRange] = this.resolveCombatRange(model, 0, this.minSpacingX); const maxRange = this.minSpacingX; - const minRange = Math.min(rawMinRange, Math.max(0, maxRange - 1)); move.direction = enemyX > currentX ? 1 : -1; - if (dist < minRange) { - this.performRetreat(view, move, model, currentX); - } else if (dist <= maxRange) { + if (dist <= maxRange) { view.status_change("idle"); model.is_atking = true; } else { @@ -151,14 +147,11 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate const enemyX = enemy.node.position.x; const dist = Math.abs(currentX - enemyX); - const [minRange, maxRange] = this.resolveCombatRange(model, 120, 360); + const [, maxRange] = this.resolveCombatRange(model, 120, 360); move.direction = enemyX > currentX ? 1 : -1; - if (dist < minRange) { - // 太近了,后撤 - this.performRetreat(view, move, model, currentX); - } else if (dist > maxRange) { + if (dist > maxRange) { const speed = model.speed / 3; this.moveEntity(view, move.direction, speed); model.is_atking = true; @@ -173,14 +166,11 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate const enemyX = enemy.node.position.x; const dist = Math.abs(currentX - enemyX); - const [minRange, maxRange] = this.resolveCombatRange(model, 360, 720); + const [, maxRange] = this.resolveCombatRange(model, 360, 720); move.direction = enemyX > currentX ? 1 : -1; - if (dist < minRange) { - // 太近了,后撤 (远程单位对距离更敏感) - this.performRetreat(view, move, model, currentX); - } else if (dist > maxRange) { + if (dist > maxRange) { const speed = model.speed / 3; this.moveEntity(view, move.direction, speed); model.is_atking = true; @@ -239,7 +229,7 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate } const side = model.fac === FacSet.MON ? 1 : -1; if (rangeType === SkillRange.Long) { - return 240 * side; + return 300 * side; } if (rangeType === SkillRange.Mid) { return 200 * side;