Class: Item#

Hierarchy#

Constructors#

constructor#

new Item(itemId: number, x: number, y: number, skinId?: number): Item

Creates an item object at the specified coordinates.

Parameters:#

NameTypeDescription
itemIdnumberThe rawcode of the item.
xnumberThe x-coordinate of the item
ynumberThe y-coordinate of the item
skinId?numberThe skin ID of the item.

Returns: Item

Defined in: handles/item.ts:9

Properties#

handle#

• Readonly handle: item

Overrides: Widget.handle

Defined in: handles/item.ts:9

Accessors#

charges#

charges(): number

Returns: number

Defined in: handles/item.ts:26

charges(value: number): void

Parameters:#

NameType
valuenumber

Returns: void

Defined in: handles/item.ts:30


description#

description(): string

async

Returns: string

Defined in: handles/item.ts:49

description(description: string): void

Parameters:#

NameType
descriptionstring

Returns: void

Defined in: handles/item.ts:53


extendedTooltip#

extendedTooltip(): string

async

Returns: string

Defined in: handles/item.ts:60

extendedTooltip(tooltip: string): void

Parameters:#

NameType
tooltipstring

Returns: void

Defined in: handles/item.ts:64


icon#

icon(): string

async

Returns: string

Defined in: handles/item.ts:71

icon(path: string): void

Parameters:#

NameType
pathstring

Returns: void

Defined in: handles/item.ts:75


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/item.ts:38

invulnerable(flag: boolean): void

Parameters:#

NameType
flagboolean

Returns: void

Defined in: handles/item.ts:34


level#

level(): number

Returns: number

Defined in: handles/item.ts:42


life#

life(): number

Get the Widget's life.

Returns: number

Defined in: handles/widget.ts:9

life(value: number): void

Set the Widget's life.

Parameters:#

NameType
valuenumber

Returns: void

Defined in: handles/widget.ts:16


name#

name(): string

async

Returns: string

Defined in: handles/item.ts:82

name(value: string): void

Parameters:#

NameType
valuestring

Returns: void

Defined in: handles/item.ts:86


pawnable#

pawnable(): boolean

Returns: boolean

Defined in: handles/item.ts:101

pawnable(flag: boolean): void

Parameters:#

NameType
flagboolean

Returns: void

Defined in: handles/item.ts:105


player#

player(): player

Returns: player

Defined in: handles/item.ts:109


skin#

skin(): number

Returns: number

Defined in: handles/item.ts:137

skin(skinId: number): void

Parameters:#

NameType
skinIdnumber

Returns: void

Defined in: handles/item.ts:141


tooltip#

tooltip(): string

async

Returns: string

Defined in: handles/item.ts:93

tooltip(tooltip: string): void

Parameters:#

NameType
tooltipstring

Returns: void

Defined in: handles/item.ts:97


type#

type(): itemtype

Returns: itemtype

Defined in: handles/item.ts:113


typeId#

typeId(): number

Returns: number

Defined in: handles/item.ts:117


userData#

userData(): number

Returns: number

Defined in: handles/item.ts:121

userData(value: number): void

Parameters:#

NameType
valuenumber

Returns: void

Defined in: handles/item.ts:125


visible#

visible(): boolean

Returns: boolean

Defined in: handles/item.ts:129

visible(flag: boolean): void

Parameters:#

NameType
flagboolean

Returns: void

Defined in: handles/item.ts:133


x#

x(): number

Returns: number

Defined in: handles/item.ts:145

x(value: number): void

Parameters:#

NameType
valuenumber

Returns: void

Defined in: handles/item.ts:149


y#

y(): number

Returns: number

Defined in: handles/item.ts:153

y(value: number): void

Parameters:#

NameType
valuenumber

Returns: void

Defined in: handles/item.ts:157

Methods#

addAbility#

addAbility(abilCode: number): void

Parameters:#

NameType
abilCodenumber

Returns: void

Defined in: handles/item.ts:161


destroy#

destroy(): void

Returns: void

Defined in: handles/item.ts:177


getAbility#

getAbility(abilCode: number): ability

Parameters:#

NameType
abilCodenumber

Returns: ability

Defined in: handles/item.ts:165


getAbilityByIndex#

getAbilityByIndex(index: number): ability

Parameters:#

NameType
indexnumber

Returns: ability

Defined in: handles/item.ts:169


getField#

getField(field: itembooleanfield | itemintegerfield | itemrealfield | itemstringfield): string | number | boolean

Parameters:#

NameType
fielditembooleanfield | itemintegerfield | itemrealfield | itemstringfield

Returns: string | number | boolean

Defined in: handles/item.ts:181


isOwned#

isOwned(): boolean

Returns: boolean

Defined in: handles/item.ts:198


isPawnable#

isPawnable(): boolean

Returns: boolean

Defined in: handles/item.ts:202


isPowerup#

isPowerup(): boolean

Returns: boolean

Defined in: handles/item.ts:206


isSellable#

isSellable(): boolean

Returns: boolean

Defined in: handles/item.ts:210


removeAbility#

removeAbility(abilCode: number): void

Parameters:#

NameType
abilCodenumber

Returns: void

Defined in: handles/item.ts:173


setDropId#

setDropId(unitId: number): void

Parameters:#

NameType
unitIdnumber

Returns: void

Defined in: handles/item.ts:214


setDropOnDeath#

setDropOnDeath(flag: boolean): void

Parameters:#

NameType
flagboolean

Returns: void

Defined in: handles/item.ts:218


setDroppable#

setDroppable(flag: boolean): void

Parameters:#

NameType
flagboolean

Returns: void

Defined in: handles/item.ts:222


setField#

setField(field: itembooleanfield | itemintegerfield | itemrealfield | itemstringfield, value: string | number | boolean): boolean

Parameters:#

NameType
fielditembooleanfield | itemintegerfield | itemrealfield | itemstringfield
valuestring | number | boolean

Returns: boolean

Defined in: handles/item.ts:226


setOwner#

setOwner(whichPlayer: MapPlayer, changeColor: boolean): void

Parameters:#

NameType
whichPlayerMapPlayer
changeColorboolean

Returns: void

Defined in: handles/item.ts:242


setPoint#

setPoint(whichPoint: Point): void

Parameters:#

NameType
whichPointPoint

Returns: void

Defined in: handles/item.ts:246


setPosition#

setPosition(x: number, y: number): void

Parameters:#

NameType
xnumber
ynumber

Returns: void

Defined in: handles/item.ts:250


fromEvent#

static fromEvent(): Item

Returns: Item

Overrides: Widget

Defined in: handles/item.ts:254


fromHandle#

static fromHandle(handle: item): Item

Parameters:#

NameType
handleitem

Returns: Item

Overrides: Widget

Defined in: handles/item.ts:258


isIdPawnable#

static isIdPawnable(itemId: number): boolean

Parameters:#

NameType
itemIdnumber

Returns: boolean

Defined in: handles/item.ts:262


isIdPowerup#

static isIdPowerup(itemId: number): boolean

Parameters:#

NameType
itemIdnumber

Returns: boolean

Defined in: handles/item.ts:266


isIdSellable#

static isIdSellable(itemId: number): boolean

Parameters:#

NameType
itemIdnumber

Returns: boolean

Defined in: handles/item.ts:270