From a3e928d7aa278b9c3f7785cda15a726d3feb420e Mon Sep 17 00:00:00 2001 From: CookieCat Date: Mon, 23 Oct 2023 22:07:23 -0400 Subject: [PATCH] Zero Jumps gen error fix --- worlds/ahit/Locations.py | 9 ++++++--- worlds/ahit/Rules.py | 7 +++---- worlds/ahit/Types.py | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/worlds/ahit/Locations.py b/worlds/ahit/Locations.py index b398ffbfd2..7825b1fe2d 100644 --- a/worlds/ahit/Locations.py +++ b/worlds/ahit/Locations.py @@ -44,6 +44,8 @@ def location_dlc_enabled(world: World, location: str) -> bool: return True elif data.dlc_flags == HatDLC.death_wish and world.is_dw(): return True + elif data.dlc_flags == HatDLC.dlc1_dw and world.is_dlc1() and world.is_dw(): + return True elif data.dlc_flags == HatDLC.dlc2_dw and world.is_dlc2() and world.is_dw(): return True @@ -70,11 +72,12 @@ def is_location_valid(world: World, location: str) -> bool: return False # No need for all those event items if we're not doing candles - if data.dlc_flags is HatDLC.death_wish or data.dlc_flags is HatDLC.dlc2_dw: + if data.dlc_flags & HatDLC.death_wish: if world.multiworld.DWExcludeCandles[world.player].value > 0 and location in event_locs.keys(): return False - if world.multiworld.DWShuffle[world.player].value > 0 and data.region not in world.get_dw_shuffle(): + if world.multiworld.DWShuffle[world.player].value > 0 \ + and data.region in death_wishes and data.region not in world.get_dw_shuffle(): return False if location in zero_jumps: @@ -720,7 +723,7 @@ zero_jumps_expert = { dlc_flags=HatDLC.death_wish), "Sleepy Subcon (Zero Jumps)": LocData(0, "Sleepy Subcon", required_hats=[HatType.ICE], dlc_flags=HatDLC.death_wish), - "Ship Shape (Zero Jumps)": LocData(0, "Ship Shape", required_hats=[HatType.ICE], dlc_flags=HatDLC.death_wish), + "Ship Shape (Zero Jumps)": LocData(0, "Ship Shape", required_hats=[HatType.ICE], dlc_flags=HatDLC.dlc1_dw), } zero_jumps = { diff --git a/worlds/ahit/Rules.py b/worlds/ahit/Rules.py index ae7aa21243..42bf818114 100644 --- a/worlds/ahit/Rules.py +++ b/worlds/ahit/Rules.py @@ -255,9 +255,8 @@ def set_rules(world: World): if key in contract_locations.keys(): continue - if data.dlc_flags is HatDLC.death_wish or data.dlc_flags is HatDLC.dlc2_dw: - if key in snatcher_coins.keys(): - key = f"{key} ({data.region})" + if data.dlc_flags & HatDLC.death_wish and key in snatcher_coins.keys(): + key = f"{key} ({data.region})" location = world.multiworld.get_location(key, world.player) @@ -929,7 +928,7 @@ def set_event_rules(world: World): if not is_location_valid(world, name): continue - if (data.dlc_flags is HatDLC.death_wish or data.dlc_flags is HatDLC.dlc2_dw) and name in snatcher_coins.keys(): + if data.dlc_flags & HatDLC.death_wish and name in snatcher_coins.keys(): name = f"{name} ({data.region})" event: Location = world.multiworld.get_location(name, world.player) diff --git a/worlds/ahit/Types.py b/worlds/ahit/Types.py index 3e1d01ab61..16255d7ec5 100644 --- a/worlds/ahit/Types.py +++ b/worlds/ahit/Types.py @@ -25,7 +25,8 @@ class HatDLC(IntFlag): dlc1 = 0b001 dlc2 = 0b010 death_wish = 0b100 - dlc2_dw = 0b0110 # for Snatcher Coins in Nyakuza Metro + dlc1_dw = 0b101 + dlc2_dw = 0b110 class ChapterIndex(IntEnum):