diff --git a/assets/script/game/hero/HeroAtkSystem.ts b/assets/script/game/hero/HeroAtkSystem.ts index e6621422..20f6f9cd 100644 --- a/assets/script/game/hero/HeroAtkSystem.ts +++ b/assets/script/game/hero/HeroAtkSystem.ts @@ -204,7 +204,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd // 检查死亡 if (TAttrsComp.hp <= 0) { // 复活机制:如果玩家属性内的复活属性值>=1 则执行复活,原地50%血量复活 - if (TAttrsComp.fac === FacSet.HERO && TAttrsComp.Attrs[Attrs.REVIVE_COUNT] >= 1) { + if (TAttrsComp.is_master && TAttrsComp.Attrs[Attrs.REVIVE_COUNT] >= 1) { TAttrsComp.Attrs[Attrs.REVIVE_COUNT]--; TAttrsComp.is_reviving = true; // 标记为正在复活 @@ -226,7 +226,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd if (caster) CAttrsComp.Attrs.killed_count++; // 玩家英雄死亡后,怪物停止刷新和移动 - if (TAttrsComp.fac === FacSet.HERO) { + if (TAttrsComp.is_master) { smc.mission.stop_mon_action = true; console.log("[HeroAtkSystem] Hero died, stopping monster action (spawn/move)"); } @@ -261,7 +261,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd // 检查死亡 if (CAttrs.hp <= 0) { // 复活机制 - if (CAttrs.fac === FacSet.HERO && CAttrs.Attrs[Attrs.REVIVE_COUNT] >= 1) { + if (CAttrs.is_master && CAttrs.Attrs[Attrs.REVIVE_COUNT] >= 1) { CAttrs.Attrs[Attrs.REVIVE_COUNT]--; CAttrs.is_reviving = true; @@ -277,7 +277,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd } // 玩家英雄死亡后,怪物停止刷新和移动 - if (CAttrs.fac === FacSet.HERO) { + if (CAttrs.is_master) { smc.mission.stop_mon_action = true; 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 0e640d0f..288a2519 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -361,7 +361,7 @@ export class HeroViewComp extends CCComp { this.lastBarUpdateTime=0 // 恢复怪物行动 - if (this.model.fac === FacSet.HERO) { + if (this.model.is_master) { smc.mission.stop_mon_action = false; console.log("[HeroViewComp] Hero revived, resuming monster action"); } diff --git a/assets/script/game/map/MissionComp.ts b/assets/script/game/map/MissionComp.ts index 03bb7bff..860161c4 100644 --- a/assets/script/game/map/MissionComp.ts +++ b/assets/script/game/map/MissionComp.ts @@ -162,7 +162,7 @@ export class MissionComp extends CCComp { open_Victory(e:any,is_hero_dead: boolean = false){ // 暂停游戏循环和怪物行为 // smc.mission.play = false; - smc.mission.stop_mon_action = true; + smc.mission.pause = true; // oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false}) console.log("[MissionComp] open_Victory",is_hero_dead,this.revive_times) oops.gui.open(UIID.Victory,{ @@ -203,6 +203,7 @@ export class MissionComp extends CCComp { data_init(){ //局内数据初始化 smc 数据初始化 smc.mission.play = true; + smc.mission.pause = false; smc.mission.stop_mon_action = false; smc.vmdata.mission_data.in_fight=false smc.vmdata.mission_data.fight_time=0 diff --git a/assets/script/game/map/VictoryComp.ts b/assets/script/game/map/VictoryComp.ts index 84223af8..b2de532d 100644 --- a/assets/script/game/map/VictoryComp.ts +++ b/assets/script/game/map/VictoryComp.ts @@ -51,8 +51,6 @@ export class VictoryComp extends CCComp { this.node.getChildByName("btns").getChildByName("next").active=!args.can_revive this.node.getChildByName("btns").getChildByName("alive").active=args.can_revive - smc.mission.pause=true - } @@ -99,7 +97,7 @@ export class VictoryComp extends CCComp { // 3. 恢复游戏状态 // smc.mission.play = true; - smc.mission.stop_mon_action = false; + smc.mission.pause = false; // 4. 关闭结算界面 oops.gui.removeByNode(this.node);