FFMQ: No Longer Allow Inaccessible Useful Items (#4323)

Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
This commit is contained in:
Exempt-Medic 2024-12-03 16:51:58 -05:00 committed by GitHub
parent ac8a206d46
commit 5b0de6b6c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 8 deletions

View File

@ -211,9 +211,12 @@ def stage_set_rules(multiworld):
# If there's no enemies, there's no repeatable income sources # If there's no enemies, there's no repeatable income sources
no_enemies_players = [player for player in multiworld.get_game_players("Final Fantasy Mystic Quest") no_enemies_players = [player for player in multiworld.get_game_players("Final Fantasy Mystic Quest")
if multiworld.worlds[player].options.enemies_density == "none"] if multiworld.worlds[player].options.enemies_density == "none"]
if (len([item for item in multiworld.itempool if item.classification in (ItemClassification.filler, if (
ItemClassification.trap)]) > len([player for player in no_enemies_players if len([item for item in multiworld.itempool if item.excludable]) >
multiworld.worlds[player].options.accessibility == "minimal"]) * 3): len([player
for player in no_enemies_players
if multiworld.worlds[player].options.accessibility != "minimal"]) * 3
):
for player in no_enemies_players: for player in no_enemies_players:
for location in vendor_locations: for location in vendor_locations:
if multiworld.worlds[player].options.accessibility == "full": if multiworld.worlds[player].options.accessibility == "full":
@ -221,11 +224,8 @@ def stage_set_rules(multiworld):
else: else:
multiworld.get_location(location, player).access_rule = lambda state: False multiworld.get_location(location, player).access_rule = lambda state: False
else: else:
# There are not enough junk items to fill non-minimal players' vendors. Just set an item rule not allowing raise Exception(f"Not enough filler/trap items for FFMQ players with full and items accessibility. "
# advancement items so that useful items can be placed. f"Add more items or change the 'Enemies Density' option to something besides 'none'")
for player in no_enemies_players:
for location in vendor_locations:
multiworld.get_location(location, player).item_rule = lambda item: not item.advancement
class FFMQLocation(Location): class FFMQLocation(Location):