fix: 调整战斗边界并修复英雄出界时仍能施法的问题

- 缩小地图左右边界从±420到±360,优化战斗区域
- 增加英雄位置边界检查,出界时禁止施法技能
- 微调任务卡牌界面英雄信息项间距从10减至5
- 修复卡牌预制体缩放值错误(x从1改为-1)
This commit is contained in:
panw
2026-03-31 17:18:30 +08:00
parent 1437a7ee40
commit 5889423db0
4 changed files with 12 additions and 5 deletions

View File

@@ -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) {