Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def d20_with_adv(adv):
"""Returns Xd20 for the correct advantage type."""
if adv == d20.AdvType.NONE:
return "1d20"
elif adv == d20.AdvType.ADV:
return "2d20kh1"
elif adv == d20.AdvType.DIS:
return "2d20kl1"
elif adv == 2:
return "3d20kh1"
return "1d20"