new BossAI()
BossAI component for boss encounter behaviors. Uses state machine for phase-based attacks.
- Source
Extends
Members
(readonly) properties
The entity that this component is attached to.
- Inherited From
- Source
Methods
addAttackPhase()
Add a phase that selects among data-driven attacks through a CombatSystem.
- Source
addPhase(healthThreshold, patterns)
Add a phase.
Parameters:
| Name | Type | Description |
|---|---|---|
healthThreshold | number | Health percent to trigger (1.0 = 100%). |
patterns | Array.<function()> | Array of attack pattern functions. |
- Source
deserialize(props)
Populates the component properties from a data object. Override this method for custom property handling.
Parameters:
| Name | Type | Description |
|---|---|---|
props | object | The properties object (usually from JSON). |
- Inherited From
- Source
setTarget(target)
Set the target to attack.
Parameters:
| Name | Type | Description |
|---|---|---|
target | Entity |
- Source
stun(duration)
Stun the boss temporarily.
Parameters:
| Name | Type | Description |
|---|---|---|
duration | number |
- Source
update(deltaTime, stats)
Update AI behavior.
Parameters:
| Name | Type | Description |
|---|---|---|
deltaTime | number | |
stats | Stats | Boss stats component. |
- Source