From 83826f92002b78d3e18f59f0944c7cc96b8c6f6f Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Wed, 21 Mar 2012 12:09:56 -0400 Subject: [PATCH] dice.py: I've made a huge mistake - 'd' is a terrible letter for a modifier --- dice.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dice.py b/dice.py index caa8abc..1d63192 100755 --- a/dice.py +++ b/dice.py @@ -30,14 +30,14 @@ class Dice(): reroll = 0 reroll_times = 0 - for m in re.findall(r'[dD+-]\d+', desc): + for m in re.findall(r'[lh+-]\d+', desc): if m[0] == '-': mod += int(m) elif m[0] == '+': mod += int(m[1:]) - elif m[0] == 'D': + elif m[0] == 'h': drop_high = int(m[1:]) - elif m[0] == 'd': + elif m[0] == 'l': drop_low = int(m[1:]) m = re.search(r'r(\d+)(x\d+)?', desc) @@ -170,8 +170,8 @@ This will roll X Y-sided dice and apply the specified modifiers. Modifiers can be any of the following (where N and M are integers): (+|-)N Add or subtract N from the total -dN Drop the lowest-rolling N dice from the total -DN Drop the highest-rolling N dice from the total +lN Drop the lowest-rolling N dice from the total +hN Drop the highest-rolling N dice from the total rN[xM] Any dice that roll <= N will be rerolled. If the optional 'xM' option is specified, dice will be rerolled a maximum of M times. Otherwise each die will be rerolled until the result is > N