#eastern keep floor 1 earth elemental
from eventAPI import *
from APIUtils import *

rtkeep1Earth = 0

def fireEvent(e):
   global rtkeep1Earth
   rtkeep1Earth = getTag(e, "rtkeep1Earth")
   if (rtkeep1Earth == 2):
      return 1
   elif (rtkeep1Earth == 1):
      removeBarrier(e)
   else:
      noMark(e)


def removeBarrier(e):
   global rtkeep1Earth
   showMessage(e, ["A shower of rock and dirt erupts from the ground.", "",  "As the debris settles, it forms an elemental being.","", "Slowly, the earthen beast begins to speak to you."], optionInput)
   showPicture(e, "Earth_Elemental")
   showMessage(e, ["\"You bear the Mark of Earth.\"", "", "\"The barrier shall be removed.\""])
   rtkeep1Earth = 2
   setTag(e, "rtkeep1Earth", rtkeep1Earth)
   return 0

def noMark(e):
   showMessage(e, ["A shower of rock and dirt erupts from the ground.", "",  "As the debris settles, it forms an elemental being.","", "Slowly, the earthen beast begins to speak to you."])
   showPicture(e, "Earth_Elemental")
   showMessage(e, ["\"You must first gain the Mark of Earth.\"", "", "\"Go now and do not return until you bear the mark.\""])
   partyIdx = 0
   while (partyIdx < getPartyCount(e)):
      modifyHP(e, partyIdx, -30)
      partyIdx += 1
   return 0
