Health Class
A component class holding the health and base resistances.
Constructor
Health
-
maximumHealth
-
baseCyanResistance
-
baseMagentaResistance
-
baseYellowResistance
-
baseWhiteResistance
Parameters:
-
maximumHealth
NumberEntity's maximum health.
-
baseCyanResistance
NumberBase resistance to cyan damage. Resistances should be from 0 to 1, where 0 means no resistance and 1 means full resistance.
-
baseMagentaResistance
NumberBase 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
NumberBase 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
NumberBase 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.
Item Index
Methods
getBaseCyanResistance
()
Number
Returns:
getBaseMagentaResistance
()
Number
Returns:
getBaseWhiteResistance
()
Number
Returns:
getBaseYellowResistance
()
Number
Returns:
getCurrentHealth
()
Number
Returns:
getMaximumHealth
()
Number
Returns:
setBaseCyanResistance
-
baseCyanResistance
Parameters:
-
baseCyanResistance
NumberBase 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
NumberBase 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
NumberBase 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
NumberBase 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