fix(战斗逻辑): 修复非战斗状态下技能释放和状态同步问题
- 在 SCastSystem 中增加战斗状态检查,防止非战斗时误触发技能 - 同步 mission.in_fight 状态到 vmdata.mission_data.in_fight 以保持数据一致性 - 调整 MissionCardComp 在波次开始时正确布局卡牌槽位并分发卡牌 - 优化游戏地平线位置和 UI 布局参数
This commit is contained in:
@@ -53,6 +53,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
update(e: ecs.Entity): void {
|
||||
if(!smc.mission.play ) return;
|
||||
if(smc.mission.pause) return
|
||||
if(!smc.mission.in_fight) return
|
||||
const heroAttrs = e.get(HeroAttrsComp);
|
||||
const heroView = e.get(HeroViewComp);
|
||||
if (!heroAttrs || !heroView || !heroView.node) return;
|
||||
@@ -107,6 +108,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
* - 触发技能CD
|
||||
*/
|
||||
private castSkill(castPlan: { skillId: number; skillLv: number; isFriendly: boolean; targetPos: Vec3 | null; targetEids: number[] }, heroAttrs: HeroAttrsComp, heroView: HeroViewComp) {
|
||||
if (!smc.mission.in_fight) return;
|
||||
const s_uuid = castPlan.skillId;
|
||||
const skillLv = castPlan.skillLv;
|
||||
const config = SkillSet[s_uuid];
|
||||
@@ -124,9 +126,11 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
const delay = config.ready > 0 ? config.ready : GameConst.Battle.SKILL_CAST_DELAY;
|
||||
|
||||
heroView.scheduleOnce(() => {
|
||||
if (!smc.mission.play || smc.mission.pause || !smc.mission.in_fight) return;
|
||||
if (!heroView.node || !heroView.node.isValid || heroAttrs.is_dead) return;
|
||||
const castTimes = 1 + cNum;
|
||||
for (let i = 0; i < castTimes; i++) {
|
||||
if (!smc.mission.play || smc.mission.pause || !smc.mission.in_fight) return;
|
||||
if (!heroView.node || !heroView.node.isValid || heroAttrs.is_dead) return;
|
||||
if (castPlan.isFriendly) {
|
||||
const friendlyTargets = this.resolveFriendlyTargets(castPlan.targetEids, heroAttrs.fac);
|
||||
|
||||
Reference in New Issue
Block a user