#config weapon=1 #config heatsinks=2 opo 11 100 opo 19 22 ;transponder opo 21 3 ;com cahnell opo 22 10 ;mine layed mov ax 1 int 3 ;keepshift on so i can turn ipo 3 ax neg ax opo 14 ax opo 13 0 jmp !go !go call !checkturn jmp !findnme !findnme opo 17 64 do 5 :10 ipo 17 bx ipo 7 ax cmp ax 2000 jls 20 opo 12 bx shl bx 1 ;search and aim code opo 17 bx cmp @5 22 je 10 jne 20 :20 shr bx 1 opo 17 bx mpy bx @3 opo 12 bx loop 10 jmp !calc !calc ipo 1 ax cmp ax 0 je !firesnipe int 9 ;get info on how to fire cmp fx 10 jls !firestill jgr !firemov !firestill opo 18 1 ipo 7 ax opo 15 @3 ;one bigger shot right at him opo 18 0 jmp !go !firemov ipo 7 ax opo 12 @3 opo 12 @3 ipo 7 ax opo 15 @3 opo 15 -1 opo 15 1 ;a dense spray of 5 opo 15 0 ;to hit a moving target opo 15 @3 jmp !go !firesnipe ipo 7 ax opo 12 @3 opo 15 @3 ipo 7 ax opo 12 @3 ;two aimed hits opo 12 @3 ipo 7 ax opo 12 @3 opo 15 @3 jmp !go !checkturn ;checkturn code stolen from randman3.at2 ;modified ;someone tell me if i shouldnt have :) ;Get location int 5 ; EX,FX = X,Y ;Scenario 1 cmp ex 950 ; X>950? jgr 4001 ; If so, scenario1. ;Scenario 2 cmp ex 50 ; X<50? jls 4002 ; If so, scenario2. ;Scenario 3 cmp fx 950 ; Y>950? jgr 4003 ; If so, scenario3. ;Scenario 4 cmp fx 50 ; Y<50? jls 4004 ; If so, scenario4. ;Last resort (not near a wall) delay 10 opo 11 100 ; throttle to 100% ret ;Scenario 1 :4001 ipo 10, ax ; random number and ax 0x40 ; now it is 0-63. add ax 0xA0 ; now it is 160-223 call 5000 ; turn to that heading. ret ;Scenario 2 :4002 ipo 10, ax ; random number and ax 0x40 ; now it is 0-63. add ax, 0x20 ; now it is 32-95. call 5000 ; turn to that heading. ret ;Scenario 3 :4003 ipo 10, ax ; random number and ax 0x40 ; now it is 0-63. add ax, 0xE0 ; now it is 224-287. and ax, 255 ; now it is 224-255 or 0-31. call 5000 ; turn to that heading. ret ;Scenario 4 :4004 ipo 10, ax ; random number and ax 0x40 ; now it is 0-63. add ax, 60h ; now it is 96-159. call 5000 ; turn to that heading. ret ;course-setting subroutine ;set course to heading in AX. :5000 ipo 1, bx ; get current heading ; (actual heading) sub ax, bx ; get number of degrees to turn. opo 14, ax ; turn! :5001 ipo 3, bx ; bx = heading cmp bx, @1 ; is heading equal to desired heading? jne 5001 ; if not, wait until it is. opo 11, 100 ; Throttle to 100% ret #end !findnme do 4 ;the loop ahead will only run 4 times opo 17 64 mov bx 64 :100 ipo 7 ax cmp ax 2000 jgr 110 int 8 cmp fx 22 jne 120 :110 opo 12 bx opo 12 bx jmp 100 :120 ;now a baddie MUST be in the arc mov ex bx mpy ex @3 opo 12 ex ;now hes centered shr bx 1 opo 17 bx ipo 7 ax cmp ax 2000 jls 140 jmp !findnme :140 loop 120