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

rtkeep1Water = 0

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


def removeBarrier(e):
   global rtkeep1Water
   showMessage(e, ["A spout of water appears.", "",  "The water takes the shape of an elemental being, which begins to address you."], optionInput)
   showPicture(e, "Water_Elemental")
   showMessage(e, ["\"You bear upon you the Mark of Water.\"", "", "\"I shall open the way for you.\""])
   rtkeep1Water = 2
   setTag(e, "rtkeep1Water", rtkeep1Water)
   return 0

def noMark(e):
   showMessage(e, ["A spout of water appears.", "",  "The water takes the shape of an elemental being, which begins to address you."])
   showPicture(e, "Water_Elemental")
   showMessage(e, ["\"You do not bear the Mark of Water.\"", "", "\"Only those who bear the Mark may pass the barrier.\""])
   partyIdx = 0
   while (partyIdx < getPartyCount(e)):
      modifyHP(e, partyIdx, -30)
      partyIdx += 1
   return 0