BossAI

new BossAI()

BossAI component for boss encounter behaviors. Uses state machine for phase-based attacks.

Extends

Members

(readonly) properties

The entity that this component is attached to.

Inherited From

Methods

addAttackPhase()

Add a phase that selects among data-driven attacks through a CombatSystem.

addPhase(healthThreshold, patterns)

Add a phase.

Parameters:
NameTypeDescription
healthThresholdnumber

Health percent to trigger (1.0 = 100%).

patternsArray.<function()>

Array of attack pattern functions.

deserialize(props)

Populates the component properties from a data object. Override this method for custom property handling.

Parameters:
NameTypeDescription
propsobject

The properties object (usually from JSON).

Inherited From

setTarget(target)

Set the target to attack.

Parameters:
NameTypeDescription
targetEntity

stun(duration)

Stun the boss temporarily.

Parameters:
NameTypeDescription
durationnumber

update(deltaTime, stats)

Update AI behavior.

Parameters:
NameTypeDescription
deltaTimenumber
statsStats

Boss stats component.