Warmth shared by every pile hot enough

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-21 13:22:20 +01:00
parent b4ecacf96c
commit f7daa4e44d
3 changed files with 26 additions and 7 deletions

View file

@ -1953,6 +1953,21 @@ class FirekeepingTest(unittest.TestCase):
self.assertEqual(self.fires["kitchen"]["saved"], 4)
self.assertEqual(self.sam["xp"]["firekeeping"], 0)
def test_warmth_is_shared_by_every_pile_hot_enough_for_the_craft(self):
self.world["players"]["ash"] = ash = game.new_player("ash", "Ash", "commoner", T0)
ash["xp"]["cooking"] = game.XP_TABLE[15]
self.fires["kitchen"].update(at=T0, fuel=[{"tier": 3, "left": 6000, "by": "kai"},
{"tier": 0, "left": 6000, "by": "sam"}])
ash["bank"] = {"raw_shrimp": 1, "raw_trout": 1}
game.start_action(self.world, ash, "cook_shrimp", T0, once=True)
game.process_player(self.world, ash, T0 + 25, random.Random(1))
self.assertAlmostEqual(self.kai["xp"]["firekeeping"], 6 * game.WARMTH / 2)
self.assertAlmostEqual(self.sam["xp"]["firekeeping"], 6 * game.WARMTH / 2)
game.start_action(self.world, ash, "cook_trout", T0 + 25, once=True)
game.process_player(self.world, ash, T0 + 60, random.Random(1))
self.assertAlmostEqual(self.kai["xp"]["firekeeping"], 6 * game.WARMTH / 2 + 15 * game.WARMTH) # trout: kai's alone
self.assertAlmostEqual(self.sam["xp"]["firekeeping"], 6 * game.WARMTH / 2)
def test_catch_up_runs_everyone_and_keeps_what_they_missed(self):
game.start_action(self.world, self.sam, "mine_stone", T0)
self.assertTrue(game.catch_up(self.world, T0 + 100, random.Random(1)))