def Zap(self): 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 y<3 and y>-5 and ((x>11.5 and x<18) or (z>11.5 and z<18)): plus.zap(bot, 10, 3.0) self.zapping.append(bot) plus.playSound(self.zapsound)
def Zap(self): if not plus.isMatchPaused() and not plus.isMatchOver(): if self.chargetimer == 0.0: for bot, in_range in self.sensors.iteritems(): if in_range: plus.zap(bot, 10, 3.0) self.zapping.append(bot) self.zaptimer = 3.0 self.chargetimer = 5.0 Arenas.currentArena.Charge(self.chargetimer, self.sensors) plus.loopSound(self.zapsound) plus.playSound(self.chargesound)
def Tick(self): if self.emitting == True: if plus.isMatchOver(): self.FlameOff() if self.timeEmitting < 1: #flames are long enough by the end of 1 second self.timeEmitting += .25 vel = vector3(self.velocity) flamepos = vel * self.timeEmitting flamepos = flamepos + vector3(self.location) arena = Arenas.currentArena if arena: compinfo = plus.rayTest(self.adjustedLoc.asTuple(), flamepos.asTuple()) if not compinfo[ 0] == -1: # we got a valid bot and component back from the ray test if not plus.isMatchPaused() and not plus.isMatchOver(): plus.damage(compinfo[0], compinfo[1], 25, (compinfo[2], compinfo[3], compinfo[4]))
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)
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