Exemple #1
0
    def test_parse_die(self):
        paramlist = ['d6', 'd20']
        die = parse.die(paramlist)

        assert all(isinstance(dice, int) for dice in die)
        assert die[0] == 6
        assert die[1] == 20
Exemple #2
0
    def test_action_roll(self):
        raw_multipliers = ['2', '1']
        raw_die = ['d6', 'd20']
        raw_modifiers = ['+1+2-3', '-3-2+1']

        multipliers = parse.multipliers(raw_multipliers)
        die = parse.die(raw_die)
        modifiers = parse.modifiers(raw_modifiers)

        roll_results = roll(multipliers, die, modifiers['bonuses'], modifiers['penalties'])
        print roll_results