; A modified version on mysecond #msg Watch out!! ; Setup some config stuff #config scanner=4 #config weapon=2 #config armor=2 #config engine=0 #config heatsinks=4 #config mines=0 #config shield=0 ; Some Variables #def vel #def sdir #def health #def hot #def running #def scanadd ; do some set up and get us moving mov ax 1 ; overburn on int 4 ; we like speed =) mov vel 100 ; set our velocity up out 11 vel ; a sitting duck is a dead duck, let's get moving mov sdir 64 ; direction to scan in out 13 sdir ; 90 degrees off to the right in 6 health ; what is our current armor level? mov hot 0 ; we are not overheated right now mov running 0 ; we are not running mov scanadd 12 ; add 12 to the scan ;--[Main loop]--; :1000 ; Check if we've been hit. If so, take action. in 6 bx ; check armor level cmp bx health ; has it changed since last checked? je 5000 ; if so, we've been hit: out 11 vel ; run, then think cmp running 0 ; are we running from a previous hit? jne 5500 ; then keep running mov running 1 ; we are now out 14 64 ; take evasive action neg vel ; Go the other way, maybe dodge a bit out 11 vel ; get the heck out of here mov ex 500 ; aim for the middle of the arena mov fx 500 ; ditto int 7 ; which way do I go george? out 11 100 ; go there now del 50 ; wait while we run :5000 ; if not, go here: mov running 0 ; are we running? :5500 mov health bx ; store health for next time ; Check if we've run into something. If so, take action. int 12 ; How many collisions have happened cmp fx 0 ; since last time? je 6000 ; If any: neg vel ; flip our direction out 11 vel ; and head the other way int 13 ; and reset the collision counter in 6 bx ; we need to store armor level mov health bx ; so we don't think that we were shot :6000 ; if not, keep going on ; See what mode we're in and kill or scan apropriately. :6500 ; Start of the scan area out 11 vel ; make sure we're moving cmp running 0 ; are we running? jne 8000 ; if so, don't scan in 7 bx ; look for our enemy cmp bx MAXINT ; see if there's something there je 7000 ; If so: ; Kill Mode!!! ;mov ax 1 ; turning keepshift on ;int 3 ; so we won't lose our target in 8 bx ; what's the error? shl bx 1 ; multiply this by two **try this both ways** cmp hot 0 ; is our engine too hot? jne 7500 ; If so, don't fire out 15 bx ; fire at the sucker :7500 out 12 bx ; try to track the enemy in 3 dx ; where are we facing? in 5 bx ; where is the turret facing? sub bx dx ; find the difference ;shr bx 1 ; divide by 2 sub bx 32 ; move at a 45 degree angle to the enemy out 14 bx ; turn that way out 11 vel ; go for it ---modified to go for the vel ;neg vel ; try not to get too close neg scanadd ; if we lose track, it will scan the other way jmp 8000 ; skip the flip :7000 ; If there are no enemies: ;xor ax ax ; turn keepshift off ;int 3 ; no need for it now ;neg sdir ; Flip the scan to the other direction add sdir scanadd ; try going every 22.5 degrees out 13 sdir ; set the new scan direction up :8000 ; Pretty much the end of the line ; Watch out for overheating in 2 bx ; What is our current temp? cmp bx 350 ; is it hotter than 350? jls 9000 ; If so: mov hot 1 ; it is too hot xor ax ax ; off with the overburn int 4 ; bye bye jmp 10000 ; don't unset it :9000 ; see if it's cool enough yet xor hot hot ; it's not too hot cmp bx 275 ; wait for it to get a bit cooler jgr 10000 ; if it's not, don't turn stuff back on mov ax 1 ; turn it on baby int 4 ; overburn!!! :10000 jmp 1000 ; start all over again