From 1d6ab130157c6a8f5b0473cdba097e75e9fc0d9d Mon Sep 17 00:00:00 2001 From: alwaysintreble Date: Thu, 23 Feb 2023 20:16:10 -0600 Subject: [PATCH] ArchipIDLE: add a completion condition instead of hard coding tests around a game (#1444) --- test/general/TestImplemented.py | 2 +- worlds/archipidle/Rules.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/general/TestImplemented.py b/test/general/TestImplemented.py index 66a09981..22c546ef 100644 --- a/test/general/TestImplemented.py +++ b/test/general/TestImplemented.py @@ -8,7 +8,7 @@ class TestImplemented(unittest.TestCase): def testCompletionCondition(self): """Ensure a completion condition is set that has requirements.""" for game_name, world_type in AutoWorldRegister.world_types.items(): - if not world_type.hidden and game_name not in {"ArchipIDLE", "Sudoku"}: + if not world_type.hidden and game_name not in {"Sudoku"}: with self.subTest(game_name): multiworld = setup_solo_multiworld(world_type) self.assertFalse(multiworld.completion_condition[1](multiworld.state)) diff --git a/worlds/archipidle/Rules.py b/worlds/archipidle/Rules.py index 94c6e099..ddf906c2 100644 --- a/worlds/archipidle/Rules.py +++ b/worlds/archipidle/Rules.py @@ -31,3 +31,7 @@ def set_rules(world: MultiWorld, player: int): world.get_location(f"IDLE for at least {int(i / 2)} minutes {30 if (i % 2) else 0} seconds", player), lambda state: state._archipidle_location_is_accessible(player, 20) ) + + world.completion_condition[player] =\ + lambda state:\ + state.can_reach(world.get_location("IDLE for at least 50 minutes 0 seconds", player), "Location", player)