Masonry joins Construction; smith hardware; homesteader plots
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f4b2bb1320
commit
e825518c5e
6 changed files with 258 additions and 72 deletions
6
app.py
6
app.py
|
|
@ -112,8 +112,8 @@ def player_view(world: dict, player: dict, now: float) -> dict:
|
|||
view["power"] = game.combat_power(player)
|
||||
view["perk_costs"] = {perk: game.perk_cost(player, perk) for perk in player["perks"]}
|
||||
if player["action"]:
|
||||
action = game.ACTION_BY_ID[player["action"]["id"]]
|
||||
view["action"] = {**player["action"], "duration": game.action_time(world, player, action)}
|
||||
action = game.growing(player)
|
||||
view["action"] = {**player["action"], "growing": action["id"], "duration": game.action_time(world, player, action)}
|
||||
view["times"] = {action["id"]: game.action_time(world, player, action) for action in game.ACTIONS}
|
||||
view["blocked"] = {action["id"]: game.can_start(world, player, action) for action in game.ACTIONS}
|
||||
view["drill_per_action"] = game.drill_per_action(player)
|
||||
|
|
@ -370,6 +370,8 @@ class Handler(BaseHTTPRequestHandler):
|
|||
player["cls"], player["repick"] = cls, False
|
||||
game.log(world, now, "join", f"{player['name']} took up the {game.CLASSES[cls]['name'].lower()}'s trade", player["id"])
|
||||
return None
|
||||
if path == "/api/plot":
|
||||
return game.plant_second_plot(world, player, body.get("id") or None)
|
||||
if path == "/api/perk":
|
||||
return game.buy_perk(player, str(body.get("perk")))
|
||||
if path == "/api/settings":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue