From 66cca038ac7c528d050c2a07c517d39955cb9e80 Mon Sep 17 00:00:00 2001 From: freiheit Date: Fri, 22 Mar 2024 23:00:49 -0700 Subject: [PATCH] Lint/style fixes with `black` --- mvkroller.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mvkroller.py b/mvkroller.py index b520754..709dbe2 100644 --- a/mvkroller.py +++ b/mvkroller.py @@ -138,6 +138,7 @@ def adv_disadv(advantage, disadvantage, dicecounts, dicerolls): return answer, dicerolls[20] + def calc_action(fortunedicerolls, characterdicerolls): """Compute the action total, using up to one d20 and the highest character die roll.""" try: @@ -151,6 +152,7 @@ def calc_action(fortunedicerolls, characterdicerolls): ) from exc return answer + def calc_impact(fortunedicerolls, characterdicerolls): """Calculate the impact total""" try: @@ -168,6 +170,7 @@ def calc_impact(fortunedicerolls, characterdicerolls): raise RollError("Coding error calculating Impact") from exc return answer + def crit_fumble(fortunedicerolls, characterdicerolls): """Check if we had a critical fumble. If so, add output and discard lowest non-1 die""" answer = "" @@ -186,11 +189,12 @@ def crit_fumble(fortunedicerolls, characterdicerolls): scratched = True answer += f"*Scratched {i}*\n" # no append because scratching this die - + answer += "**Gain 1 inspiration point**\n" answer += f"New character dice: {newdicerolls}\n" return answer, newdicerolls + def mvkroll(dicestr: str): """Implementation of dice roller that applies MvK rules.""" @@ -245,8 +249,10 @@ def mvkroll(dicestr: str): answer += adv_disadv_answer answer += print_dice(dicerolls) - - fumble_answer, characterdicerolls = crit_fumble(fortunedicerolls, characterdicerolls) + + fumble_answer, characterdicerolls = crit_fumble( + fortunedicerolls, characterdicerolls + ) answer += fumble_answer answer += calc_action(fortunedicerolls, characterdicerolls)