#config scanner=4 #config weapon=3 #config armor=5 #config engine=0 #config heatsinks=0 #config shield=0 #config mines=0 #def scanarc #def scanarcs #def tgtx #def tgty ;opo 19,314 ;change transponder ID to 314 ;opo 24,1 ;shield on opo 22,10 opo 22,10 int 2 ;what is the closest corner? cmp ex,500 jls !cv mov tgtx,1000 !cv cmp fx,500 jls !ca mov tgty,1000 !ca mov ex,tgtx ;find angle to corner mov fx,tgty int 7 sub ax,@1 opo 14,ax ;turn mov ax,1 ;overburn int 4 opo 11,100 ;go fast opo 17,64 ;set scan-arc to 64 mov scanarc,64 mov scanarcs,5 !cloop ipo 7,ax ;check scanner cmp ax,1500 ;if not in range, then increase range jgr !cbigarc ;cmp @5,314 ;if a friend ;jeq !cbigarc ;then ignore mov ax,@3 ;get accuracy cmp scanarcs,0 ;adjust for scanner size jeq !ctrack shl ax,scanarcs dec scanarcs ;shrink scanner size shr scanarc,1 opo 17,scanarc !ctrack opo 12,ax ;follow enemy ipo 7,ax ;if almost dead, then don't worry about heat cmp ax,25 jbe !fire ipo 2,ax ;check heat shl ax,scanarcs cmp ax,280 ;if cool, then fire jae !checkforwall !fire mov ax,0 int 4 opo 15,0 ;fire! mov ax,1 int 4 !checkforwall cmp @8,0 jeq !cloop int 13 int 2 cmp ex,tgtx ;check what it was jeq !hitwall cmp fx,tgty jeq !hitwall ipo 2,ax cmp ax,160 jae !cloop ipo 16,ax opo 13,ax opo 15,0 ;if an enemy, then fire opo 15,0 opo 15,0 opo 15,0 opo 15,0 opo 15,0 opo 15,0 opo 15,0 opo 15,0 opo 15,0 opo 11,100 ;go fast jls !cloop !hitwall ;opo 24,0 ;if wall, then shield off mov ax,0 ;overburn off int 4 mov ax,@1 ;turn around shr ax,6 shl ax,6 sub ax,96 sub ax,@1 opo 14,ax opo 17,32 ;set scan-arc to 32 mov scanarc,32 mov scanarcs,4 !loop ipo 7,ax ;check scanner cmp ax,1500 ;if not in range, then increase range jgr !bigarc ;cmp @5,314 ;if a friend ;jeq !bigarc ;then ignore mov ax,@3 ;get accuracy shl ax,scanarcs opo 12,ax ;follow enemy cmp scanarcs,0 jeq !cfire !track dec scanarcs ;shrink scanner size shr scanarc,1 opo 17,scanarc jne !loop !bigarc cmp scanarcs,4 jeq !aimstr inc scanarcs shl scanarc,1 opo 17,scanarc jne !loop !aimstr opo 13,0 jeq !loop !cbigarc cmp scanarcs,5 jeq !caimstr inc scanarcs shl scanarc,1 opo 17,scanarc jne !checkforwall !caimstr opo 12,128 jeq !checkforwall !cfire ipo 2,ax ;check heat cmp ax,80 jae !loop !cfireloop cmp ax,250 ;if cool, then fire jae !loop ipo 7,ax cmp ax,1500 opo 12,@3 jgr !loop opo 15,0 ;fire! ipo 2,ax jbe !cfireloop