Dungeons: stay in lobby after a run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-27 21:46:07 +00:00
parent 2597a1d7e7
commit 13371ec269
3 changed files with 19 additions and 10 deletions

View file

@ -1036,7 +1036,7 @@ class DungeonTest(unittest.TestCase):
self.assertIsNone(game.start_run(self.world, self.wil, T0 + 600))
names = []
now = T0 + 600
while game.party_of(self.world, self.wil):
while "run" in self.party():
fight = self.party()["fight"] or {}
if fight.get("stage"):
names.append(fight["enemy"])
@ -1046,10 +1046,16 @@ class DungeonTest(unittest.TestCase):
pulls = game.ACTION_BY_ID["dungeon_watchtower"]["pulls"]
self.assertEqual(list(dict.fromkeys(names)), pulls)
for p in (self.wil, self.kay):
self.assertIsNone(p["action"])
self.assertEqual(p["stopped"], "Cleared Watchtower Depths")
self.assertEqual(p["away"]["run_over"], "Cleared Watchtower Depths")
self.assertGreaterEqual(p["gold"], game.DUNGEONS["dungeon_watchtower"]["bonus_gold"])
self.assertIn("cleared Watchtower Depths", self.world["ledger"][-1]["text"])
# Back in the lobby together: waiting on the leader, open to join, ready to go again.
self.online(now + 600)
self.assertIs(game.party_of(self.world, self.kay), self.party())
self.assertIsNone(self.party()["fight"])
self.assertFalse(game.run_of(self.world, self.wil)["started"])
self.assertTrue(game.joinable(self.world, self.wil))
self.assertIsNone(game.start_run(self.world, self.wil, now + 600))
def test_a_group_waits_for_its_leader_and_holds_four(self):
game.start_action(self.world, self.wil, "dungeon_watchtower", T0)
@ -1096,11 +1102,12 @@ class DungeonTest(unittest.TestCase):
p["xp"]["combat"] = game.XP_TABLE[20]
self.party()["run"] = {"pull": 7, "wipes": 0} # the ogre, naked
now = T0
while game.party_of(self.world, self.wil):
while "run" in self.party():
now += 30
self.online(now)
self.assertLess(now, T0 + 3 * 3600)
self.assertEqual(self.wil["stopped"], "Wiped 3 times at Watchtower ogre")
self.assertEqual(self.wil["away"]["run_over"], "Wiped 3 times at Watchtower ogre")
self.assertEqual(self.party()["members"], ["wil", "kay"])
def test_the_leader_can_pull_early(self):
game.start_action(self.world, self.wil, "dungeon_watchtower", T0)