Presses count until you're really down, not forecast down

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-25 22:29:42 +00:00
parent 387f4c201b
commit e6702871ff
3 changed files with 25 additions and 6 deletions

View file

@ -846,6 +846,24 @@ class ActivePlayTest(unittest.TestCase):
self.p["action"] = None
self.assertEqual(game.press(self.world, self.p, "crushing_blow", later), "You're not fighting")
def test_a_forecast_loss_can_still_be_turned(self):
world = world_with(("ash", "miner"))
p = world["players"]["ash"]
p["xp"]["combat"] = game.XP_TABLE[20]
p["equip"].update(weapon="steel_warhammer")
p["hp"], p["last_active"] = game.max_hp(p), T0
game.start_action(world, p, "fight_clay_golems", T0)
game.process_player(world, p, T0, random.Random(2))
fight = p["action"]["fight"]
at = lambda t: T0 + (fight["rest"] + t) / fight["pace"]
game.set_manual(world, p, "find_the_seam", True, T0)
mine = game.member_of(fight, "ash")
self.assertEqual(mine["result"], "down") # on auto from here, ash goes down...
self.assertIsNone(game.press(world, p, "find_the_seam", at(38))) # ...but hasn't yet
self.assertEqual(game.member_of(fight, "ash")["result"], "won")
game.member_of(fight, "ash")["out_at"] = 30 # down for real (a party fights on)
self.assertEqual(game.press(world, p, "find_the_seam", at(31)), "You're out of this fight")
def test_old_worlds_get_manual(self):
del self.p["manual"]
self.world["version"] = 27