def _roll_stat(self):
     """
     The first step to creating your character is to roll 3d6 for each of the
     six attribute scores.
     """
     
     return sum(dice.roll("3d6", sorted=True))
    def _roll_stat(self):
        """
        Assumes D&D v3.5 PHB1 default rules:
        Roll 4d6, drop lowest roll, sum the
        rest of the dice for ability score
        """

        return sum(dice.discard(dice.roll("4d6", sorted=True), 1))
Beispiel #3
0
def roll():
    to_roll = request.args.get('dice') or '1d20'
    adv = request.args.get('adv', 0)
    rolled = dice.roll(to_roll, adv)

    result = {
        'total': rolled.total,
        'result': rolled.result,
        'is_crit': rolled.crit,
        'dice': [part.to_dict() for part in rolled.raw_dice.parts]
    }

    return jsonify(result)