Skip to content

Commit

Permalink
Cleaned up duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkirby committed Oct 28, 2024
1 parent 3e9cc8d commit 0b32a0d
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions Hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,22 +1149,11 @@ def get_important_check_hint(spoiler: Spoiler, world: World, checked: set[str])
for location in world.get_filled_locations():
region = HintArea.at(location).text(world.settings.clearer_hints)
if region == hint_loc:
if (location.item.majoritem
# exclude locked items
if ((location.item.majoritem or location.item.name in ('Biggoron Sword', 'Double Defense'))
and not location.locked
and not (location.name == 'Song from Impa' and 'Zeldas Letter' in world.settings.starting_items and 'Zeldas Letter' not in world.settings.shuffle_child_trade)
# Special cases where the item is only considered major for important checks hints
or location.item.name == 'Biggoron Sword'
or location.item.name == 'Double Defense'
# Handle make keys not in own dungeon major items
or (location.item.type in ('SmallKey', 'SmallKeyRing') and not (world.settings.shuffle_smallkeys == 'dungeon' or world.settings.shuffle_smallkeys == 'vanilla'))
or (location.item.type in ('HideoutSmallKey', 'HideoutSmallKeyRing') and not world.settings.shuffle_hideoutkeys == 'vanilla')
or (location.item.type in ('TCGSmallKey', 'TCGSmallKeyRing') and not world.settings.shuffle_tcgkeys == 'vanilla')
or (location.item.type == 'BossKey' and not (world.settings.shuffle_bosskeys == 'dungeon' or world.settings.shuffle_bosskeys == 'vanilla'))
or (location.item.type == 'GanonBossKey' and not (world.settings.shuffle_ganon_bosskey == 'vanilla'
or world.settings.shuffle_ganon_bosskey == 'dungeon' or world.settings.shuffle_ganon_bosskey == 'on_lacs'
or world.settings.shuffle_ganon_bosskey == 'stones' or world.settings.shuffle_ganon_bosskey == 'medallions'
or world.settings.shuffle_ganon_bosskey == 'dungeons' or world.settings.shuffle_ganon_bosskey == 'tokens'))):
and not (location.name == 'Song from Impa'
and 'Zeldas Letter' in world.settings.starting_items
and 'Zeldas Letter' not in world.settings.shuffle_child_trade)):
item_count = item_count + 1

checked.add(hint_loc + ' Important Check')
Expand Down

0 comments on commit 0b32a0d

Please sign in to comment.