fix(战斗系统): 修复角色状态切换和击退效果的问题

- 在HeroMove和MonMove系统中增加攻击状态检查,避免攻击时被错误切换为待机状态
- 为HeroAtkSystem添加受击者击退效果
- 优化HeroViewComp的击退逻辑,包括英雄和怪物,并修复重复触发问题
- 修复怪物死亡后状态切换问题
This commit is contained in:
walkpan
2026-01-03 13:41:08 +08:00
parent 1cce4ce361
commit 08c153ee5d
4 changed files with 34 additions and 13 deletions

View File

@@ -176,6 +176,11 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
TAttrsComp.hp -= damage; // 应用伤害到数据层
// 受击者产生击退效果
if (damage > 0 && targetView) {
targetView.back();
}
smc.updateHeroInfo(TAttrsComp); // 更新英雄数据到 VM
if (this.debugMode) {
const casterName = damageEvent.caster?.ent?.get(HeroAttrsComp)?.hero_name || "未知";