from eventAPI import *
from APIUtils import *

def fireEvent(e):
   if (getTag(e, "lFlagU") == 2):
      return 1
   elif (getTag(e, "lFlagU") == 0):
      showMessage(e, ["You've made your way to the hatchery and nursery. Eggs are tended in a part of the cave, while larvae sprawl happily in another","",
                      "The nannies look happy to see you: it will save them a trip to the food store."])
      setTag(e, "lFlagU", 1)
   else:
      showMessage(e, ["If the ants are surprised to see their larvae's food come by its own means, they don't show it. However, they wish to separate you into manageable bits."])
   cr = combat(e, [("Warrior Ant", 8, 4, 10), ("Fire Ant", 4, 2, 30)])
   if (cr == 1):
      showMessage(e, ["After killing the nannies, you squash the larvae and crush the eggs. What fun!"])
      setTag(e, "lFlagU", 2)
      return 1
   elif (cr == 3):
      showMessage(e, ["The nannies feed you to their charges, who look happier than ever."])
   else:  
      showMessage(e, ["You retreat peacefully, if a bit precipitately."])
      return 0

