How to use the d20.AdvType.NONE function in d20

To help you get started, we’ve selected a few d20 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github avrae / avrae / utils / dice.py View on Github external
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"
github avrae / avrae / cogs5e / dice.py View on Github external
def _string_search_adv(rollstr):
        adv = d20.AdvType.NONE
        if re.search('(^|\s+)(adv|dis)(\s+|$)', rollstr) is not None:
            adv = d20.AdvType.ADV if re.search('(^|\s+)adv(\s+|$)', rollstr) is not None else d20.AdvType.DIS
            rollstr = re.sub('(adv|dis)(\s+|$)', '', rollstr)
        return rollstr, adv