Make X: count for one-off crafts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-26 16:48:44 +00:00
parent 2996d7a9d7
commit f735831a1e
5 changed files with 37 additions and 8 deletions

5
app.py
View file

@ -358,7 +358,10 @@ class Handler(BaseHTTPRequestHandler):
if not isinstance(qty, int):
return "Bad quantity"
if path == "/api/action":
return game.start_action(world, player, str(body.get("id")), now, once=bool(body.get("once")))
once = body.get("once") or 0
if not isinstance(once, int) or not 0 <= once <= game.MAKE_MAX:
return f"1 to {game.MAKE_MAX:,}"
return game.start_action(world, player, str(body.get("id")), now, once=int(once))
if path == "/api/join":
return game.join_fight(world, player, str(body.get("id")), now)
if path == "/api/press":