Zero Jumps gen error fix

This commit is contained in:
CookieCat
2023-10-23 22:07:23 -04:00
parent afdcde88ae
commit a3e928d7aa
3 changed files with 11 additions and 8 deletions

View File

@@ -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 = {

View File

@@ -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)

View File

@@ -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):