refactor: damage -> harm

This commit is contained in:
cha0s 2019-12-12 19:28:01 -06:00
parent af9924d441
commit ac7746a3a6

View File

@ -113,12 +113,12 @@ export class Alive extends decorate(Trait) {
listeners() {
return {
tookDamage: (damage, source) => {
if (damage.damageSpec.power > 0) {
this.entity.life -= damage.amount;
tookHarm: (harm, source) => {
if (harm.harmSpec.power > 0) {
this.entity.life -= harm.amount;
}
else {
this.entity.life += damage.amount;
this.entity.life += harm.amount;
}
// Clamp health between 0 and max.
this.entity.life = Math.min(