#Lair level 2 entrance
from eventAPI import *
from APIUtils import *

lair2Gate = 0

def fireEvent(e):
    global lair2Gate
    lair2Gate = getTag(e, "lair2Gate")
    if(not lair2Gate):
        showMessage(e,
            ["From out of the ether, a disembodied voice poses a riddle"])
        answer = stringInput(e,
            ["From gentle ripples to might tides "
             "Even dew that clings to hides "
             "Drawn from the earth in wooden pails "
             "And traveled upon by means of sails "
             "Mother, father, son and daughter ",
             "All must drink the precious..."])
        if(answer.lower() != "water"):
            return 0
        else:
            lair2Gate = 1
            setTag(e, "lair2Gate", lair2Gate)
    showPicture(e, "Cave")
    if (poseYesNo(e,
        ["You see before you leading up into the Lair.",
         "Do you enter?"])):
        tickGame(e, 60)
        setExit(e, "maps/lair2.cfg", 11, 14, 180)
    return 0
