feat(英雄系统): 添加英雄复活机制并调整死亡处理逻辑

初始化英雄时添加复活次数属性
修改英雄死亡事件触发条件为复活次数耗尽
移除HeroViewComp中重复的死亡事件触发
This commit is contained in:
walkpan
2026-01-03 19:58:12 +08:00
parent 4a2768cb13
commit 063b882879
3 changed files with 10 additions and 10 deletions

View File

@@ -8,6 +8,8 @@ import { HeroViewComp } from "./HeroViewComp";
import { DamageQueueComp, DamageEvent } from "./DamageQueueComp";
import { smc } from "../common/SingletonModuleComp";
import { TalAttrs } from "../common/config/TalSet";
import { oops } from "db://oops-framework/core/Oops";
import { GameEvent } from "../common/config/GameEvent";
/** 最终伤害数据接口
@@ -226,9 +228,10 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
if (caster) CAttrsComp.Attrs.killed_count++;
// 玩家英雄死亡后,怪物停止刷新和移动
if (TAttrsComp.is_master) {
if (TAttrsComp.is_master&&TAttrsComp.Attrs[Attrs.REVIVE_COUNT] <= 0) {
smc.mission.stop_mon_action = true;
console.log("[HeroAtkSystem] Hero died, stopping monster action (spawn/move)");
oops.message.dispatchEvent(GameEvent.HeroDead, { hero_uuid: TAttrsComp.hero_uuid});
console.log("[HeroAtkSystem] Hero died, stopping monster action (spawn/move)"+TAttrsComp.Attrs[Attrs.REVIVE_COUNT]);
}
this.doDead(target);
@@ -277,8 +280,9 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
}
// 玩家英雄死亡后,怪物停止刷新和移动
if (CAttrs.is_master) {
if (CAttrs.is_master&&CAttrs.Attrs[Attrs.REVIVE_COUNT] <= 0) {
smc.mission.stop_mon_action = true;
oops.message.dispatchEvent(GameEvent.HeroDead, { hero_uuid: CAttrs.hero_uuid});
console.log("[HeroAtkSystem] Hero died from thorns, stopping monster action (spawn/move)");
}