From dc9bbad8403b5f99d0433308071bce12541e7b2f Mon Sep 17 00:00:00 2001 From: Scipio Wright Date: Sun, 28 Jul 2024 12:10:49 -0400 Subject: [PATCH] Add back LogicRules as an invisible option, to not break old yamls --- worlds/tunic/__init__.py | 8 +++++++- worlds/tunic/options.py | 22 ++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/worlds/tunic/__init__.py b/worlds/tunic/__init__.py index 249270103c..3ad6be59c1 100644 --- a/worlds/tunic/__init__.py +++ b/worlds/tunic/__init__.py @@ -9,7 +9,7 @@ from .regions import tunic_regions from .er_scripts import create_er_regions from .er_data import portal_mapping from .options import (TunicOptions, EntranceRando, tunic_option_groups, tunic_option_presets, TunicPlandoConnections, - LaurelsLocation) + LaurelsLocation, LogicRules, LaurelsZips, IceGrappling, LadderStorage) from worlds.AutoWorld import WebWorld, World from Options import PlandoConnection from decimal import Decimal, ROUND_HALF_UP @@ -83,6 +83,12 @@ class TunicWorld(World): shop_num: int = 1 # need to make it so that you can walk out of shops, but also that they aren't all connected def generate_early(self) -> None: + if self.options.logic_rules >= LogicRules.option_no_major_glitches: + self.options.laurels_zips.value = LaurelsZips.option_true + self.options.ice_grappling.value = IceGrappling.option_medium + if self.options.logic_rules.value == LogicRules.option_unrestricted: + self.options.ladder_storage.value = LadderStorage.option_medium + if self.options.plando_connections: for index, cxn in enumerate(self.options.plando_connections): # making shops second to simplify other things later diff --git a/worlds/tunic/options.py b/worlds/tunic/options.py index e14ef8d9df..c8d35f9f2c 100644 --- a/worlds/tunic/options.py +++ b/worlds/tunic/options.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from typing import Dict, Any from Options import (DefaultOnToggle, Toggle, StartInventoryPool, Choice, Range, TextChoice, PlandoConnections, - PerGameCommonOptions, OptionGroup, Removed) + PerGameCommonOptions, OptionGroup, Visibility) from .er_data import portal_mapping @@ -240,6 +240,24 @@ class LadderStorageWithoutItems(Toggle): display_name = "Ladder Storage without Items" +class LogicRules(Choice): + """ + This option has been superseded by the individual trick options. + If set to nmg, it will set Ice Grappling to medium and Laurels Zips on. + If set to ur, it will do nmg as well as set Ladder Storage to medium. + It is here to avoid breaking old yamls, and will be removed at a later date. + """ + visibility = Visibility.none + internal_name = "logic_rules" + display_name = "Logic Rules" + option_restricted = 0 + option_no_major_glitches = 1 + alias_nmg = 1 + option_unrestricted = 2 + alias_ur = 2 + default = 0 + + @dataclass class TunicOptions(PerGameCommonOptions): start_inventory_from_pool: StartInventoryPool @@ -264,7 +282,7 @@ class TunicOptions(PerGameCommonOptions): ladder_storage_without_items: LadderStorageWithoutItems plando_connections: TunicPlandoConnections - logic_rules: Removed + logic_rules: LogicRules tunic_option_groups = [