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(); }