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