Kill
release-tag / release-image (push) Successful in 20s

This commit is contained in:
2024-05-11 20:29:05 +02:00
parent 56ead1a635
commit 46bb39aa74
3 changed files with 6 additions and 1 deletions
+2
View File
@@ -175,6 +175,8 @@ class ClientController:
# "update", self.player.team.serialize_guest()
# )
if self.game_controller.game.ended == True:
return await self.send_error("game is already finished!")
if self.player.team != self.game_controller.game.current_turn:
return await self.send_error("it is not your turn to play!")
if message.type == "action":
+1 -1
View File
@@ -11,7 +11,7 @@ class Team(Serializable):
color: str
name: str
def __init__(self, health=80, color="red", name="unnamed Team") -> None:
def __init__(self, health=50, color="red", name="unnamed Team") -> None:
super().__init__()
self.health = health
self.color = color
+3
View File
@@ -285,6 +285,9 @@ class Turn(Serializable):
self.damage_reserve -= 1
team.health -= 1
if team.health <= 0:
await self.player.game.kill_team(team)
await self.player.game.notify_controller(MessageType.UPDATE, self.serialize())
await self.player.game.notify_controller(MessageType.UPDATE, team.serialize())