annotate orpg/dieroller/rollers/hero.py @ 211:f7e78e36de50 alpha

Traipse Alpha 'OpenRPG' {100428-04} 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) Moved to Beta! New Features: New Namespace method with two new syntaxes New Namespace Internal is context sensitive, always! New Namespace External is 'as narrow as you make it' New Namespace FutureCheck helps ensure you don't receive an incorrect node New PluginDB access for URL2Link plugin New to Forms, they now show their content in Design Mode New to Update Manager, checks Repo for updates on software start 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 Fix to Backgrounds not loading through remote loader Fix to Node name errors Fix to rolling dice in chat Whispers Fix to Splitters Sizing issues Fix to URL2Link plugin, modified regex compilation should remove memory leak Fix to mapy.py, a roll back due to zoomed grid issues Fix to whiteboard_handler, Circles work by you clicking the center of the circle Fix to Servers parse_incoming_dom which was outdated and did not respect XML Fix to a broken link in the server welcome message Fix to InterParse and logger requiring traceback Fix to Update Manager Status Bar Fix to failed image and erroneous pop up
author sirebral
date Wed, 28 Apr 2010 07:54:19 -0500
parents b633f4c64aae
children
rev   line source
167
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
1 # (at your option) any later version.
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
2 #
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
3 # This program is distributed in the hope that it will be useful,
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
4 # but WITHOUT ANY WARRANTY; without even the implied warranty of
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
5 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
6 # GNU General Public License for more details.
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
7 #
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
8 # You should have received a copy of the GNU General Public License
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
9 # along with this program; if not, write to the Free Software
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
10 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
11 # --
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
12 #
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
13 # File: Hero.py
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
14 # Version:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
15 # $Id: Hero.py,v .3 DJM & Heroman
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
16 #
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
17 # Description: Hero System die roller originally based on Posterboy's D20 Dieroller
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
18 #
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
19 # Changelog:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
20 # v.3 by Heroman
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
21 # Added hl() to show hit location (+side), and hk() for Hit Location killing damage
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
22 # (No random stun multiplier)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
23 # v.2 DJM
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
24 # Removed useless modifiers from the Normal damage roller
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
25 # Changed Combat Value roller and SKill roller so that positive numbers are bonuses,
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
26 # negative numbers are penalties
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
27 # Changed Killing damage roller to correct stun multiplier bug
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
28 # Handled new rounding issues
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
29 #
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
30 # v.1 original release DJM
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
31
195
b633f4c64aae Traipse Alpha 'OpenRPG' {100219-00}
sirebral
parents: 167
diff changeset
32 __version__ = "$Id: hero.py,v Traipse 'Ornery-Orc' prof.ebral Exp $"
167
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
33
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
34 from time import time, clock
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
35 import random
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
36 from std import std
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
37 from orpg.dieroller.base import *
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
38
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
39 # Hero stands for "Hero system" not 20 sided die :)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
40
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
41 class hero(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
42 name = "hero"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
43
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
44 def __init__(self,source=[]):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
45 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
46
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
47
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
48 def k(self,mod):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
49 return herok(self,mod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
50
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
51 def hl(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
52 return herohl(self)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
53
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
54 def hk(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
55 return herohk(self)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
56
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
57 def n(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
58 return heron(self)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
59
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
60 def cv(self,cv,mod):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
61 return herocv(self,cv,mod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
62
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
63 def sk(self,sk,mod):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
64 return herosk(self,sk,mod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
65
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
66 die_rollers.register(hero)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
67
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
68 class herocv(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
69 def __init__(self,source=[],cv=10,mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
70 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
71 self.cv = cv
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
72 self.mod = mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
73
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
74 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
75 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
76 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
77 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
78 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
79 myStr += "] = (" + str(self.sum()) + ")"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
80
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
81 myStr += " with a CV of " + str(self.cv)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
82 myStr += " and a modifier of " + str(self.mod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
83 cvhit = 11 + self.cv - self.sum() + self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
84 myStr += " hits up to <b>DCV <font color='#ff0000'>" + str(cvhit) + "</font></b>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
85 return myStr
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
86
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
87 class herosk(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
88 def __init__(self,source=[],sk=11,mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
89 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
90 self.sk = sk
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
91 self.mod = mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
92
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
93 def is_success(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
94 return (((self.sum()-self.mod) <= self.sk))
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
95
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
96 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
97 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
98 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
99 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
100 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
101 strAdd="] - "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
102 swapmod=self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
103 if self.mod < 0:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
104 strAdd= "] + "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
105 swapmod= -self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
106 myStr += strAdd + str(swapmod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
107 modSum = self.sum()-self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
108 myStr += " = (" + str(modSum) + ")"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
109 myStr += " vs " + str(self.sk)
195
b633f4c64aae Traipse Alpha 'OpenRPG' {100219-00}
sirebral
parents: 167
diff changeset
110 if self.is_success(): myStr += " or less <font color='#ff0000'>Success!"
b633f4c64aae Traipse Alpha 'OpenRPG' {100219-00}
sirebral
parents: 167
diff changeset
111 else: myStr += " or less <font color='#ff0000'>Failure!"
167
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
112 Diff = self.sk - modSum
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
113 myStr += " by " + str(Diff) +" </font>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
114 return myStr
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
115
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
116 class herok(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
117 def __init__(self,source=[],mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
118 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
119 self.mod = mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
120
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
121 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
122 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
123 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
124 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
125 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
126 myStr += "] = (<font color='#ff0000'><b>" + str(int(round(self.sum()))) + "</b></font>)"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
127 stunx = random.randint(1,6)-1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
128 if stunx <= 1:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
129 stunx = 1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
130 myStr += " <b>Body</b> and a stunx of (" + str(stunx)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
131 stunx = stunx + self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
132 myStr += " + " + str(self.mod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
133 stunsum = round(self.sum()) * stunx
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
134 myStr += ") for a total of (<font color='#ff0000'><b>" + str(int(stunsum)) + "</b></font>) <b>Stun</b>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
135 return myStr
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
136
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
137 class herohl(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
138 def __init__(self,source=[],mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
139 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
140 self.mod = mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
141
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
142 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
143 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
144 side = random.randint(1,6)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
145 sidestr = "Left "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
146 if side >=4:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
147 sidestr = "Right "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
148 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
149 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
150 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
151 myStr += "] = (<font color='#ff0000'><b>" + str(int(round(self.sum()))) + "</b></font>) "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
152 location = int(round(self.sum()))
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
153 if location <= 5:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
154 myStr += "Location: <B>Head</B>, StunX:<B>x5</B>, NStun:<B>x2</B>, Bodyx:<B>x2</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
155 elif location == 6:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
156 myStr += "Location: <B>" + sidestr + "Hand</B>, StunX:<B>x1</B>, NStun:<B>x1/2</B>, Bodyx:<B>x1/2</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
157 elif location == 7:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
158 myStr += "Location: <B>" + sidestr + "Arm</B>, StunX:<B>x2</B>, NStun:<B>x1/2</B>, Bodyx:<B>x1/2</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
159 elif location == 8:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
160 myStr += "Location: <B>" + sidestr + "Arm</B>, StunX:<B>x2</B>, NStun:<B>x1/2</B>, Bodyx:<B>x1/2</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
161 elif location == 9:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
162 myStr += "Location: <B>" + sidestr + "Shoulder</B>, StunX:<B>x3</B>, NStun:<B>x1</B>, Bodyx:<B>x1</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
163 elif location == 10:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
164 myStr += "Location: <B>Chest</B>, StunX:<B>x3</B>, NStun:<B>x1</B>, Bodyx:<B>x1</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
165 elif location == 11:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
166 myStr += "Location: <B>Chest</B>, StunX:<B>x3</B>, NStun:<B>x1</B>, Bodyx:<B>x1</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
167 elif location == 12:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
168 myStr += "Location: <B>Stomach</B>, StunX:<B>x4</B>, NStun:<B>x1 1/2</B>, Bodyx:<B>x1</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
169 elif location == 13:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
170 myStr += "Location: <B>Vitals</B>, StunX:<B>x4</B>, NStun:<B>x1 1/2</B>, Bodyx:<B>x2</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
171 elif location == 14:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
172 myStr += "Location: <B>" + sidestr + "Thigh</B>, StunX:<B>x2</B>, NStun:<B>x1</B>, Bodyx:<B>x1</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
173 elif location == 15:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
174 myStr += "Location: <B>" + sidestr + "Leg</B>, StunX:<B>x2</B>, NStun:<B>x1/2</B>, Bodyx:<B>x1/2</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
175 elif location == 16:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
176 myStr += "Location: <B>" + sidestr + "Leg</B>, StunX:<B>x2</B>, NStun:<B>x1/2</B>, Bodyx:<B>x1/2</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
177 elif location >= 17:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
178 myStr += "Location: <B>" + sidestr + "Foot</B>, StunX:<B>x1</B>, NStun:<B>x1/2</B>, Bodyx:<B>x1/2</B>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
179 return myStr
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
180
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
181 class herohk(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
182 def __init__(self,source=[],mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
183 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
184 self.mod = mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
185
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
186 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
187 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
188 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
189 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
190 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
191 myStr += "] = (<font color='#ff0000'><b>" + str(int(round(self.sum()))) + "</b></font>)"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
192 stunx = 1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
193 myStr += " <b>Body</b> "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
194 stunx = stunx + self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
195 stunsum = round(self.sum()) * stunx
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
196 myStr += " for a total of (<font color='#ff0000'><b>" + str(int(stunsum)) + "</b></font>) <b>Stun</b>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
197 return myStr
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
198
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
199 class heron(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
200 def __init__(self,source=[],mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
201 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
202 self.bodtot=0
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
203
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
204 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
205 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
206 if self.data[0] == 6:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
207 self.bodtot=self.bodtot+2
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
208 else:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
209 self.bodtot=self.bodtot+1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
210 if self.data[0] <= 1:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
211 self.bodtot=self.bodtot-1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
212 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
213 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
214 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
215 if a == 6:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
216 self.bodtot=self.bodtot+2
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
217 else:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
218 self.bodtot=self.bodtot+1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
219 if a <= 1:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
220 self.bodtot=self.bodtot-1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
221 myStr += "] = (<font color='#ff0000'><b>" + str(self.bodtot) + "</b></font>)"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
222 myStr += " <b>Body</b> and "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
223 myStr += "(<font color='#ff0000'><b>" + str(int(round(self.sum()))) + "</b></font>) <b>Stun</b>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
224 return myStr
195
b633f4c64aae Traipse Alpha 'OpenRPG' {100219-00}
sirebral
parents: 167
diff changeset
225