#Plane of air Elbrus
from eventAPI import *
from APIUtils import *

rtElbrus = 0

def fireEvent(e):
   global rtElbrus
   rtElbrus = getTag(e, "rtElbrus")
   if (rtElbrus == 2):
      return 1
   elif (rtElbrus == 1):
      elbrus(e)
   else:
      showMessage(e, ["You are blocked by a wall of intense flame.  There is no way to pass through the blaze."])
      return 0

def elbrus(e):
   global rtElbrus
   showMessage(e, ["You are blocked by a wall of intense flame.  There is no way to pass through the blaze."])
   showMessage(e, ["A voice behind you speaks.", "", "\"Stay away from the fires as they would surely destroy you.\""])
   showPicture(e, "Ruby_Golem")
   showMessage(e, ["It is Elbrus, the elemental whom you spared before."])
   if (poseYesNo(e, ["\"Flame waits beyond.  You seek an audience with him?\""])):
      showMessage(e, ["\"For your kindness, I will get you past the barrier.  Be wary, Flame is both gracious and greedy.  One never knows which until the audience is concluded.\"", "", "\"I shall leave now for the realms of Earth.  Please, do not tell Flame what I have done here...\""])
      clearPicture(e)
      showMessage(e, ["Elbrus walks forward into the massive blaze.  As he passes through the fires, the flames dimish and disappear.  With a last look back, Elbrus leaves."])
      rtElbrus = 2
      setTag(e, "rtElbrus", rtElbrus)
      return 1
   else:
      showMessage(e, ["\"Wise not to disturb him.  I do not think that I can ever face him...\""]) 
      clearPicture(e)
      return 0
