From 253f3e61f74b5866b5427df5673420a8d7bf8028 Mon Sep 17 00:00:00 2001 From: Yussur Mustafa Oraji Date: Sat, 28 Oct 2023 21:44:16 +0200 Subject: [PATCH] sm64ex: All Bowser Stages Goal (#2112) --- worlds/sm64ex/Options.py | 7 +++++++ worlds/sm64ex/Rules.py | 7 ++++++- worlds/sm64ex/__init__.py | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/worlds/sm64ex/Options.py b/worlds/sm64ex/Options.py index a603b61c..8a10f3ed 100644 --- a/worlds/sm64ex/Options.py +++ b/worlds/sm64ex/Options.py @@ -88,6 +88,12 @@ class ExclamationBoxes(Choice): option_Off = 0 option_1Ups_Only = 1 +class CompletionType(Choice): + """Set goal for game completion""" + display_name = "Completion Goal" + option_Last_Bowser_Stage = 0 + option_All_Bowser_Stages = 1 + class ProgressiveKeys(DefaultOnToggle): """Keys will first grant you access to the Basement, then to the Secound Floor""" @@ -110,4 +116,5 @@ sm64_options: typing.Dict[str, type(Option)] = { "death_link": DeathLink, "BuddyChecks": BuddyChecks, "ExclamationBoxes": ExclamationBoxes, + "CompletionType" : CompletionType, } diff --git a/worlds/sm64ex/Rules.py b/worlds/sm64ex/Rules.py index 7c50ba47..27b5fc8f 100644 --- a/worlds/sm64ex/Rules.py +++ b/worlds/sm64ex/Rules.py @@ -124,4 +124,9 @@ def set_rules(world, player: int, area_connections): add_rule(world.get_location("MIPS 1", player), lambda state: state.can_reach("Basement", 'Region', player) and state.has("Power Star", player, world.MIPS1Cost[player].value)) add_rule(world.get_location("MIPS 2", player), lambda state: state.can_reach("Basement", 'Region', player) and state.has("Power Star", player, world.MIPS2Cost[player].value)) - world.completion_condition[player] = lambda state: state.can_reach("Bowser in the Sky", 'Region', player) + if world.CompletionType[player] == "last_bowser_stage": + world.completion_condition[player] = lambda state: state.can_reach("Bowser in the Sky", 'Region', player) + elif world.CompletionType[player] == "all_bowser_stages": + world.completion_condition[player] = lambda state: state.can_reach("Bowser in the Dark World", 'Region', player) and \ + state.can_reach("Bowser in the Fire Sea", 'Region', player) and \ + state.can_reach("Bowser in the Sky", 'Region', player) diff --git a/worlds/sm64ex/__init__.py b/worlds/sm64ex/__init__.py index 6a7a3bd2..3cc87708 100644 --- a/worlds/sm64ex/__init__.py +++ b/worlds/sm64ex/__init__.py @@ -154,6 +154,7 @@ class SM64World(World): "MIPS2Cost": self.multiworld.MIPS2Cost[self.player].value, "StarsToFinish": self.multiworld.StarsToFinish[self.player].value, "DeathLink": self.multiworld.death_link[self.player].value, + "CompletionType" : self.multiworld.CompletionType[self.player].value, } def generate_output(self, output_directory: str):