Skip to content

Commit

Permalink
ICS no longer implies Low%
Browse files Browse the repository at this point in the history
  • Loading branch information
mauvealerts committed Sep 3, 2022
1 parent 9dcd448 commit cca9fcb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/modlunky2/ui/trackers/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class Label(Enum):
NO_TELEPORTER = LabelMetadata("No TP", start=True)
NO_GOLD = LabelMetadata("No Gold", start=True)
PACIFIST = LabelMetadata("Pacifist", start=True)
ICE_CAVES_SHORTCUT = LabelMetadata("Ice Caves Shortcut")
CHAIN = LabelMetadata("Chain")
LOW = LabelMetadata("Low", start=True, hide_early=False, percent_priority=5)
ICE_CAVES_SHORTCUT = LabelMetadata("Ice Caves Shortcut", percent_priority=0)
NO = LabelMetadata("No", start=True, hide_early=False, percent_priority=5)
ANY = LabelMetadata(
"Any", start=True, hide_early=False, percent_priority=4, terminus=True
Expand Down Expand Up @@ -198,8 +198,8 @@ def _visible(
if Label.LOW not in vis:
vis.discard(Label.CHAIN)

# Handle ICS% and No% hiding Low%. We do this here to avoid multiple passes over _HIDES/duplicating _HIDES[Label.LOW]
if not vis.isdisjoint({Label.NO, Label.ICE_CAVES_SHORTCUT}):
# Handle No% hiding Low%. We do this here to avoid multiple passes over _HIDES/duplicating _HIDES[Label.LOW]
if not vis.isdisjoint({Label.NO}):
vis.discard(Label.LOW)
vis -= self._HIDES[Label.LOW]

Expand Down
2 changes: 1 addition & 1 deletion src/modlunky2/ui/trackers/runstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ def update_new_entities(self, game_state: State):

def fail_low(self):
self.is_low_percent = False
self.run_label.discard(Label.LOW, Label.NO, Label.ICE_CAVES_SHORTCUT)
self.run_label.discard(Label.LOW, Label.NO)

def update_on_level_start(self, world: int, theme: Theme, ropes: int):
if not self.level_started:
Expand Down
16 changes: 10 additions & 6 deletions src/tests/ui/trackers/label_matches_mr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,25 @@
({Label.NO, Label.NO_GOLD, Label.LOW, Label.ANY}, "No%"),
({Label.NO, Label.NO_GOLD, Label.LOW, Label.SUNKEN_CITY}, "No% Sunken City"),
# -------------------------------------------
(
{Label.ICE_CAVES_SHORTCUT, Label.ANY},
"Ice Caves Shortcut Any%",
),
(
{Label.ICE_CAVES_SHORTCUT, Label.LOW, Label.ANY},
"Ice Caves Shortcut%",
"Ice Caves Shortcut Low%",
),
(
{Label.PACIFIST, Label.ICE_CAVES_SHORTCUT, Label.LOW, Label.ANY},
"Pacifist Ice Caves Shortcut%",
"Pacifist Ice Caves Shortcut Low%",
),
(
{Label.ICE_CAVES_SHORTCUT, Label.LOW, Label.MILLIONAIRE, Label.ANY},
"Ice Caves Shortcut% Millionaire",
"Ice Caves Shortcut Low% Millionaire",
),
(
{Label.ICE_CAVES_SHORTCUT, Label.LOW, Label.SUNKEN_CITY},
"Ice Caves Shortcut Sunken City%",
"Ice Caves Shortcut Low% Sunken City",
),
]

Expand Down Expand Up @@ -371,11 +375,11 @@
),
(
{Label.PACIFIST, Label.ICE_CAVES_SHORTCUT, Label.LOW, Label.ANY},
"Pacifist Ice Caves Shortcut%",
"Pacifist Ice Caves Shortcut Low%",
),
(
{Label.PACIFIST, Label.ICE_CAVES_SHORTCUT, Label.LOW, Label.SUNKEN_CITY},
"Pacifist Ice Caves Shortcut Sunken City%",
"Pacifist Ice Caves Shortcut Low% Sunken City",
),
]

Expand Down

0 comments on commit cca9fcb

Please sign in to comment.