#Lair - entrance to level 4
from eventAPI import *
from APIUtils import *

lair4Gate = 0

def fireEvent(e):
    global lair4Gate
    lair4Gate = getTag(e, "lair4Gate")
    if(not lair4Gate):
        showMessage(e,
            ["From out of the ether, a disembodied voice poses a riddle..."])
        answer = stringInput(e,
            ["Warmth and light, or most deadly fury",
             "Makes meat taste good, if not in a hurry",
             "Both friend and foe, a dangerous power",
             "Can destroy homes, or light the hour",
             "Adorning every funeral pyre",
             "Is the element known as..."])
        if(answer.lower() != "fire"):
            return 0
        else:
            lair4Gate = 1
            setTag(e, "lair4Gate", lair4Gate)
    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/lair4.cfg", 18, 18, 180)
    return 0
