Construction frames: mid-tier craft for later building levels
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
46540c69cf
commit
3f30e8ccdd
3 changed files with 74 additions and 17 deletions
|
|
@ -297,6 +297,16 @@ class ActionTest(unittest.TestCase):
|
|||
game.migrate(world, T0)
|
||||
self.assertEqual(world["players"]["fred"]["gave"], {})
|
||||
|
||||
def test_migrate_turns_funded_planks_into_frames(self):
|
||||
world = world_with(("fred", "commoner"))
|
||||
world["city"]["buildings"]["houses"]["fund"] = {"oak_plank": 210, "willow_plank": 32, "bricks": 5}
|
||||
world["city"]["buildings"]["lumber_shed"]["fund"] = {"oak_plank": 40} # still planks at that level
|
||||
world["version"] = 36
|
||||
game.migrate(world, T0)
|
||||
self.assertEqual(world["city"]["buildings"]["houses"]["fund"], {"oak_frame": 42, "willow_frame": 6, "bricks": 5})
|
||||
self.assertEqual(world["city"]["buildings"]["lumber_shed"]["fund"], {"oak_plank": 40})
|
||||
self.assertEqual(world["city"]["stockpile"].get("willow_plank"), 2)
|
||||
|
||||
def test_full_bank_sells_what_the_city_cannot_use(self):
|
||||
world = world_with(("fred", "commoner"))
|
||||
p = world["players"]["fred"]
|
||||
|
|
@ -1868,7 +1878,7 @@ class ConstructionTest(unittest.TestCase):
|
|||
self.assertIn(f"saw_{plank}", game.ACTION_BY_ID)
|
||||
for key, *_ in game.METALS:
|
||||
self.assertIn(f"smith_{key}_hammer", game.ACTION_BY_ID)
|
||||
self.assertIn("oak_plank", game.build_cost("houses", 3))
|
||||
self.assertIn("oak_frame", game.build_cost("houses", 3))
|
||||
|
||||
def test_v6_timer_becomes_labour(self):
|
||||
world = world_with(("fred", "miner"))
|
||||
|
|
@ -2321,6 +2331,15 @@ class TradeSkillsTest(unittest.TestCase):
|
|||
self.assertNotIn("iron_bar", game.build_cost("houses", 2))
|
||||
self.assertIn("iron_nails", game.build_cost("houses", 2))
|
||||
|
||||
def test_builders_frame_the_later_building_levels(self):
|
||||
frame = game.ACTION_BY_ID["make_maple_frame"]
|
||||
self.assertEqual((frame["level"], frame["inputs"]), (56, {"maple_plank": 4, "mithril_brackets": 2}))
|
||||
self.assertEqual(game.build_cost("walls", 5)["maple_frame"], 4)
|
||||
self.assertNotIn("maple_plank", game.build_cost("walls", 5))
|
||||
for spec in game.BUILDINGS.values():
|
||||
for part in ("late", "final"):
|
||||
self.assertFalse([item for item in spec.get(part, {}) if item.endswith("_plank")])
|
||||
|
||||
def test_homesteader_focuses_or_tends_two_plots(self):
|
||||
world = world_with(("hom", "homesteader"), ("com", "commoner"))
|
||||
h, c = world["players"]["hom"], world["players"]["com"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue