#
Class: Item#
Hierarchy↳ Item
#
Constructors#
constructornew Item(itemId: number, x: number, y: number, skinId?: number): Item
Creates an item object at the specified coordinates.
#
Parameters:Name | Type | Description |
---|---|---|
itemId | number | The rawcode of the item. |
x | number | The x-coordinate of the item |
y | number | The y-coordinate of the item |
skinId? | number | The skin ID of the item. |
Returns: Item
Defined in: handles/item.ts:9
#
Properties#
handle• Readonly
handle: item
Defined in: handles/item.ts:9
#
Accessors#
chargescharges(): number
Returns: number
Defined in: handles/item.ts:26
charges(value: number): void
#
Parameters:Name | Type |
---|---|
value | number |
Returns: void
Defined in: handles/item.ts:30
#
descriptiondescription(): string
async
Returns: string
Defined in: handles/item.ts:49
description(description: string): void
#
Parameters:Name | Type |
---|---|
description | string |
Returns: void
Defined in: handles/item.ts:53
#
extendedTooltipextendedTooltip(): string
async
Returns: string
Defined in: handles/item.ts:60
extendedTooltip(tooltip: string): void
#
Parameters:Name | Type |
---|---|
tooltip | string |
Returns: void
Defined in: handles/item.ts:64
#
iconicon(): string
async
Returns: string
Defined in: handles/item.ts:71
icon(path: string): void
#
Parameters:Name | Type |
---|---|
path | string |
Returns: void
Defined in: handles/item.ts:75
#
idid(): 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
#
invulnerableinvulnerable(): boolean
Returns: boolean
Defined in: handles/item.ts:38
invulnerable(flag: boolean): void
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: void
Defined in: handles/item.ts:34
#
levellevel(): number
Returns: number
Defined in: handles/item.ts:42
#
lifelife(): number
Get the Widget's life.
Returns: number
Defined in: handles/widget.ts:9
life(value: number): void
Set the Widget's life.
#
Parameters:Name | Type |
---|---|
value | number |
Returns: void
Defined in: handles/widget.ts:16
#
namename(): string
async
Returns: string
Defined in: handles/item.ts:82
name(value: string): void
#
Parameters:Name | Type |
---|---|
value | string |
Returns: void
Defined in: handles/item.ts:86
#
pawnablepawnable(): boolean
Returns: boolean
Defined in: handles/item.ts:101
pawnable(flag: boolean): void
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: void
Defined in: handles/item.ts:105
#
playerplayer(): player
Returns: player
Defined in: handles/item.ts:109
#
skinskin(): number
Returns: number
Defined in: handles/item.ts:137
skin(skinId: number): void
#
Parameters:Name | Type |
---|---|
skinId | number |
Returns: void
Defined in: handles/item.ts:141
#
tooltiptooltip(): string
async
Returns: string
Defined in: handles/item.ts:93
tooltip(tooltip: string): void
#
Parameters:Name | Type |
---|---|
tooltip | string |
Returns: void
Defined in: handles/item.ts:97
#
typetype(): itemtype
Returns: itemtype
Defined in: handles/item.ts:113
#
typeIdtypeId(): number
Returns: number
Defined in: handles/item.ts:117
#
userDatauserData(): number
Returns: number
Defined in: handles/item.ts:121
userData(value: number): void
#
Parameters:Name | Type |
---|---|
value | number |
Returns: void
Defined in: handles/item.ts:125
#
visiblevisible(): boolean
Returns: boolean
Defined in: handles/item.ts:129
visible(flag: boolean): void
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: void
Defined in: handles/item.ts:133
#
xx(): number
Returns: number
Defined in: handles/item.ts:145
x(value: number): void
#
Parameters:Name | Type |
---|---|
value | number |
Returns: void
Defined in: handles/item.ts:149
#
yy(): number
Returns: number
Defined in: handles/item.ts:153
y(value: number): void
#
Parameters:Name | Type |
---|---|
value | number |
Returns: void
Defined in: handles/item.ts:157
#
Methods#
addAbilityaddAbility(abilCode: number): void
#
Parameters:Name | Type |
---|---|
abilCode | number |
Returns: void
Defined in: handles/item.ts:161
#
destroydestroy(): void
Returns: void
Defined in: handles/item.ts:177
#
getAbilitygetAbility(abilCode: number): ability
#
Parameters:Name | Type |
---|---|
abilCode | number |
Returns: ability
Defined in: handles/item.ts:165
#
getAbilityByIndexgetAbilityByIndex(index: number): ability
#
Parameters:Name | Type |
---|---|
index | number |
Returns: ability
Defined in: handles/item.ts:169
#
getFieldgetField(field: itembooleanfield | itemintegerfield | itemrealfield | itemstringfield): string | number | boolean
#
Parameters:Name | Type |
---|---|
field | itembooleanfield | itemintegerfield | itemrealfield | itemstringfield |
Returns: string | number | boolean
Defined in: handles/item.ts:181
#
isOwnedisOwned(): boolean
Returns: boolean
Defined in: handles/item.ts:198
#
isPawnableisPawnable(): boolean
Returns: boolean
Defined in: handles/item.ts:202
#
isPowerupisPowerup(): boolean
Returns: boolean
Defined in: handles/item.ts:206
#
isSellableisSellable(): boolean
Returns: boolean
Defined in: handles/item.ts:210
#
removeAbilityremoveAbility(abilCode: number): void
#
Parameters:Name | Type |
---|---|
abilCode | number |
Returns: void
Defined in: handles/item.ts:173
#
setDropIdsetDropId(unitId: number): void
#
Parameters:Name | Type |
---|---|
unitId | number |
Returns: void
Defined in: handles/item.ts:214
#
setDropOnDeathsetDropOnDeath(flag: boolean): void
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: void
Defined in: handles/item.ts:218
#
setDroppablesetDroppable(flag: boolean): void
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: void
Defined in: handles/item.ts:222
#
setFieldsetField(field: itembooleanfield | itemintegerfield | itemrealfield | itemstringfield, value: string | number | boolean): boolean
#
Parameters:Name | Type |
---|---|
field | itembooleanfield | itemintegerfield | itemrealfield | itemstringfield |
value | string | number | boolean |
Returns: boolean
Defined in: handles/item.ts:226
#
setOwnersetOwner(whichPlayer: MapPlayer, changeColor: boolean): void
#
Parameters:Name | Type |
---|---|
whichPlayer | MapPlayer |
changeColor | boolean |
Returns: void
Defined in: handles/item.ts:242
#
setPointsetPoint(whichPoint: Point): void
#
Parameters:Name | Type |
---|---|
whichPoint | Point |
Returns: void
Defined in: handles/item.ts:246
#
setPositionsetPosition(x: number, y: number): void
#
Parameters:Name | Type |
---|---|
x | number |
y | number |
Returns: void
Defined in: handles/item.ts:250
#
fromEventstatic fromEvent(): Item
Returns: Item
Overrides: Widget
Defined in: handles/item.ts:254
#
fromHandlestatic fromHandle(handle: item): Item
#
Parameters:Name | Type |
---|---|
handle | item |
Returns: Item
Overrides: Widget
Defined in: handles/item.ts:258
#
isIdPawnablestatic isIdPawnable(itemId: number): boolean
#
Parameters:Name | Type |
---|---|
itemId | number |
Returns: boolean
Defined in: handles/item.ts:262
#
isIdPowerupstatic isIdPowerup(itemId: number): boolean
#
Parameters:Name | Type |
---|---|
itemId | number |
Returns: boolean
Defined in: handles/item.ts:266
#
isIdSellablestatic isIdSellable(itemId: number): boolean
#
Parameters:Name | Type |
---|---|
itemId | number |
Returns: boolean
Defined in: handles/item.ts:270