Queue: +Q from anything, After Q / Skip Q

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-27 20:01:00 +00:00
parent 54f703341e
commit 6e48c72d95
5 changed files with 93 additions and 15 deletions

23
game.py
View file

@ -3225,6 +3225,19 @@ def queue_set(player: dict, index: int, qty: int) -> str | None:
return None
def set_then(player: dict, action_id: str | None) -> str | None:
"""What to go back to once the make and the queue are done: an action, or None to go idle."""
current = player["action"]
if not current or "left" not in current:
return "Not making anything"
current.pop("resume_plot2", None)
if action_id:
current["resume"] = action_id
else:
current.pop("resume", None)
return None
def skip_make(world: dict, player: dict, now: float) -> str | None:
"""Drop the make that's running: on to the next in the queue, or back to what you were doing."""
current = player["action"]
@ -3951,8 +3964,10 @@ MAKE_MAX = 1000 # most you can ask for in one "Make X"
QUEUE_MAX = 5 # makes lined up after the current one
def start_action(world: dict, player: dict, action_id: str, now: float, once: int = 0) -> str | None:
"""Start an action. `once` does it that many times, then goes back to what you were doing."""
def start_action(world: dict, player: dict, action_id: str, now: float, once: int = 0, skip: bool = False) -> str | None:
"""Start an action. `once` does it that many times, then goes back to what you were doing.
While a make is running, a plain start is what comes after it and the queue, not instead,
unless `skip`: then the make and the queue go and it starts now."""
action = ACTION_BY_ID.get(action_id)
if not action:
return "No such action"
@ -3961,6 +3976,9 @@ def start_action(world: dict, player: dict, action_id: str, now: float, once: in
return reason
entry = {"id": action_id, "start": now}
current = player["action"]
if not once and not skip and current and "left" in current:
set_then(player, action_id)
return None
if once:
back = current and (current.get("resume") or current["id"])
entry["left"] = int(once)
@ -6244,6 +6262,7 @@ PATCH_NOTES = [
("fix", "+Q button: rounded corners."),
("fix", "Make box: number field sits in front of +Q."),
("new", "Crafting queue menu: tap ⏳ in the top bar to reorder, change counts, skip or clear."),
("new", "Updated crafting queue to be more intuitive"),
("new", "Bury on the spot: bones from combat turns into prayer points and 1/2 bury XP as they drop. Toggle in the Prayer menu."),
("balance", "Prayer costs adjusted."),
("balance", "Prayer potions now relevant for new costs."),