Armoury: each guard post's kit, best first, with stats

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-30 11:55:48 +00:00
parent bacef12cb5
commit b5dfb713de
3 changed files with 32 additions and 5 deletions

12
game.py
View file

@ -4758,11 +4758,11 @@ def wear_share(ratio: float) -> float:
return 0.1 + 0.2 * max(0.0, 2 - ratio)
def issued_kit(world: dict, slot: str) -> list[tuple[str, int]]:
"""The `slot` items handed to the guards on duty, best first."""
def issued_kit(world: dict, slot: str, people: int | None = None) -> list[tuple[str, int]]:
"""The `slot` items handed to the guards on duty (or `people` guards), best first."""
stock = world["city"]["stockpile"]
stat = KIT_DEFENCE[slot][0]
people = guards_on_duty(world)
people = guards_on_duty(world) if people is None else people
issued = []
for item in sorted((i for i in stock if kit_slot(i) == slot), key=lambda i: -ITEMS[i].get(stat, 0)):
if not people:
@ -4868,7 +4868,8 @@ def defence(world: dict, guards: int | None = None) -> dict:
if city["starving"]:
total *= 0.8
return {"parts": parts, "garrison": garrison, "total": round(total, 1), "starving": city["starving"],
"guards": armed, "posts": posts, "wages": int(city.get("wages", 0)), "wage": GUARD_WAGE}
"guards": armed, "posts": posts, "wages": int(city.get("wages", 0)), "wage": GUARD_WAGE,
"kit": {slot: issued_kit(world, slot, posts) for slot in KIT_DEFENCE}}
def standing_defence(world: dict) -> float:
@ -6842,6 +6843,9 @@ ORDER_RECIPES, ORDER_RAW = _order_sources()
# What changed, shown on the Patch notes page. Newest first; every shipped change adds a
# line here (new / balance / fix), and a new release a new entry on top.
PATCH_NOTES = [
{"date": "2026-10-30", "title": "Armoury", "notes": [
("new", "Added armoury to raid readiness."),
]},
{"date": "2026-10-29", "title": "Frames, no coal past steel", "notes": [
("balance", "Mithril, adamant and rune bars: no coal. Steel still takes 2."),
("balance", "Ore worth: mithril 15 → 21, adamantite 30 → 36, runite 55 → 63. Bars: mithril 47 → 32, adamant 74 → 54, rune 114 → 95."),