#Mage Tower (entrance)
from eventAPI import *
from APIUtils import *

lair1Gate = 0

def fireEvent(e):
    global lair1Gate
    lair1Gate = getTag(e, "lair1Gate")
    if(not lair1Gate):
        showMessage(e,
            ["From out of the ether, a disembodied voice poses a riddle"])
        answer = stringInput(e,
            ["Golem and rock,",
             "This elemental stock.",
             "Home to the Dwarves,",
             "source of farmer's chores.",
             "Only at sea is there a dearth,",
             "of this element we call..."])
        if(answer.lower() != "earth"):
            return 0
        else:
            lair1Gate = 1
            setTag(e, "lair1Gate", lair1Gate)
    showPicture(e, "Cave")
    if (poseYesNo(e,
        ["You see before you stairs leading up into the Lair.",
         "Do you enter?"])):
        tickGame(e, 60)
        setExit(e, "maps/lair1.cfg", 0, 0, 0)
    return 0
