hood: Implement DistributedTimerAI (for the AA geyser)

This commit is contained in:
Joey Z 2014-04-05 16:18:04 -04:00
parent 2eb26897b2
commit 7ad1b3b16b
2 changed files with 15 additions and 3 deletions

View file

@ -1,9 +1,18 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.distributed.ClockDelta import *
import time
class DistributedTimerAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedTimerAI")
def setStartTime(self, todo0):
pass
def __init__(self, air):
DistributedObjectAI.__init__(self, air)
self.setStartTime(globalClockDelta.getRealNetworkTime(bits = 32))
def setStartTime(self, time):
self.startTime = time
def getStartTime(self):
return self.startTime

View file

@ -1,8 +1,11 @@
from toontown.toonbase import ToontownGlobals
from HoodAI import HoodAI
from toontown.toonbase import ToontownGlobals
from toontown.distributed import DistributedTimerAI
class OZHoodAI(HoodAI):
HOOD = ToontownGlobals.OutdoorZone
def createSafeZone(self):
HoodAI.createTreasurePlanner(self)
self.timer = DistributedTimerAI.DistributedTimerAI(self.air)
self.timer.generateWithRequired(ToontownGlobals.OutdoorZone)