;By Leper ;This robot drives about dodging walls and other robots and not firing, until there is only 1 ;enemy left, then (if it gets that far) it will go into attack mode and ;kill the last robot. INGENIOUS ;-) ; ; ; ;In attack mode it uses the attack routines of my standard class robot "Mother" because that is ;the best i could come up with at this time. And since Mother is in 3rd place at the moment i am ;thinking it should do quite well. #config scanner= 1 #config weapon= 3 #config armor= 2 #config engine= 5 #config heatsinks= 1 #config mines= 0 #config shield= 0 #msg Who's the Daddy? #def speed #def scanarc #def scandist #def max_heat #def veer_angle ;start up opo 11, 100 ;get moving opo 22, 20 ;lay mine mov ax, 1 int 3 ;keep shift mov speed, 100 mov scanarc, 64 mov scandist, 350 mov max_heat, 200 mov veer_angle, 40 opo 17, scanarc opo 22, 20 ;lay mine :1 int 10 cmp dx, 2 ;total active robots je !one_enemy_left cmp @0, 0 je !stopped int 2 cmp ex, 100 jls !wall_left cmp ex, 900 jgr !wall_right cmp fx, 100 jls !wall_top cmp fx, 900 jgr !wall_bottom ipo 9, ax cmp ax, 100 jls !veer_away ;enemy too close cmp @0, 0 je !stopped !wall_left cmp @1, 128 ;desired heading is not towards wall so leave it jls 1 int 19 ;resets meters travelled counter ipo 3, ax cmp ax, 192 jls !anticlockwise jge !clockwise !wall_right cmp @1, 128 ;heading not towards wall jgr 1 int 19 ;resets meters travelled counter ipo 3, ax cmp ax, 64 jls !anticlockwise jge !clockwise !wall_top int 19 ;resets meters travelled counter ipo 3, ax cmp ax, 64 jls !clockwise cmp ax, 192 jgr !anticlockwise jmp !moving !wall_bottom int 19 ;resets meters travelled counter ipo 3, ax cmp ax, 128 jls !anticlockwise jge !clockwise !clockwise opo 14, 66 je !moving jne !moving !anticlockwise opo 14, -66 je !moving jne !moving !moving cmp @9, 60 opo 11, 100 jls !moving jgr 1 !veer_away opo 14, veer_angle neg veer_angle je 1 jne 1 !stopped neg speed opo 11, speed je 1 jne 1 ;*******************************************************; ; ; ;Lets kick some bottoms ; ; ; ;*******************************************************; !one_enemy_left :100 cmp @0, 0 ;get speed je !stopped_2 :200 opo 17, scanarc ;set scan arc ipo 7, ax ;scan cmp ax, 1500 jgr !no_target cmp @0, 0 jls !flip_robot ;if going backwards and found a target turn around je !steering jne !steering :201 cmp scanarc, 8 jle !fire mov ax, 302 add ax, @3 je ax jne ax :300 ;accuracy = -2 mov bx, scanarc add bx, scanarc neg bx shr bx, 1 opo 12, bx ;turret faces where enemy was shr scanarc, 1 ;1/2scanarc je 100 jne 100 :301 ;accuracy = -1 mov bx, scanarc neg bx shr bx, 1 opo 12, bx ;turret faces where enemy was shr scanarc, 1 ;1/2scanarc je 100 jne 100 :302 ;accuracy = 0 opo 15 ;take a lucky shot opo 14, 64 ;going straight towards target, steer to avoid death shr scanarc, 1 ;1/2scanarc je 100 jne 100 :303 ;accuracy = 1 mov bx, scanarc shr bx, 1 opo 12, bx ;turret faces where enemy was shr scanarc, 1 ;1/2scanarc je 100 jne 100 :304 ;accuracy = 2 mov bx, scanarc add bx, scanarc shr bx, 1 opo 12, bx ;turret faces where enemy was shr scanarc, 1 ;1/2scanarc je 100 jne 100 !stopped_2 neg speed opo 11, speed ;go opo 14, 48 ;turn a bit so if no target u dont just go back and forward je 200 jne 200 !no_target cmp scanarc, 64 je !flip_sensor shl scanarc, 1 ;double scanarc je 100 jne 100 !flip_sensor opo 12 ,128 ;turn turret to opposite direction je 100 jne 100 !steering opo 14, @2 ;steer to turret offset je 201 jne 201 !flip_robot opo 14, 128 ;about turn neg speed ;will make the speed positive opo 11, speed ;go je 201 jne 201 !hot opo 14, 100 opo 11, 100 je 100 jne 100 ;************************************************************* ;This is where the good stuff happens !fire ipo 2, ax ;testing heat cmp ax, 300 jgr !hot ;too hot cmp ax, 100 jls !overburn ;nice and cool :500 ipo 7, ax ;another scan to get new accuracy cmp ax, 150 jls !killer mov bx, @3 add bx, @3 opo 15, bx mov ax, 0 ;if overburn was on it turns it off int 4 je 100 jne 100 !overburn mov ax, 1 int 4 ;over burn on je 500 jne 500 !killer ;mov ax, 1 ;int 4 opo 17, 4 ipo 7, ax mov bx, @3 add bx, @3 opo 15, bx sub bx, 1 opo 15, bx add bx, 2 opo 15, bx ;mov ax, 0 ;int 4 je 100 jne 100