Class: Destructable#

Hierarchy#

Constructors#

constructor#

new Destructable(objectId: number, x: number, y: number, z: number, face: number, scale: number, varation: number): Destructable

Creates a destructable at the specified coordinates.

Parameters:#

NameTypeDescription
objectIdnumberThe rawcode of the destructable to be created.
xnumberThe x-coordinate of the Destructable.
ynumberThe y-coordinate of the Destructable.
znumberThe z-coordinate of the Destructable.
facenumberThe facing of the Destructable.
scalenumberThe X-Y-Z scaling value of the Destructable.
varationnumberThe integer representing the variation of the Destructable to be created.

Returns: Destructable

Defined in: handles/destructable.ts:7

Properties#

handle#

• Readonly handle: destructable

Overrides: Widget.handle

Defined in: handles/destructable.ts:7

Accessors#

id#

id(): number

Get the unique ID of the handle. The ID is recycled once you destroy the object.

Returns: number

The unique ID of a handle object.

Defined in: handles/handle.ts:18


invulnerable#

invulnerable(): boolean

Returns: boolean

Defined in: handles/destructable.ts:31

invulnerable(flag: boolean): void

Parameters:#

NameType
flagboolean

Returns: void

Defined in: handles/destructable.ts:27


life#

life(): number

Returns: number

Defined in: handles/destructable.ts:35

life(value: number): void

Parameters:#

NameType
valuenumber

Returns: void

Defined in: handles/destructable.ts:39


maxLife#

maxLife(): number

Returns: number

Defined in: handles/destructable.ts:43

maxLife(value: number): void

Parameters:#

NameType
valuenumber

Returns: void

Defined in: handles/destructable.ts:47


name#

name(): string

This will return different values depending on the locale.

Returns: string

Defined in: handles/destructable.ts:54


occluderHeight#

occluderHeight(): number

Returns: number

Defined in: handles/destructable.ts:58

occluderHeight(value: number): void

Parameters:#

NameType
valuenumber

Returns: void

Defined in: handles/destructable.ts:62


typeId#

typeId(): number

Returns: number

Defined in: handles/destructable.ts:66


x#

x(): number

Returns: number

Defined in: handles/destructable.ts:70


y#

y(): number

Returns: number

Defined in: handles/destructable.ts:74

Methods#

destroy#

destroy(): void

Returns: void

Defined in: handles/destructable.ts:78


heal#

heal(life: number, birth: boolean): void

Resurrects a Destructable with the specified hit points.

Parameters:#

NameTypeDescription
lifenumberThe amount of hit points the Destructable will have when it is resurrected. A value of 0, or any value above the Destructable's maximum HP, will give the Destructable its maximum HP (as defined in the object editor). Any value below 0.5 will give the Destructable 0.5 hit points.
birthbooleanIf true, the Destructable will play its birth animation upon resurrection.

Returns: void

Defined in: handles/destructable.ts:90


kill#

kill(): void

Returns: void

Defined in: handles/destructable.ts:94


queueAnim#

queueAnim(whichAnimation: string): void

Parameters:#

NameType
whichAnimationstring

Returns: void

Defined in: handles/destructable.ts:98


setAnim#

setAnim(whichAnimation: string): void

Parameters:#

NameType
whichAnimationstring

Returns: void

Defined in: handles/destructable.ts:102


setAnimSpeed#

setAnimSpeed(speedFactor: number): void

Parameters:#

NameType
speedFactornumber

Returns: void

Defined in: handles/destructable.ts:106


show#

show(flag: boolean): void

Parameters:#

NameType
flagboolean

Returns: void

Defined in: handles/destructable.ts:110


fromEvent#

static fromEvent(): Destructable

Returns: Destructable

Overrides: Widget

Defined in: handles/destructable.ts:114


fromHandle#

static fromHandle(handle: destructable): Destructable

Parameters:#

NameType
handledestructable

Returns: Destructable

Overrides: Widget

Defined in: handles/destructable.ts:118