From 1e5aa43383247eef9f86e2d67c91304cae97ade8 Mon Sep 17 00:00:00 2001 From: Renge Date: Wed, 27 Apr 2022 22:43:44 -0400 Subject: [PATCH] feat: snake apply poison damage --- src/shattered_sword/AI/SnakeAI.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/shattered_sword/AI/SnakeAI.ts b/src/shattered_sword/AI/SnakeAI.ts index c925f1b..d12e4b2 100644 --- a/src/shattered_sword/AI/SnakeAI.ts +++ b/src/shattered_sword/AI/SnakeAI.ts @@ -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; + } + } } \ No newline at end of file