; RAMMER - Robot that rams targets, sometimes driving backwards. ; Sample robot - Intended only to demonstrate backwards driving. ; ; Ed T. Toton III - 02/20/97 ; #def q #def w #def e #def a #def s #config mines=5 #config scanner=3 #config weapon=0 #config armor=1 #config heatsinks=2 #config engine=1 #def speed #msg Eat my shorts! opo 17 3 ; Scan arc is +/-6 out 13, 0 ; Aim turret forward. mov speed, 100 ; speed = 100% ipo 10, ax ; get random cmp ax, 0 ; 50% chance jls 100 out 13, 80h ; Aim turret backwards. mov speed, -100 ; Robot will go backwards at max (75) ; (The -100 will be trunc'ed to -75 ; by the game engine, but if the game's ; max backward speed ever gets changed, ; the robot is already designed to as ; fast as the game will allow). :100 ; begin main loop out 14, 3 ; turn 5 degrees left out 11, speed ; drive backwards at maximum speed! in 7, ax ; scan cmp ax, 1500 ; find anything? ja 100 ; if not, repeat mov bx, 0 ; bx = 0 :101 ; if so, do the following: ipo 10, ax ; get random number cmp ax, 4000h ; 1/4 chance jls 102 ;ipo 7, q ;cmp q, 50 ;jbe 103 ;sub bx, 3 opo 15, bx ; fire! ipo 7, a cmp a, 25 jae 102 !et opo 22, 3 opo 22, 3 opo 22, 3 opo 22, 4 opo 22, 4 opo 22, 5 !etr do 10 opo 14, -6 opo 11, 100 loop 5 !str add s, 1 opo 11, 100 cmp s, 50 ja 102 jmp !str :102 opo 23, 2 mov s, 0 ipo 8 bx ; get accuracy setting from scan mpy bx, 3 ;1 ; enlarge it ; add bx, -9 out 14, bx ; turn! Keep him centered! ; add bx, 9 in 7, ax ; scan cmp ax, 1500 ; still there? jls 101 ; if so, scan again. jmp 100 ; end main loop :103 opo 12, 64 do 5 opo 11, 100 loop 25 jmp 100