#Asher in
from eventAPI import *
from APIUtils import *

AsherEnc = 0

def fireEvent(e):
    AsherEnc = getTag(e, "AsherEnc")

    if(AsherEnc == 0):
        showMessage(e, ["At the foot of the stairs, you stumble over something, looking down, you see its the helm rose was wearing"])
        showMessage(e, ["There's still a little bit of Rose left in it"])
        showPicture(e, "Lich")
        showMessage(e, ["\"They are coming master, we will protect you!!!!\""])
        showMessage(e, ["You can't see who they were talking to, but you do feel the presence of something large in the room just back in the shadows"])
        showMessage(e, ["As it steps forth from the darkness, you can see that there are small bits of shiny metal hanging from the corners of its maw",
             "You think you know what happened to Rose"])
        fightGuardians(e)
    else:
        return 1

    return 0

def fightGuardians(e):
    combatRet = combat(e, [("Ghost Dragon", 1, 0, 40), ("Crypt Thing", 3, 1, 30), ("Wight", 4, 2, 10)])
    if (combatRet == 1):
        wonGuardiansFight(e)
    elif (combatRet == 3):
        lostGuardiansFight(e)
    else:
        defeatedGuardiansFight(e)

def wonGuardiansFight(e):
    showMessage(e, ["The fight finally over, you are now given a chance to look around and gain your bearings"])
    showPicture(e, "argent")
    showMessage(e, ["\"I had to come back I heard the sounds of battle, and then things went quiet. I knew that if you all had failed, I couldn't live with the thought of not laying down my life to stop this ancient evil"])
    showMessage(e, ["So did Asher make himself known? No?  this does not bode well for us\""])
    showMessage(e, ["Argent begins looking around in earnest, obviously worried, but looking more sensible than before"])
    showMessage(e, ["THERE - in the North-East corner!"])
    setTag(e, "AsherEnc", 1)
    setTag(e, "ArgentPlt1", 3)

def lostGuardiansFight(e):
    showMesasge(e,
        ["Your last memory is that of cold breath on your neck"])

def defeatedGuardiansFight(e):
    showMessage(e,
        ["As you run away, you notice you're not pursued apparently the horrid things are intent on protection only"])
 
