from app.functions.roll_dices import roll_dices
from app.tables.encounters import EncounterTable


def roll_encounter(terrain):
    roll = roll_dices(1, 20, False).get('result')
    et = EncounterTable()
    creature = et.get_encounter(roll, terrain)
    return {"encounter": creature}
