Work order composer: have / need on reagents, max quantity, reason by Post
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d03f0035eb
commit
79740d9a86
3 changed files with 13 additions and 7 deletions
6
game.py
6
game.py
|
|
@ -2060,7 +2060,7 @@ def stop(player: dict, reason: str | None = None) -> None:
|
|||
|
||||
ORDER_LIMIT = 5 # open orders per player
|
||||
ORDER_DAYS = 3 # before an order expires and is refunded
|
||||
ORDER_MAX = {"craft": 50, "gather": 2000}
|
||||
ORDER_MAX = {"craft": 500, "gather": 2000}
|
||||
|
||||
|
||||
def _order_sources() -> tuple[dict, dict]:
|
||||
|
|
@ -2094,7 +2094,7 @@ def post_order(world: dict, player: dict, kind: str, item: str, qty, provide, re
|
|||
if not source:
|
||||
return "Nobody can make that" if kind == "craft" else "Nobody gathers that"
|
||||
if not isinstance(qty, int) or not 1 <= qty <= ORDER_MAX[kind]:
|
||||
return "Bad quantity"
|
||||
return f"1 to {ORDER_MAX[kind]}"
|
||||
if not isinstance(reward, int) or reward < 0:
|
||||
return "Bad reward"
|
||||
if sum(o["by"] == player["id"] and o["status"] == "open" for o in world["orders"]) >= ORDER_LIMIT:
|
||||
|
|
@ -3887,7 +3887,7 @@ def content() -> dict:
|
|||
"city_uses": {item: city_uses(item) for item in ITEMS},
|
||||
"prayers": [{**prayer, "text": describe_prayer(prayer)} for prayer in PRAYERS], "max_prayers": MAX_PRAYERS,
|
||||
"potion_charges": POTION_CHARGES, "order_recipes": ORDER_RECIPES, "order_raw": ORDER_RAW,
|
||||
"order_limit": ORDER_LIMIT, "problems": PROBLEMS, "fittings": list(FITTING_BY_ID.values()),
|
||||
"order_limit": ORDER_LIMIT, "order_max": ORDER_MAX, "problems": PROBLEMS, "fittings": list(FITTING_BY_ID.values()),
|
||||
"equip_slots": EQUIP_SLOTS, "eat_below": EAT_BELOW, "class_speed": CLASS_SPEED,
|
||||
"styles": STYLES, "damage_types": DAMAGE_TYPES, "weights": WEIGHTS, "vulnerable": VULNERABLE,
|
||||
"resistant": RESISTANT, "class_style": CLASS_STYLE, "block_chance": BLOCK_CHANCE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue