; Robot Name: BuBu4 ; Version: 4.913 ; Autor: Bruno A. Blank Cassol ; Country: Brazil ; Email: dynamycs@hotmail.com ; After months of studying ive developed my own fast-math close-shot engine ; that can make sequences of precises shots when target near. Because of ; that, BuBu4 has small scanner and may take a bit to lock on the enemy. But ; once locked its fatal. ; This robot has been written based on bubu 3 ; Some of it's main features are: ; * Go to center when colide and at start ; * Smart shot that use target-speed to calc the angle of shot ; * Fast maths. This makes it a fast shooter and fatal when near! ; * Seek target. It will always try to be heading towards the target in a ; Kami-Kasi style #msg Brazil is wonderfull!! #config scanner=1 #config engine=0 #config armor=3 #config heatsinks=5 #config weapon=3 #config mines=0 #config shield=0 #def arc! #def trgt #def spd! opo 11 100 ; set throttle opo 22 15 ; lay mine opo 22 15 ; lay mine mov ax 1 ; ax = 1 int 3 ; if ax <> 0 then keep-shift on (we set ax = 1 just above) !gotoMIDDLE mov ex 500 ; ex = 500 mov fx 500 ; fx = 500 int 7 ; find angle to X(ex),Y(fx) mov bx, @1 ; get current desired heading ; (not actual heading) and ax, 255 ; Fix ax into 0-255. sub ax, bx ; get number of degrees to turn. opo 14, ax ; turn! opo 11 100 ; set throttle !start mov arc! 64 ; arc! = 64 opo 12 128 ; flip turret !checkwall! cmp @0 0 ; compare our throttle jz !gotoMIDDLE ; if thrttle = 0% then -> !gotoMIDDLE !seekIt cmp @2 224 ; compare turret-offset to 160 ja !ScaN ; if > 160 -> !ScaN cmp @2 32 ; compare turret-offset to 96 jb !ScaN ; if < 96 -> !ScaN cmp @2 128 ; compare turret offset to 128 jb !GetToRight! !GetToLeft! opo 14 -20 ; turn 20 to left jae !ScaN jb !ScaN !GetToRight! opo 14 20 ; turn 20 to right !ScaN opo 17 arc! ; scanner arc = arc! ipo 7 trgt ; scan, result of scan in trgt cmp trgt 1500 ; anybody in range? ja !nobody ; no damn -> !nobody ;) cmp @3 0 ; is it straight ahead? je !shoot ; fire!! ja !right ; if a bit right -> !right ;left ; elseif a bit left do code bellow cmp @3 -2 ; how much left is it? jne !hleft ; halfway? then -> !hleft mov ax arc! ; ax = arc! neg ax ; ax = 0 - ax opo 12 ax ; turn turrret ax amount je !fire ; -> !fire !hleft mov ax arc! ; ax = arc! shr ax 1 ; arc = arc! / 2 neg ax ; ax = 0 - ax opo 12 ax ; turn left ax amount jne !fire ; -> !fire !right cmp @3 2 ; how much right is it? jne !hright ; halway? then -> hright opo 12 arc! ; turn right arc! amount je !fire ; -> !fire !hright mov ax arc! ; ax = arc! shr ax 1 ; arc = arc / 2 opo 12 ax ; turn right ax amount !fire mov spd! [13] ; spd! = target speed shr spd! 7 ; divide spd! some times :) cmp [3] 0 ; whats our acuracy jae !prepare ; if acuracy >= 0 then -> !shoot neg spd! ; else spd! = spd! * -1 !prepare opo 12 spd! ; turn turret spd! amount !shoot opo 15 @3 ; fire! !finished cmp arc! 4 ; compare arc! to 4 jle !checkwall! ; if arc <= 4, then skip shrinking it shr arc! 2 ; else, cut our arc to 1/4 size ja !checkwall! ; scan again !nobody cmp arc! 64 ; what is our arc setting? jae !start ; if too wide skip increasing it shl arc! 2 ; otherwise widen the arc jb !checkwall! ; scan again #END