comparison orpg/gametree/nodehandlers/d20.py @ 195:b633f4c64aae alpha

Traipse Alpha 'OpenRPG' {100219-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 (Patch-2) New Features: New Namespace method with two new syntaxes Fixes: Fix to Server GUI startup errors Fix to Server GUI Rooms tab updating Fix to Chat and Settings if non existant die roller is picked Fix to Dieroller and .open() used with .vs(). Successes are correctly calculated Fix to Alias Lib's Export to Tree, Open, Save features Fix to alias node, now works properly Fix to Splitter node, minor GUI cleanup
author sirebral
date Sat, 24 Apr 2010 08:37:20 -0500
parents bf799efe7a8a
children
comparison
equal deleted inserted replaced
182:4b2884f29a72 195:b633f4c64aae
19 # 19 #
20 # File: d20.py 20 # File: d20.py
21 # Author: Chris Davis 21 # Author: Chris Davis
22 # Maintainer: 22 # Maintainer:
23 # Version: 23 # Version:
24 # $Id: d20.py,v 1.30 2007/05/22 00:50:57 digitalxero Exp $ 24 # $Id: d20.py,v Traipse 'Ornery-Orc' prof.ebral Exp $
25 # 25 #
26 # Description: The file contains code for the d20 nodehanlers 26 # Description: The file contains code for the d20 nodehanlers
27 # 27 #
28 28
29 __version__ = "$Id: d20.py,v 1.30 2007/05/22 00:50:57 digitalxero Exp $" 29 __version__ = "$Id: d20.py,v Traipse 'Ornery-Orc' prof.ebral Exp $"
30 30
31 from core import * 31 from core import *
32 from containers import * 32 from containers import *
33 import re 33 import re
34 from xml.etree.ElementTree import ElementTree, Element, iselement 34 from xml.etree.ElementTree import ElementTree, Element, iselement
35 from xml.etree.ElementTree import fromstring, tostring, parse, XML 35 from xml.etree.ElementTree import fromstring, tostring, parse, XML
36 from orpg.tools.orpg_log import debug 36 from orpg.tools.orpg_log import debug
37 from orpg.tools.InterParse import Parse
37 38
38 D20_EXPORT = wx.NewId() 39 D20_EXPORT = wx.NewId()
39 ############################ 40 ############################
40 ## d20 character node handler 41 ## d20 character node handler
41 ############################ 42 ############################
989 990
990 # Simple matter to output all the attack/damage lines to the chat buffer. 991 # Simple matter to output all the attack/damage lines to the chat buffer.
991 for i in range( 0, len( bab ) ): 992 for i in range( 0, len( bab ) ):
992 if bab[i] > 0 or i == 0: 993 if bab[i] > 0 or i == 0:
993 attack_roll_str = '[1d20%+d]' % (bab[i] + attack_mod) 994 attack_roll_str = '[1d20%+d]' % (bab[i] + attack_mod)
994 attack_roll_parsed = self.chat.ParseDice( attack_roll_str ) 995 attack_roll_parsed = Parse.Dice( attack_roll_str )
995 damage_roll_str = '[%dd%d%+d%s]' % (num_damage_dice, damage_die, damage_mod, extra_damage) 996 damage_roll_str = '[%dd%d%+d%s]' % (num_damage_dice, damage_die, damage_mod, extra_damage)
996 damage_roll_parsed = self.chat.ParseDice( damage_roll_str ) 997 damage_roll_parsed = Parse.Dice( damage_roll_str )
997 txt = '%s (%s): %s ===> Damage: %s' \ 998 txt = '%s (%s): %s ===> Damage: %s' \
998 % (name, bab_attributes[i], attack_roll_parsed, damage_roll_parsed) 999 % (name, bab_attributes[i], attack_roll_parsed, damage_roll_parsed)
999 self.chat.Post( txt, True, True ) 1000 self.chat.Post( txt, True, True )
1000 1001
1001 # Check for a critical hit 1002 # Check for a critical hit