#plane of air fight 2
from eventAPI import *
from APIUtils import *

rtpoairFlag2=0

def fireEvent(e):
   global rtpoairFlag2
   rtpoairFlag2 = getTag(e, "rtpoairFlag2")
   if (rtpoairFlag2 == 1):
      return 1
   else:
      fightThem(e)

def fightThem(e):
   combatRet = combat(e, [("Twister", 8, 3, 20)])
   if (combatRet == 1):
      wonFight(e)

def wonFight(e):
   global rtpoairFlag2
   global rtPrinceofSongs
   chest(e, 3, 0, 0, [], dice(1, 4, 1), "Treasure")
   rtPrinceofSongs = getTag(e, "rtPrinceofSongs")
   if (rtPrinceofSongs == 1):
      showPicture(e, "Laneraven")
      showMessage(e, ["The Prince of Songs trills a short song of amusment and circles overhead.", "", "\"Such things cannot be used to decorate a nest.  Why would one call them treasure?\""])
   rtpoairFlag2 = 1
   setTag(e, "rtpoairFlag2", rtpoairFlag2)
