Spend favour on the city: builders, informants, militia

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-18 19:48:22 +01:00
parent 34dc85284d
commit 67a5db86ff
5 changed files with 142 additions and 3 deletions

3
app.py
View file

@ -327,6 +327,8 @@ class Handler(BaseHTTPRequestHandler):
return "That isn't food"
player["food"] = food
return None
if path == "/api/favour":
return game.spend_favour(world, player, str(body.get("kind")), now)
if path == "/api/perk":
return game.buy_perk(player, str(body.get("perk")))
if path == "/api/settings":
@ -411,6 +413,7 @@ class Handler(BaseHTTPRequestHandler):
"summary": summary,
"city": city_view(world, now),
"upcoming": game.event_view(world, upcoming, now) if upcoming else None,
"favours": game.favours(world, now),
"history": history,
"players": roster(world, now),
"ledger": world["ledger"][-80:],