How to use the d20.ast 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 / cogs5e / models / automation.py View on Github external
def mapper(node):
        if isinstance(node, d20.ast.Dice):
            miX = d20.ast.SetOperator('mi', [d20.ast.SetSelector(None, int(minimum))])
            return d20.ast.OperatedDice(node, miX)
        return node
github avrae / avrae / cogs5e / funcs / scripting / functions.py View on Github external
def mapper(node):
            if isinstance(node, d20.ast.Dice):
                node.num = (node.num * multiply) + add
            return node
github avrae / avrae / cogs5e / models / automation.py View on Github external
def mapper(node):
                if isinstance(node, d20.ast.Dice):
                    node.num = level_dice
                return node