Table of Contents

Class BossScriptState

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Per-NPC runtime state for a BossScript. Tracks the current phase index, timed mechanic timers, and handles phase transitions and mechanic activations.

This is a plain C# class (not a ScriptableObject) because it holds mutable state that differs per NPC instance — the same BossScript asset may be shared across multiple boss spawns.

public class BossScriptState
Inheritance
BossScriptState
Inherited Members

Constructors

BossScriptState(BossScript)

public BossScriptState(BossScript script)

Parameters

script BossScript

Properties

CurrentPhase

Returns the current BossPhase, or null if no phases are configured.

public BossPhase CurrentPhase { get; }

Property Value

BossPhase

CurrentPhaseIndex

Current phase index into Phases.

public int CurrentPhaseIndex { get; }

Property Value

int

Initialized

True if this state has been initialized.

public bool Initialized { get; }

Property Value

bool

Script

The asset defining phases and mechanics.

public BossScript Script { get; }

Property Value

BossScript

Methods

EvaluatePhases(AIController)

Evaluates phase transitions based on current HP. Returns true if a phase change occurred. Call once per AI tick.

public bool EvaluatePhases(AIController controller)

Parameters

controller AIController

The boss NPC's AI controller.

Returns

bool

True if a phase transition happened this tick.

Reset()

Resets the boss to phase 0 and resets all mechanic timers. Called on leash or despawn.

public void Reset()

TickMechanics(AIController, float)

Ticks all active timed mechanics for the current phase. Call once per AI tick with the delta time.

public void TickMechanics(AIController controller, float deltaTime)

Parameters

controller AIController

The boss NPC's AI controller.

deltaTime float

Time since last tick.