tweak cypher result output string

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
2026-06-01 11:02:47 -05:00
parent ba076b846a
commit eb325f98b0
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -97,9 +97,9 @@ def cypher_result(difficulty: int, modifier: int, is_attack: bool, stat: str, co
modded_diff = difficulty
if ircify:
detail_str = f"14(res. {result_lvl} (d20={result}) vs. {stat} diff. {diff_level} ({modded_diff}))"
detail_str = f"14(res. {result_lvl} (d20={result}) vs. {stat} difficulty {diff_level} ({modded_diff}))"
else:
detail_str = f"(res. {result_lvl} (d20={result}) vs. {stat} diff. {diff_level} ({modded_diff}))"
detail_str = f"(res. {result_lvl} (d20={result}) vs. {stat} difficulty {diff_level} ({modded_diff}))"
return f"{display_comment} {result_str} {detail_str}"
else:
+1 -1
View File
@@ -92,7 +92,7 @@ class DiceLibTestCase(TestCase):
"""Test the Cypher result string generation."""
with mock.patch('random.SystemRandom.randint', return_value=10):
result = dice.lib.cypher_result(3, 0, False, "Might", "")
self.assertEqual(result, "task succeeded! (res. 3 (d20=10) vs. Might diff. 3 (3))")
self.assertEqual(result, "task succeeded! (res. 3 (d20=10) vs. Might difficulty 3 (3))")
def test_reaction_roll(self):
"""Roll possible reactions."""
+3 -3
View File
@@ -52,16 +52,16 @@ class DiceRollerTestCase(TestCase):
"""Roll a variety of cypher rolls."""
with mock.patch('random.SystemRandom.randint', return_value=5):
result = self.roller.do_roll('difficulty 5 might task to muscle good')
self.assertEqual(result, 'task to muscle good failed. (res. 1 (d20=5) vs. might diff. 5 (5))')
self.assertEqual(result, 'task to muscle good failed. (res. 1 (d20=5) vs. might difficulty 5 (5))')
with mock.patch('random.SystemRandom.randint', return_value=4):
result = self.roller.do_roll('difficulty 2-2 might attack to hit good')
self.assertEqual(result, 'attack to hit good succeeded! (res. 1 (d20=4) vs. might diff. 0 (2-2))')
self.assertEqual(result, 'attack to hit good succeeded! (res. 1 (d20=4) vs. might difficulty 0 (2-2))')
with mock.patch('random.SystemRandom.randint', return_value=20):
result = self.roller.do_roll('difficulty 2+2 might attack to hit good')
self.assertEqual(result, 'attack to hit good succeeded, with a MAJOR EFFECT! '
'(res. 6 (d20=20) vs. might diff. 4 (2+2))')
'(res. 6 (d20=20) vs. might difficulty 4 (2+2))')
with mock.patch('random.SystemRandom.randint', return_value=5):
result = self.roller.do_roll('-1 might task to muscle good')