Dungeons: run on while anyone watches

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-27 21:49:49 +00:00
parent 13371ec269
commit 25ecb885f5
2 changed files with 29 additions and 12 deletions

View file

@ -1083,15 +1083,26 @@ class DungeonTest(unittest.TestCase):
game.start_action(self.world, self.wil, "dungeon_watchtower", T0)
self.assertEqual(game.start_run(self.world, self.wil, T0), "Not in a dungeon")
def test_a_run_waits_for_whoever_looked_away(self):
def test_a_run_goes_on_while_someone_watches(self):
game.start_action(self.world, self.wil, "dungeon_watchtower", T0)
game.join_fight(self.world, self.kay, "wil", T0)
game.start_run(self.world, self.wil, T0)
self.online(T0 + 300, [self.wil]) # kay went to make tea
self.online(T0 + 1200, [self.wil])
now = T0
while self.party()["run"]["pull"] < 2: # kay went to make tea: on auto, wil plays on
now += 2
self.online(now, [self.wil])
self.assertLess(now, T0 + 3600)
self.assertEqual(game.run_of(self.world, self.wil)["away"], [])
self.assertIn("kay", [m["id"] for m in self.party()["fight"]["members"]])
def test_a_run_waits_when_no_one_watches(self):
game.start_action(self.world, self.wil, "dungeon_watchtower", T0)
game.join_fight(self.world, self.kay, "wil", T0)
game.start_run(self.world, self.wil, T0)
game.catch_up(self.world, T0 + 1200, random.Random(1)) # both went to make tea
self.assertIsNone(self.party()["fight"])
self.assertEqual(game.run_of(self.world, self.wil)["away"], ["Kay"])
self.online(T0 + 1210)
self.assertEqual(game.run_of(self.world, self.wil)["away"], ["Wil", "Kay"])
self.online(T0 + 1210, [self.kay])
self.assertIsNotNone(self.party()["fight"])
def test_three_wipes_on_a_pull_end_the_run(self):