Files
pixelheros/assets/script/game/hero/BossPhaseComp.ts
2026-10-07 15:32:15 +08:00

23 lines
824 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
/**
* Boss 阶段标记组件:挂载即表示该实体参与多阶段状态机
* 由 Mon.load 按 phase_plan_id 条件挂载,Monster.destroy 显式 remove(触发 reset + 回组件池)
* 计时字段 elapsed 随 reset 天然归零,无全局战斗计时状态
*/
@ecs.register('BossPhase')
export class BossPhaseComp extends ecs.Comp {
/** 生效的阶段方案 id(BossPhaseSet key) */
plan_id: number = 0;
/** 当前阶段索引:0=P1 / 1=P2 / 2=P3(P3 后系统不再检测) */
index: number = 0;
/** Boss 在场战斗累计时长(秒),time 触发条件基准 */
elapsed: number = 0;
reset() {
this.plan_id = 0;
this.index = 0;
this.elapsed = 0;
}
}