Workbench speeds the building site
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9ff7a22a5d
commit
111dc9049f
3 changed files with 6 additions and 5 deletions
|
|
@ -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,
|
crafting skill (anvil stand, jeweller's bench, workbench, hearth, alembic,
|
||||||
tanning rack, loom), from the tier's planks and hardware and another
|
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
|
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
|
- **Storage:** builders make
|
||||||
strongboxes (+2 to +14 bank slots) and homesteaders sew bags (+250 to
|
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
|
+2,000 per stack); each has one slot on the Bank page, and a smaller one
|
||||||
|
|
|
||||||
4
game.py
4
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]
|
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.
|
# 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
|
# 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)
|
# skill: (id suffix, noun, glyph, other material)
|
||||||
STATIONS = {
|
STATIONS = {
|
||||||
"construction": ("workbench", "workbench", "toolbox", "bar"),
|
"construction": ("workbench", "workbench", "toolbox", "bar"),
|
||||||
|
|
@ -1963,7 +1963,7 @@ def action_time(world: dict, player: dict, action: dict) -> float:
|
||||||
if tool:
|
if tool:
|
||||||
seconds *= 1 - ITEMS[tool]["speed"]
|
seconds *= 1 - ITEMS[tool]["speed"]
|
||||||
station = player["equip"].get(f"station_{action['skill']}")
|
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"]
|
seconds *= 1 - ITEMS[station]["speed"]
|
||||||
if action["skill"] == "smithing":
|
if action["skill"] == "smithing":
|
||||||
seconds *= 1 - 0.08 * building_level(world, "smithy")
|
seconds *= 1 - 0.08 * building_level(world, "smithy")
|
||||||
|
|
|
||||||
|
|
@ -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["smith_iron_mortar_and_pestle"]["inputs"], {"iron_bar": 2, "oak_logs": 1})
|
||||||
self.assertEqual(game.ACTION_BY_ID["make_oak_workbench"]["skill"], "construction")
|
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"]
|
labour = game.ACTION_BY_ID["labour"]
|
||||||
bare = game.action_time(self.world, self.bob, labour)
|
bare = game.action_time(self.world, self.bob, labour)
|
||||||
self.bob["equip"]["station_construction"] = "magic_workbench"
|
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):
|
def test_stations_move_out_of_the_tool_slot(self):
|
||||||
self.world["version"] = 22
|
self.world["version"] = 22
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue