-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add logic to qualify new grand_prix mode
- Loading branch information
Showing
6 changed files
with
155 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ modes: | |
- base | ||
- green_flag | ||
- grooveline | ||
- grand_prix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#config_version=6 | ||
|
||
mode: | ||
start_events: | ||
- logicblock_grand_prix_counter_complete | ||
stop_events: | ||
- multiball_grand_prix_ended | ||
restart_on_next_ball: false | ||
priority: 200 | ||
|
||
multiballs: | ||
grand_prix: | ||
ball_count: 1 | ||
ball_count_type: add | ||
shoot_again: 15s | ||
start_events: mode_grand_prix_started | ||
# TODO: entering all 3 "holes" adds a ball | ||
add_a_ball_events: | ||
- player_grand_prix_hole_counter_count{current_player.grand_prix_hole_counter_count == 3} | ||
|
||
# TODO: counter for each hole |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
from tests.death_save_game_testing import DeathSaveGameTesting | ||
|
||
class TestGrandPrixMode(DeathSaveGameTesting): | ||
|
||
# To qualify: | ||
# | ||
# - Advance "GRAND" by hitting s_grand_advance | ||
# - With GRAND lit, hit s_grand_hole to qualify "PRIX" | ||
# - Advance "PRIX" by hitting s_prix_advance | ||
# - With PRIX lit, hit s_prix_hole to lock in one letter | ||
# - Repeat 3 more times to qualify "GRAND PRIX" and | ||
# start multiball | ||
# | ||
def test_qualification(self): | ||
self._start() | ||
self._start_green_flag() | ||
self.assertEqual(1, self.machine.playfield.balls) | ||
self.assertEqual(True, | ||
self.machine.counters["grand_counter"].enabled) | ||
self.assertEqual(False, | ||
self.machine.counters["prix_counter"].enabled) | ||
self.assertEqual(0, | ||
self.machine.game.player.grand_prix_counter_count) | ||
|
||
# After lighting GRAND, the prix_counter is | ||
# enabled and the grand_counter is disabled | ||
self._light_grand() | ||
self.assertEqual(5, | ||
self.machine.game.player.grand_counter_count) | ||
# Main counter unaffected so far | ||
self.assertEqual(0, | ||
self.machine.game.player.grand_prix_counter_count) | ||
|
||
# After lighting PRIX, the grand_counter is | ||
# re-enabled and user hits it 4 times | ||
self._light_prix() | ||
# Counter resets immediately | ||
self.assertEqual(0, | ||
self.machine.game.player.prix_counter_count) | ||
# And increases "Main" grand_prix_counter | ||
self.assertEqual(1, | ||
self.machine.game.player.grand_prix_counter_count) | ||
|
||
# Repeat sequence 3 more times | ||
for i in range(3): | ||
self._light_grand() | ||
self._light_prix() | ||
self.assertEqual(4, | ||
self.machine.game.player.grand_prix_counter_count) | ||
|
||
self.assertModeRunning("grand_prix") | ||
|
||
def _light_grand(self): | ||
for i in range(5): | ||
self.hit_and_release_switch("s_grand_advance") | ||
self.assertModeRunning("green_flag") | ||
self.assertEqual(True, | ||
self.machine.counters["prix_counter"].enabled) | ||
self.assertEqual(False, | ||
self.machine.counters["grand_counter"].enabled) | ||
|
||
def _light_prix(self): | ||
for i in range(4): | ||
self.hit_and_release_switch("s_prix_advance") | ||
self.assertEqual(True, | ||
self.machine.counters["grand_counter"].enabled) | ||
self.assertEqual(False, | ||
self.machine.counters["prix_counter"].enabled) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters