#bwmagicmouthred2 riddle
from eventAPI import *
from APIUtils import *

bwmagicmouthred2 = 0

def fireEvent(e):
    global bwmagicmouthred2
    bwmagicmouthred2 = getTag(e, "bwmagicmouthred2")
    showPicture(e, "bw_magicmouthred2")
    if(not bwmagicmouthred2):
    	showPicture(e, "bw_magicmouthred2")
        showMessage(e,
            ["From out of the wall a magic mouth appears. It asks a riddle"])
        answer = stringInput(e,
            ["We appear during the night. We dissapear by morning. What are we?"])
        if(answer.lower() != "stars"):
            return 0 
        else:
            bwmagicmouthred2 = 1
            setTag(e, "bwmagicmouthred2", bwmagicmouthred2)
            
            
    showPicture(e, "Cave")
    if (poseYesNo(e,
        ["Upon giving the correct answer the magic mouth dissapears revealing a passageway.",
         "Do you enter?"])):
        tickGame(e, 60)
        setExit(e, "maps/bwquadrant2.cfg", 28, 20, 90)
    return 0
