Work orders: craft your own
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5606267df5
commit
4eb23fc009
3 changed files with 37 additions and 15 deletions
9
game.py
9
game.py
|
|
@ -4176,8 +4176,6 @@ def claim_order(world: dict, player: dict, order_id) -> str | None:
|
|||
order = order_by_id(world, order_id)
|
||||
if not order or order["status"] != "open" or order["kind"] != "craft":
|
||||
return "No such order"
|
||||
if order["by"] == player["id"] and not order.get("city"):
|
||||
return "That's your own order"
|
||||
if order["claimed"] not in (None, player["id"]):
|
||||
return "Someone else has it"
|
||||
if skill_level(player, order["skill"]) < order["level"]:
|
||||
|
|
@ -4267,8 +4265,8 @@ def _deliver(world: dict, order: dict, giver: dict, qty: int, now: float,
|
|||
earned = order.setdefault("earned", {})
|
||||
earned[uid] = earned.get(uid, 0) + share
|
||||
pay -= share
|
||||
giver["gold"] += pay
|
||||
if pay:
|
||||
giver["gold"] += pay # on your own order: what the helpers didn't earn comes back
|
||||
if pay and giver["id"] != order["by"]:
|
||||
note(world, giver, now, "Earned", "gold", pay, who=order["by"])
|
||||
owner = world["players"].get(order["by"])
|
||||
if order.get("city"):
|
||||
|
|
@ -4279,7 +4277,7 @@ def _deliver(world: dict, order: dict, giver: dict, qty: int, now: float,
|
|||
order["status"] = "done"
|
||||
order["done"] = now
|
||||
_refund(world, order, now) # leftover reagents
|
||||
whose = "the city's" if order.get("city") else f"{owner['name']}'s" if owner else "someone's"
|
||||
whose = "the city's" if order.get("city") else "their own" if owner is giver else f"{owner['name']}'s" if owner else "someone's"
|
||||
log(world, now, "order", f"{giver['name']} filled {whose} order: {amount(order['item'], order['qty'])}")
|
||||
|
||||
|
||||
|
|
@ -6855,6 +6853,7 @@ PATCH_NOTES = [
|
|||
{"date": "2026-11-03", "title": "Combat materials on order", "notes": [
|
||||
("new", "Work orders: relics, reagents and trophies under Materials ⚔️, by area."),
|
||||
("new", "Work orders: 🔨 on recipes and gathering, opens the order."),
|
||||
("new", "Work orders: craft your own. Helpers' reagents still get paid."),
|
||||
]},
|
||||
{"date": "2026-11-02", "title": "Militia drilling", "notes": [
|
||||
("fix", "Drilling the militia is no longer wiped before a raid is calculated. Last raid losses recalculated."),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue