From 16c6e17a49873e8d432567ddd7bcdd3636e6b83f Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Mon, 7 Jun 2021 01:19:27 -0500 Subject: [PATCH] Initial handling of hybrid glitch logic outside of UnderworldGlitchRules --- BaseClasses.py | 3 +++ Mystery.py | 2 +- Options.py | 2 ++ worlds/alttp/ItemPool.py | 2 +- worlds/alttp/Rules.py | 10 ++++++++-- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 0f5e5e6b..4c103b4d 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -813,6 +813,9 @@ class CollectionState(object): rules.append(self.has('Moon Pearl', player)) return all(rules) + def can_bomb_clip(self, region: Region, player: int) -> bool: + return self.is_not_bunny(region, player) and self.has('Pegasus Boots', player) + # Minecraft logic functions def has_iron_ingots(self, player: int): return self.has('Progressive Tools', player) and self.has('Ingot Crafting', player) diff --git a/Mystery.py b/Mystery.py index a80872b8..8f26afdc 100644 --- a/Mystery.py +++ b/Mystery.py @@ -586,7 +586,7 @@ def roll_alttp_settings(ret: argparse.Namespace, weights, plando_options): logging.warning("Only NMG, OWG and No Logic supported") glitches_required = 'none' ret.logic = {None: 'noglitches', 'none': 'noglitches', 'no_logic': 'nologic', 'overworld_glitches': 'owglitches', - 'minor_glitches': 'minorglitches'}[ + 'minor_glitches': 'minorglitches', 'hybrid_major_glitches': 'hybridglitches'}[ glitches_required] ret.dark_room_logic = get_choice("dark_room_logic", weights, "lamp") diff --git a/Options.py b/Options.py index 3795b817..9582a3ea 100644 --- a/Options.py +++ b/Options.py @@ -146,8 +146,10 @@ class Logic(Choice): option_no_glitches = 0 option_minor_glitches = 1 option_overworld_glitches = 2 + option_hybrid_major_glitches = 3 option_no_logic = 4 alias_owg = 2 + alias_hmg = 3 class Objective(Choice): diff --git a/worlds/alttp/ItemPool.py b/worlds/alttp/ItemPool.py index d03b686b..a42598d1 100644 --- a/worlds/alttp/ItemPool.py +++ b/worlds/alttp/ItemPool.py @@ -571,7 +571,7 @@ def get_pool_core(world, player: int): return world.random.choice([True, False]) if progressive == 'random' else progressive == 'on' # provide boots to major glitch dependent seeds - if logic in {'owglitches', 'nologic'} and world.glitch_boots[player] and goal != 'icerodhunt': + if logic in {'owglitches', 'hybridglitches', 'nologic'} and world.glitch_boots[player] and goal != 'icerodhunt': precollected_items.append('Pegasus Boots') pool.remove('Pegasus Boots') pool.append('Rupees (20)') diff --git a/worlds/alttp/Rules.py b/worlds/alttp/Rules.py index faf37308..d2c9ac49 100644 --- a/worlds/alttp/Rules.py +++ b/worlds/alttp/Rules.py @@ -47,12 +47,17 @@ def set_rules(world, player): if world.logic[player] == 'noglitches': no_glitches_rules(world, player) - elif world.logic[player] in ['owglitches', 'nologic']: + elif world.logic[player] == 'owglitches': # Initially setting no_glitches_rules to set the baseline rules for some # entrances. The overworld_glitches_rules set is primarily additive. no_glitches_rules(world, player) fake_flipper_rules(world, player) overworld_glitches_rules(world, player) + elif world.logic[player] in ['hybridglitches', 'nologic']: + no_glitches_rules(world, player) + fake_flipper_rules(world, player) + overworld_glitches_rules(world, player) + underworld_glitches_rules(world, player) elif world.logic[player] == 'minorglitches': no_glitches_rules(world, player) fake_flipper_rules(world, player) @@ -75,7 +80,8 @@ def set_rules(world, player): set_inverted_big_bomb_rules(world, player) # if swamp and dam have not been moved we require mirror for swamp palace - if not world.swamp_patch_required[player]: + # however there is mirrorless swamp in hybrid MG, so we don't necessarily want this. HMG handles this requirement itself. + if not world.swamp_patch_required[player] and world.logic[player] not in ['hybridglitches', 'nologic']: add_rule(world.get_entrance('Swamp Palace Moat', player), lambda state: state.has('Magic Mirror', player)) # GT Entrance may be required for Turtle Rock for OWG and < 7 required