PhaseSystem ​
Inherits: Resource
PhaseSystem manages phase transitions for boss encounters. Phases can be triggered by health thresholds, time elapsed, or custom events.
Description ​
Each phase can have:
- Different attack logic
- Entry/exit actions
- Modified stats
- Visual changes
Example 3-phase boss:
- Phase 1 (100-70% HP): Melee attacks
- Phase 2 (70-30% HP): Summons adds, uses AOE
- Phase 3 (30-0% HP): Enrage mode, faster attacks
Properties ​
Array[BossPhase] | phases | [] |
Variables ​
Entity | entity | |
ModularCombatScript | combat_script | |
int | current_phase_index | -1 |
bool | is_active | false |
bool | combat_started | false |
Methods ​
void | setup( system_hub: GameHost.SystemHub, entity_ref: Entity, script: ModularCombatScript ) |
void | start_combat() |
void | check_phase_transition( delta: float ) |
BossPhase | get_current_phase() |
void | force_phase_transition( phase_index: int ) |
void | cleanup() |
Property descriptions ​
Array[BossPhase] phases = [] ​
All phases in this system
Variable descriptions ​
Entity entity ​
Reference to the entity
ModularCombatScript combat_script ​
Reference to the combat script
int current_phase_index = -1 ​
Current active phase index
bool is_active = false ​
Whether phase system is active
bool combat_started = false ​
True once the combat has started (the phases are on).
Method descriptions ​
void setup( system_hub: GameHost.SystemHub, entity_ref: Entity, script: ModularCombatScript ) ​
Setup the phase system
void start_combat() ​
Start the phase system when combat begins
void check_phase_transition( delta: float ) ​
Check if we should transition to a new phase
BossPhase get_current_phase() ​
Get the current active phase
void force_phase_transition( phase_index: int ) ​
Force transition to a specific phase (for scripted events)
void cleanup() ​
Cleanup