コード例 #1
0
    def Tick(self):
        if self.active:
            self.timer += .5
            if self.timer == self.delay:
                self.slider.Lock(False)
                self.slider.SetDirection(1)
                self.active = False
                plus.loopSound(self.slidesound)
                self.sliding = True
                self.slidetime = 0

        if self.sliding:
            self.slidetime += .5
            if self.slidetime >= 16:
                plus.stopSound(self.slidesound)
コード例 #2
0
    def DoIntro(self, on):
        if on:
            self.Intro = self.Introduction()
            self.bDoingIntro = True
        else:
            self.bDoingIntro = False
            # start cams over from first camera
            self.StaticCamIterator = iter(self.StaticCams)
            self.WatchCamIterator = iter(self.WatchCams)

            for sound in self.intro_sounds.itervalues():
                plus.stopSound(sound)
                plus.removeSound(sound)

            if self.intro_music:
                plus.stopSound(self.intro_music)
                plus.removeSound(self.intro_music)

            plus.introComplete()
コード例 #3
0
ファイル: Elec2haz.py プロジェクト: egold555/RobotArenaMod
    def Tick(self):
        for each in plus.getPlayers():
            if plus.getLocation(each)[1] < -5 or abs(plus.getLocation(each)[0]) > 18 or abs(plus.getLocation(each)[2]) > 18:
                p = 1
            else:
                p = 0

        if self.NumBotsInRange()>0:
            self.Zap()
            if not plus.isMatchPaused() and not plus.isMatchOver():
                for bot, in_range in self.sensors.iteritems():
                    x = abs(plus.getLocation(bot)[0])
                    y = plus.getLocation(bot)[1]
                    z = abs(plus.getLocation(bot)[2])
                    if in_range and p==0 and y<3 and y>-5 and ((x>11.5 and x<18) or (z>11.5 and z<18)):
                        plus.damage(bot, 0, 16, plus.getLocation(bot))
                        plus.addPoints(bot, -16)
        
        if self.NumBotsInRange()==0:
            self.zapping = []
            plus.stopSound(self.zapsound)
コード例 #4
0
    def Tick(self):
        #self.announcetimer -= .25
        if self.chargetimer == 0.0 and self.NumBotsInRange() == 1:
            self.Zap()

        if self.zaptimer > 0.0:
            self.zaptimer -= .25
            if self.zaptimer <= 0.0:
                self.zaptimer = 0.0
                self.zapping = []
                plus.stopSound(self.zapsound)
            elif self.zaptimer > 0.0:
                for bot in self.zapping:
                    if not plus.isMatchPaused() and not plus.isMatchOver():
                        plus.damage(bot, 0, 25, plus.getLocation(bot))
                        if self.sensors[bot]:
                            plus.force(bot, 0, 115 * plus.getWeight(bot), 0)

        if self.chargetimer > 0.0:
            self.chargetimer -= .25
        elif self.chargetimer < 0.0:
            self.chargetimer = 0.0
コード例 #5
0
 def FlameOff(self):
     self.emitter.SetEmitting(False)
     self.emitting = False
     plus.stopSound(self.flamesound)
コード例 #6
0
 def __del__(self):
     if self.endmusic:
         plus.stopSound(self.endmusic)
         plus.removeSound(self.endmusic)