Purchase delays

This commit is contained in:
Eden Kirin
2023-04-11 17:34:59 +02:00
parent 9425e0fff0
commit 9a2b5befd3
5 changed files with 22 additions and 13 deletions

View File

@ -212,6 +212,8 @@ class GameEngine:
)
self._purchase_countdown_timer.start()
await asyncio.sleep(settings.game.PURCHASE_START_DELAY)
async def purchase_product(self, player: Player, product: Product) -> None:
if not player.state == PlayerState.ON_DESTINATION:
raise PurchaseForbiddenForPlayer()
@ -220,6 +222,7 @@ class GameEngine:
await self.ws_server.send_product_purchase_done_message(
player=player, product=product
)
await asyncio.sleep(settings.game.PURCHASE_FINISHED_DELAY)
await self.reset_game()
def _reset_player(self, player) -> None: