#Riddle 4
from eventAPI import *
from APIUtils import *
from SDLKeys import *

def fireEvent(e):
    if (getTag(e, "DKR") >= 4):
        return 1
    else:
        return next(e)

def next(e):
    showPicture(e, "bw_magicmouthred2") 
    answer = stringInput(e, ["A magic mouth on the wall speaks to you, saying this:", "", "\"In spring I am dressed in handsome array; in summer more clothing I wear; when colder it grows I fling off my clothes; and in winter quite naked appear. What am I?\""])
    if((answer.lower() == "tree") or (answer.lower() == "trees")):
        showMessage(e, ["You are now one step closer to the exit."])
        setTag(e, "DKR", 4)
        return 1
    else:
        showMessage(e, ["Wrong. You are not ready to pass."])
        return 0
