def Activate(self, active): if active: if AI.SuperAI.debugging: self.debug = Gooey.Plain("watch", 0, 75, 200, 105) tbox = self.debug.addText("line0", 0, 0, 200, 15) tbox.setText("Throttle") tbox = self.debug.addText("line1", 0, 15, 200, 15) tbox.setText("Turning") tbox = self.debug.addText("line2", 0, 30, 200, 15) tbox.setText("") tbox = self.debug.addText("line3", 0, 45, 200, 15) tbox.setText("") tbox = self.debug.addText("line4", 0, 60, 200, 15) tbox.setText("") tbox = self.debug.addText("line5", 0, 75, 200, 15) tbox.setText("") tbox = self.debug.addText("line6", 0, 90, 200, 15) tbox.setText("") Me = self.GetID() for i in range(0, self.GetNumComponents()): max_HP = plus.getHitpoints(Me, i) plus.damage(Me, i, max_HP, plus.getLocation(Me)) plus.damage(Me, i, max_HP, plus.getLocation(Me)) plus.damage(Me, 0, 41, plus.getLocation(Me)) plus.damage(Me, 0, 41, plus.getLocation(Me)) plus.damage(Me, 0, 41, plus.getLocation(Me)) return AI.SuperAI.Activate(self, active)
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
def Activate(self, active): plus.damage(1, 0, 50000, plus.getLocation(1)) plus.damage(1, 0, 50000, plus.getLocation(1)) plus.damage(1, 0, 50000, plus.getLocation(1)) if active: #if AI.SuperAI.debugging: self.debug = Gooey.Plain("watch", 0, 75, 200, 105) tbox = self.debug.addText("line0", 0, 0, 200, 15) tbox.setText("Throttle") tbox = self.debug.addText("line1", 0, 15, 200, 15) tbox.setText("Turning") tbox = self.debug.addText("line2", 0, 30, 200, 15) tbox.setText("") tbox = self.debug.addText("line3", 0, 45, 200, 15) tbox.setText("") tbox = self.debug.addText("line4", 0, 60, 200, 15) tbox.setText("") tbox = self.debug.addText("line5", 0, 75, 200, 15) tbox.setText("") tbox = self.debug.addText("line6", 0, 90, 200, 15) tbox.setText("") return AI.SuperAI.Activate(self, active)
def Secret(self, bTarget): #This is definitely NOT a secret super death AI for Spinner from the west!!! You don't need to scroll down any further!!! # Tauntauns if self.numComps > 0: if plus.getTimeElapsed() < 3: self.tauntbox.get("taunt1").setText("I have been waiting a long time for this.") if 3 < plus.getTimeElapsed() < 5: self.tauntbox.get("taunt1").setText("Go on, squirm!") if 5 < plus.getTimeElapsed() < 8: self.tauntbox.get("taunt1").setText("Just try and budge that useless hood ornament you call a weapon!") if 8 < plus.getTimeElapsed() < 10: self.tauntbox.get("taunt1").setText("Squirm like the worm you are!") if 10 < plus.getTimeElapsed() < 12: self.tauntbox.get("taunt1").setText("Your struggles will not avail you...") if 12 < plus.getTimeElapsed() < 16: self.tauntbox.get("taunt1").setText("...against the power of the EYE OF THE WEST!") if 16 < plus.getTimeElapsed() < 18: self.tauntbox.get("taunt1").setText("Long have I tolerated your abuse, but NO LONGER!") if 18 < plus.getTimeElapsed() < 22: self.tauntbox.get("taunt1").setText("With the power of the Western Eye at my command, I AM INVINCIBLE!") if 22 < plus.getTimeElapsed() < 24: self.tauntbox.get("taunt1").setText("Now... suffer.") if 24 < plus.getTimeElapsed() < 27: self.tauntbox.get("taunt1").setText("Know the black depths of pain you have inflicted upon me!") if 27 < plus.getTimeElapsed() < 29: self.tauntbox.get("taunt1").setText("FEEL THE WRATH OF THE WEST!") if 29 < plus.getTimeElapsed() < 32: self.tauntbox.get("taunt1").setText("HA HA HA HA HA HA HA HA HA HA HA HA HA...") #stay put unless we're being counted out if not self.bImmobile: self.Throttle(0) for bot in self.bids: #cool psychic lightning effects self.arena.SetLightningStartEnd(bot, self.GetLocation(), plus.getLocation(bot)) self.zaptimer += 1 if self.zaptimer > 4: plus.zap(bot, 20, 1) self.zaptimer = 0 #apply more force as bots get further from center self.xforce = -1 * plus.getLocation(bot)[0] * plus.getWeight(bot) self.yforce = -30 * (plus.getLocation(bot)[1] - self.yCenter) * plus.getWeight(bot) self.zforce = -1 * plus.getLocation(bot)[2] * plus.getWeight(bot) plus.force(bot, self.xforce, self.yforce, self.zforce) #summon THE EYE OF THE WEST if abs(plus.getLocation(bot)[0]) < 2 and abs(plus.getLocation(bot)[2]) < 2 and self.eyetimer == 0: self.summon = 1 plus.removeSound(self.psygrab) if self.summon == 1 and self.eyetimer < 17: self.eyetimer += 0.25 if 0 < self.eyetimer <= 8 and self.eyetimer%1 == 0: plus.AddParticleEmitter((4*math.cos((math.pi/8)*self.eyetimer), (self.yCenter - 6), 4*math.sin((math.pi/8)*self.eyetimer)), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.AddParticleEmitter((4*math.cos((math.pi/8)*self.eyetimer + math.pi), (self.yCenter - 6), 4*math.sin((math.pi/8)*self.eyetimer + math.pi)), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.playSound(self.flamepuff) if self.eyetimer == 9: plus.AddParticleEmitter((1, (self.yCenter - 6), 3), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.AddParticleEmitter((-1, (self.yCenter - 6), -3), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.playSound(self.flamepuff) if self.eyetimer == 10: plus.AddParticleEmitter((1.6, (self.yCenter - 6), 2), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.AddParticleEmitter((-1.6, (self.yCenter - 6), -2), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.playSound(self.flamepuff) if self.eyetimer == 11: plus.AddParticleEmitter((1.9, (self.yCenter - 6), 1), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.AddParticleEmitter((-1.9, (self.yCenter - 6), -1), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.playSound(self.flamepuff) if self.eyetimer == 12: plus.AddParticleEmitter((2, (self.yCenter - 6), 0), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.AddParticleEmitter((-2, (self.yCenter - 6), 0), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.playSound(self.flamepuff) if self.eyetimer == 13: plus.AddParticleEmitter((1.9, (self.yCenter - 6), -1), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.AddParticleEmitter((-1.9, (self.yCenter - 6), 1), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.playSound(self.flamepuff) if self.eyetimer == 14: plus.AddParticleEmitter((1.6, (self.yCenter - 6), -2), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.AddParticleEmitter((-1.6, (self.yCenter - 6), 2), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.playSound(self.flamepuff) if self.eyetimer == 15: plus.AddParticleEmitter((1, (self.yCenter - 6), -3), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.AddParticleEmitter((-1, (self.yCenter - 6), 3), (0, 3, 0), (1, 5, 1)).SetEmitting(True) plus.playSound(self.flamepuff) if self.eyetimer == 16: plus.AddParticleEmitter((0, (self.yCenter - 6), 0), (0, 16, 0), (1, 16, 1)).SetEmitting(True) plus.playSound(self.eye) plus.removeSound(self.flamepuff) self.timetodie = 1 #remove enemy components one by one if self.timetodie == 1: if self.numComps > 0: self.numComps -= 0.25 if self.numComps%1 == 0: plus.addPoints(self.GetID(), 1337) for bot in self.bids: if self.numComps > 0: plus.emitSmoke(30, (plus.getLocation(bot)), (0, 0, 0), (5, 5, 5)) plus.damage(bot, self.numComps, 100000, plus.getLocation(bot)) plus.damage(bot, self.numComps, 100000, plus.getLocation(bot)) plus.addPoints(bot, -1000) #finishing blow if self.numComps == 0: if self.smoker == 32: plus.removeSound(self.eye) plus.fadeInToLoop(self.finale, -100, 3200) self.tauntbox.get("taunt1").setText("Do you hear that sound? Know what it is?") if self.smoker > 1: self.smoker -= 0.5 self.smoketimer += 0.1 self.smokeh = (self.yCenter - 6) + (6 * ((1 / self.smoker) ** 2)) #SMOKE TORNADO plus.emitSmoke(30, ((self.smoker * (math.cos((math.pi/4) + self.smoketimer))), self.smokeh, (self.smoker * (math.sin((math.pi/4) + self.smoketimer)))), (0, 0, 0), (5, 8, 5)) plus.emitSmoke(30, ((self.smoker * (math.cos((math.pi/2) + self.smoketimer))), self.smokeh, (self.smoker * (math.sin((math.pi/2) + self.smoketimer)))), (0, 0, 0), (5, 8, 5)) plus.emitSmoke(30, ((self.smoker * (math.cos((3*math.pi/4) + self.smoketimer))), self.smokeh, (self.smoker * (math.sin((3*math.pi/4) + self.smoketimer)))), (0, 0, 0), (5, 8, 5)) plus.emitSmoke(30, ((self.smoker * (math.cos((math.pi) + self.smoketimer))), self.smokeh, (self.smoker * (math.sin((math.pi) + self.smoketimer)))), (0, 0, 0), (5, 8, 5)) plus.emitSmoke(30, ((self.smoker * (math.cos((5*math.pi/4) + self.smoketimer))), self.smokeh, (self.smoker * (math.sin((5*math.pi/4) + self.smoketimer)))), (0, 0, 0), (5, 8, 5)) plus.emitSmoke(30, ((self.smoker * (math.cos((3*math.pi/2) + self.smoketimer))), self.smokeh, (self.smoker * (math.sin((3*math.pi/2) + self.smoketimer)))), (0, 0, 0), (5, 8, 5)) plus.emitSmoke(30, ((self.smoker * (math.cos((7*math.pi/4) + self.smoketimer))), self.smokeh, (self.smoker * (math.sin((7*math.pi/4) + self.smoketimer)))), (0, 0, 0), (5, 8, 5)) plus.emitSmoke(30, ((self.smoker * (math.cos((2*math.pi) + self.smoketimer))), self.smokeh, (self.smoker * (math.sin((2*math.pi) + self.smoketimer)))), (0, 0, 0), (5, 8, 5)) if self.smoker == 24: self.tauntbox.get("taunt1").setText("That is the sound of your death approaching.") if self.smoker == 16: self.tauntbox.get("taunt1").setText("At last... vengeance shall be mine.") if self.smoker == 8: self.tauntbox.get("taunt1").setText("HA HA HA HA HA HA HA HA HA HA HA HA HA...") if self.smoker == 2: plus.stopAllSounds() plus.playSound(self.charge) if self.smoker == 1: plus.removeSound(self.charge) plus.playSound(self.bang) self.smoker = 0.9 plus.fadeFromBlack(6) for bot in self.bids: #must un-disable bots in order to kill them plus.disable(bot, 0) self.arena.SetLightningVisible(bot, False) plus.damage(bot, 0, 100000, plus.getLocation(bot)) plus.damage(bot, 0, 100000, plus.getLocation(bot)) plus.damage(bot, 0, 100000, plus.getLocation(bot)) plus.damage(bot, 0, 100000, plus.getLocation(bot)) #reset numLosses file("adaptiveAI_2.txt", "w").write("0")