import os

from characters import *
from items import *
from helpers import Dice
from locations import *

def choose_location():
    global current_location
    print(f"dostepne lokacje: {locations[current_location]}")
    goto = input("idz do: ")
    for l in locations[current_location]:
        if l.name == goto:
            current_location = l
            return

    print("niepoprawna lokacja")
    choose_location()

locations = {
    village : [village, forest],
    forest : [forest, cave]
}


current_location = village
 
player = Player("Adrian")
print(f"{player.name}, Witaj podróżniku!")
current_location.enter(player)
 
while player.is_alive():
    os.system('cls')
    choose_location()
    current_location.enter(player)



    if not player.is_alive():
        break
 
print("GAME OVER")
