add PLAY_NEXT_CARD_BOUGHT CardEffect

This commit is contained in:
2024-04-20 14:30:03 +02:00
parent f49e1568f2
commit fa045c235f
5 changed files with 109 additions and 8 deletions
+9 -2
View File
@@ -78,8 +78,14 @@ class ClientController(ClientControllerInterface):
@vibe_check(Message)
async def game_context(self, message: Message):
print(message)
if self.player.team != self.game_controller.game.turn:
return await self.send_error("it is not your turn to play!")
if message.type == "action":
if message.data_type == "buy":
for c in message.data:
await self.player.buy_card(c)
elif message.data_type == "play_cards":
await self.player.play_cards(message.data)
@vibe_check(LoginMessage)
async def login_context(self, message: LoginMessage):
@@ -143,3 +149,4 @@ class ClientController(ClientControllerInterface):
self.player.ready = bool(message.data)
if all(p.ready for p in self.game_controller.game.players):
await self.game_controller.start_game()
self.on_message = self.game_context