Bank: drink all potions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-27 21:23:00 +00:00
parent bb56d618df
commit 2597a1d7e7
4 changed files with 28 additions and 7 deletions

View file

@ -1636,6 +1636,18 @@ class HerbloreTest(unittest.TestCase):
self.assertEqual(game.ITEMS["mining_potion_6"]["name"], "Mining potion VI")
self.assertFalse(any("heal" in p[6] or "double" in p[6] for p in game.POTIONS))
def test_drink_all_potions_stacks_charges(self):
p = self.p
p["bank"] = {"mining_potion_1": 3, "mining_potion_2": 1}
game.use_potion(p, "mining_potion_2")
self.assertIsNone(game.use_potion(p, "mining_potion_1", "all"))
self.assertEqual(p["potions"]["mining"], {"item": "mining_potion_1", "charges": 3 * game.POTION_CHARGES})
self.assertNotIn("mining_potion_1", p["bank"])
self.assertEqual(game.use_potion(p, "mining_potion_1", "all"), "You don't have one")
p["bank"]["mining_potion_1"] = 2
self.assertEqual(game.use_potion(p, "mining_potion_1", 0), "Bad amount")
self.assertEqual(game.use_potion(p, "mining_potion_1", 3), "You don't have that many")
def test_skill_potion_speeds_up_and_uses_charges(self):
world, p = self.world, self.p
plain = game.action_time(world, p, game.ACTION_BY_ID["cut_logs"])