# HG changeset patch # User sirebral # Date 1263461540 21600 # Node ID 60dde67c4ed61a43a647f2244d8f85011c0a2429 # Parent 537a6bbac9bd968e0cb868a0ea574ebc04befd97 Traipse Alpha 'OpenRPG' {100114-00} 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 (Keeping up with Beta) New Features: Added Bookmarks Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager New TrueDebug Class in orpg_log (See documentation for usage) Portable Mercurial Tip of the Day added, from Core and community New Reference Syntax added for custom PC sheets New Child Reference for gametree New Parent Reference for gametree New Gametree Recursion method, mapping, context sensitivity, and effeciency.. New Features node with bonus nodes and Node Referencing help added Dieroller structure from Core New DieRoller portability for odd Dice Added 7th Sea die roller; ie [7k3] = [7d10.takeHighest(3).open(10)] New 'Mythos' System die roller added Added new vs. die roller method for WoD; ie [3v3] = [3d10.vs(3)]. Included for Mythos roller also New Warhammer FRPG Die Roller (Special thanks to Puu-san for the support) New EZ_Tree Reference system. Push a button, Traipse the tree, get a reference (Alpha!!) Fixes: Fix to Text based Server Fix to Remote Admin Commands Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Fix to Map from gametree not showing to all clients Fix to gametree about menus Fix to Password Manager check on startup Fix to PC Sheets from tool nodes. They now use the tabber_panel Fixed Whiteboard ID to prevent random line or text deleting. Modified ID's to prevent non updated clients from ruining the fix. default_manifest.xml renamed to default_upmana.xml Fix to Update Manager; cleaner clode for saved repositories Fixes made to Settings Panel and now reactive settings when Ok is pressed Fixes to Alternity roller's attack roll. Uses a simple Tuple instead of a Splice Fix to Use panel of Forms and Tabbers. Now longer enters design mode Fix made Image Fetching. New fetching image and new failed image diff -r 537a6bbac9bd -r 60dde67c4ed6 images/failed.png Binary file images/failed.png has changed diff -r 537a6bbac9bd -r 60dde67c4ed6 images/fetching.png Binary file images/fetching.png has changed diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/dieroller/base.py --- a/orpg/dieroller/base.py Wed Jan 13 02:50:22 2010 -0600 +++ b/orpg/dieroller/base.py Thu Jan 14 03:32:20 2010 -0600 @@ -462,4 +462,4 @@ def __setitem__(self, *args): raise AttributeError -die_rollers = DieRollers() \ No newline at end of file +die_rollers = DieRollers() diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/dieroller/rollers/7sea.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/orpg/dieroller/rollers/7sea.py Thu Jan 14 03:32:20 2010 -0600 @@ -0,0 +1,54 @@ +## 7th Sea Dieroller +#!/usr/bin/env python +# Copyright (C) 2000-2001 The OpenRPG Project +# +# openrpg-dev@lists.sourceforge.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# -- +# +# File: wod.py +# Author: OpenRPG Dev Team +# Maintainer: +# Version: +# $Id: wod.py,v 1.14 2007/05/09 19:57:00 digitalxero Exp $ +# +# Description: WOD die roller +# +# Targetthr is the Threshhold target +# for compatibility with Mage die rolls. +# Threshhold addition by robert t childers + +__version__ = "$Id: wod.py,v 1.14 2007/05/09 19:57:00 digitalxero Exp $" + +from std import std +from orpg.dieroller.base import * + +class seventhsea(std): + name = "7sea" + + def __init__(self,source=[]): + std.__init__(self,source) + + def non_stdDie(self, s): + print '7th Sea' + num_sides = s.split('k') + if len(num_sides) > 1: + num_sides; num = num_sides[0]; sides = '10'; target = num_sides[1] + ret = ['(', num.strip(), "**die_rollers['7sea'](", + sides.strip(), ')).takeHighest(', target, ').open(10)'] + s = ''.join(ret); return str(eval(s)) + +die_rollers.register(seventhsea) diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/dieroller/rollers/mythos.py --- a/orpg/dieroller/rollers/mythos.py Wed Jan 13 02:50:22 2010 -0600 +++ b/orpg/dieroller/rollers/mythos.py Thu Jan 14 03:32:20 2010 -0600 @@ -39,6 +39,7 @@ class mythos(std): name = "mythos" + def __init__(self,source=[],target=0,targetthr=0): std.__init__(self,source) self.target = target @@ -52,12 +53,10 @@ if target == 5: self.targets = [6, 12] return self - def thr(self,targetthr): self.targetthr = targetthr return self - def sum(self): rolls = [] s = 0 @@ -75,7 +74,6 @@ if botch == 1 and s < 0: s = 0 return s - def __str__(self): if len(self.data) > 0: myStr = "[" + str(self.data[0]) @@ -87,4 +85,13 @@ else: myStr += "] vs " +str(self.target)+" result of (" + str(self.sum()) + ")" return myStr + def non_stdDie(self, s): ## Puu-san + num_sides = s.split('v') + if len(num_sides) > 1: + num_sides; num = num_sides[0]; sides = num_sides[1] + sides = '10'; target = num_sides[1] + ret = ['(', num.strip(), "**die_rollers['mythos'](", + sides.strip(), ')).vs(', target, ')'] + return ''.join(ret) + die_rollers.register(mythos) diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/dieroller/rollers/wfrpg.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/orpg/dieroller/rollers/wfrpg.py Thu Jan 14 03:32:20 2010 -0600 @@ -0,0 +1,160 @@ +## a die roller as used by Warhammer Fantasy Roleplay Dice Roller +#!/usr/bin/env python +# Copyright (C) 2000-2001 The OpenRPG Project +# +# openrpg-dev@lists.sourceforge.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# -- +# +# File: wfrpg.py +# Author: Prof. Ebral, TaS (Traipse) +# Maintainer: +# Version: +# $Id: wfrpg.py,v 1.00 Jan/13/2010 prof.ebral Exp $ +# +# Description: Warhammer Fantasy Roleplay Dice Roller die roller +# Comissioned by Puu-san +# + +__version__ = "$Id: wfrpg.py,v 1.00 Jan/13/2010 prof.ebral Exp $" + +from std import std +import random +from orpg.dieroller.base import * + +class wfrpg(std): + name = "wfrpg" + + def __init__(self, source=[]): + std.__init__(self, source) + + def non_stdDie(self, s): + self.war_die = {'rec': self.reckless, + 'con': self.conservative, + 'chr': self.characteristic, + 'cha': self.challenge, + 'for': self.fortune, + 'mis': self.misfortune, + 'exp': self.expertise} + for key in self.war_die.keys(): + dice = s.lower().split(key) + if len(dice) > 1: + return self.war_die[key](int(dice[0])) + + def roll(self, dice, facets): + for x in range(0,dice): + self.rolls.append(int(random.uniform(1, facets+1))) + + def reckless(self, dice): + self.rolls = [] + reck = {1: 'Bane', 2: 'Double Boon', 3: 'Boon & Success', + 4: 'Double Success', 5: 'Success & Exertion', 6: 'Blank', + 7: 'Bane', 8: 'Double Success', 9: 'Success & Exertion', + 10: 'Blank'} + self.roll(dice, 10) + for roll in self.rolls: + self.data.append(reck[roll]) + myStr = '[' + str(dice) + ' Reckless] = (' + for data in self.data: + myStr += data + ', ' + myStr = myStr[:len(myStr)-2] + ')' + return myStr + + def conservative(self, dice): + self.rolls = [] + reck = {1: 'Boon', 2: 'Success', 3: 'Success & Boon', + 4: 'Success & Delay', 5: 'Blank', 6: 'Boon', + 7: 'Success', 8: 'Success', 9: 'Success & Delay', + 10: 'Success'} + self.roll(dice, 10) + for roll in self.rolls: + self.data.append(reck[roll]) + myStr = '[' + str(dice) + ' Conservative] = (' + for data in self.data: + myStr += data + ', ' + myStr = myStr[:len(myStr)-2] + ')' + return myStr + + def challenge(self, dice): + self.rolls = [] + reck = {1: 'Challenge', 2: 'Double Challenge', 3: 'Bane', + 4: 'Double Bane', 5: 'Chaos Star', 6: 'Blank', + 7: 'Challenge', 8: 'Double Challenge'} + self.roll(dice, 8) + for roll in self.rolls: + self.data.append(reck[roll]) + myStr = '[' + str(dice) + ' Challenge] = (' + for data in self.data: + myStr += data + ', ' + myStr = myStr[:len(myStr)-2] + ')' + return myStr + + def characteristic(self, dice): + self.rolls = [] + reck = {1: 'Boon', 2: 'Success', 3: 'Blank', + 4: 'Boon', 5: 'Success', 6: 'Success', + 7: 'Blank', 8: 'Success'} + self.roll(dice, 8) + for roll in self.rolls: + self.data.append(reck[roll]) + myStr = '[' + str(dice) + ' Characterisitics] = (' + for data in self.data: + myStr += data + ', ' + myStr = myStr[:len(myStr)-2] + ')' + return myStr + + def fortune(self, dice): + self.rolls = [] + reck = {1: 'Success', 2: 'Blank', 3: 'Boon', + 4: 'Blank', 5: 'Success', 6: 'Blank'} + self.roll(dice, 6) + for roll in self.rolls: + self.data.append(reck[roll]) + myStr = '[' + str(dice) + ' Fortune] = (' + for data in self.data: + myStr += data + ', ' + myStr = myStr[:len(myStr)-2] + ')' + return myStr + + def misfortune(self, dice): + self.rolls = [] + reck = {1: 'Challenge', 2: 'Blank', 3: 'Bane', + 4: 'Blank', 5: 'Challenge', 6: 'Blank'} + self.roll(dice, 6) + for roll in self.rolls: + self.data.append(reck[roll]) + myStr = '[' + str(dice) + ' Misfortune] = (' + for data in self.data: + myStr += data + ', ' + myStr = myStr[:len(myStr)-2] + ')' + return myStr + + def expertise(self, dice): + self.rolls = [] + reck = {1: 'Boon', 2: 'Success', 3: 'Righteous Success', + 4: 'Comet', 5: 'Blank', 6: 'Boon'} + self.roll(dice, 6) + for roll in self.rolls: + self.data.append(reck[roll]) + myStr = '[' + str(dice) + ' Expertise] = (' + for data in self.data: + myStr += data + ', ' + myStr = myStr[:len(myStr)-2] + ')' + return myStr + + +die_rollers.register(wfrpg) + diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/dieroller/rollers/wod.py --- a/orpg/dieroller/rollers/wod.py Wed Jan 13 02:50:22 2010 -0600 +++ b/orpg/dieroller/rollers/wod.py Thu Jan 14 03:32:20 2010 -0600 @@ -65,12 +65,9 @@ if s1 >0: s1 -= 1 s -= 1 - else: - botch = 1 - elif r == 1: - s -= 1 - if botch == 1 and s < 0: - s = 0 + else: botch = 1 + elif r == 1: s -= 1 + if botch == 1 and s < 0: s = 0 return s def __str__(self): @@ -79,14 +76,18 @@ for a in self.data[1:]: myStr += "," myStr += str(a) - if self.sum() < 0: - myStr += "] vs " +str(self.target)+" result of a botch" - elif self.sum() == 0: - myStr += "] vs " +str(self.target)+" result of a failure" - else: - myStr += "] vs " +str(self.target)+" result of (" + str(self.sum()) + ")" - - + if self.sum() < 0: myStr += "] vs " +str(self.target)+" result of a botch" + elif self.sum() == 0: myStr += "] vs " +str(self.target)+" result of a failure" + else: myStr += "] vs " +str(self.target)+" result of (" + str(self.sum()) + ")" return myStr -die_rollers.register(wod) \ No newline at end of file + def non_stdDie(self, s): + num_sides = s.split('v') + if len(num_sides) > 1: + num_sides; num = num_sides[0]; sides = num_sides[1] + sides = '10'; target = num_sides[1] + ret = ['(', num.strip(), "**die_rollers['wod'](", + sides.strip(), ')).vs(', target, ')'] + s = ''.join(ret); return str(eval(s)) + +die_rollers.register(wod) diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/dieroller/utils.py --- a/orpg/dieroller/utils.py Wed Jan 13 02:50:22 2010 -0600 +++ b/orpg/dieroller/utils.py Thu Jan 14 03:32:20 2010 -0600 @@ -55,48 +55,37 @@ def listRollers(self): return die_rollers.keys() - def stdDieToDClass(self,match): + def stdDieToDClass(self, match): s = match.group(0) num_sides = s.split('d') - if len(num_sides) > 1: num_sides; num = num_sides[0]; sides = num_sides[1] - else: return self.non_stdDieToDClass(s) # Use a non standard converter. - - if sides.strip().upper() == 'F': sides = "'f'" - try: - if int(num) > 100 or int(sides) > 10000: return None - except: pass - ret = ['(', num.strip(), "**die_rollers['", self.getRoller(), "'](", - sides.strip(), '))'] - return ''.join(ret) - - def non_stdDieToDClass(self, s): - num_sides = s.split('v') if len(num_sides) > 1: num_sides; num = num_sides[0]; sides = num_sides[1] - if self.getRoller() == 'mythos': sides = '12'; target = num_sides[1] - elif self.getRoller() == 'wod': sides = '10'; target = num_sides[1] + if sides.strip().upper() == 'F': sides = "'f'" + try: + if int(num) > 100 or int(sides) > 10000: return None + except: pass ret = ['(', num.strip(), "**die_rollers['", self.getRoller(), "'](", - sides.strip(), ')).vs(', target, ')'] - return ''.join(ret) + sides.strip(), '))'] + s = ''.join(ret); return str(eval(s)) ## Moved eval here for portability. - num_sides = s.split('k') - if len(num_sides) > 1: - num_sides; num = num_sides[0]; sides = '10'; target = num_sides[1] - ret = ['(', num.strip(), "**die_rollers['", self.getRoller(), "'](", - sides.strip(), ')).takeHighest(', target, ').open(10)'] - return ''.join(ret) + ## Portable Non Standard Die Characters (for Puu-san) + else: s = die_rollers._rollers[self.getRoller()]().non_stdDie(s); return s # Use this to convert ndm-style (3d6) dice to d_base format def convertTheDieString(self,s): reg = re.compile("(?:\d+|\([0-9\*/\-\+]+\))\s*[a-zA-Z]+\s*[\dFf]+") (result, num_matches) = reg.subn(self.stdDieToDClass, s) if num_matches == 0 or result is None: - try: - s2 = self.roller_class + "(0)." + s + reg = re.compile("(?:\d+|\([0-9\*/\-\+]+\))\s*[a-zA-Z]+\s*[a-zA-Z]+") ## Prof Ebral + (result, num_matches) = reg.subn(self.stdDieToDClass, s) ## Prof Ebral + """try: ## Kinda pointless when you can create new Regular Expressions + s2 = self.roller_class + "(0)." + s ## Broken method test = eval(s2) return s2 - except: pass + except Exception, e: print e; pass""" return result def proccessRoll(self, s): - return str(eval(self.convertTheDieString(s))) + v = str(self.convertTheDieString(s)) + return v + diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/mapper/images.py --- a/orpg/mapper/images.py Wed Jan 13 02:50:22 2010 -0600 +++ b/orpg/mapper/images.py Thu Jan 14 03:32:20 2010 -0600 @@ -106,7 +106,7 @@ self.__fetching = {} urllib.urlcleanup() -#Private Methods + #Private Methods def __loadThread(self, path, image_type, imageId): uriPath = urllib.unquote(path) try: @@ -121,11 +121,13 @@ else: logger.general("Image refused to load or URI did not " "reference a valid image: " + path, True) + self.__queue.put(('failed', image_type, imageId)) del self.__fetching[path] except IOError: del self.__fetching[path] logger.general("Unable to resolve/open the specified URI; " "image was NOT laoded: " + path, True) + self.__queue.put((dir_struct["icon"] + "failed.png", image_type, imageId)) def __loadCacheThread(self, path, image_type, imageId): try: diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/mapper/map.py --- a/orpg/mapper/map.py Wed Jan 13 02:50:22 2010 -0600 +++ b/orpg/mapper/map.py Thu Jan 14 03:32:20 2010 -0600 @@ -156,7 +156,8 @@ else: pass if not ImageHandler.Queue.empty(): (path, image_type, imageId) = ImageHandler.Queue.get() - img = wx.ImageFromMime(path[1], path[2]) + if path == 'failed': img = wx.Image(dir_struct["icon"] + "failed.png", wx.BITMAP_TYPE_PNG) + else: img = wx.ImageFromMime(path[1], path[2]) try: # Now, apply the image to the proper object if image_type == "miniature": diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/orpg_version.py --- a/orpg/orpg_version.py Wed Jan 13 02:50:22 2010 -0600 +++ b/orpg/orpg_version.py Thu Jan 14 03:32:20 2010 -0600 @@ -4,7 +4,7 @@ #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed) DISTRO = "Traipse Alpha" DIS_VER = "Ornery Orc" -BUILD = "100113-00" +BUILD = "100114-00" # This version is for network capability. PROTOCOL_VERSION = "1.2" diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/templates/nodes/die_roller_notes.xml --- a/orpg/templates/nodes/die_roller_notes.xml Wed Jan 13 02:50:22 2010 -0600 +++ b/orpg/templates/nodes/die_roller_notes.xml Thu Jan 14 03:32:20 2010 -0600 @@ -1,4 +1,4 @@ - + The new dieroller is design with expansion in mind. While there are a number of new dieroller options in the base roller, the new design facilitates the building of new rollers that can be loaded at any time. In this test build three are 3 rollers: std, d20, and wod. The std roller is the generic roller. It has generic dice options and is the base for all other dierollers. The d20 and wod rollers are game specific rollers and have game specific options. They also serve as examples for how to create your own rollers in python. @@ -52,7 +52,7 @@ - The 7th Sea roller is part of the Standard rollers in Traipse. + Remember, to use the 7th Sea roller type: "/dieroller 7sea" The 7th Sea roller includes a truncated version that allows you to roll quickly. @@ -71,7 +71,7 @@ - Remember, to use the wod roller type: "/dieroller wod" + Remember, to use the WoD roller type: "/dieroller wod" vs(target) - vs roll against target @@ -98,7 +98,7 @@ 'w' = Wound 'm' = Mortal - Remember, to use the mythos roller type: "/dieroller mythos" + Remember, to use the Mythos roller type: "/dieroller mythos" The mythos roller is a roller designed by community request. The roller uses a new style of versus similar to the wod roller. @@ -117,8 +117,26 @@ The mythos roller also works with the new shortened vs. roll [3v3] = [3d12.vs(3)] - vs roll against 3, 6, 9, 12 + + Remember, to use the Warhammer FRPG roller type: "/dieroller wfrpg" + +*Special thanks goes to Puu-san who purchase a support ticket for this awesome die roller. Be sure and thank Puu-san.* + +The Warhammer FRPG die roller is the first of it's kind and is used when playing the Warhammer Fantasy Role-Playing Game. Unlike standard dice the WFRPG roller has pictures on it's facets. When rolling the WFRPG die, you will return text that corrosponds to the facet one the die. + +Die Types & Syntax: + +Below you will see the die types and how to roll 1 of each die type. + +Reckless: [1rec] +Conservative: [1con] +Characteristic: [1cha] +Challenge: [1chr] +Fortune: [1for] +Mistfortune: [1mis] +Expertise: [1exp] - Remember, to use the hero roller type: "/dieroller hero" + Remember, to use the Hero roller type: "/dieroller hero" Skill Roller, example [3d6.sk(11,0)] Make a SKill roll. The first number of the two modifiers is the rating in the skill, 11 meaning 11 or less. The second number is any penalty or bonus you have for the roll. A positive number is a bonus, a negative number is a penalty. As with many Hero system rolls, the only die choice that makes sense is 3d6 diff -r 537a6bbac9bd -r 60dde67c4ed6 orpg/tools/orpg_settings.py --- a/orpg/tools/orpg_settings.py Wed Jan 13 02:50:22 2010 -0600 +++ b/orpg/tools/orpg_settings.py Thu Jan 14 03:32:20 2010 -0600 @@ -185,8 +185,9 @@ rm = component.get('DiceManager') try: rm.setRoller(changes) - self.chat.SystemPost('You have changed your die roller to the "' + rm.getRoller.name + '" roller.') - except: + self.chat.SystemPost('You have changed your die roller to the "' + rm.getRoller() + '" roller.') + except Exception, e: + print e rm.setRoller('std') self.settings.change('dieroller', 'std') self.chat.SystemPost('"' + changes + '" is an invalid roller. Setting roller to "std"')