fix: game node undefined
This commit is contained in:
parent
d4e69bb3ff
commit
2bf59346f7
|
@ -134,6 +134,10 @@ export default class EnemyAI extends StateMachineGoapAI implements BattlerAI {
|
||||||
activate(options: Record<string, any>): void { }
|
activate(options: Record<string, any>): void { }
|
||||||
|
|
||||||
damage(damage: number): void {
|
damage(damage: number): void {
|
||||||
|
// enemy already dead, do not send new event
|
||||||
|
if (this.CURRENT_HP <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log(damage +" damage taken, "+this.CURRENT_HP+" hp left");
|
console.log(damage +" damage taken, "+this.CURRENT_HP+" hp left");
|
||||||
this.CURRENT_HP -= damage;
|
this.CURRENT_HP -= damage;
|
||||||
//TODO -
|
//TODO -
|
||||||
|
|
Loading…
Reference in New Issue
Block a user