Change hint for shop items to be "for sale"
Lock Dungeon Prizes, as they're not supposed to be moved by any swapping mechanic
This commit is contained in:
parent
c0cdeef67a
commit
e8a57a4d24
|
@ -452,9 +452,11 @@ class World(object):
|
||||||
"""Check if accessibility rules are fulfilled with current or supplied state."""
|
"""Check if accessibility rules are fulfilled with current or supplied state."""
|
||||||
if not state:
|
if not state:
|
||||||
state = CollectionState(self)
|
state = CollectionState(self)
|
||||||
players = {}
|
players = {"none" : set(),
|
||||||
|
"items": set(),
|
||||||
|
"locations": set()}
|
||||||
for player, access in self.accessibility.items():
|
for player, access in self.accessibility.items():
|
||||||
players.setdefault(access, set()).add(player)
|
players[access].add(player)
|
||||||
|
|
||||||
beatable_fulfilled = False
|
beatable_fulfilled = False
|
||||||
|
|
||||||
|
|
|
@ -619,7 +619,7 @@ def fill_prizes(world, attempts=15):
|
||||||
prize_locs = list(empty_crystal_locations)
|
prize_locs = list(empty_crystal_locations)
|
||||||
world.random.shuffle(prizepool)
|
world.random.shuffle(prizepool)
|
||||||
world.random.shuffle(prize_locs)
|
world.random.shuffle(prize_locs)
|
||||||
fill_restrictive(world, all_state, prize_locs, prizepool, True)
|
fill_restrictive(world, all_state, prize_locs, prizepool, True, lock=True)
|
||||||
except FillError as e:
|
except FillError as e:
|
||||||
logging.getLogger('').exception("Failed to place dungeon prizes (%s). Will retry %s more times", e,
|
logging.getLogger('').exception("Failed to place dungeon prizes (%s). Will retry %s more times", e,
|
||||||
attempts - attempt)
|
attempts - attempt)
|
||||||
|
|
6
Main.py
6
Main.py
|
@ -218,7 +218,7 @@ def main(args, seed=None):
|
||||||
|
|
||||||
if shop_slots:
|
if shop_slots:
|
||||||
# TODO: allow each game to register a blacklist to be used here?
|
# TODO: allow each game to register a blacklist to be used here?
|
||||||
blacklist_words = {"Rupee", "Pendant", "Crystal"}
|
blacklist_words = {"Rupee"}
|
||||||
blacklist_words = {item_name for item_name in item_table if any(
|
blacklist_words = {item_name for item_name in item_table if any(
|
||||||
blacklist_word in item_name for blacklist_word in blacklist_words)}
|
blacklist_word in item_name for blacklist_word in blacklist_words)}
|
||||||
blacklist_words.add("Bee")
|
blacklist_words.add("Bee")
|
||||||
|
@ -238,12 +238,14 @@ def main(args, seed=None):
|
||||||
if shop.can_push_inventory(slot_num):
|
if shop.can_push_inventory(slot_num):
|
||||||
for c in candidates: # chosen item locations
|
for c in candidates: # chosen item locations
|
||||||
if c.item_rule(location.item) and location.item_rule(c.item): # if rule is good...
|
if c.item_rule(location.item) and location.item_rule(c.item): # if rule is good...
|
||||||
logger.debug(f'Swapping {c} into {location}:: {c.item}')
|
|
||||||
swap_location_item(c, location, check_locked=False)
|
swap_location_item(c, location, check_locked=False)
|
||||||
candidates.remove(c)
|
candidates.remove(c)
|
||||||
if not world.fulfills_accessibility():
|
if not world.fulfills_accessibility():
|
||||||
swap_location_item(c, location, check_locked=False)
|
swap_location_item(c, location, check_locked=False)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
logger.debug(f'Swapping {c} into {location}:: {location.item}')
|
||||||
break
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -416,7 +416,8 @@ def create_shops(world, player: int):
|
||||||
if my_shop_slots.pop():
|
if my_shop_slots.pop():
|
||||||
additional_item = 'Rupees (50)' # world.random.choice(['Rupees (50)', 'Rupees (100)', 'Rupees (300)'])
|
additional_item = 'Rupees (50)' # world.random.choice(['Rupees (50)', 'Rupees (100)', 'Rupees (300)'])
|
||||||
slot_name = "{} Slot {}".format(shop.region.name, index + 1)
|
slot_name = "{} Slot {}".format(shop.region.name, index + 1)
|
||||||
loc = Location(player, slot_name, address=shop_table_by_location[slot_name], parent=shop.region)
|
loc = Location(player, slot_name, address=shop_table_by_location[slot_name],
|
||||||
|
parent=shop.region, hint_text="for sale")
|
||||||
loc.shop_slot = True
|
loc.shop_slot = True
|
||||||
loc.locked = True
|
loc.locked = True
|
||||||
loc.item = ItemFactory(additional_item, player)
|
loc.item = ItemFactory(additional_item, player)
|
||||||
|
|
Loading…
Reference in New Issue