Mercurial > traipse_dev
diff orpg/dieroller/hero.py @ 71:449a8900f9ac ornery-dev
Code refining almost completed, for this round. Some included files are still in need of some clean up, but this is test worthy.
author | sirebral |
---|---|
date | Thu, 20 Aug 2009 03:00:39 -0500 |
parents | 4385a7d0efd1 |
children | bf799efe7a8a |
line wrap: on
line diff
--- a/orpg/dieroller/hero.py Tue Aug 18 20:48:36 2009 -0500 +++ b/orpg/dieroller/hero.py Thu Aug 20 03:00:39 2009 -0500 @@ -33,42 +33,50 @@ from time import time, clock import random - __version__ = "$Id: hero.py,v 1.15 2006/11/04 21:24:19 digitalxero Exp $" # Hero stands for "Hero system" not 20 sided die :) class hero(std): + def __init__(self,source=[]): std.__init__(self,source) # these methods return new die objects for specific options + def k(self,mod): return herok(self,mod) + def hl(self): return herohl(self) + def hk(self): return herohk(self) + def n(self): return heron(self) + def cv(self,cv,mod): return herocv(self,cv,mod) + def sk(self,sk,mod): return herosk(self,sk,mod) class herocv(std): + def __init__(self,source=[],cv=10,mod=0): std.__init__(self,source) self.cv = cv self.mod = mod + def __str__(self): myStr = "[" + str(self.data[0]) for a in self.data[1:]: @@ -83,14 +91,17 @@ return myStr class herosk(std): + def __init__(self,source=[],sk=11,mod=0): std.__init__(self,source) self.sk = sk self.mod = mod + def is_success(self): return (((self.sum()-self.mod) <= self.sk)) + def __str__(self): myStr = "[" + str(self.data[0]) for a in self.data[1:]: @@ -117,10 +128,12 @@ return myStr class herok(std): + def __init__(self,source=[],mod=0): std.__init__(self,source) self.mod = mod + def __str__(self): myStr = "[" + str(self.data[0]) for a in self.data[1:]: @@ -138,10 +151,12 @@ return myStr class herohl(std): + def __init__(self,source=[],mod=0): std.__init__(self,source) self.mod = mod + def __str__(self): myStr = "[" + str(self.data[0]) side = random.randint(1,6) @@ -182,10 +197,12 @@ return myStr class herohk(std): + def __init__(self,source=[],mod=0): std.__init__(self,source) self.mod = mod + def __str__(self): myStr = "[" + str(self.data[0]) for a in self.data[1:]: @@ -200,10 +217,12 @@ return myStr class heron(std): + def __init__(self,source=[],mod=0): std.__init__(self,source) self.bodtot=0 + def __str__(self): myStr = "[" + str(self.data[0]) if self.data[0] == 6: