refactor: damage -> harm
This commit is contained in:
parent
af9924d441
commit
ac7746a3a6
|
@ -113,12 +113,12 @@ export class Alive extends decorate(Trait) {
|
||||||
listeners() {
|
listeners() {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
tookDamage: (damage, source) => {
|
tookHarm: (harm, source) => {
|
||||||
if (damage.damageSpec.power > 0) {
|
if (harm.harmSpec.power > 0) {
|
||||||
this.entity.life -= damage.amount;
|
this.entity.life -= harm.amount;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.entity.life += damage.amount;
|
this.entity.life += harm.amount;
|
||||||
}
|
}
|
||||||
// Clamp health between 0 and max.
|
// Clamp health between 0 and max.
|
||||||
this.entity.life = Math.min(
|
this.entity.life = Math.min(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user