#Trap #71  vacuum
#Added with Tales of the North MOD
#7d9+4, save vs. Air for half
from eventAPI import *
from APIUtils import *

def fireEvent(e):
   lFlagS = getTag(e, "lFlagS")
   if (not issetany(lFlagS, 0x00000300)):
      return 1
   if (isclearall(lFlagS, 0x00000002)):
      showMessage(e, ["You gasp for air as a magical vacuum surrounds you."], optionInput)
      for partyIdx in range(getPartyCount(e)):
         dmg = dice(7, 9, 4)
         if (savingThrow(e, "air", partyIdx, 0) > 0):
            dmg = dmg / 2
         modifyHP(e, partyIdx, -dmg)
   return 1
