From 77669092943c88f4af5f1a7cb248d97e16004c4f Mon Sep 17 00:00:00 2001 From: panFD Date: Wed, 7 Oct 2026 15:32:15 +0800 Subject: [PATCH] feat: add BossPhaseComp marker component --- assets/script/game/hero/BossPhaseComp.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 assets/script/game/hero/BossPhaseComp.ts diff --git a/assets/script/game/hero/BossPhaseComp.ts b/assets/script/game/hero/BossPhaseComp.ts new file mode 100644 index 00000000..4a50ad30 --- /dev/null +++ b/assets/script/game/hero/BossPhaseComp.ts @@ -0,0 +1,22 @@ +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; + } +}