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