Each stat has two variables that only ever increase (strength is strength.up and strength.down, use the average to determine which has happened most of the time)... and I think the math is right but when I do a test run, no matter how often I increase "strength.down" the checking system (in this case strength.high) still returns as true. Please let me know what I'm doing wrong! I'm also open to hearing about different/better self-balancing methods if you've come up with one that works great for you.
Code: Select all
class Stat(renpy.store.object):
def __init__(self, average=0, up=1, down=1):
self.average=average
self.up=up
self.down=down
#stat adding and subtracting system
def rise(self):
self.up += 1
def drop(self):
self.down += 1
#stat checking system
def high(self):
self.average = (self.up / (self.up + self.down))
if self.average > .9:
return True
else:
return False
def more(self):
self.average = (self.up / (self.up + self.down))
if self.average > .7:
return True
else:
return False
def less(self):
self.average = (self.up / (self.up + self.down))
if self.average > .3:
return True
else:
return False
def low(self):
self.average = (self.up / (self.up + self.down))
if self.average > .1:
return True
else:
return False