another attempt to fix ability check

This commit is contained in:
Greg Gauthier 2024-06-30 12:09:34 +01:00
parent 8621353105
commit aa817b97d9

View File

@ -2,9 +2,14 @@ from app.functions.roll_dices import roll_dices
def roll_ability_check(score, multiplier): def roll_ability_check(score, multiplier):
result = dict()
threshold = score * multiplier threshold = score * multiplier
result['threshold'] = threshold
rolled = roll_dices(1, 100, False).get('result') rolled = roll_dices(1, 100, False).get('result')
result['rolled'] = rolled
if rolled < threshold: if rolled < threshold:
return {'threshold': threshold, 'rolled': rolled, 'success': True} result['success'] = True
else: else:
return {'threshold': threshold, 'rolled': rolled, 'success': False} result['success'] = False
return result