From aa817b97d915eceb8495d990f7aa6637818c0da7 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Sun, 30 Jun 2024 12:09:34 +0100 Subject: [PATCH] another attempt to fix ability check --- app/functions/roll_ability_check.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/functions/roll_ability_check.py b/app/functions/roll_ability_check.py index e1be450..5817a67 100644 --- a/app/functions/roll_ability_check.py +++ b/app/functions/roll_ability_check.py @@ -2,9 +2,14 @@ from app.functions.roll_dices import roll_dices def roll_ability_check(score, multiplier): + result = dict() threshold = score * multiplier + result['threshold'] = threshold rolled = roll_dices(1, 100, False).get('result') + result['rolled'] = rolled if rolled < threshold: - return {'threshold': threshold, 'rolled': rolled, 'success': True} + result['success'] = True else: - return {'threshold': threshold, 'rolled': rolled, 'success': False} + result['success'] = False + + return result