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

rtCastle1Flag3=0

def fireEvent(e):
   global rtCastle1Flag3
   rtCastle1Flag3 = getTag(e, "rtCastle1Flag3")
   if (rtCastle1Flag3 == 1):
      return 1
   elif (rtCastle1Flag3 == 2):
      showMessage(e, ["The guards were waiting for you."])
   else:
      showMessage(e, ["As you burst into the room, 5 pairs of eyes turn their gaze upon you."], optionInput)
   fightThem(e)
   setTag(e, "rtCastle1Flag3", rtCastle1Flag3)
   if (rtCastle1Flag3 == 1):
      return 1
   else:
      return 0

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

def wonFight(e):
   global rtCastle1Flag3
   showMessage(e, ["The faces of the fallen guards show no emotion or pain.  Were they even human?"])
   rtCastle1Flag3 = 1
   setTag(e, "rtCastle1Flag3", rtCastle1Flag3)

def lostFight(e):
   showMessage(e, ["The guards mechanically slaughter you.  No emotion shows on their faces as they go about their bloody work."])

def ranAwayFight(e):
   global rtCastle1Flag3
   showMessage(e, ["Stangely, the guards do not follow you outside of the room."])
   rtCastle1Flag3 = 2
   setTag(e, "rtCastle1Flag3", rtCastle1Flag3)
