From 111dc9049f442cc271ce44161bf8340941fffb6d Mon Sep 17 00:00:00 2001 From: rope Date: Wed, 21 Oct 2026 14:37:52 +0100 Subject: [PATCH] Workbench speeds the building site Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- game.py | 4 ++-- tests/test_game.py | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e483a5f..0f25335 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Alpha. One season, bandit raids plus two friendly events, six buildings. crafting skill (anvil stand, jeweller's bench, workbench, hearth, alembic, tanning rack, loom), from the tier's planks and hardware and another trade's bars, leather or cloth. Both run 15–60% faster by tier, and a - station speeds what's made at it, not the building site. + station speeds what's made at it (a workbench the building site too). - **Storage:** builders make strongboxes (+2 to +14 bank slots) and homesteaders sew bags (+250 to +2,000 per stack); each has one slot on the Bank page, and a smaller one diff --git a/game.py b/game.py index d494412..b1cedfa 100644 --- a/game.py +++ b/game.py @@ -128,7 +128,7 @@ TOOLS = {"mining": ("pickaxe", "⛏️"), "woodcutting": ("axe", "🪓"), "farmi TOOL_SPEED = [0.15, 0.30, 0.38, 0.45, 0.52, 0.60] # Crafting stations: a second slot for every crafting skill, beside its tool, and as fast. # Builders make every station, from the tier's planks and hardware and a material from -# another trade. A station speeds what's made at it, not work like the building site. +# another trade. A station speeds what's made at it, and a workbench the building site too. # skill: (id suffix, noun, glyph, other material) STATIONS = { "construction": ("workbench", "workbench", "toolbox", "bar"), @@ -1963,7 +1963,7 @@ def action_time(world: dict, player: dict, action: dict) -> float: if tool: seconds *= 1 - ITEMS[tool]["speed"] station = player["equip"].get(f"station_{action['skill']}") - if station and action["outputs"]: + if station and (action["outputs"] or action.get("special") == "labour"): seconds *= 1 - ITEMS[station]["speed"] if action["skill"] == "smithing": seconds *= 1 - 0.08 * building_level(world, "smithy") diff --git a/tests/test_game.py b/tests/test_game.py index 8954305..4df453a 100644 --- a/tests/test_game.py +++ b/tests/test_game.py @@ -1865,11 +1865,12 @@ class StationAndStorageTest(unittest.TestCase): self.assertEqual(game.ACTION_BY_ID["smith_iron_mortar_and_pestle"]["inputs"], {"iron_bar": 2, "oak_logs": 1}) self.assertEqual(game.ACTION_BY_ID["make_oak_workbench"]["skill"], "construction") - def test_a_workbench_doesnt_speed_the_building_site(self): + def test_a_workbench_speeds_the_building_site(self): labour = game.ACTION_BY_ID["labour"] bare = game.action_time(self.world, self.bob, labour) self.bob["equip"]["station_construction"] = "magic_workbench" - self.assertEqual(game.action_time(self.world, self.bob, labour), bare) + speed = game.ITEMS["magic_workbench"]["speed"] + self.assertAlmostEqual(game.action_time(self.world, self.bob, labour), bare * (1 - speed)) def test_stations_move_out_of_the_tool_slot(self): self.world["version"] = 22