def avatarEnter(self):
     avId = self.air.getAvatarIdFromSender()
     if avId not in self.air.doId2do:
         self.notify.warning('Avatar: %s not found' % avId)
         return
     if self.isBusy():
         self.freeAvatar(avId)
         return
     av = self.air.doId2do[avId]
     self.busy = avId
     self.acceptOnce(self.air.getAvatarExitEvent(avId), self.__handleUnexpectedExit, extraArgs=[avId])
     parties = av.hostedParties
     if av.getTotalMoney() < PartyGlobals.MinimumPartyCost:
         flag = NPCToons.PARTY_MOVIE_MINCOST
         self.d_setMovie(avId, flag)
         self.sendClearMovie(None)
     elif av.canPlanParty():
         flag = NPCToons.PARTY_MOVIE_START
         self.d_setMovie(avId, flag)
         taskMgr.doMethodLater(30.0, self.sendTimeoutMovie, self.uniqueName('clearMovie'))
     else:
         flag = NPCToons.PARTY_MOVIE_ALREADYHOSTING
         self.d_setMovie(avId, flag)
         self.sendClearMovie(None)
     DistributedNPCToonBaseAI.avatarEnter(self)
     return
 def avatarEnter(self):
     avId = self.air.getAvatarIdFromSender()
     if avId not in self.air.doId2do:
         self.notify.warning('Avatar: %s not found' % avId)
         return
     if self.isBusy():
         self.freeAvatar(avId)
         return
     av = self.air.doId2do[avId]
     self.busy = avId
     self.acceptOnce(self.air.getAvatarExitEvent(avId), self.__handleUnexpectedExit, extraArgs=[avId])
     laff = av.getMaxHp() - av.getHp()
     cost = laff * ToontownGlobals.CostPerLaffRestock
     if laff <= 0:
         self.d_setMovie(avId, LaffRestockGlobals.FullLaff)
         self.sendClearMovie(None)
     elif cost > av.getTotalMoney():
         self.d_setMovie(avId, LaffRestockGlobals.NoMoney)
         self.sendClearMovie(None)
     else:
         self.d_setMovie(avId, NPCToons.SELL_MOVIE_START)
         taskMgr.doMethodLater(LaffRestockGlobals.LAFFCLERK_TIMER, self.sendTimeoutMovie, self.uniqueName('clearMovie'))
         DistributedNPCToonBaseAI.avatarEnter(self)
 def delete(self):
     taskMgr.remove(self.uniqueName('clearMovie'))
     self.ignoreAll()
     DistributedNPCToonBaseAI.delete(self)
 def __init__(self, air, npcId):
     DistributedNPCToonBaseAI.__init__(self, air, npcId)
     self.givesQuests = 0
     self.busy = 0
 def delete(self):
     taskMgr.remove(self.uniqueName('clearMovie'))
     self.ignoreAll()
     DistributedNPCToonBaseAI.delete(self)
 def __init__(self, air, npcId):
     DistributedNPCToonBaseAI.__init__(self, air, npcId)
     self.givesQuests = 0
     self.busy = 0