from __future__ import generatorsimport plusimport AIfrom AI import vector3import Arenasimport Gooeyimport mathimport Tacticsclass PinnerPlus(AI.SuperAI): "Pushes without backing up" name = "PinnerPlus" # Designed for true pushers, though does NOT back up repeatedly like Pusher.py does. This has a spin function too. # In-built average Throttle, Topspeed, Turn and Turnspeed values for easier AI-ing. Also invertible. # Brought to you by G.K. def __init__(self, **args): AI.SuperAI.__init__(self, **args) self.tactics.append(Tactics.Engage(self)) self.max_Throttle = 130 self.top_speed = 99 self.bInvertible = True self.max_turn = 40 self.max_turn_speed = 3 self.spin_range = 40.0 if 'range' in args: self.spin_range = args.get('range') def Activate(self, active): if active: if AI.SuperAI.debugging: self.debug = Gooey.Plain("watch", 0, 75, 100, 75) tbox = self.debug.addText("line0", 0, 0, 100, 15) tbox.setText("Throttle") tbox = self.debug.addText("line1", 0, 15, 100, 15) tbox.setText("Turning") tbox = self.debug.addText("line2", 0, 30, 100, 15) tbox.setText("") tbox = self.debug.addText("line3", 0, 45, 100, 15) tbox.setText("") return AI.SuperAI.Activate(self, active) def Tick(self): if self.weapons: # spin up depending on enemy's range enemy, range = self.GetNearestEnemy() if enemy is not None and range < self.spin_range: self.Input("Spin", 0, 1) elif self.GetInputStatus("Spin", 0) != 0: self.Input("Spin", 0, 0) return AI.SuperAI.Tick(self) def LostComponent(self, id): #print "Lost Component!" return AI.SuperAI.LostComponent(self, id) def DebugString(self, id, string): if self.debug: if id == 0: self.debug.get("line0").setText(string) elif id == 1: self.debug.get("line1").setText(string) elif id == 2: self.debug.get("line2").setText(string) elif id == 3: self.debug.get("line3").setText(string) AI.register(PinnerPlus)
I think SM is a pretty cool guy, eh builds unicycle-bots and doesn't afraid of anything
Here's PinnerPlus.py, Pinner with added support for a spinning weapon:
You know that Omni does the exact same thing as Pinner right? Just use Omni and don't wire any controls and you've got yourself a Pinner. Wire a spinner control and you've got yourself a PinnerPlus.
list.append(("Red Dragon","Omni",{'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,12,13,14)})) # 32 - RAW list.append(("Cryoseism","Omni",{'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)})) list.append(("LOL WUT","SpinupOmni",{'radius':1.2,'range':99,'spinuptime':5,'topspeed':99,'throttle':130,'turn':100,'turnspeed':1.8,'weapons':(19,20,21)})) list.append(("Krakatau","Omni",{'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)})) list.append(("Steel Reign","Omni",{'invertible':True,'range':99,'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)})) list.append(("Reindeer","Pinner",{'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)})) list.append(("Army Of One","Omni",{'radius':0.1,'topspeed':100,'throttle':130,'turn':60,'turnspeed':2.5,'weapons':(11,)}))