fix: 调整战斗边界并修复英雄出界时仍能施法的问题
- 缩小地图左右边界从±420到±360,优化战斗区域 - 增加英雄位置边界检查,出界时禁止施法技能 - 微调任务卡牌界面英雄信息项间距从10减至5 - 修复卡牌预制体缩放值错误(x从1改为-1)
This commit is contained in:
@@ -1338,7 +1338,7 @@
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"x": -1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
//攻击距离
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user