fix(key logic): typo

This commit is contained in:
aerinon
2023-11-11 20:00:31 -07:00
parent 13f9fe8f92
commit f4a702951c
2 changed files with 69 additions and 66 deletions

View File

@@ -10,7 +10,6 @@ try:
except ImportError: except ImportError:
from enum import IntFlag as FastEnum from enum import IntFlag as FastEnum
from source.classes.BabelFish import BabelFish from source.classes.BabelFish import BabelFish
from EntranceShuffle import door_addresses, indirect_connections from EntranceShuffle import door_addresses, indirect_connections
from Utils import int16_as_bytes from Utils import int16_as_bytes
@@ -94,6 +93,7 @@ class World(object):
for player in range(1, players + 1): for player in range(1, players + 1):
def set_player_attr(attr, val): def set_player_attr(attr, val):
self.__dict__.setdefault(attr, {})[player] = val self.__dict__.setdefault(attr, {})[player] = val
set_player_attr('_region_cache', {}) set_player_attr('_region_cache', {})
set_player_attr('player_names', []) set_player_attr('player_names', [])
set_player_attr('remote_items', False) set_player_attr('remote_items', False)
@@ -1013,7 +1013,6 @@ class CollectionState(object):
self.collect(event.item, True, event) self.collect(event.item, True, event)
new_locations = True new_locations = True
def can_reach_blue(self, region, player): def can_reach_blue(self, region, player):
return region in self.reachable_regions[player] and self.reachable_regions[player][region] in [CrystalBarrier.Blue, CrystalBarrier.Either] return region in self.reachable_regions[player] and self.reachable_regions[player][region] in [CrystalBarrier.Blue, CrystalBarrier.Either]
@@ -1410,6 +1409,7 @@ class CollectionState(object):
raise RuntimeError('Cannot parse %s.' % item) raise RuntimeError('Cannot parse %s.' % item)
@unique @unique
class RegionType(Enum): class RegionType(Enum):
Menu = 0 Menu = 0
@@ -2191,6 +2191,7 @@ class Boss(object):
def can_defeat(self, state): def can_defeat(self, state):
return self.defeat_rule(state, self.player) return self.defeat_rule(state, self.player)
class Location(object): class Location(object):
def __init__(self, player, name='', address=None, crystal=False, hint_text=None, parent=None, forced_item=None, def __init__(self, player, name='', address=None, crystal=False, hint_text=None, parent=None, forced_item=None,
player_address=None, note=None): player_address=None, note=None):
@@ -2353,12 +2354,14 @@ class Item(object):
class Crystal(Item): class Crystal(Item):
pass pass
@unique @unique
class ShopType(Enum): class ShopType(Enum):
Shop = 0 Shop = 0
TakeAny = 1 TakeAny = 1
UpgradeShop = 2 UpgradeShop = 2
class Shop(object): class Shop(object):
def __init__(self, region, room_id, type, shopkeeper_config, custom, locked, sram_address): def __init__(self, region, room_id, type, shopkeeper_config, custom, locked, sram_address):
self.region = region self.region = region
@@ -2783,7 +2786,7 @@ class Spoiler(object):
self.world.fish.translate("meta", "doors", entry['entrance']), self.world.fish.translate("meta", "doors", entry['entrance']),
'<=>' if entry['direction'] == 'both' else '<=' if entry['direction'] == 'exit' else '=>', '<=>' if entry['direction'] == 'both' else '<=' if entry['direction'] == 'exit' else '=>',
self.world.fish.translate("meta", "doors", entry['exit']), self.world.fish.translate("meta", "doors", entry['exit']),
'({0})'.format(entry['dname']) if self.world.doorShuffle[entry['player']] == 'crossed' else '') for '({0})'.format(entry['dname']) if self.world.doorShuffle[entry['player']] != 'basic' else '') for
entry in self.doors.values()])) entry in self.doors.values()]))
if self.lobbies: if self.lobbies:
outfile.write('\n\nDungeon Lobbies:\n\n') outfile.write('\n\nDungeon Lobbies:\n\n')
@@ -2887,6 +2890,7 @@ dungeon_keys = {
'Universal': 'Small Key (Universal)' 'Universal': 'Small Key (Universal)'
} }
class PotItem(FastEnum): class PotItem(FastEnum):
Nothing = 0x0 Nothing = 0x0
OneRupee = 0x1 OneRupee = 0x1
@@ -3008,7 +3012,6 @@ rb_mode = {"none": 0, "mapcompass": 1, "dungeon": 2}
algo_mode = {"balanced": 0, "equitable": 1, "vanilla_fill": 2, "dungeon_only": 3, "district": 4, 'major_only': 5} algo_mode = {"balanced": 0, "equitable": 1, "vanilla_fill": 2, "dungeon_only": 3, "district": 4, 'major_only': 5}
boss_mode = {"none": 0, "simple": 1, "full": 2, "chaos": 3, 'random': 3, 'unique': 4} boss_mode = {"none": 0, "simple": 1, "full": 2, "chaos": 3, 'random': 3, 'unique': 4}
# byte 10: settings_version # byte 10: settings_version
# byte 11: FBBB TTSS (flute_mode, bow_mode, take_any, small_key_mode) # byte 11: FBBB TTSS (flute_mode, bow_mode, take_any, small_key_mode)
flute_mode = {'normal': 0, 'active': 1} flute_mode = {'normal': 0, 'active': 1}

View File

@@ -1800,7 +1800,7 @@ def imp_locations_factory(world, player):
imp_locations = ['Agahnim 1', 'Agahnim 2', 'Attic Cracked Floor', 'Suspicious Maiden'] imp_locations = ['Agahnim 1', 'Agahnim 2', 'Attic Cracked Floor', 'Suspicious Maiden']
if world.mode[player] == 'standard': if world.mode[player] == 'standard':
imp_locations.append('Zelda Pickup') imp_locations.append('Zelda Pickup')
imp_locations.append('Zelda Dropoff') imp_locations.append('Zelda Drop Off')
return imp_locations return imp_locations