From 3fa64a2c8a3143a3d9e6e48f259bfd5662217c64 Mon Sep 17 00:00:00 2001 From: Jonas Zeunert Date: Tue, 7 Jun 2022 01:37:06 +0200 Subject: [PATCH] Deactivate bonus slow --- config.py | 1 + events/EndBallEvent.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 30ab4f1..1f1fcec 100644 --- a/config.py +++ b/config.py @@ -29,3 +29,4 @@ WAIT_TIME_TO_RESET_SECONDS = 0.15 MAX_NETWORK_RETRIES = 10 NETWORK_SLEEP_TIME_SECONDS = 0.1 BANK_SLEEP_TIME = 0.1 +BONUS_SLEEP_TIME = 0.1 diff --git a/events/EndBallEvent.py b/events/EndBallEvent.py index 55bddbc..e7b0ecd 100644 --- a/events/EndBallEvent.py +++ b/events/EndBallEvent.py @@ -6,6 +6,11 @@ from events.StartBallEvent import StartBallEvent from solenoids.MainFlipper import MainFlipper from solenoids.TopFlipper import TopFlipper +from time import sleep +from config import BONUS_SLEEP_TIME + +from lamps.LampGroup import BONUS_LAMPS + class EndBallEvent(Event): def __init__(self, gameState): self.gameState = gameState @@ -30,5 +35,9 @@ class EndBallEvent(Event): EndGameEvent().trigger(None) def scorePoints(self): - bonus = self.gameState.currentPlayer.bonus * self.gameState.currentPlayer.bonusMultiplier * 1000 - self.gameState.currentPlayer.addPoints(bonus) + currentPlayer = self.gameState.currentPlayer + for i in range(currentPlayer.bonus): + bonus = self.gameState.currentPlayer.bonusMultiplier * 1000 + self.gameState.currentPlayer.addPoints(bonus) + BONUS_LAMPS.deactivateCurrent() + sleep(BONUS_SLEEP_TIME) \ No newline at end of file