#Plane of healing spring
from eventAPI import *
from APIUtils import *

rtHealTime = 0

def fireEvent(e):
   global rtHealTime
   rtHealTime = getTag(e, "rtHealTime")
   currentGameTime = getGameTime(e)
   if (currentGameTime > (rtHealTime + 5760)):
      healMe(e)
   else:
      showMessage(e, ["You kneel by the waters edge and drink deeply.", "", "The water is cool, but it does not heal you any further.", "", "Perhaps you must wait longer before the effects will again work."])
   return 0


def healMe(e):
   partyIdx = 0
   while (partyIdx < getPartyCount(e)):
      modifyHP(e, partyIdx, +400)
      modifySP(e, partyIdx, +200)
      partyIdx += 1
   showMessage(e, ["You kneel by the waters edge and drink deeply.", "", "The properties of the water heal many of your wounds and re-energizes you."])
   rtHealTime = getGameTime(e)
   setTag(e, "rtHealTime", rtHealTime)
   return 0