API Docs for:
Show:

Health Class

A component class holding the health and base resistances.

Constructor

Health

(
  • maximumHealth
  • baseCyanResistance
  • baseMagentaResistance
  • baseYellowResistance
  • baseWhiteResistance
)

Parameters:

  • maximumHealth Number

    Entity's maximum health.

  • baseCyanResistance Number

    Base resistance to cyan damage. Resistances should be from 0 to 1, where 0 means no resistance and 1 means full resistance.

  • baseMagentaResistance Number

    Base resistance to magenta damage. Resistances can be negative. Resistances are % based, where 0 means no resistance 1 means full resistance and -1 means that the entity will take double damage.

  • baseYellowResistance Number

    Base resistance to yellow damage. Resistances can be negative. Resistances are % based, where 0 means no resistance 1 means full resistance and -1 means that the entity will take double damage.

  • baseWhiteResistance Number

    Base resistance to white damage. Resistances can be negative. Resistances are % based, where 0 means no resistance 1 means full resistance and -1 means that the entity will take double damage.

Methods

getBaseCyanResistance

() Number

Returns:

Number:

getBaseMagentaResistance

() Number

Returns:

Number:

getBaseWhiteResistance

() Number

Returns:

Number:

getBaseYellowResistance

() Number

Returns:

Number:

getCurrentHealth

() Number

Returns:

Number:

getMaximumHealth

() Number

Returns:

Number:

setBaseCyanResistance

(
  • baseCyanResistance
)

Parameters:

  • baseCyanResistance Number

    Base resistance to cyan damage. Resistances can be negative. Resistances are % based, where 0 means no resistance 1 means full resistance and -1 means that the entity will take double damage.

setBaseMagentaResistance

(
  • baseMagentaResistance
)

Parameters:

  • baseMagentaResistance Number

    Base resistance to magenta damage. Resistances can be negative. Resistances are % based, where 0 means no resistance 1 means full resistance and -1 means that the entity will take double damage.

setBaseWhiteResistance

(
  • baseWhiteResistance
)

Parameters:

  • baseWhiteResistance Number

    Base resistance to white damage. Resistances can be negative. Resistances are % based, where 0 means no resistance 1 means full resistance and -1 means that the entity will take double damage.

setBaseYellowResistance

(
  • baseYellowResistance
)

Parameters:

  • baseYellowResistance Number

    Base resistance to yellow damage. Resistances can be negative. Resistances are % based, where 0 means no resistance 1 means full resistance and -1 means that the entity will take double damage.

setMaximumHealth

(
  • maximumHealth
)

Parameters:

  • maximumHealth Number