Spoiler additions for doors
This commit is contained in:
@@ -1027,6 +1027,7 @@ class Spoiler(object):
|
|||||||
def __init__(self, world):
|
def __init__(self, world):
|
||||||
self.world = world
|
self.world = world
|
||||||
self.entrances = OrderedDict()
|
self.entrances = OrderedDict()
|
||||||
|
self.doors = OrderedDict()
|
||||||
self.medallions = {}
|
self.medallions = {}
|
||||||
self.playthrough = {}
|
self.playthrough = {}
|
||||||
self.locations = {}
|
self.locations = {}
|
||||||
@@ -1041,6 +1042,12 @@ class Spoiler(object):
|
|||||||
else:
|
else:
|
||||||
self.entrances[(entrance, direction, player)] = OrderedDict([('player', player), ('entrance', entrance), ('exit', exit), ('direction', direction)])
|
self.entrances[(entrance, direction, player)] = OrderedDict([('player', player), ('entrance', entrance), ('exit', exit), ('direction', direction)])
|
||||||
|
|
||||||
|
def set_door(self, entrance, exit, direction, player):
|
||||||
|
if self.world.players == 1:
|
||||||
|
self.doors[(entrance, direction, player)] = OrderedDict([('entrance', entrance), ('exit', exit), ('direction', direction)])
|
||||||
|
else:
|
||||||
|
self.doors[(entrance, direction, player)] = OrderedDict([('player', player), ('entrance', entrance), ('exit', exit), ('direction', direction)])
|
||||||
|
|
||||||
def parse_data(self):
|
def parse_data(self):
|
||||||
self.medallions = OrderedDict()
|
self.medallions = OrderedDict()
|
||||||
if self.world.players == 1:
|
if self.world.players == 1:
|
||||||
@@ -1135,6 +1142,7 @@ class Spoiler(object):
|
|||||||
self.parse_data()
|
self.parse_data()
|
||||||
out = OrderedDict()
|
out = OrderedDict()
|
||||||
out['Entrances'] = list(self.entrances.values())
|
out['Entrances'] = list(self.entrances.values())
|
||||||
|
out['Doors'] = list(self.doors.values())
|
||||||
out.update(self.locations)
|
out.update(self.locations)
|
||||||
out['Special'] = self.medallions
|
out['Special'] = self.medallions
|
||||||
if self.shops:
|
if self.shops:
|
||||||
@@ -1164,9 +1172,12 @@ class Spoiler(object):
|
|||||||
outfile.write('Menu speed: %s\n' % self.world.fastmenu)
|
outfile.write('Menu speed: %s\n' % self.world.fastmenu)
|
||||||
outfile.write('Keysanity enabled: %s\n' % ('Yes' if self.metadata['keysanity'] else 'No'))
|
outfile.write('Keysanity enabled: %s\n' % ('Yes' if self.metadata['keysanity'] else 'No'))
|
||||||
outfile.write('Players: %d' % self.world.players)
|
outfile.write('Players: %d' % self.world.players)
|
||||||
|
if self.doors:
|
||||||
|
outfile.write('\n\nDoors:\n\n')
|
||||||
|
outfile.write('\n'.join(['%s%s %s %s' % ('Player {0}: '.format(entry['player']) if self.world.players > 1 else '', entry['entrance'], '<=>' if entry['direction'] == 'both' else '<=' if entry['direction'] == 'exit' else '=>', entry['exit']) for entry in self.doors.values()]))
|
||||||
if self.entrances:
|
if self.entrances:
|
||||||
outfile.write('\n\nEntrances:\n\n')
|
outfile.write('\n\nEntrances:\n\n')
|
||||||
outfile.write('\n'.join(['%s%s %s %s' % ('Player {0}: '.format(entry['player']) if self.world.players >1 else '', entry['entrance'], '<=>' if entry['direction'] == 'both' else '<=' if entry['direction'] == 'exit' else '=>', entry['exit']) for entry in self.entrances.values()]))
|
outfile.write('\n'.join(['%s%s %s %s' % ('Player {0}: '.format(entry['player']) if self.world.players > 1 else '', entry['entrance'], '<=>' if entry['direction'] == 'both' else '<=' if entry['direction'] == 'exit' else '=>', entry['exit']) for entry in self.entrances.values()]))
|
||||||
outfile.write('\n\nMedallions\n')
|
outfile.write('\n\nMedallions\n')
|
||||||
if self.world.players == 1:
|
if self.world.players == 1:
|
||||||
outfile.write('\nMisery Mire Medallion: %s' % (self.medallions['Misery Mire']))
|
outfile.write('\nMisery Mire Medallion: %s' % (self.medallions['Misery Mire']))
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ def link_doors(world, player):
|
|||||||
|
|
||||||
# These connection are here because they are currently unable to be shuffled
|
# These connection are here because they are currently unable to be shuffled
|
||||||
for entrance, ext in spiral_staircases:
|
for entrance, ext in spiral_staircases:
|
||||||
connect_two_way(world, entrance, ext, player)
|
connect_two_way(world, entrance, ext, player, True)
|
||||||
for entrance, ext in straight_staircases:
|
for entrance, ext in straight_staircases:
|
||||||
connect_two_way(world, entrance, ext, player)
|
connect_two_way(world, entrance, ext, player, True)
|
||||||
for entrance, ext in open_edges:
|
for entrance, ext in open_edges:
|
||||||
connect_two_way(world, entrance, ext, player)
|
connect_two_way(world, entrance, ext, player, True)
|
||||||
for exitName, regionName in falldown_pits:
|
for exitName, regionName in falldown_pits:
|
||||||
connect_simple_door(world, exitName, regionName, player)
|
connect_simple_door(world, exitName, regionName, player)
|
||||||
for exitName, regionName in dungeon_warps:
|
for exitName, regionName in dungeon_warps:
|
||||||
@@ -27,9 +27,9 @@ def link_doors(world, player):
|
|||||||
|
|
||||||
if world.doorShuffle == 'vanilla':
|
if world.doorShuffle == 'vanilla':
|
||||||
for entrance, ext in default_door_connections:
|
for entrance, ext in default_door_connections:
|
||||||
connect_two_way(world, entrance, ext, player)
|
connect_two_way(world, entrance, ext, player, True)
|
||||||
for ent, ext in default_one_way_connections:
|
for ent, ext in default_one_way_connections:
|
||||||
connect_one_way(world, ent, ext, player)
|
connect_one_way(world, ent, ext, True)
|
||||||
normal_dungeon_pool(world, player)
|
normal_dungeon_pool(world, player)
|
||||||
elif world.doorShuffle == 'basic':
|
elif world.doorShuffle == 'basic':
|
||||||
normal_dungeon_pool(world, player)
|
normal_dungeon_pool(world, player)
|
||||||
@@ -91,7 +91,7 @@ def connect_simple_door(world, exit_name, region_name, player):
|
|||||||
d.dest = region
|
d.dest = region
|
||||||
|
|
||||||
|
|
||||||
def connect_two_way(world, entrancename, exitname, player):
|
def connect_two_way(world, entrancename, exitname, player, skipSpoiler=False):
|
||||||
entrance = world.get_entrance(entrancename, player)
|
entrance = world.get_entrance(entrancename, player)
|
||||||
ext = world.get_entrance(exitname, player)
|
ext = world.get_entrance(exitname, player)
|
||||||
|
|
||||||
@@ -112,10 +112,11 @@ def connect_two_way(world, entrancename, exitname, player):
|
|||||||
x.dest = y
|
x.dest = y
|
||||||
if y is not None:
|
if y is not None:
|
||||||
y.dest = x
|
y.dest = x
|
||||||
# world.spoiler.set_entrance(entrance.name, exit.name, 'both') # todo: spoiler stuff
|
if not skipSpoiler and x is not None and y is not None:
|
||||||
|
world.spoiler.set_door(x.name, y.name, 'both', player)
|
||||||
|
|
||||||
|
|
||||||
def connect_one_way(world, entrancename, exitname, player):
|
def connect_one_way(world, entrancename, exitname, player, skipSpoiler=False):
|
||||||
entrance = world.get_entrance(entrancename, player)
|
entrance = world.get_entrance(entrancename, player)
|
||||||
ext = world.get_entrance(exitname, player)
|
ext = world.get_entrance(exitname, player)
|
||||||
|
|
||||||
@@ -134,7 +135,8 @@ def connect_one_way(world, entrancename, exitname, player):
|
|||||||
x.dest = y
|
x.dest = y
|
||||||
if y is not None:
|
if y is not None:
|
||||||
y.dest = x
|
y.dest = x
|
||||||
# spoiler info goes here?
|
if not skipSpoiler and x is not None and y is not None:
|
||||||
|
world.spoiler.set_door(x.name, y.name, 'entrance', player)
|
||||||
|
|
||||||
|
|
||||||
def within_dungeon(world, player):
|
def within_dungeon(world, player):
|
||||||
|
|||||||
13
Regions.py
13
Regions.py
@@ -413,12 +413,13 @@ def mark_light_world_regions(world):
|
|||||||
current = queue.popleft()
|
current = queue.popleft()
|
||||||
current.is_dark_world = True
|
current.is_dark_world = True
|
||||||
for exit in current.exits:
|
for exit in current.exits:
|
||||||
if exit.connected_region.type == RegionType.LightWorld:
|
if exit.connected_region is not None:
|
||||||
# Don't venture into the light world
|
if exit.connected_region.type == RegionType.LightWorld:
|
||||||
continue
|
# Don't venture into the light world
|
||||||
if exit.connected_region not in seen:
|
continue
|
||||||
seen.add(exit.connected_region)
|
if exit.connected_region not in seen:
|
||||||
queue.append(exit.connected_region)
|
seen.add(exit.connected_region)
|
||||||
|
queue.append(exit.connected_region)
|
||||||
|
|
||||||
# (room_id, shopkeeper, replaceable)
|
# (room_id, shopkeeper, replaceable)
|
||||||
shop_table = {
|
shop_table = {
|
||||||
|
|||||||
Reference in New Issue
Block a user