Reference Source Test
public class | source

Item

Extends:

Entity → Item

This os an object type of Entity

Constructor Summary

Public Constructor
public

constructor(id: Number, kind: String, name: String, count: Number, ability: Ability, abilityLevel: Number)

Default constructor

Member Summary

Public Members
public

Ability

public

Ability level

public

How many

public

If this item was dropped

public

Whether or not it has a shadow

public

If this item is stacked

public

Type of entity

Method Summary

Public Methods
public

Check if this has a shadow or not

public

idle()

Set the idle animation

Inherited Summary

From class Entity
public

Angle of the entity

public

[angled description]

public

Animations for the sprite

public

Timeout function for blinking

public

Count down time

public

Current counter

public

Critical health

public

Current animation the sprite should be playing

public

Set if the entity is dirty

public

Callback for when the entity is dirty

public

Whether or not this is fading

public

Fading time

public

Grid X position

public

Grid Y position

public

Handler for the entity

public

Has a counter

public

Hurt sprite name

public

Entity id

public

Label for the entity

public

Name of the entity

public

Non pathable

public

Normal sprite name

public

Path

public

CAllback function when the entity is ready

public

Rendering data

public

Has a shadow

public

Offset for the shadow on the Y axis

public

Sprite

public

Whether or not to flip the sprite on the X axis

public

Whether or not to flip the sprite on the Y axis

public

Whether or not the sprite has been loaded

public

Stunned status

public

Terror status

public

Wehther or not this entity is visible

public

X coordinate

public

Y coordinate

public

blink(speed: Number)

Tell this entity to start blinking

public

fadeIn(time: Number)

Tell this to fade in given the duration

public

Look for an animtions list for this specific animation given it's name

public

Get the distance from this entity to the given x,y coordinates

public

Get the distance from this entity to another entity

public

Returns the name of the sprite

public

Check if this entity currently has a path

public

Check whether or not this entity has a shadow

public

Returns the instance of the weapon this entity has

public

Figure out if this entity is within the attack radius of the given entity

public

Figure out if this entity is within the extended attack radius of the given entity

public

isPositionAdjacent(x: Number, y: Number, ignoreDiagonals: Boolean): Boolean

Checks to see if the x,y coordinate is adjacent to the entity's current position

public

Check whether or not this entity is visible

public

This is important for when the client is on a mobile screen.

public

onDirty(callback: Function)

When this entity's is dirty (mobile) use this callback

public

onReady(callback: Function)

When this entity's sprite is loaded trigger this callback

public

setAnimation(name: String, speed: Number, count: Number, onEndCount: Number)

Set the animation on this entity

public

Set the count for the count down time

public

Set the x,y position of the entity on the tile grid

public

setName(name: String)

Set the entity's name

public

setPosition(x: Number, y: [type])

Set the x,y position for the entity

public

setSprite(sprite: Sprite)

Set the sprite for this entity

public

setVisible(visible: Boolean)

Set the visibility on this entity

public

Tell the entity to stop blinking and force it to be visible

public

Toggle the current visibility of this entity

Public Constructors

public constructor(id: Number, kind: String, name: String, count: Number, ability: Ability, abilityLevel: Number) source

Default constructor

Override:

Entity#constructor

Params:

NameTypeAttributeDescription
id Number

id of the item

kind String

type of the item

name String

name of the item

count Number

how many

ability Ability

ability

abilityLevel Number

ability level

Public Members

public ability: Ability source

Ability

public abilityLevel: Number source

Ability level

public count: Number source

How many

public dropped: Boolean source

If this item was dropped

public shadow: Boolean source

Whether or not it has a shadow

Override:

Entity#shadow

public stackable: Boolean source

If this item is stacked

public type: String source

Type of entity

Public Methods

public hasShadow(): Boolean source

Check if this has a shadow or not

Override:

Entity#hasShadow

Return:

Boolean

public idle() source

Set the idle animation