#Senrat guard door
from eventAPI import *
from APIUtils import *

senratdoor = 0

def fireEvent(e):
    global senratdoor
    senratdoor = getTag(e, "senratdoor")
    if(not senratdoor):
        showMessage(e,
            ["There is a door to the north, which is being guarded by a Senrat."])
        answer = stringInput(e,
            ["From the other side of the door the Senrat asks, What's the password?..."])
        if(answer.lower() != "platinum"):
            return 0
        else:
            senratdoor = 1
            setTag(e, "senratdoor", senratdoor)
    showPicture(e, "Cave")
    if (poseYesNo(e,
        ["The Senrat opens the door, revealing a passageway.",
         "Do you enter?"])):
        tickGame(e, 60)
        setExit(e, "maps/bwquadrant1.cfg", 30, 18, 0)
    return 0
