Prayer: bones, prayer points, combat prayers, temple offerings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-18 23:09:17 +01:00
parent 568e61799d
commit 278c5f4283
6 changed files with 296 additions and 25 deletions

11
app.py
View file

@ -99,7 +99,11 @@ def player_view(world: dict, player: dict, now: float) -> dict:
view["armour"] = game.armour(player)
view["reduction"] = round(game.damage_reduction(player), 3)
view["edible"] = game.edible(player)
view["fight_damage"] = {a["id"]: round(game.fight_damage(player, a), 1) for a in game.ACTIONS if a["skill"] == "combat"}
blessed = game.blessing(player)
view["blessing"] = blessed
view["fight_damage"] = {a["id"]: round(game.fight_damage(player, a, blessed), 1)
for a in game.ACTIONS if a["skill"] == "combat"}
view["pp"] = int(player["pp"])
view["levels"] = {skill: game.skill_level(player, skill) for skill in game.SKILL_IDS}
view["slots"] = game.bank_slots(world, player)
view["stack"] = game.stack_size(world)
@ -134,6 +138,8 @@ def city_view(world: dict, now: float) -> dict:
**game.population_view(world),
"buildings": buildings,
"queue": city["queue"],
"devotion": round(city.get("devotion", 0), 1),
"ward": game.ward(world),
"treasury": int(city["treasury"]),
"stockpile": city["stockpile"],
"construction": city["construction"],
@ -322,6 +328,9 @@ class Handler(BaseHTTPRequestHandler):
return "There's no raid to stand guard for"
player["garrison"] = bool(body.get("join"))
return None
if path == "/api/prayers":
ids = body.get("ids")
return game.set_prayers(player, ids) if isinstance(ids, list) else "Bad request"
if path == "/api/food":
food = body.get("item")
if food is not None and "heal" not in game.ITEMS.get(str(food), {}):