gammatools/app/functions/roll_ability_check.py

11 lines
369 B
Python
Raw Normal View History

from app.functions.roll_dices import roll_dices
def roll_ability_check(score, multiplier):
threshold = score * multiplier
rolled = roll_dices(1, 100, False).get('result')
if rolled < threshold:
2024-06-30 11:01:34 +00:00
return {'threshold': threshold, 'rolled': rolled, 'success': True}
else:
2024-06-30 11:01:34 +00:00
return {'threshold': threshold, 'rolled': rolled, 'success': False}