fix(hero): 修复复活后治疗未重置复活计数的问题并支持配置复活恢复百分比

- 在MissionComp中,英雄被治疗后重置复活计数,防止下回合无法复活
- 在HeroAtkSystem中,从技能配置读取复活恢复生命值百分比,替代硬编码的50%
This commit is contained in:
panw
2026-04-23 09:49:38 +08:00
parent b9f7a66fae
commit 5ae4c8fcd0
2 changed files with 16 additions and 4 deletions

View File

@@ -514,6 +514,9 @@ export class MissionComp extends CCComp {
attrs.hp = Math.min(attrs.hp_max, attrs.hp + healAmount);
attrs.dirty_hp = true;
// 重置复活次数,使得下回合可以继续复活
attrs.revived_count = 0;
// 触发治疗动画,即使在墓地的英雄也触发(会在其当前位置播放)
view.health(healAmount);
});