@@ -138,6 +138,7 @@ def adv_disadv(advantage, disadvantage, dicecounts, dicerolls):
138138
139139 return answer , dicerolls [20 ]
140140
141+
141142def calc_action (fortunedicerolls , characterdicerolls ):
142143 """Compute the action total, using up to one d20 and the highest character die roll."""
143144 try :
@@ -151,6 +152,7 @@ def calc_action(fortunedicerolls, characterdicerolls):
151152 ) from exc
152153 return answer
153154
155+
154156def calc_impact (fortunedicerolls , characterdicerolls ):
155157 """Calculate the impact total"""
156158 try :
@@ -168,6 +170,7 @@ def calc_impact(fortunedicerolls, characterdicerolls):
168170 raise RollError ("Coding error calculating Impact" ) from exc
169171 return answer
170172
173+
171174def crit_fumble (fortunedicerolls , characterdicerolls ):
172175 """Check if we had a critical fumble. If so, add output and discard lowest non-1 die"""
173176 answer = ""
@@ -186,11 +189,12 @@ def crit_fumble(fortunedicerolls, characterdicerolls):
186189 scratched = True
187190 answer += f"*Scratched { i } *\n "
188191 # no append because scratching this die
189-
192+
190193 answer += "**Gain 1 inspiration point**\n "
191194 answer += f"New character dice: { newdicerolls } \n "
192195 return answer , newdicerolls
193196
197+
194198def mvkroll (dicestr : str ):
195199 """Implementation of dice roller that applies MvK rules."""
196200
@@ -245,8 +249,10 @@ def mvkroll(dicestr: str):
245249 answer += adv_disadv_answer
246250
247251 answer += print_dice (dicerolls )
248-
249- fumble_answer , characterdicerolls = crit_fumble (fortunedicerolls , characterdicerolls )
252+
253+ fumble_answer , characterdicerolls = crit_fumble (
254+ fortunedicerolls , characterdicerolls
255+ )
250256 answer += fumble_answer
251257
252258 answer += calc_action (fortunedicerolls , characterdicerolls )
0 commit comments