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:
        result['success'] = True
    else:
        result['success'] = False

    return result
