VT28 update: Keysanity has dungeon items in normal item pool

This commit is contained in:
Kevin Cathcart 2018-01-02 20:01:16 -05:00
parent 3adf4fadd1
commit e3ac7ee4a6
4 changed files with 20 additions and 2 deletions

View File

@ -145,6 +145,9 @@ class World(object):
ret.clear_cached_unreachable()
return ret
def get_items(self):
return [loc.item for loc in self.get_filled_locations()] + self.itempool
def find_items(self, item):
return [location for location in self.get_locations() if location.item is not None and location.item.name == item]

View File

@ -103,6 +103,8 @@ def fill_dungeons(world):
world.state.clear_cached_unreachable()
def get_dungeon_item_pool(world):
return [item for dungeon in world.dungeons for item in dungeon.all_items if item.key or world.place_dungeon_items]
def fill_dungeons_restrictive(world, shuffled_locations):
all_state_base = world.get_all_state()
@ -112,7 +114,16 @@ def fill_dungeons_restrictive(world, shuffled_locations):
skull_woods_big_chest.event = True
shuffled_locations.remove(skull_woods_big_chest)
dungeon_items = [item for dungeon in world.dungeons for item in dungeon.all_items if item.key or world.place_dungeon_items]
if world.keysanity:
#in keysanity dungeon items are distributed as part of the normal item pool
for item in world.get_items():
if item.key:
item.advancement = True
elif item.map or item.compass:
item.priority = True
return
dungeon_items = get_dungeon_item_pool(world)
# sort in the order Big Key, Small Key, Other before placing dungeon items
sort_order = {"BigKey": 3, "SmallKey": 2}

View File

@ -3,6 +3,7 @@ import random
from Items import ItemFactory
from Fill import fill_restrictive
from Dungeons import get_dungeon_item_pool
#This file sets the item pools for various modes. Timed modes and triforce hunt are enforced first, and then extra items are specified per mode to fill in the remaining space.
#Some basic items that various modes require are placed here, including pendants and crystals. Medallion requirements for the two relevant entrances are also decided.
@ -203,6 +204,9 @@ def generate_itempool(world):
if treasure_hunt_icon is not None:
world.treasure_hunt_icon = treasure_hunt_icon
if world.keysanity:
world.itempool.extend(get_dungeon_item_pool(world))
# shuffle medallions
mm_medallion = ['Ether', 'Quake', 'Bombos'][random.randint(0, 2)]
tr_medallion = ['Ether', 'Quake', 'Bombos'][random.randint(0, 2)]

View File

@ -178,7 +178,7 @@ def create_playthrough(world):
raise RuntimeError('Cannot beat game. Something went terribly wrong here!')
# get locations containing progress items
prog_locations = [location for location in world.get_locations() if location.item is not None and (location.item.advancement or (location.item.key and world.keysanity))]
prog_locations = [location for location in world.get_filled_locations() if location.item.advancement]
collection_spheres = []
state = CollectionState(world)