#config scanner=4 #config engine=3 #config weapon=2 #config armor=2 #config heatsinks=1 #msg A genie in a bottle #def turnadd #def tightadd #def wideadd #def arc #def speed #def dist mov turnadd, 600 mov ax, 1 int 3 opo 20, 400 opo 11, 100 opo 22, 15 opo 22, 15 ;######initialise####### put 2, 605 ;600 is accuracy turn value range put 4, 606 put 0, 604 put -2, 603 put -4, 602 put 4, 609 put 8, 610 put 0, 608 put -4, 607 put 8, 617 put 16, 618 put 0, 616 put -8, 615 put -16, 614 put 16, 633 put 32, 634 put 0, 632 put -16, 631 put -32, 630 put 32, 665 put 64, 666 put 0, 664 put -32, 663 put -64, 662 mov arc, 64 ;########!scan######## !scan call !move opo 17, arc ipo 7, dist cmp dist, 1500 jgr !scnone cmp arc, 2 jbe !scarclow mov ax, 0 add ax, turnadd add ax, @3 add ax, arc opo 12, [ax] je !sctight jne !sctight !scnone cmp arc, 64 jeq !scflip shl arc, 1 opo 17, arc cmp @3, 0 jls !scnneg jgr !scnpos je !scan jne !scan !scnneg mov ax, arc neg ax opo 12, ax je !scan jne !scan !scnpos opo 12, arc je !scan jne !scan !scarclow opo 12, @3 cmp arc, 2 jeq !sctight call !shoot je !scan jne !scan !sctight cmp arc, 8 jls !scshoot :1 cmp arc, 4 jbe !scan sar arc, 1 opo 17, arc je !scan jne !scan !scshoot call !shoot je 1 jne 1 !scflip opo 12, 120 je !scan jne !scan ;##########!shoot######### !shoot ipo 2, ax cmp @7, 10 jbe !nonmover cmp ax, 100 jls !overburnshot je !shot jne !shot !nonmover cmp ax, 100 jgr !shot cmp @7, -10 jls !shot opo 18, 1 opo 15, 0 opo 15, 0 opo 15, 0 opo 15, 0 opo 15, 0 opo 18, 0 ret !close cmp ax, 200 jgr !shot opo 15, 0 opo 15, 1 opo 15, -1 opo 15, 0 opo 15, 0 ret !shot cmp ax, 200 jgr !sret opo 15, 0 opo 15, 0 ret !overburnshot opo 18, 1 opo 15, 0 opo 15, 0 opo 18, 0 ret !sret ret ;#######!move####### !move opo 11, 100 int 2 cmp ex, 100 jls !mleft cmp ex, 900 jgr !mright cmp fx, 100 jls !mup cmp fx, 900 jgr !mdown je !mclear jne !mclear !mleft ipo 3, ax mov bx, 64 sub bx, ax opo 14, bx ret !mright ipo 3, ax mov bx, 192 sub bx, ax opo 14, bx opo 11, 100 ret !mdown ipo 3, ax mov bx, 0 sub bx, ax opo 14, bx opo 11, 100 ret !mup ipo 3, ax mov bx, 128 sub bx, ax opo 14, bx opo 11, 100 ret !mclear opo 14, 2 ret