Archived
@@ -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
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user