;-=KEWL=-

;Jeremiah Martell
;made by: Psuedo_Chaos

#msg I'm the best!
#def    accuracy
#msg    Jeremiah's robot
mov     bx,  100
:1
        opo     17,     6        ;sets scan angle
        inc     ax
        int     3,      ax
:2
        int     12
        cmp     fx,     0
        jgr     6
        opo     11,     bx      ;sets throttle
        opo     14,     6       ;turns 
        ipo     7,      ax      ;scan
        cmp     ax,     1500    ;is anything there?

        ipo     8,      accuracy
        shl     accuracy,       2       ;multiplies accuracy by 4
        opo     12,     accuracy        ;rotates turret depending if
                                        ;was off of aiming

        jls     3               ;if there is goto 3 
        jgr     4               ;if there isn't goto 4
        jmp     2               ;loop back to :2
:3
        ipo     2,      dx
        cmp     dx,     300
        jgr     5

        
        opo     15,     2
        opo     15
        opo     15,     -2      ;shoots 3 bullets in a spred form
        jmp     2

:4
        opo     12,     -20
        jmp     2

:5
        opo     11,     100     ;sets throttle 
        opo     14,     3       ;turns
        ipo     7,      ax      ;scan
        cmp     ax,     1500    ;is anything there?

        ipo     8,      accuracy
        shl     accuracy,       2       ;multiplies accuracy by 4
        opo     12,     accuracy        ;rotates turret depending if
                                        ;was off of aiming

        ipo     2,      dx      ;determines if is cool enough
        cmp     dx,     100
        jgr     5
        jmp     2

:6
        int     13
        neg     bx
        jmp     2
