mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 12:12:36 -06:00
parent
9271489041
commit
37097d0645
1 changed files with 2 additions and 5 deletions
|
@ -3,14 +3,12 @@ from pandac.PandaModules import *
|
|||
from toontown.fishing import FishSellGUI
|
||||
from toontown.toonbase import ToontownGlobals, TTLocalizer
|
||||
import TreasureChestGlobals
|
||||
import time
|
||||
|
||||
class DistributedTreasureChest(DistributedObject):
|
||||
|
||||
def __init__(self, cr):
|
||||
DistributedObject.__init__(self, cr)
|
||||
self.cr = cr
|
||||
self.lastCollision = 0
|
||||
self.createModel(45, -165.75, 0.025, 210)
|
||||
self.initCollisions()
|
||||
|
||||
|
@ -27,6 +25,7 @@ class DistributedTreasureChest(DistributedObject):
|
|||
|
||||
def destroyFishGui(self):
|
||||
self.ignore('treasureChestSell')
|
||||
|
||||
if hasattr(self, 'fishGui'):
|
||||
self.fishGui.destroy()
|
||||
del self.fishGui
|
||||
|
@ -49,12 +48,10 @@ class DistributedTreasureChest(DistributedObject):
|
|||
self.accept('enter' + self.cSphereNode.getName(), self.handleCollisionSphereEnter)
|
||||
|
||||
def handleCollisionSphereEnter(self, collEntry):
|
||||
if self.lastCollision != 0 and self.lastCollision > time.time():
|
||||
return
|
||||
self.lastCollision = time.time() + ToontownGlobals.NPCCollisionDelay
|
||||
if not base.localAvatar.fishTank.getFish():
|
||||
base.localAvatar.setSystemMessage(0, TTLocalizer.STOREOWNER_NOFISH)
|
||||
return
|
||||
|
||||
base.setCellsActive(base.bottomCells, 0)
|
||||
base.cr.playGame.getPlace().setState('stopped')
|
||||
self.acceptOnce('treasureChestSell', self.handleSaleDone)
|
||||
|
|
Loading…
Reference in a new issue