feat: snake apply poison damage
This commit is contained in:
parent
3bf7704528
commit
1e5aa43383
|
@ -1,4 +1,5 @@
|
|||
import AnimatedSprite from "../../Wolfie2D/Nodes/Sprites/AnimatedSprite";
|
||||
import PlayerController from "../Player/PlayerController";
|
||||
import EnemyAI, { EnemyStates } from "./EnemyAI";
|
||||
import SnakeAttack from "./EnemyStates/SnakeAttack";
|
||||
|
||||
|
@ -7,4 +8,11 @@ export default class SnakeAI extends EnemyAI {
|
|||
super.initializeAI(owner, options);
|
||||
this.addState(EnemyStates.ATTACK, new SnakeAttack(this, owner));
|
||||
}
|
||||
|
||||
collideWithPlayer(player: PlayerController): void {
|
||||
player.damage(10);
|
||||
if (this.isAttaking && !player.invincible && !player.godMode) {
|
||||
player.poisonCounter = 5;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user