From 5889423db018628b44af71c1bc7572eef292c5ef Mon Sep 17 00:00:00 2001 From: panw Date: Tue, 31 Mar 2026 17:18:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E6=88=98=E6=96=97?= =?UTF-8?q?=E8=BE=B9=E7=95=8C=E5=B9=B6=E4=BF=AE=E5=A4=8D=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E5=87=BA=E7=95=8C=E6=97=B6=E4=BB=8D=E8=83=BD=E6=96=BD=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 缩小地图左右边界从±420到±360,优化战斗区域 - 增加英雄位置边界检查,出界时禁止施法技能 - 微调任务卡牌界面英雄信息项间距从10减至5 - 修复卡牌预制体缩放值错误(x从1改为-1) --- assets/resources/gui/element/card.prefab | 2 +- assets/script/game/common/config/GameSet.ts | 4 ++-- assets/script/game/hero/SCastSystem.ts | 9 ++++++++- assets/script/game/map/MissionCardComp.ts | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/assets/resources/gui/element/card.prefab b/assets/resources/gui/element/card.prefab index 705115bf..d9687264 100644 --- a/assets/resources/gui/element/card.prefab +++ b/assets/resources/gui/element/card.prefab @@ -1338,7 +1338,7 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1, + "x": -1, "y": 1, "z": 1 }, diff --git a/assets/script/game/common/config/GameSet.ts b/assets/script/game/common/config/GameSet.ts index d784a22f..33c7231b 100644 --- a/assets/script/game/common/config/GameSet.ts +++ b/assets/script/game/common/config/GameSet.ts @@ -8,8 +8,8 @@ export enum BoxSet { MONSTER = 2, HERO = 4, //地图边界 - LETF_END = -420, - RIGHT_END = 420, + LETF_END = -360, + RIGHT_END = 360, //游戏地平线 GAME_LINE = 100, //攻击距离 diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index ff3f1dfc..a7fd750e 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -7,7 +7,7 @@ import { Skill } from "../skill/Skill"; import { smc } from "../common/SingletonModuleComp"; import { HType } from "../common/config/heroSet"; import { Attrs } from "../common/config/HeroAttrs"; -import { FightSet } from "../common/config/GameSet"; +import { BoxSet, FightSet } from "../common/config/GameSet"; /** * ==================== 自动施法系统 ==================== @@ -38,6 +38,10 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate } return this.heroMatcher; } + + private isOutOfBattleBounds(x: number): boolean { + return x < BoxSet.LETF_END || x > BoxSet.RIGHT_END; + } /** 系统过滤器:仅处理英雄实体 */ filter(): ecs.IMatcher { @@ -57,6 +61,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate const heroAttrs = e.get(HeroAttrsComp); const heroView = e.get(HeroViewComp); if (!heroAttrs || !heroView || !heroView.node) return; + if (this.isOutOfBattleBounds(heroView.node.position.x)) return; if (heroAttrs.is_dead || heroAttrs.is_reviving || heroAttrs.isFrost()) return; heroAttrs.updateCD(this.dt); heroView.cd_show(); @@ -329,6 +334,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate if (!attrs || !view?.node) return; if (attrs.fac === heroAttrs.fac) return; if (attrs.is_dead || attrs.is_reviving) return; + if (this.isOutOfBattleBounds(view.node.position.x)) return; const dist = Math.abs(currentX - view.node.position.x); if (dist > maxRange) return; if (dist >= minDist) return; @@ -355,6 +361,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate if (attrs.fac === heroAttrs.fac) return; if (attrs.is_dead || attrs.is_reviving) return; const enemyX = view.node.position.x; + if (this.isOutOfBattleBounds(enemyX)) return; const dist = Math.abs(currentX - enemyX); if (dist > maxRange) return; if (direction > 0) { diff --git a/assets/script/game/map/MissionCardComp.ts b/assets/script/game/map/MissionCardComp.ts index 9cbfce32..41b099e1 100644 --- a/assets/script/game/map/MissionCardComp.ts +++ b/assets/script/game/map/MissionCardComp.ts @@ -62,7 +62,7 @@ export class MissionCardComp extends CCComp { /** 当前卡池等级(仅影响抽卡来源,不直接改卡槽现有内容) */ private poolLv: number = CARD_POOL_INIT_LEVEL; private readonly heroInfoItemGap: number = 110; - private readonly heroInfoItemSpacing: number = 10; + private readonly heroInfoItemSpacing: number = 5; private heroInfoSyncTimer: number = 0; private hasCachedCardsBaseScale: boolean = false; private cardsBaseScale: Vec3 = new Vec3(1, 1, 1);