コード例 #1
0
ファイル: StormCloud.py プロジェクト: coginvasion/src
 def __init__(self):
     SquirtGag.__init__(self, CIGlobals.StormCloud, GagGlobals.getProp(4, 'stormcloud-mod'), 60, GagGlobals.CLOUD_HIT_SFX, None, GagGlobals.CLOUD_MISS_SFX, None, None, None, None, 1, 1)
     LocationGag.__init__(self, 10, 50)
     LocationGag.setShadowData(self, isCircle=True, shadowScale=0.75)
     self.setImage('phase_3.5/maps/storm-cloud.png')
     self.entities = []
     self.searchRadius = 6
     return
コード例 #2
0
ファイル: StormCloud.py プロジェクト: coginvasion/src
 def release(self):
     LocationGag.release(self)
     actorTrack = LocationGag.getActorTrack(self)
     LocationGag.getSoundTrack(self).start()
     if actorTrack:
         if self.isLocal():
             actorTrack.append(Func(self.considerSquirt))
         actorTrack.start()
コード例 #3
0
 def __init__(self):
     SquirtGag.__init__(self, CIGlobals.StormCloud, GagGlobals.getProp(4, 'stormcloud-mod'), 60,
                        GagGlobals.CLOUD_HIT_SFX, None, GagGlobals.CLOUD_MISS_SFX, None, None, None, None, 1, 1)
     LocationGag.__init__(self, 10, 50)
     LocationGag.setShadowData(self, isCircle = True, shadowScale = 0.75)
     self.setImage('phase_3.5/maps/storm-cloud.png')
     self.entities = []
     self.searchRadius = 6
     self.timeout = 3.0
コード例 #4
0
ファイル: ActivateTrapGag.py プロジェクト: coginvasion/src
 def start(self):
     TrapGag.startTrap(self)
     if self.trapMode == 0:
         LocationGag.start(self, self.avatar)
     elif self.trapMode == 1:
         if not self.gag:
             self.build()
             self.setHandJoint()
         self.gag.reparentTo(self.handJoint)
         self.avatar.play('toss', fromFrame=22)
コード例 #5
0
 def start(self):
     TrapGag.startTrap(self)
     if self.trapMode == 0:
         LocationGag.start(self, self.avatar)
     else:
         if self.trapMode == 1:
             if not self.gag:
                 self.build()
                 self.setHandJoint()
             self.gag.reparentTo(self.handJoint)
             self.avatar.play('toss', fromFrame=22)
コード例 #6
0
    def start(self):
        TrapGag.startTrap(self)

        # Let's start the location seeker if we're using a trapdoor or quicksand gag.
        if self.trapMode == 0:
            LocationGag.start(self, self.avatar)
        elif self.trapMode == 1:
            if not self.gag:
                self.build()
                self.setHandJoint()
            self.gag.reparentTo(self.handJoint)
            self.avatar.play('toss', fromFrame=22)
コード例 #7
0
 def release(self):
     LocationGag.release(self)
     if self.isLocal():
         self.startTimeout()
     actorTrack = LocationGag.getActorTrack(self)
     LocationGag.getSoundTrack(self).start()
     if actorTrack:
         if self.isLocal():
             actorTrack.append(Func(self.considerSquirt))
         actorTrack.start()
     if self.isLocal():
         base.localAvatar.sendUpdate('usedGag', [self.id])
コード例 #8
0
ファイル: ActivateTrapGag.py プロジェクト: coginvasion/src
 def __init__(self, name, model, damage, hitSfx, collRadius, mode = 0, anim = None, autoRelease = True, activateSfx = None):
     TrapGag.__init__(self, name, model, damage, hitSfx, anim, doesAutoRelease=autoRelease)
     LocationGag.__init__(self, 10, 50, shadowScale=0.25)
     self.trapMode = mode
     self.entities = []
     self.lifeTime = 120
     self.minSafeDistance = 5
     self.collRadius = collRadius
     self.activateSfx = None
     if game.process == 'client':
         if activateSfx:
             self.activateSfx = base.audio3d.loadSfx(activateSfx)
     return
コード例 #9
0
 def __init__(self, name, model, damage, hitSfx, collRadius, mode=0, anim=None, autoRelease=True, activateSfx=None):
     TrapGag.__init__(self, name, model, damage, hitSfx, anim, doesAutoRelease=autoRelease)
     LocationGag.__init__(self, 10, 50, shadowScale=0.25)
     self.trapMode = mode
     self.entities = []
     self.lifeTime = 120
     self.minSafeDistance = 5
     self.collRadius = collRadius
     self.activateSfx = None
     self.entityTrack = None
     if game.process == 'client':
         if activateSfx:
             self.activateSfx = base.audio3d.loadSfx(activateSfx)
     return
コード例 #10
0
ファイル: ActivateTrapGag.py プロジェクト: coginvasion/src
 def release(self):
     TrapGag.release(self)
     if self.trapMode == 0:
         LocationGag.release(self)
         self.build()
         self.buildCollisions()
         actorTrack = LocationGag.getActorTrack(self)
         if actorTrack:
             LocationGag.getSoundTrack(self).start()
             if self.isLocal():
                 actorTrack.append(Func(self.avatar.b_gagThrow, self.getID()))
             actorTrack.start()
     elif self.trapMode == 1:
         self.startEntity()
