From 0a7903f138b82745592a7867a4a91ab1bf512b02 Mon Sep 17 00:00:00 2001 From: walkpan Date: Fri, 2 Jan 2026 23:53:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E8=8B=B1=E9=9B=84=E7=B3=BB=E7=BB=9F):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E6=8A=80=E8=83=BD=E8=B7=9D=E7=A6=BB?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=92=8C=E4=BC=A4=E5=AE=B3=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除getMaxSkillDistance方法的MP参数,改为内部处理 在应用伤害后添加英雄数据更新到VM的操作 --- assets/script/game/hero/HeroAtkSystem.ts | 7 +++++-- assets/script/game/hero/HeroAttrsComp.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/script/game/hero/HeroAtkSystem.ts b/assets/script/game/hero/HeroAtkSystem.ts index 37549c85..1849cce2 100644 --- a/assets/script/game/hero/HeroAtkSystem.ts +++ b/assets/script/game/hero/HeroAtkSystem.ts @@ -7,6 +7,7 @@ import { HeroAttrsComp } from "./HeroAttrsComp"; import { HeroViewComp } from "./HeroViewComp"; import { DamageQueueComp, DamageEvent } from "./DamageQueueComp"; import { smc } from "../common/SingletonModuleComp"; +import { TalAttrs } from "../common/config/TalSet"; /** 最终伤害数据接口 @@ -172,8 +173,10 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd targetView.shield_tip(shieldResult.absorbedDamage); } if (damage <= 0) return reDate; - // 应用伤害到数据层 - TAttrsComp.hp -= damage; + + TAttrsComp.hp -= damage; // 应用伤害到数据层 + + smc.updateHeroInfo(TAttrsComp); // 更新英雄数据到 VM if (this.debugMode) { const casterName = damageEvent.caster?.ent?.get(HeroAttrsComp)?.hero_name || "未知"; const casterUuid = damageEvent.caster?.ent?.get(HeroAttrsComp)?.hero_uuid || 0; diff --git a/assets/script/game/hero/HeroAttrsComp.ts b/assets/script/game/hero/HeroAttrsComp.ts index 30d7db35..f2252c88 100644 --- a/assets/script/game/hero/HeroAttrsComp.ts +++ b/assets/script/game/hero/HeroAttrsComp.ts @@ -444,7 +444,7 @@ export class HeroAttrsComp extends ecs.Comp { } // 最远距离使用当前MP可施放的技能 - this.maxSkillDistance = skillsComp.getMaxSkillDistance(this.mp); + this.maxSkillDistance = skillsComp.getMaxSkillDistance(); // 最近距离使用所有技能中的最小距离,不考虑MP限制,用于停止位置判断 this.minSkillDistance = skillsComp.getAbsoluteMinSkillDistance(); }