#keep level 3 fight #1
from eventAPI import *
from APIUtils import *

rtKeep3Flag1=0

def fireEvent(e):
   global rtKeep3Flag1
   rtKeep3Flag1 = getTag(e, "rtKeep3Flag1")
   if (rtKeep3Flag1 == 1):
      return 1
   elif (rtKeep3Flag1 == 2):
      showMessage(e, ["How did they get such large creatures into such a tiny room?"], optionInput)
   else:
      showMessage(e, ["You come face to face with two rather large golems."], optionInput)
   fightThem(e)
   if (rtKeep3Flag1 == 1):
      return 1
   else:
      return 0

def fightThem(e):
   combatRet = combat(e, [("Gold Golem", 1, 0, 10), ("Gold Golem", 1, 0, 20)])
   if (combatRet == 1):
      wonFight(e)
   elif (combatRet == 3):
      lostFight(e)
   else:
      ranAwayFight(e)

def wonFight(e):
   global rtKeep3Flag1
   rtKeep3Flag1 = 1
   setTag(e, "rtKeep3Flag1", rtKeep3Flag1)

def lostFight(e):
   showMessage(e, ["You have been thoroughly squished."])

def ranAwayFight(e):
   global rtKeep3Flag1
   showMessage(e, ["The golems are too big to follow you outside of the room."], optionInput)
   rtKeep3Flag1 = 2
   setTag(e, "rtKeep3Flag1", rtKeep3Flag1)
