Every crafting skill gets a tool and a station

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-20 21:20:25 +01:00
parent a86594594a
commit 91a5263acf
6 changed files with 90 additions and 29 deletions

View file

@ -1770,8 +1770,31 @@ class StationAndStorageTest(unittest.TestCase):
def test_a_station_speeds_its_craft(self):
smelt = game.ACTION_BY_ID["smith_copper_bar"]
bare = game.action_time(self.world, self.bob, smelt)
self.bob["equip"]["tool_smithing"] = "oak_anvil_stand"
self.bob["equip"]["station_smithing"] = "oak_anvil_stand"
self.assertAlmostEqual(game.action_time(self.world, self.bob, smelt), bare * 0.7)
self.bob["equip"]["tool_smithing"] = "copper_chisel"
self.assertAlmostEqual(game.action_time(self.world, self.bob, smelt), bare * 0.7 * 0.85)
def test_every_crafting_skill_has_a_tool_and_a_station(self):
for skill in game.CRAFTING:
self.assertIn(f"tool_{skill}", game.EQUIP_SLOTS)
self.assertIn(f"station_{skill}", game.EQUIP_SLOTS)
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):
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)
def test_stations_move_out_of_the_tool_slot(self):
self.world["version"] = game.WORLD_VERSION - 1
self.bob["equip"]["tool_smithing"] = "oak_anvil_stand"
del self.bob["equip"]["station_smithing"]
game.migrate(self.world, T0)
self.assertEqual((self.bob["equip"]["tool_smithing"], self.bob["equip"]["station_smithing"]),
(None, "oak_anvil_stand"))
def test_strongbox_adds_slots_and_bag_a_bigger_stack(self):
slots, stack = game.bank_slots(self.world, self.bob), game.stack_size(self.world, self.bob)