Initial Shopsanity
Retro work
This commit is contained in:
86
Regions.py
86
Regions.py
@@ -1,4 +1,5 @@
|
||||
import collections
|
||||
from Items import ItemFactory
|
||||
from BaseClasses import Region, Location, Entrance, RegionType, Shop, ShopType
|
||||
|
||||
|
||||
@@ -38,7 +39,7 @@ def create_regions(world, player):
|
||||
create_cave_region(player, 'Bush Covered House', 'the grass man'),
|
||||
create_cave_region(player, 'Tavern (Front)', 'the tavern'),
|
||||
create_cave_region(player, 'Light World Bomb Hut', 'a restock room'),
|
||||
create_cave_region(player, 'Kakariko Shop', 'a common shop'),
|
||||
create_cave_region(player, 'Kakariko Shop', 'a common shop', ['Kakariko Shop - Left', 'Kakariko Shop - Middle', 'Kakariko Shop - Right']),
|
||||
create_cave_region(player, 'Fortune Teller (Light)', 'a fortune teller'),
|
||||
create_cave_region(player, 'Lake Hylia Fortune Teller', 'a fortune teller'),
|
||||
create_cave_region(player, 'Lumberjack House', 'a boring house'),
|
||||
@@ -78,14 +79,14 @@ def create_regions(world, player):
|
||||
create_cave_region(player, 'Ice Rod Cave', 'a cave with a chest', ['Ice Rod Cave']),
|
||||
create_cave_region(player, 'Good Bee Cave', 'a cold bee'),
|
||||
create_cave_region(player, '20 Rupee Cave', 'a cave with some cash'),
|
||||
create_cave_region(player, 'Cave Shop (Lake Hylia)', 'a common shop'),
|
||||
create_cave_region(player, 'Cave Shop (Dark Death Mountain)', 'a common shop'),
|
||||
create_cave_region(player, 'Cave Shop (Lake Hylia)', 'a common shop', ['Lake Hylia Shop - Left', 'Lake Hylia Shop - Middle', 'Lake Hylia Shop - Right']),
|
||||
create_cave_region(player, 'Cave Shop (Dark Death Mountain)', 'a common shop', ['Dark Death Mountain Shop - Left', 'Dark Death Mountain Shop - Middle', 'Dark Death Mountain Shop - Right']),
|
||||
create_cave_region(player, 'Bonk Rock Cave', 'a cave with a chest', ['Bonk Rock Cave']),
|
||||
create_cave_region(player, 'Library', 'the library', ['Library']),
|
||||
create_cave_region(player, 'Kakariko Gamble Game', 'a game of chance'),
|
||||
create_cave_region(player, 'Potion Shop', 'the potion shop', ['Potion Shop']),
|
||||
create_lw_region(player, 'Lake Hylia Island', ['Lake Hylia Island']),
|
||||
create_cave_region(player, 'Capacity Upgrade', 'the queen of fairies'),
|
||||
create_cave_region(player, 'Capacity Upgrade', 'the queen of fairies', ['Capacity Upgrade - Left', 'Capacity Upgrade - Right']),
|
||||
create_cave_region(player, 'Two Brothers House', 'a connector', None, ['Two Brothers House Exit (East)', 'Two Brothers House Exit (West)']),
|
||||
create_lw_region(player, 'Maze Race Ledge', ['Maze Race'], ['Two Brothers House (West)']),
|
||||
create_cave_region(player, '50 Rupee Cave', 'a cave with some cash'),
|
||||
@@ -122,7 +123,7 @@ def create_regions(world, player):
|
||||
'Paradox Cave Upper - Right'],
|
||||
['Paradox Cave Push Block', 'Paradox Cave Bomb Jump']),
|
||||
create_cave_region(player, 'Paradox Cave', 'a connector', None, ['Paradox Cave Exit (Middle)', 'Paradox Cave Exit (Top)', 'Paradox Cave Drop']),
|
||||
create_cave_region(player, 'Light World Death Mountain Shop', 'a common shop'),
|
||||
create_cave_region(player, 'Light World Death Mountain Shop', 'a common shop', ['Paradox Shop - Left', 'Paradox Shop - Middle', 'Paradox Shop - Right']),
|
||||
create_lw_region(player, 'East Death Mountain (Top)', None, ['Paradox Cave (Top)', 'Death Mountain (Top)', 'Spiral Cave Ledge Access', 'East Death Mountain Drop', 'Turtle Rock Teleporter', 'Fairy Ascension Ledge']),
|
||||
create_lw_region(player, 'Spiral Cave Ledge', None, ['Spiral Cave', 'Spiral Cave Ledge Drop']),
|
||||
create_cave_region(player, 'Spiral Cave (Top)', 'a connector', ['Spiral Cave'], ['Spiral Cave (top to bottom)', 'Spiral Cave Exit (Top)']),
|
||||
@@ -157,16 +158,16 @@ def create_regions(world, player):
|
||||
create_dw_region(player, 'Hammer Peg Area', ['Dark Blacksmith Ruins'], ['Bat Cave Drop Ledge Mirror Spot', 'Dark World Hammer Peg Cave', 'Peg Area Rocks']),
|
||||
create_dw_region(player, 'Bumper Cave Entrance', None, ['Bumper Cave (Bottom)', 'Bumper Cave Entrance Mirror Spot', 'Bumper Cave Entrance Drop']),
|
||||
create_cave_region(player, 'Fortune Teller (Dark)', 'a fortune teller'),
|
||||
create_cave_region(player, 'Village of Outcasts Shop', 'a common shop'),
|
||||
create_cave_region(player, 'Dark Lake Hylia Shop', 'a common shop'),
|
||||
create_cave_region(player, 'Dark World Lumberjack Shop', 'a common shop'),
|
||||
create_cave_region(player, 'Dark World Potion Shop', 'a common shop'),
|
||||
create_cave_region(player, 'Village of Outcasts Shop', 'a common shop', ['Village of Outcasts Shop - Left', 'Village of Outcasts Shop - Middle', 'Village of Outcasts Shop - Right']),
|
||||
create_cave_region(player, 'Dark Lake Hylia Shop', 'a common shop', ['Dark Lake Hylia Shop - Left', 'Dark Lake Hylia Shop - Middle', 'Dark Lake Hylia Shop - Right']),
|
||||
create_cave_region(player, 'Dark World Lumberjack Shop', 'a common shop', ['Dark Lumberjack Shop - Left', 'Dark Lumberjack Shop - Middle', 'Dark Lumberjack Shop - Right']),
|
||||
create_cave_region(player, 'Dark World Potion Shop', 'a common shop', ['Dark Potion Shop - Left', 'Dark Potion Shop - Middle', 'Dark Potion Shop - Right']),
|
||||
create_cave_region(player, 'Dark World Hammer Peg Cave', 'a cave with an item', ['Peg Cave']),
|
||||
create_cave_region(player, 'Pyramid Fairy', 'a cave with two chests', ['Pyramid Fairy - Left', 'Pyramid Fairy - Right']),
|
||||
create_cave_region(player, 'Brewery', 'a house with a chest', ['Brewery']),
|
||||
create_cave_region(player, 'C-Shaped House', 'a house with a chest', ['C-Shaped House']),
|
||||
create_cave_region(player, 'Chest Game', 'a game of 16 chests', ['Chest Game']),
|
||||
create_cave_region(player, 'Red Shield Shop', 'the rare shop'),
|
||||
create_cave_region(player, 'Red Shield Shop', 'the rare shop', ['Red Shield Shop - Left', 'Red Shield Shop - Middle', 'Red Shield Shop - Right']),
|
||||
create_cave_region(player, 'Dark Sanctuary Hint', 'a storyteller'),
|
||||
create_cave_region(player, 'Bumper Cave', 'a connector', None, ['Bumper Cave Exit (Bottom)', 'Bumper Cave Exit (Top)']),
|
||||
create_dw_region(player, 'Bumper Cave Ledge', ['Bumper Cave Ledge'], ['Bumper Cave Ledge Drop', 'Bumper Cave (Top)', 'Bumper Cave Ledge Mirror Spot']),
|
||||
@@ -857,6 +858,7 @@ def mark_light_world_regions(world, player):
|
||||
|
||||
|
||||
def create_shops(world, player):
|
||||
world.shops[player] = []
|
||||
for region_name, (room_id, type, shopkeeper, custom, locked, inventory) in shop_table.items():
|
||||
if world.mode[player] == 'inverted' and region_name == 'Dark Lake Hylia Shop':
|
||||
locked = True
|
||||
@@ -864,9 +866,16 @@ def create_shops(world, player):
|
||||
region = world.get_region(region_name, player)
|
||||
shop = Shop(region, room_id, type, shopkeeper, custom, locked)
|
||||
region.shop = shop
|
||||
world.shops.append(shop)
|
||||
world.shops[player].append(shop)
|
||||
for index, item in enumerate(inventory):
|
||||
shop.add_inventory(index, *item)
|
||||
if not world.shopsanity[player]:
|
||||
if region_name in shop_to_location_table.keys():
|
||||
for index, location in enumerate(shop_to_location_table[region_name]):
|
||||
loc = world.get_location(location, player)
|
||||
loc.skip = True
|
||||
loc.forced_item = loc.item = ItemFactory(shop.inventory[index]['item'], player)
|
||||
loc.item.location = loc
|
||||
|
||||
|
||||
def adjust_locations(world, player):
|
||||
@@ -909,6 +918,29 @@ shop_table = {
|
||||
'Capacity Upgrade': (0x0115, ShopType.UpgradeShop, 0x04, True, True, [('Bomb Upgrade (+5)', 100, 7), ('Arrow Upgrade (+5)', 100, 7)])
|
||||
}
|
||||
|
||||
|
||||
shop_to_location_table = {
|
||||
'Cave Shop (Dark Death Mountain)': ['Dark Death Mountain Shop - Left', 'Dark Death Mountain Shop - Middle', 'Dark Death Mountain Shop - Right'],
|
||||
'Red Shield Shop': ['Red Shield Shop - Left', 'Red Shield Shop - Middle', 'Red Shield Shop - Right'],
|
||||
'Dark Lake Hylia Shop': ['Dark Lake Hylia Shop - Left', 'Dark Lake Hylia Shop - Middle', 'Dark Lake Hylia Shop - Right'],
|
||||
'Dark World Lumberjack Shop': ['Dark Lumberjack Shop - Left', 'Dark Lumberjack Shop - Middle', 'Dark Lumberjack Shop - Right'],
|
||||
'Village of Outcasts Shop': ['Village of Outcasts Shop - Left', 'Village of Outcasts Shop - Middle', 'Village of Outcasts Shop - Right'],
|
||||
'Dark World Potion Shop': ['Dark Potion Shop - Left', 'Dark Potion Shop - Middle', 'Dark Potion Shop - Right'],
|
||||
'Light World Death Mountain Shop': ['Paradox Shop - Left', 'Paradox Shop - Middle', 'Paradox Shop - Right'],
|
||||
'Kakariko Shop': ['Kakariko Shop - Left', 'Kakariko Shop - Middle', 'Kakariko Shop - Right'],
|
||||
'Cave Shop (Lake Hylia)': ['Lake Hylia Shop - Left', 'Lake Hylia Shop - Middle', 'Lake Hylia Shop - Right'],
|
||||
'Capacity Upgrade': ['Capacity Upgrade - Left', 'Capacity Upgrade - Right'],
|
||||
}
|
||||
|
||||
retro_shops = {
|
||||
'Old Man Sword Cave': ['Old Man Sword Cave Item 1'],
|
||||
'Take-Any #1': ['Take-Any #1 Item 1', 'Take-Any #1 Item 2'],
|
||||
'Take-Any #2': ['Take-Any #2 Item 1', 'Take-Any #2 Item 2'],
|
||||
'Take-Any #3': ['Take-Any #3 Item 1', 'Take-Any #3 Item 2'],
|
||||
'Take-Any #4': ['Take-Any #4 Item 1', 'Take-Any #4 Item 2'],
|
||||
}
|
||||
|
||||
|
||||
key_drop_data = {
|
||||
'Hyrule Castle - Map Guard Key Drop': [0x140036, 0x140037, 'in Hyrule Castle', 'Small Key (Escape)'],
|
||||
'Hyrule Castle - Boomerang Guard Key Drop': [0x140033, 0x140034, 'in Hyrule Castle', 'Small Key (Escape)'],
|
||||
@@ -1202,7 +1234,37 @@ location_table = {'Mushroom': (0x180013, 0x186338, False, 'in the woods'),
|
||||
'Skull Woods - Prize': ([0x120A3, 0x53F12, 0x53F13, 0x180058, 0x18007B, 0xC704], None, True, 'Skull Woods'),
|
||||
'Ice Palace - Prize': ([0x120A4, 0x53F5A, 0x53F5B, 0x180059, 0x180073, 0xC705], None, True, 'Ice Palace'),
|
||||
'Misery Mire - Prize': ([0x120A2, 0x53F48, 0x53F49, 0x180057, 0x180075, 0xC703], None, True, 'Misery Mire'),
|
||||
'Turtle Rock - Prize': ([0x120A7, 0x53F24, 0x53F25, 0x18005C, 0x180079, 0xC708], None, True, 'Turtle Rock')}
|
||||
'Turtle Rock - Prize': ([0x120A7, 0x53F24, 0x53F25, 0x18005C, 0x180079, 0xC708], None, True, 'Turtle Rock'),
|
||||
'Kakariko Shop - Left': (None, None, False, 'for sale in Kakariko'),
|
||||
'Kakariko Shop - Middle': (None, None, False, 'for sale in Kakariko'),
|
||||
'Kakariko Shop - Right': (None, None, False, 'for sale in Kakariko'),
|
||||
'Lake Hylia Shop - Left': (None, None, False, 'for sale near the lake'),
|
||||
'Lake Hylia Shop - Middle': (None, None, False, 'for sale near the lake'),
|
||||
'Lake Hylia Shop - Right': (None, None, False, 'for sale near the lake'),
|
||||
'Paradox Shop - Left': (None, None, False, 'for sale near seven chests'),
|
||||
'Paradox Shop - Middle': (None, None, False, 'for sale near seven chests'),
|
||||
'Paradox Shop - Right': (None, None, False, 'for sale near seven chests'),
|
||||
'Capacity Upgrade - Left': (None, None, False, 'for sale near the queen'),
|
||||
'Capacity Upgrade - Right': (None, None, False, 'for sale near the queen'),
|
||||
'Village of Outcasts Shop - Left': (None, None, False, 'for sale near outcasts'),
|
||||
'Village of Outcasts Shop - Middle': (None, None, False, 'for sale near outcasts'),
|
||||
'Village of Outcasts Shop - Right': (None, None, False, 'for sale near outcasts'),
|
||||
'Dark Lumberjack Shop - Left': (None, None, False, 'for sale in the far north'),
|
||||
'Dark Lumberjack Shop - Middle': (None, None, False, 'for sale in the far north'),
|
||||
'Dark Lumberjack Shop - Right': (None, None, False, 'for sale in the far north'),
|
||||
'Dark Lake Hylia Shop - Left': (None, None, False, 'for sale near the dark lake'),
|
||||
'Dark Lake Hylia Shop - Middle': (None, None, False, 'for sale near the dark lake'),
|
||||
'Dark Lake Hylia Shop - Right': (None, None, False, 'for sale near the dark lake'),
|
||||
'Dark Potion Shop - Left': (None, None, False, 'for sale near a catfish'),
|
||||
'Dark Potion Shop - Middle': (None, None, False, 'for sale near a catfish'),
|
||||
'Dark Potion Shop - Right': (None, None, False, 'for sale near a catfish'),
|
||||
'Dark Death Mountain Shop - Left': (None, None, False, 'for sale on the dark mountain'),
|
||||
'Dark Death Mountain Shop - Middle': (None, None, False, 'for sale on the dark mountain'),
|
||||
'Dark Death Mountain Shop - Right': (None, None, False, 'for sale on the dark mountain'),
|
||||
'Red Shield Shop - Left': (None, None, False, 'for sale as a curiosity'),
|
||||
'Red Shield Shop - Middle': (None, None, False, 'for sale as a curiosity'),
|
||||
'Red Shield Shop - Right': (None, None, False, 'for sale as a curiosity')
|
||||
}
|
||||
|
||||
lookup_id_to_name = {data[0]: name for name, data in location_table.items() if type(data[0]) == int}
|
||||
lookup_id_to_name = {**lookup_id_to_name, **{data[1]: name for name, data in key_drop_data.items()}}
|
||||
|
||||
Reference in New Issue
Block a user