gammatools/app/functions/roll_ability_check.py

16 lines
390 B
Python
Raw Normal View History

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