mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-25 20:52:26 -06:00
21 lines
629 B
Python
21 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
|