from random import randint
#The walk home text RPG
#intro
print("try walk home. '/list' to show a list of options '/kill loop' to exit (no caps)")
#Variables
Currency = str(input("What money would you like: "))
Y = bool(0) #kill
E = int (0) #Event
Morale = int(100) #stats
Fatigue  = int(0) #stats
Distance = int(input("How far: ")) #stats
Money = int(20) #stats
Turns = int(1) #time keeping
#loop 
while(Y == 0):#(indentation past this point)
#input
    
    I = input(str("What to do?: "))
#Events
    E = randint(0,4)
#Events Detections
    if E == 1:
        print("it's raining: -10 morale") #rain
        Morale = Morale - 10
    elif E == 2:
        print("brr cold +10 Fatigue") #cold
        Fatigue = Fatigue + 10
    elif E == 3:
        print("Hey ice cream man over here -5 Morale")#ice cream
        Morale = Morale - 5
    elif E == 4:
        print("Ooh look a note +10", Currency)
        Money = Money + 10
    else:
        print("This is fine (nothing special)") #fine weather
#Detections
    if I == "run":
        Distance = Distance - randint(3,5)
        Fatigue = Fatigue + randint(7,12)
        print("Huff I hope that was worth it")
    elif I == "/list":
        print("run = 3 to 5 Distance, 7 to 12 More Fatigue")
        print("walk = 1 or 2 Distance, 3 to 7 More Fatigue")
        print("buy food = 8 to 12 less Money, 8 to 10 more Morale, 14 to 16 Less Fatigue")
        print("beg money = 1 to 20 More Money, 5 to 10 Less Morale")
        print("beg food = 1 to 10 Less Fatigue, 5 to 10 less Morale")
        print("cinema =  80 to 100 Less Money, 100 to 120 Morale")
        print("part time = 1 to 10 More Fatigue, 20 to 30 More Money")
        print("buffet = 80 to 100 less money, 100 to 120 less fatigue")
        print("phew looking stuff up is tiring, best rest")
    elif I == "walk":
        Distance = Distance - randint(1,2)
        Fatigue = Fatigue + randint(3,7)
        print("Nice little stroll")
    elif I == "buy food":
        if Money >= 12:
            Fatigue = Fatigue - randint(14,16)
            Money = Money - randint(8,12)
            Morale = Morale + randint(8,10)
            print("What I couldn't help eating it")
        else:
            print("Couldn't afford it.")
    elif I == "beg money":
        Money = Money + randint(1,20)
        Morale = Morale - randint(5,10)
        print("Aw come on just a penny")
    elif I == "/kill loop":
        Y = 1
    elif I == "cinema":
        if Money >= 100:
            Money = Money - randint(80,100)
            Morale = Morale + randint(100,120)
            print("Lets get to the action already")
        else:
            print("Couldn't afford it.")
    elif I == "beg food":
        Fatigue = Fatigue - randint(1,10)
        Morale = Morale - randint(5,10)
    elif I == "buffet":
        if Money >= 100:
            Money = Money - randint(80,100)
            Fatigue = Fatigue - randint(100,120)
            print("Mmm tasty")
        else:
            print("Couldn't afford it.")
    elif I == "part time":
        Fatigue = Fatigue + randint(1,10)
        Money = Money + randint(20,30)
    else:
        print("I didn't quite get that so I'll just wait")
        
#Score
    print()
    print("Morale:", Morale)
    print("Fatigue:", Fatigue)
    print("Distance:", Distance)
    print("Money:", Money, Currency)
    print("Turns:", Turns)
    print()
    if Morale <= 0:
        print("Dont just take the bus your only:", Distance,"away (Game over enter to quit)")
        Y = 1
        input()
    elif Fatigue >= 100:
        print("Wait dont pass out your only:", Distance,"away (Game over enter to quit)")
        Y = 1
        input()
    elif Distance <= 0:
        print("Yay you win (Game over enter to quit)")
        Y = 1
        input()
    Turns = Turns + 1
