mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-25 20:52:26 -06:00
22 lines
898 B
Python
22 lines
898 B
Python
|
from direct.distributed import DistributedObjectAI
|
||
|
from toontown.fishing import FishGlobals
|
||
|
import TreasureChestGlobals
|
||
|
|
||
|
class DistributedTreasureChestAI(DistributedObjectAI.DistributedObjectAI):
|
||
|
|
||
|
def completeSale(self, sell):
|
||
|
avId = self.air.getAvatarIdFromSender()
|
||
|
av = self.air.doId2do.get(avId)
|
||
|
|
||
|
if not av:
|
||
|
return
|
||
|
|
||
|
if sell:
|
||
|
trophyResult = self.air.fishManager.creditFishTank(av)
|
||
|
|
||
|
if trophyResult:
|
||
|
self.sendUpdateToAvatarId(avId, 'completeSaleResult', [TreasureChestGlobals.TROPHY, len(av.fishCollection), FishGlobals.getTotalNumFish()])
|
||
|
else:
|
||
|
self.sendUpdateToAvatarId(avId, 'completeSaleResult', [TreasureChestGlobals.COMPLETE, 0, 0])
|
||
|
else:
|
||
|
self.sendUpdateToAvatarId(avId, 'completeSaleResult', [TreasureChestGlobals.NONE, 0, 0])
|