def roll(self, char, weapon, options = None): variables = self.createVarDict(char, weapon, options) self.evaluate(variables) difficulty = variables["GS"] pool = variables["pool"] r = roll(pool) return getNumberOfSuccesses(r, difficulty)
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)