BaseEntity
Base class for entities in the game world.
Properties
Section titled “Properties”Type: BaseEntityData
alive Getter
Section titled “alive ”Whether the entity is alive.
Type: boolean
auras Getter
Section titled “auras ”The entity’s auras.
Type: Aura[]
cell Getter
Section titled “cell ”The cell the entity is in.
Type: string
hp Getter
Section titled “hp ”The entity’s current HP.
Type: number
maxHp Getter
Section titled “maxHp ”The entity’s max HP.
Type: number
state Getter
Section titled “state ”The entity’s state.
Type: EntityState
Methods
Section titled “Methods”getAura
Section titled “getAura”Retrieves an aura active on the entity.
| Parameter | Type | Description |
|---|---|---|
| name | string | The aura name. |
Returns: Aura | undefined
hasAura
Section titled “hasAura”Whether the entity has the specified aura. If a value is provided, it will check if the aura has the specified value.
| Parameter | Type | Optional | Default | Description |
|---|---|---|---|---|
| name | string | The aura name. | ||
| value | number? | ✓ | The value to check. |
Returns: boolean
isDead
Section titled “isDead”Returns: boolean
isHpGreaterThan
Section titled “isHpGreaterThan”Whether the entity’s hp is greater than a value.
| Parameter | Type | Description |
|---|---|---|
| value | number | The value to compare the entity’s hp to. |
Returns: boolean
isHpLessThan
Section titled “isHpLessThan”Whether the entity’s hp is less than a value.
| Parameter | Type | Description |
|---|---|---|
| value | number | The value to compare the entity’s hp to. |
Returns: boolean
isHpPercentageGreaterThan
Section titled “isHpPercentageGreaterThan”Whether the entity’s hp is greater than a percentage value.
| Parameter | Type | Description |
|---|---|---|
| value | number | The percentage value to compare the entity’s hp to. |
Returns: boolean
isHpPercentageLessThan
Section titled “isHpPercentageLessThan”Whether the entity’s hp is less than a percentage value.
| Parameter | Type | Description |
|---|---|---|
| value | number | The percentage value to compare the entity’s hp to. |
Returns: boolean
isIdle
Section titled “isIdle”Whether the entity is idle.
Returns: boolean
isInCell
Section titled “isInCell”Whether the entity is in the specified cell.
| Parameter | Type | Description |
|---|---|---|
| cell | string | The cell to check. |
Returns: boolean
isInCombat
Section titled “isInCombat”Whether the entity is in combat.
Returns: boolean
isMonster
Section titled “isMonster”Whether the entity is a monster.
Returns: this is Monster
isPlayer
Section titled “isPlayer”Whether the entity is a player.
Returns: this is Avatar