comparison orpg/dieroller/utils.py @ 97:bb22f0f1a7ec alpha

Traipse Alpha 'OpenRPG' {090924-01} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: 00: Update forwards to the 090909-02 Server code that now works. New default Lobby Map, designed for Traipse. Feel free to change it. Updates to Server GUI: * Admin can Ban from Backend. * Prework to modify Ban List in back end. * Server GUI finds your Lobby Name * New users default as Lurker unless a Role is set New Addition to Chat Die Roll commands. Math Ordering. Ex. [(X+Y)dZ]. Currently does pairs only, no nesting either. Cleaner TraipseSuiteAttention portability and clean up in Main (Beta!) 01: Die Roll Commands addition removed in favor of Core code
author sirebral
date Thu, 24 Sep 2009 21:21:49 -0500
parents 449a8900f9ac
children bf799efe7a8a
comparison
equal deleted inserted replaced
96:65c1604e7949 97:bb22f0f1a7ec
80 return "(" + num.strip() + "**" + self.roller_class + "(" + sides.strip() + "))" 80 return "(" + num.strip() + "**" + self.roller_class + "(" + sides.strip() + "))"
81 81
82 # Use this to convert ndm-style (3d6) dice to d_base format 82 # Use this to convert ndm-style (3d6) dice to d_base format
83 83
84 def convertTheDieString(self,s): 84 def convertTheDieString(self,s):
85 reg = re.compile("\d+\s*[a-zA-Z]+\s*[\dFf]+") 85 reg = re.compile("(?:\d+|\([0-9\*/\-\+]+\))\s*[a-zA-Z]+\s*[\dFf]+")
86 (result, num_matches) = reg.subn(self.stdDieToDClass, s) 86 (result, num_matches) = reg.subn(self.stdDieToDClass, s)
87 if num_matches == 0 or result is None: 87 if num_matches == 0 or result is None:
88 try: 88 try:
89 s2 = self.roller_class + "(0)." + s 89 s2 = self.roller_class + "(0)." + s
90 test = eval(s2) 90 test = eval(s2)