annotate orpg/dieroller/rollers/hero.py @ 167:5c9a118476b2 alpha

Traipse Alpha 'OpenRPG' {091210-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 Added 7th Sea die roller method; 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)]. Includes support for Mythos roller 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 no reactive settings when Ok is pressed Fixes to Alternity roller's attack roll. Uses a simple Tuple instead of a Splice
author sirebral
date Thu, 10 Dec 2009 10:53:33 -0600
parents
children dcae32e219f1
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
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
32 __version__ = "$Id: hero.py,v 1.15 2006/11/04 21:24:19 digitalxero Exp $"
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
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
37 from std import std
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
38 from orpg.dieroller.base import *
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
39
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
40 # Hero stands for "Hero system" not 20 sided die :)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
41
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
42 class hero(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
43 name = "hero"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
44
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
45 def __init__(self,source=[]):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
46 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
47
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
48 # these methods return new die objects for specific options
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
49
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
50 def k(self,mod):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
51 return herok(self,mod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
52
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
53 def hl(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
54 return herohl(self)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
55
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
56 def hk(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
57 return herohk(self)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
58
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
59 def n(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
60 return heron(self)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
61
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
62 def cv(self,cv,mod):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
63 return herocv(self,cv,mod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
64
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
65 def sk(self,sk,mod):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
66 return herosk(self,sk,mod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
67
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
68 die_rollers.register(hero)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
69
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
70 class herocv(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
71 def __init__(self,source=[],cv=10,mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
72 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
73 self.cv = cv
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
74 self.mod = mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
75
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
76
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
77 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
78 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
79 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
80 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
81 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
82 myStr += "] = (" + str(self.sum()) + ")"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
83
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
84 myStr += " with a CV of " + str(self.cv)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
85 myStr += " and a modifier of " + str(self.mod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
86 cvhit = 11 + self.cv - self.sum() + self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
87 myStr += " hits up to <b>DCV <font color='#ff0000'>" + str(cvhit) + "</font></b>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
88 return myStr
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
89
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
90 class herosk(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
91 def __init__(self,source=[],sk=11,mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
92 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
93 self.sk = sk
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
94 self.mod = mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
95
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
96 def is_success(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
97 return (((self.sum()-self.mod) <= self.sk))
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
98
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
99 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
100 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
101 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
102 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
103 myStr += str(a)
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 if self.mod < 0:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
107 strAdd= "] + "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
108 swapmod= -self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
109 myStr += strAdd + str(swapmod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
110 modSum = self.sum()-self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
111 myStr += " = (" + str(modSum) + ")"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
112 myStr += " vs " + str(self.sk)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
113
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
114 if self.is_success():
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
115 myStr += " or less <font color='#ff0000'>Success!"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
116 else:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
117 myStr += " or less <font color='#ff0000'>Failure!"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
118
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
119 Diff = self.sk - modSum
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
120 myStr += " by " + str(Diff) +" </font>"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
121
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
122 return myStr
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
123
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
124 class herok(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
125 def __init__(self,source=[],mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
126 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
127 self.mod = mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
128
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
129 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
130 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
131 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
132 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
133 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
134 myStr += "] = (<font color='#ff0000'><b>" + str(int(round(self.sum()))) + "</b></font>)"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
135 stunx = random.randint(1,6)-1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
136 if stunx <= 1:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
137 stunx = 1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
138 myStr += " <b>Body</b> and a stunx of (" + str(stunx)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
139 stunx = stunx + self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
140 myStr += " + " + str(self.mod)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
141 stunsum = round(self.sum()) * stunx
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
142 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
143 return myStr
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
144
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
145 class herohl(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
146 def __init__(self,source=[],mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
147 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
148 self.mod = mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
149
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
150 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
151 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
152 side = random.randint(1,6)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
153 sidestr = "Left "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
154 if side >=4:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
155 sidestr = "Right "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
156 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
157 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
158 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
159 myStr += "] = (<font color='#ff0000'><b>" + str(int(round(self.sum()))) + "</b></font>) "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
160 location = int(round(self.sum()))
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
161 if location <= 5:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
162 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
163 elif location == 6:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
164 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
165 elif location == 7:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
166 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
167 elif location == 8:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
168 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
169 elif location == 9:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
170 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
171 elif location == 10:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
172 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
173 elif location == 11:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
174 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
175 elif location == 12:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
176 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
177 elif location == 13:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
178 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
179 elif location == 14:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
180 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
181 elif location == 15:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
182 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
183 elif location == 16:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
184 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
185 elif location >= 17:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
186 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
187 return myStr
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
188
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
189 class herohk(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
190 def __init__(self,source=[],mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
191 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
192 self.mod = mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
193
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
194 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
195 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
196 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
197 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
198 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
199 myStr += "] = (<font color='#ff0000'><b>" + str(int(round(self.sum()))) + "</b></font>)"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
200 stunx = 1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
201 myStr += " <b>Body</b> "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
202 stunx = stunx + self.mod
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
203 stunsum = round(self.sum()) * stunx
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
204 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
205 return myStr
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
206
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
207 class heron(std):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
208 def __init__(self,source=[],mod=0):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
209 std.__init__(self,source)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
210 self.bodtot=0
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
211
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
212 def __str__(self):
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
213 myStr = "[" + str(self.data[0])
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
214 if self.data[0] == 6:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
215 self.bodtot=self.bodtot+2
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
216 else:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
217 self.bodtot=self.bodtot+1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
218 if self.data[0] <= 1:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
219 self.bodtot=self.bodtot-1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
220 for a in self.data[1:]:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
221 myStr += ","
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
222 myStr += str(a)
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
223 if a == 6:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
224 self.bodtot=self.bodtot+2
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
225 else:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
226 self.bodtot=self.bodtot+1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
227 if a <= 1:
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
228 self.bodtot=self.bodtot-1
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
229 myStr += "] = (<font color='#ff0000'><b>" + str(self.bodtot) + "</b></font>)"
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
230 myStr += " <b>Body</b> and "
5c9a118476b2 Traipse Alpha 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
231 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
232 return myStr