示例#1
0
 def unEquip(self):
     if self.isLocal():
         self.resetCrashEffect()
     LocationGag.cleanup(self)
     if self.state != GagState.LOADED:
         self.completeDrop()
     Gag.unEquip(self)
 def start(self):
     super(DropGag, self).start()
     LocationGag.start(self, self.avatar)
     if self.isLocal() and self.getName() == CIGlobals.GrandPiano:
         base.taskMgr.add(self.tickShadowIdleTask, self.shadowIdleTaskName)
         base.accept(self.getLocationSeeker().getShadowMovedName(),
                     self.__shadowMoved)
示例#3
0
    def __init__(self):
        Gag.__init__(self)
        LocationGag.__init__(self, 3, 50)
        self.crosshair.wantCrosshair = False
        self.holdGag = False
        self.missSfx = None
        self.fallSfx = None
        self.chooseLocFrame = 34
        self.completeFrame = 77
        self.collHandlerF = CollisionHandlerFloor()
        self.fallDuration = 0.75
        self.isDropping = False
        self.timeout = 3.0
        if metadata.PROCESS == 'client':
            self.missSfx = base.audio3d.loadSfx(self.missSfxPath)
            self.fallSfx = base.audio3d.loadSfx(self.fallSoundPath)

        self.dropCollider = None
        self.colliderRadius = 0.75
        self.colliderOfs = Point3(0)

        self.dropMdl = None

        # Variables to handle the drop preview with large drops.
        self.crashSite = None
        self.crashSiteGag = None
        self.crashSiteShadow = None
        self.crashSiteIval = None
        self.crashStartPos = None
        self.crashEndPos = None
        self.crashBegun = False
        self.shadowIdleTaskName = 'Handle-IdleShadow'

        self.lastShadowMoveTime = 0.0
示例#4
0
 def completeDrop(self):
     LocationGag.complete(self)
     self.isDropping = False
     if game.process != 'client':
         return
     self.reset()
     if self.isLocal():
         base.localAvatar.enablePieKeys()
示例#5
0
    def equip(self):
        Gag.equip(self)
        LocationGag.equip(self)

        if self.isLocal() and self.getName() == GagGlobals.GrandPiano:
            base.taskMgr.add(self.tickShadowIdleTask, self.shadowIdleTaskName)
            self.accept(self.getLocationSeeker().getShadowMovedName(),
                        self.__shadowMoved)
示例#6
0
 def release(self):
     LocationGag.release(self)
     self.build()
     self.isDropping = True
     self.fallSoundInterval = SoundInterval(self.fallSfx, node=self.avatar)
     actorTrack = LocationGag.getActorTrack(self)
     soundTrack = LocationGag.getSoundTrack(self)
     if actorTrack:
         actorTrack.append(Func(self.startDrop))
         actorTrack.start()
         soundTrack.append(self.fallSoundInterval)
         soundTrack.start()
示例#7
0
 def __init__(self, name, model, anim, damage, hitSfx, missSfx, scale, playRate):
     Gag.__init__(self, name, model, damage, GagType.DROP, hitSfx, anim=anim, playRate=playRate, scale=scale, autoRelease=True)
     LocationGag.__init__(self, 10, 50)
     self.missSfx = None
     self.fallSoundPath = 'phase_5/audio/sfx/incoming_whistleALT.mp3'
     self.fallSoundInterval = None
     self.fallSfx = None
     self.chooseLocFrame = 34
     self.completeFrame = 77
     self.collHandlerF = CollisionHandlerFloor()
     self.fallDuration = 0.75
     self.isDropping = False
     if game.process == 'client':
         self.missSfx = base.audio3d.loadSfx(missSfx)
         self.fallSfx = base.audio3d.loadSfx(self.fallSoundPath)
     return
 def release(self):
     if self.isLocal():
         self.startTimeout()
         self.resetCrashEffect()
     LocationGag.release(self)
     self.build()
     self.isDropping = True
     actorTrack = LocationGag.getActorTrack(self)
     self.fallSoundInterval = LocationGag.getSoundTrack(self)
     if actorTrack:
         actorTrack.append(Func(self.startDrop))
         actorTrack.start()
         self.fallSoundInterval.append(
             Parallel(SoundInterval(self.fallSfx, node=self.avatar)))
         self.fallSoundInterval.start()
     if self.isLocal():
         base.localAvatar.sendUpdate('usedGag', [self.id])
示例#9
0
 def release(self):
     if self.isLocal():
         self.startTimeout()
         self.resetCrashEffect()
     LocationGag.release(self)
     entity = self.build()
     self.isDropping = True
     self.buildTracks()
     actorTrack = LocationGag.getActorTrack(self)
     soundTrack = LocationGag.getSoundTrack(self)
     if actorTrack:
         actorTrack.append(Func(self.startDrop, entity))
         actorTrack.start()
         soundTrack.append(Parallel(SoundInterval(self.fallSfx)))
         soundTrack.start()
     entity.setPythonTag(SoundTrackName, soundTrack)
     if self.isLocal():
         base.localAvatar.sendUpdate('usedGag', [self.id])
    def __init__(self, name, model, anim, damage, hitSfx, missSfx, scale,
                 playRate):
        Gag.__init__(self,
                     name,
                     model,
                     damage,
                     GagType.DROP,
                     hitSfx,
                     anim=anim,
                     playRate=playRate,
                     scale=scale,
                     autoRelease=True)
        LocationGag.__init__(self, 10, 50)
        self.missSfx = None
        self.fallSoundPath = 'phase_5/audio/sfx/incoming_whistleALT.ogg'
        self.fallSoundInterval = None
        self.fallSfx = None
        self.chooseLocFrame = 34
        self.completeFrame = 77
        self.collHandlerF = CollisionHandlerFloor()
        self.fallDuration = 0.75
        self.isDropping = False
        self.timeout = 3.0
        if game.process == 'client':
            self.missSfx = base.audio3d.loadSfx(missSfx)
            self.fallSfx = base.audio3d.loadSfx(self.fallSoundPath)

        # Variables to handle the drop preview with large drops.
        self.crashSite = None
        self.crashSiteGag = None
        self.crashSiteShadow = None
        self.crashSiteIval = None
        self.crashStartPos = None
        self.crashEndPos = None
        self.crashBegun = False
        self.shadowIdleTaskName = 'Handle-IdleShadow'
        self.shadowIdleTime = 0.0
示例#11
0
 def setEndPos(self, x, y, z):
     LocationGag.setDropLoc(self, x, y, z)
 def unEquip(self):
     LocationGag.cleanupLocationSeeker(self)
     super(DropGag, self).unEquip()
     if self.state != GagState.LOADED:
         self.completeDrop()
示例#13
0
 def completeDrop(self):
     LocationGag.complete(self)
     self.isDropping = False
     if metadata.PROCESS != 'client':
         return
     self.reset()
示例#14
0
 def unEquip(self):
     LocationGag.cleanupLocationSeeker(self)
     super(DropGag, self).unEquip()
     if self.state != GagState.LOADED:
         self.completeDrop()
示例#15
0
 def start(self):
     super(DropGag, self).start()
     LocationGag.start(self, self.avatar)
 def completeDrop(self):
     LocationGag.complete(self)
     self.isDropping = False
     if game.process != 'client':
         return
     self.reset()
示例#17
0
 def setEndPos(self, x, y, z):
     LocationGag.setDropLoc(self, x, y, z)