2019-11-08 22:55:55 -06:00
|
|
|
from direct.directnotify import DirectNotifyGlobal
|
2020-01-05 20:53:40 -06:00
|
|
|
from direct.distributed.ClockDelta import globalClockDelta
|
2019-11-08 22:55:55 -06:00
|
|
|
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
|
|
|
|
2020-01-05 20:53:40 -06:00
|
|
|
|
2019-11-08 22:55:55 -06:00
|
|
|
class DistributedGagAI(DistributedObjectAI):
|
|
|
|
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedGagAI')
|
2020-01-05 20:53:40 -06:00
|
|
|
|
|
|
|
def __init__(self, air, ownerId, race, _, x, y, z, gagType):
|
|
|
|
DistributedObjectAI.__init__(self, air)
|
|
|
|
self.ownerId = ownerId
|
|
|
|
self.race = race
|
|
|
|
self.pos = (x, y, z)
|
|
|
|
self.gagType = gagType
|
|
|
|
self.initTime = globalClockDelta.getFrameNetworkTime()
|
|
|
|
self.activateTime = 0
|
|
|
|
|
|
|
|
def getInitTime(self):
|
|
|
|
return self.initTime
|
|
|
|
|
|
|
|
def getActivateTime(self):
|
|
|
|
return self.activateTime
|
|
|
|
|
|
|
|
def getPos(self):
|
|
|
|
return self.pos
|
|
|
|
|
|
|
|
def getRace(self):
|
|
|
|
return self.race.getDoId()
|
|
|
|
|
|
|
|
def getOwnerId(self):
|
|
|
|
return self.ownerId
|
|
|
|
|
|
|
|
def getType(self):
|
|
|
|
return self.gagType
|
|
|
|
|
|
|
|
def hitSomebody(self, avId, time):
|
|
|
|
self.race.thrownGags.remove(self)
|
|
|
|
self.requestDelete()
|