From 25a48fd2ab497980bc6a6ba4a3c1f1b650aa41a0 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Mon, 6 May 2024 15:00:38 +0200 Subject: [PATCH] Fixes #3; Prevent partial champion damage --- src/model/turn.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/model/turn.py b/src/model/turn.py index 165293f..647f9a5 100644 --- a/src/model/turn.py +++ b/src/model/turn.py @@ -261,10 +261,10 @@ class Turn(Serializable): print("You cannot attack this champion if a guard is present") return - self.damage_reserve -= 1 - p.turn.champions_health[str(c.uuid)] -= 1 - if p.turn.champions_health[str(c.uuid)] <= 0: - await self.player.stun(str(c.uuid)) + if p.turn.champions_health[str(c.uuid)] > self.damage_reserve: + print("You don't have enough damage points to stun champion!") + self.damage_reserve -= p.turn.champions_health[str(c.uuid)] + await self.player.stun(str(c.uuid)) await self.player.game.notify_controller("update", self.serialize()) await self.player.game.notify_controller("update", p.turn.serialize())