diff --git a/BaseClasses.py b/BaseClasses.py index d913721d..7f5c25e0 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -1100,7 +1100,7 @@ class CollectionState(object): new_locations = True while new_locations: reachable_events = [location for location in locations if location.event and - (not key_only or (self.world.keyshuffle[location.item.player] in ['none', 'district'] and location.item.smallkey) or (self.world.bigkeyshuffle[location.item.player] in ['none', 'district'] and location.item.bigkey)) + (not key_only or (self.world.keyshuffle[location.item.player] in ['none', 'nearby'] and location.item.smallkey) or (self.world.bigkeyshuffle[location.item.player] in ['none', 'nearby'] and location.item.bigkey)) and location.can_reach(self)] reachable_events = self._do_not_flood_the_keys(reachable_events) new_locations = False @@ -2806,11 +2806,11 @@ class Item(object): or (self.map and world.mapshuffle[self.player] == 'none')) def is_near_dungeon_item(self, world): - return ((self.prize and world.prizeshuffle[self.player] == 'district') - or (self.smallkey and world.keyshuffle[self.player] == 'district') - or (self.bigkey and world.bigkeyshuffle[self.player] == 'district') - or (self.compass and world.compassshuffle[self.player] == 'district') - or (self.map and world.mapshuffle[self.player] == 'district')) + return ((self.prize and world.prizeshuffle[self.player] == 'nearby') + or (self.smallkey and world.keyshuffle[self.player] == 'nearby') + or (self.bigkey and world.bigkeyshuffle[self.player] == 'nearby') + or (self.compass and world.compassshuffle[self.player] == 'nearby') + or (self.map and world.mapshuffle[self.player] == 'nearby')) def get_map_location(self): if self.location: @@ -3644,10 +3644,10 @@ counter_mode = {"default": 0, "off": 1, "on": 2, "pickup": 3} access_mode = {"items": 0, "locations": 1, "none": 2} # byte 7: MMCC SSBB (maps, compass, small, big) -mapshuffle_mode = {'none': 0, 'off': 0, 'district': 2, 'wild': 3, 'on': 3} -compassshuffle_mode = {'none': 0, 'off': 0, 'district': 2, 'wild': 3, 'on': 3} -keyshuffle_mode = {'none': 0, 'off': 0, 'universal': 1, 'district': 2, 'wild': 3, 'on': 3} -bigkeyshuffle_mode = {'none': 0, 'off': 0, 'district': 2, 'wild': 3, 'on': 3} +mapshuffle_mode = {'none': 0, 'off': 0, 'nearby': 2, 'wild': 3, 'on': 3} +compassshuffle_mode = {'none': 0, 'off': 0, 'nearby': 2, 'wild': 3, 'on': 3} +keyshuffle_mode = {'none': 0, 'off': 0, 'universal': 1, 'nearby': 2, 'wild': 3, 'on': 3} +bigkeyshuffle_mode = {'none': 0, 'off': 0, 'nearby': 2, 'wild': 3, 'on': 3} # byte 8: HHHD DPEE (enemy_health, enemy_dmg, potshuffle, enemies) e_health = {"default": 0, "easy": 1, "normal": 2, "hard": 3, "expert": 4} @@ -3673,7 +3673,7 @@ flutespot_mode = {"vanilla": 0, "balanced": 1, "random": 2} flute_mode = {'normal': 0, 'active': 1} bow_mode = {'progressive': 0, 'silvers': 1, 'retro': 2, 'retro_silvers': 3} # reserved 8 modes? take_any_mode = {'none': 0, 'random': 1, 'fixed': 2} -prizeshuffle_mode = {'none': 0, 'dungeon': 1, 'district': 2, 'wild': 3} +prizeshuffle_mode = {'none': 0, 'dungeon': 1, 'nearby': 2, 'wild': 3} # additions # byte 14: POOT TKKK (pseudoboots, overworld_map, trap_door_mode, key_logic_algo) diff --git a/Fill.py b/Fill.py index df7cadaf..ce4feb87 100644 --- a/Fill.py +++ b/Fill.py @@ -36,7 +36,7 @@ def dungeon_tracking(world): for dungeon in world.dungeons: layout = world.dungeon_layouts[dungeon.player][dungeon.name] layout.dungeon_items = len([i for i in dungeon.all_items if i.is_inside_dungeon_item(world)]) - if world.prizeshuffle[dungeon.player] in ['dungeon', 'district'] and not dungeon.prize: + if world.prizeshuffle[dungeon.player] in ['dungeon', 'nearby'] and not dungeon.prize: from Dungeons import dungeon_table if dungeon_table[dungeon.name].prize: layout.dungeon_items += 1 @@ -51,7 +51,7 @@ def fill_dungeons_restrictive(world, shuffled_locations): or (item.smallkey and world.keyshuffle[item.player] != 'none') or (item.bigkey and world.bigkeyshuffle[item.player] != 'none')): item.advancement = True - elif (item.map and world.mapshuffle[item.player] not in ['none', 'district']) or (item.compass and world.compassshuffle[item.player] not in ['none', 'district']): + elif (item.map and world.mapshuffle[item.player] not in ['none', 'nearby']) or (item.compass and world.compassshuffle[item.player] not in ['none', 'nearby']): item.priority = True dungeon_items = [item for item in get_dungeon_item_pool(world) if item.is_inside_dungeon_item(world) or item.is_near_dungeon_item(world)] @@ -81,7 +81,7 @@ def fill_dungeons_restrictive(world, shuffled_locations): for attempt in range(15): try: for player in range(1, world.players + 1): - if world.prizeshuffle[player] == 'district': + if world.prizeshuffle[player] == 'nearby': dungeon_pool = [] for dungeon in world.dungeons: from Dungeons import dungeon_table diff --git a/ItemList.py b/ItemList.py index 5727c523..36f9b6c1 100644 --- a/ItemList.py +++ b/ItemList.py @@ -348,11 +348,11 @@ def generate_itempool(world, player): world.treasure_hunt_icon[player] = 'Triforce Piece' world.itempool.extend([item for item in get_dungeon_item_pool(world) if item.player == player - and ((item.prize and world.prizeshuffle[player] not in ['none', 'dungeon', 'district']) - or (item.smallkey and world.keyshuffle[player] not in ['none', 'district']) - or (item.bigkey and world.bigkeyshuffle[player] not in ['none', 'district']) - or (item.map and world.mapshuffle[player] not in ['none', 'district']) - or (item.compass and world.compassshuffle[player] not in ['none', 'district']))]) + and ((item.prize and world.prizeshuffle[player] not in ['none', 'dungeon', 'nearby']) + or (item.smallkey and world.keyshuffle[player] not in ['none', 'nearby']) + or (item.bigkey and world.bigkeyshuffle[player] not in ['none', 'nearby']) + or (item.map and world.mapshuffle[player] not in ['none', 'nearby']) + or (item.compass and world.compassshuffle[player] not in ['none', 'nearby']))]) if world.logic[player] == 'hybridglitches' and world.pottery[player] not in ['none', 'cave']: keys_to_remove = 2 diff --git a/Rom.py b/Rom.py index c39c3f58..53e889de 100644 --- a/Rom.py +++ b/Rom.py @@ -1278,28 +1278,28 @@ def patch_rom(world, rom, player, team, is_mystery=False): # m - enabled for inside maps # c - enabled for inside compasses # s - enabled for inside small keys - free_item_text = 0x40 if 'district' in [world.mapshuffle[player], world.compassshuffle[player], world.keyshuffle[player], world.bigkeyshuffle[player]] else 0x00 + free_item_text = 0x40 if 'nearby' in [world.mapshuffle[player], world.compassshuffle[player], world.keyshuffle[player], world.bigkeyshuffle[player]] else 0x00 rom.write_byte(0x18016A, free_item_text | 0x10 | ((0x20 if world.prizeshuffle[player] not in ['none', 'dungeon'] else 0x00) | (0x01 if world.keyshuffle[player] not in ['none', 'universal'] else 0x00) | (0x02 if world.compassshuffle[player] != 'none' else 0x00) | (0x04 if world.mapshuffle[player] != 'none' else 0x00) | (0x08 if world.bigkeyshuffle[player] != 'none' else 0x00))) # free roaming item text boxes - rom.write_byte(0x18003B, 0x01 if world.mapshuffle[player] not in ['none', 'district'] else 0x00) # maps showing crystals on overworld + rom.write_byte(0x18003B, 0x01 if world.mapshuffle[player] not in ['none', 'nearby'] else 0x00) # maps showing crystals on overworld # compasses showing dungeon count - compass_mode = 0x80 if world.compassshuffle[player] not in ['none', 'district'] else 0x00 + compass_mode = 0x80 if world.compassshuffle[player] not in ['none', 'nearby'] else 0x00 if world.clock_mode != 'none' or world.dungeon_counters[player] == 'off': pass elif world.dungeon_counters[player] == 'on': compass_mode |= 0x02 # always on - elif (world.compassshuffle[player] not in ['none', 'district'] or world.doorShuffle[player] != 'vanilla' or world.dropshuffle[player] != 'none' + elif (world.compassshuffle[player] not in ['none', 'nearby'] or world.doorShuffle[player] != 'vanilla' or world.dropshuffle[player] != 'none' or world.dungeon_counters[player] == 'pickup' or world.pottery[player] not in ['none', 'cave']): compass_mode |= 0x01 # show on pickup if world.overworld_map[player] == 'map': compass_mode |= 0x10 # show icon if map is collected elif world.overworld_map[player] == 'compass': compass_mode |= 0x20 # show icon if compass is collected - if world.prizeshuffle[player] not in ['none', 'dungeon', 'district']: + if world.prizeshuffle[player] not in ['none', 'dungeon', 'nearby']: compass_mode |= 0x40 # show icon if boss is defeated, hide if collected rom.write_byte(0x18003C, compass_mode) @@ -1335,7 +1335,7 @@ def patch_rom(world, rom, player, team, is_mystery=False): map_index = max(0, dungeon_index - 2) # write out dislocated coords - if map_index >= 0x02 and map_index < 0x18 and (world.overworld_map[player] != 'default' or world.prizeshuffle[player] not in ['none', 'dungeon', 'district']): + if map_index >= 0x02 and map_index < 0x18 and (world.overworld_map[player] != 'default' or world.prizeshuffle[player] not in ['none', 'dungeon', 'nearby']): owid_map = [0x1E, 0x30, 0xFF, 0x7B, 0x5E, 0x70, 0x40, 0x75, 0x03, 0x58, 0x47] x_map_position_generic = [0x03c0, 0x0740, 0xff00, 0x03c0, 0x01c0, 0x0bc0, 0x05c0, 0x09c0, 0x0ac0, 0x07c0, 0x0dc0] y_map_position_generic = [0xff00, 0xff00, 0xff00, 0x0fc0, 0x0fc0, 0x0fc0, 0x0fc0, 0x0fc0, 0xff00, 0x0fc0, 0x0fc0] @@ -1349,7 +1349,7 @@ def patch_rom(world, rom, player, team, is_mystery=False): write_int16(rom, snes_to_pc(0x0ABE2E)+(map_index*6)+6, y_map_position_generic[idx]) # write out icon coord data - if world.prizeshuffle[player] not in ['none', 'dungeon', 'district'] and dungeon_table[dungeon].prize: + if world.prizeshuffle[player] not in ['none', 'dungeon', 'nearby'] and dungeon_table[dungeon].prize: dungeon_obj = world.get_dungeon(dungeon, player) entrance = dungeon_obj.prize.get_map_location() coords = get_entrance_coords(entrance) @@ -1389,7 +1389,7 @@ def patch_rom(world, rom, player, team, is_mystery=False): # figure out compass entrances and what world (light/dark) write_int16s(rom, snes_to_pc(0x0ABE2E)+(map_index*6), coords) - if world.prizeshuffle[player] in ['none', 'dungeon', 'district'] and dungeon_table[dungeon].prize: + if world.prizeshuffle[player] in ['none', 'dungeon', 'nearby'] and dungeon_table[dungeon].prize: # prize location write_int16s(rom, snes_to_pc(0x0ABE2E)+(map_index*6)+8, coords) @@ -1428,7 +1428,7 @@ def patch_rom(world, rom, player, team, is_mystery=False): # b - Big Key # a - Small Key # - enable_menu_map_check = (world.overworld_map[player] != 'default' and world.shuffle[player] != 'vanilla') or world.prizeshuffle[player] not in ['none', 'dungeon', 'district'] + enable_menu_map_check = (world.overworld_map[player] != 'default' and world.shuffle[player] != 'vanilla') or world.prizeshuffle[player] not in ['none', 'dungeon', 'nearby'] rom.write_byte(0x180045, ((0x01 if world.keyshuffle[player] not in ['none', 'universal'] else 0x00) | (0x02 if world.bigkeyshuffle[player] != 'none' else 0x00) | (0x04 if world.mapshuffle[player] != 'none' or enable_menu_map_check else 0x00) @@ -2331,7 +2331,7 @@ def write_strings(rom, world, player, team): (crystal5, crystal6, greenpendant) = tuple([x.parent_region.dungeon.name for x in [crystal5, crystal6, greenpendant]]) tt['bomb_shop'] = 'Big Bomb?\nMy supply is blocked until you clear %s and %s.' % (crystal5, crystal6) tt['sahasrahla_bring_courage'] = 'I lost my family heirloom in %s' % greenpendant - elif world.prizeshuffle[player] == 'district': + elif world.prizeshuffle[player] == 'nearby': (crystal5, crystal6, greenpendant) = tuple([x.item.dungeon_object.name for x in [crystal5, crystal6, greenpendant]]) tt['bomb_shop'] = 'Big Bomb?\nThe crystals can be found near %s and %s.' % (crystal5, crystal6) tt['sahasrahla_bring_courage'] = 'I lost my family heirloom near %s' % greenpendant diff --git a/mystery_example.yml b/mystery_example.yml index 8fde1fa0..cdff6bb1 100644 --- a/mystery_example.yml +++ b/mystery_example.yml @@ -151,7 +151,7 @@ prize_shuffle: none: 1 dungeon: 1 - district: 1 + nearby: 1 wild: 1 dungeon_items: standard: 10 @@ -162,20 +162,20 @@ # for use when you aren't using the dungeon_items above # map_shuffle: # none: 1 - # district: 1 + # nearby: 1 # wild: 1 # compass_shuffle: # none: 1 - # district: 1 + # nearby: 1 # wild: 1 # smallkey_shuffle: # none: 5 - # district: 1 + # nearby: 1 # wild: 1 # universal: 1 # bigkey_shuffle: # none: 1 - # district: 1 + # nearby: 1 # wild: 1 dungeon_counters: on: 5