diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index 531dacfd..96779f38 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -100,10 +100,10 @@ export class Hero extends ecs.Entity { model.Attrs[Attrs.AP] = model.base_ap; model.Attrs[Attrs.SPEED] = hero.speed; model.Attrs[Attrs.DIS] = hero.dis; - + // 初始化 buff/debuff 系统 model.initAttrs(); - + model.Attrs[Attrs.REVIVE_COUNT]=1 this.add(hv); oops.message.dispatchEvent(GameEvent.MasterCalled,{uuid:uuid}) const move = this.get(HeroMoveComp); diff --git a/assets/script/game/hero/HeroAtkSystem.ts b/assets/script/game/hero/HeroAtkSystem.ts index 20f6f9cd..3ed02121 100644 --- a/assets/script/game/hero/HeroAtkSystem.ts +++ b/assets/script/game/hero/HeroAtkSystem.ts @@ -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)"); } diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 288a2519..cd5db488 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -416,11 +416,7 @@ export class HeroViewComp extends CCComp { if(this.model.fac === FacSet.HERO){ // 英雄死亡:延迟触发死亡事件 // 🔥 只有主角死亡才触发游戏结束判定 - if (this.model.is_master) { - oops.message.dispatchEvent(GameEvent.HeroDead, { - hero_uuid: this.model.hero_uuid - }); - } + if (this.model.is_master) return } // 根据阵营触发不同事件 if(this.model.fac === FacSet.MON){