def rollSkill(self, skill, diff, minSuccesses=0, att=None): assert skill in self.skills if att is not None and att in self.attributes: diff = max(1, diff + self.attributes.getModifier(att)) r = roll(self.getPoolSize(skill)) if minSuccesses: return isSuccessful(r, diff, minSuccesses) else: return getNumberOfSuccesses(r, diff)
def rollAttribute(self, att, diff, minSuccesses=0): r = roll(self.attributes[att]) if minSuccesses: return isSuccessful(r, diff, minSuccesses) else: return getNumberOfSuccesses(r, diff)