Poodletooth-iLand/toontown/building/DistributedBankCollectableAI.py
2015-03-03 17:10:12 -05:00

20 lines
629 B
Python

from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.task.Task import Task
class DistributedBankCollectableAI(DistributedObjectAI):
def requestGrab(self):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId)
if not av:
return
self.sendUpdate('grab', [avId])
av.addMoney(100)
taskName = self.uniqueName('deleteBankCollectable')
taskMgr.doMethodLater(5, self.__handleDeleteBankCollectable, taskName)
def __handleDeleteBankCollectable(self, task):
self.requestDelete()
return Task.done