Skip to content

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 ​

Entityentity
ModularCombatScriptcombat_script
intcurrent_phase_index-1
boolis_activefalse
boolcombat_startedfalse

Methods ​

voidsetup( system_hub: GameHost.SystemHub, entity_ref: Entity, script: ModularCombatScript )
voidstart_combat()
voidcheck_phase_transition( delta: float )
BossPhaseget_current_phase()
voidforce_phase_transition( phase_index: int )
voidcleanup()

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