Rapid Heal mends during fights

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-20 20:44:20 +01:00
parent 8425989df3
commit 636123e454
2 changed files with 24 additions and 8 deletions

View file

@ -837,6 +837,18 @@ class PrayerTest(unittest.TestCase):
self.assertEqual(summary["second_wind"], 1)
self.assertTrue(summary["stopped"].startswith("Retreated"))
def test_rapid_heal_mends_during_fights(self):
world, p = self.priest(level=10, combat=10)
scouts = game.ACTION_BY_ID["fight_scouts"]
p["pp"], p["hp"] = 1000, 50
plain = game.simulate_fight(world, p, scouts, random.Random(3))
game.set_prayers(p, ["rapid_heal"])
mended = game.simulate_fight(world, p, scouts, random.Random(3))
swings = sum(1 for e in plain["events"] if e[1] == "you")
top = game.max_hp(p)
self.assertAlmostEqual(mended["hp"] - plain["hp"], swings * game.MEND * top * plain["interval"], places=6)
self.assertLess(game.fight_odds(p, scouts)["damage"], game.fight_odds({**p, "prayers": []}, scouts)["damage"])
def test_offerings_ward_the_city_until_the_raid(self):
world, p = self.priest(level=15)
world["city"]["buildings"]["temple"]["level"] = 1