Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added /next_progression command, which tells the player what items can be sent that will immediately unlock new locations. #30

Open
wants to merge 8 commits into
base: tracker
Choose a base branch
from
18 changes: 18 additions & 0 deletions worlds/tracker/TrackerClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,24 @@ def _cmd_reset_ignored(self):
self.ctx.ignored_locations.clear()
updateTracker(self.ctx)
logger.info("Reset ignored locations.")
def _cmd_next_progression(self):
"""Finds all items that will unlock a check immediately when collected, and a best guess of how many new checks they will unlock."""
updateTracker(self.ctx)
baseLocs = len(self.ctx.locations_available)
counter = Counter()
items_to_check = {item.name for item in self.ctx.multiworld.get_items() if item.game == self.ctx.game and ItemClassification.progression in item.classification}
for item in items_to_check:
self.ctx.manual_items.append(item)
updateTracker(self.ctx)
newlocs = len(self.ctx.locations_available) - baseLocs
if newlocs:
counter[item] = newlocs
self.ctx.manual_items.pop()
if not counter:
logger.info("No item will unlock any checks right now.")
for (item, count) in counter.most_common():
logger.info(f"{item} unlocks {count} checks.")
updateTracker(self.ctx)


class TrackerGameContext(CommonContext):
Expand Down
Loading