First set of updates from the major "backendification" rewrite #1
| @ -70,7 +70,7 @@ class DiceRoller(object): | |||||||
| 
 | 
 | ||||||
|         output = "" |         output = "" | ||||||
|         repeat = 1 |         repeat = 1 | ||||||
|         if trials != None: |         if trials is not None: | ||||||
|             repeat = trials |             repeat = trials | ||||||
|         for i in range(repeat): |         for i in range(repeat): | ||||||
|             mode = 1 |             mode = 1 | ||||||
| @ -86,8 +86,8 @@ class DiceRoller(object): | |||||||
|                 # m[0] = (keep, num dice) |                 # m[0] = (keep, num dice) | ||||||
|                 # m[1] = num faces on the die |                 # m[1] = num faces on the die | ||||||
|                 if type(m) == tuple: |                 if type(m) == tuple: | ||||||
|                     if m[0] != None: |                     if m[0] is not None: | ||||||
|                         if m[0][0] != None: |                         if m[0][0] is not None: | ||||||
|                             keep = m[0][0] |                             keep = m[0][0] | ||||||
|                         dice = m[0][1] |                         dice = m[0][1] | ||||||
|                     size = m[1] |                     size = m[1] | ||||||
| @ -113,14 +113,14 @@ class DiceRoller(object): | |||||||
|                     curr_str += str(m) |                     curr_str += str(m) | ||||||
|                 total += mode * res |                 total += mode * res | ||||||
|             if repeat == 1: |             if repeat == 1: | ||||||
|                 if comment != None: |                 if comment is not None: | ||||||
|                     output = "%d %s (%s)" % (total, comment.strip(), curr_str) |                     output = "%d %s (%s)" % (total, comment.strip(), curr_str) | ||||||
|                 else: |                 else: | ||||||
|                     output = "%d (%s)" % (total, curr_str) |                     output = "%d (%s)" % (total, curr_str) | ||||||
|             else: |             else: | ||||||
|                 output += "%d (%s)" % (total, curr_str) |                 output += "%d (%s)" % (total, curr_str) | ||||||
|                 if i == repeat - 1: |                 if i == repeat - 1: | ||||||
|                     if comment != None: |                     if comment is not None: | ||||||
|                         output += " (%s)" % (comment.strip()) |                         output += " (%s)" % (comment.strip()) | ||||||
|         return output |         return output | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user