コード例 #11
0
 def release(self):
     TrapGag.release(self)
     if self.trapMode == 0:
         LocationGag.release(self)
         self.build()
         self.buildCollisions()
         actorTrack = LocationGag.getActorTrack(self)
         if actorTrack:
             LocationGag.getSoundTrack(self).start()
             if self.isLocal():
                 actorTrack.append(Func(self.avatar.b_gagThrow, self.getID()))
             actorTrack.start()
     else:
         if self.trapMode == 1:
             self.startEntity()
コード例 #12
0
    def release(self):
        TrapGag.release(self)

        # Let's release the location seeker if we're using a trapdoor or quicksand.
        if self.trapMode == 0:
            LocationGag.release(self)
            self.build()
            self.buildCollisions()
            actorTrack = LocationGag.getActorTrack(self)
            if actorTrack:
                LocationGag.getSoundTrack(self).start()
                if self.isLocal():
                    actorTrack.append(
                        Func(self.avatar.b_gagThrow, self.getID()))
                actorTrack.start()
        elif self.trapMode == 1:
            self.startEntity()
コード例 #13
0
ファイル: StormCloud.py プロジェクト: coginvasion/src
 def getClosestCog(self, radius = 6):
     loc = LocationGag.getLocation(self)
     for cog in base.cr.doId2do.values():
         if cog.__class__.__name__ == 'DistributedSuit':
             if cog.getPlace() == base.localAvatar.zoneId:
                 distance = (cog.getPos(render) - loc).length()
                 if distance <= radius:
                     return cog
コード例 #14
0
 def getClosestCog(self, radius = 6):
     loc = LocationGag.getLocation(self)
     for cog in base.cr.doId2do.values():
         if cog.__class__.__name__ in CIGlobals.SuitClasses:
             if cog.getPlace() == base.localAvatar.zoneId:
                 distance = (cog.getPos(render) - loc).length()
                 if distance <= radius:
                     return cog
コード例 #15
0
    def __init__(self,
                 name,
                 model,
                 damage,
                 hitSfx,
                 collRadius,
                 mode=0,
                 anim=None,
                 autoRelease=True,
                 activateSfx=None):
        TrapGag.__init__(self,
                         name,
                         model,
                         damage,
                         hitSfx,
                         anim,
                         doesAutoRelease=autoRelease)
        LocationGag.__init__(self, 10, 50, shadowScale=0.25)

        # This is the mode the trap gag is on. 0) Trapdoor/Quicksand and 1) Banana Peel, marbles, etc.
        self.trapMode = mode

        # This keeps track of the entities we drop.
        self.entities = []

        # This is the length (in seconds) of how long an entity exists.
        self.lifeTime = 120

        # This is the minimum distance an entity has to be from another.
        self.minSafeDistance = 5

        # This is the radius of the CollisionSphere that detects suits.
        self.collRadius = collRadius

        # This is the sound effect called when a trap is tripped.
        self.activateSfx = None

        self.entityTrack = None

        if game.process == 'client':
            if activateSfx:
                self.activateSfx = base.audio3d.loadSfx(activateSfx)
コード例 #16
0
 def completeTrap(self):
     LocationGag.complete(self)
     self.reset()
コード例 #17
0
 def unEquip(self):
     LocationGag.cleanupLocationSeeker(self)
     SquirtGag.unEquip(self)
     self.completeSquirt()
コード例 #18
0
 def setEndPos(self, x, y, z):
     LocationGag.setDropLoc(self, x, y, z + 0.25)
コード例 #19
0
 def start(self):
     SquirtGag.start(self)
     LocationGag.start(self, self.avatar)
コード例 #20
0
 def completeSquirt(self):
     if game.process == 'client':
         LocationGag.complete(self)
         self.reset()
コード例 #21
0
ファイル: ActivateTrapGag.py プロジェクト: coginvasion/src
 def unEquip(self):
     TrapGag.unEquip(self)
     LocationGag.cleanupLocationSeeker(self)
コード例 #22
0
 def unEquip(self):
     TrapGag.unEquip(self)
     LocationGag.cleanupLocationSeeker(self)
コード例 #23
0
ファイル: ActivateTrapGag.py プロジェクト: coginvasion/src
 def setEndPos(self, x, y, z):
     LocationGag.setDropLoc(self, x, y, z + 0.25)
コード例 #24
0
ファイル: StormCloud.py プロジェクト: coginvasion/src
 def start(self):
     SquirtGag.start(self)
     LocationGag.start(self, self.avatar)
コード例 #25
0
ファイル: ActivateTrapGag.py プロジェクト: coginvasion/src
 def completeTrap(self):
     LocationGag.complete(self)
     self.reset()
     if self.isLocal():
         base.localAvatar.enablePieKeys()
コード例 #26
0
ファイル: StormCloud.py プロジェクト: coginvasion/src
 def completeSquirt(self):
     if game.process == 'client':
         LocationGag.complete(self)
         self.reset()
         if self.isLocal():
             base.localAvatar.enablePieKeys()
コード例 #27
0
ファイル: StormCloud.py プロジェクト: coginvasion/src
 def unEquip(self):
     LocationGag.cleanupLocationSeeker(self)
     SquirtGag.unEquip(self)
     self.completeSquirt()