Your browser does not support HTML5 canvas. Fork me on GitHub

Available Packages:

DamageEvent

Source

DamageElement DAMAGE_ELEMENT_ATTACK

Source

A damage instance can have an element. DAMAGE_ELEMENT_ATTACK is the defaut element added to any damage instances of DamageType ATTACK

function getDamageDesignation(DamageType t, DamageElement e) returns string

Source

Returns a damage designation given a DamageType and a DamageElement

function getDamageTypeName(DamageType t) returns string

Source

Returns the name of the given DamageType

class DamageElement

Source

Each damage instance can have a DamageElement associated to it. Allowing for categories of damage instances: DAMAGE_ELEMENT_FIRE = new DamageElement("Fire", colorA(255, 0, 0, 255)) DAMAGE_ELEMENT_WATER = new DamageElement("Water", colorA(0, 0, 255, 255)) The user can extends from DamageElement to add his own settings.

'unknown type' (the type colorA could not be found, the containing package might not be imported) color

Source

string name

Source

function getColor() returns 'unknown type' (the type colorA could not be found, the containing package might not be imported)

Source

function getName() returns string

Source

class DamageEvent

Source

boolean abort

Source

DamageListener array(dimensions = 1) firstListeners

Source

DamageListener array(dimensions = 1) firstUnreducedListeners

Source

int maxPriority

Source

int maxUnreducedPriority

Source

DamageElement nextDamageElement

Source

int nextDamageId

Source

DamageType nextDamageType

Source

function abortCurrent()

Source

Nulls the damage amount and skip all remaining listeners for the damage instance being currently fired

function addAmount(real amount)

Source

Adds to the damage amount of the damage instance being currently fired

function addListener(DamageListener listener) returns DamageListener

Source

Adds a damage event listener. If The order of firing is important, use addListener(priority, listener)

function addListener(int priority, DamageListener listener) returns DamageListener

Source

Adds a damage event listener with a given priority. Listeners of different priorities fire from the lowest priority to the highest priority added. Listeners of the same priority fire by order of addition (FIFO)

function addUnreducedListener(DamageListener listener) returns DamageListener

Source

Adds a damage event listener that fires before any damage reduction is applied (such as armor). If The order of firing is important, use addListener(priority, listener)

function addUnreducedListener(int priority, DamageListener listener) returns DamageListener

Source

Adds a damage event listener with a given priority that fires before any damage reduction is applied (such as armor). Listeners of different priorities fire from the lowest priority to the highest priority added. Listeners of the same priority fire by order of addition (FIFO)

function getAmount() returns real

Source

Returns the damage amount of the damage instance being currently fired

function getAttackType() returns attacktype

Source

Returns the attacktype of the damage instance being currently fired

function getDamageType() returns damagetype

Source

Returns the damagetype of the damage instance being currently fired

function getElement() returns DamageElement

Source

Returns the DamageElement of the damage instance being currently fired

function getId() returns int

Source

Returns the id of the damage instance being currently fired

function getNativeDamageReductionPercent() returns real

Source

Returns the percent of damage reduced from the *original unreduced amount* by damage reducing effects. If the damage instance is still unreduced, returns zero

function getOriginalAmount() returns real

Source

Returns the original reduced damage amount of the damage instance being currently fired

function getSource() returns unit

Source

Returns the source of the damage instance being currently fired

function getTarget() returns unit

Source

Returns the target of the damage instance being currently fired

function getType() returns DamageType

Source

Returns the DamageType of the damage instance being currently fired

function getUnreducedAmount() returns real

Source

Returns the unreduced damage amount of the damage instance being currently fired

function getUnreducedOriginalAmount() returns real

Source

Returns the original unreduced damage amount of the damage instance being currently fired

function getWeaponType() returns weapontype

Source

Returns the weapontype of the damage instance being currently fired

function isFiring() returns boolean

Source

Returns true if a damage instance is currently firing

function onDamage()

Source

function onUnreducedDamage()

Source

function removeListener(DamageListener listener)

Source

function removeUnreducedListener(DamageListener listener)

Source

function setAmount(real amount)

Source

Sets the damage amount of the damage instance being currently fired

function setAttackType(attacktype attackType)

Source

Sets the attacktype of the damage instance being currently fired

function setDamageType(damagetype damageType)

Source

Sets the damagetype of the damage instance being currently fired

function setNextDamageElement(DamageElement damageElement)

Source

Sets the DamageElement for the next damage instance

function setNextDamageFromCode()

Source

Sets the DamageType to CODE for the next damage instance

function setNextDamageId(int id)

Source

Sets the id for the next damage instance

function setNextDamageType(DamageType damageType)

Source

Sets the DamageType for the next damage instance

function setWeaponType(weapontype weaponType)

Source

Sets the weapontype of the damage instance being currently fired

function subAmount(real amount)

Source

Substracts from the damage amount of the damage instance being currently fired

class DamageListener

Source

DamageListener next

Source

DamageListener prev

Source

int priority

Source

boolean unreduced

Source

function onEvent()

Source