Fixes #3; Prevent partial champion damage

This commit is contained in:
2024-05-06 15:00:38 +02:00
parent 29ea3e7856
commit 25a48fd2ab
+4 -4
View File
@@ -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())