refactor: damage -> harm
This commit is contained in:
parent
af9924d441
commit
ac7746a3a6
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue
Block a user