; /================================================\ ; / , __ _ _ , __ \ ; / /|/ \ | | | | /|/ \ \ ;| |___/ | | | | _ , | __/ __ _|_ | ; \ | | | |/ |/ |/ / \_ | \/ \_| / ; \ | \_/|_/|__/|__/|__/ \/ |(__/\__/ |_/ / ; \================================================/ #def minetimer #def turret #config scanner=3 #config weapon=3 #config armor=4 #config engine=1 #config shield=0 #config mines=0 #config heatsinks=1 #msg |-----------------| opo 17, 6 ; set scan arc to 4 !turn32 opo 14, 32 ; turn 32 degrees opo 11, 100 ; Full throttle sub turret, 32 ; subtract the degrees we have turned with the turret degrees !start ipo 1, ax ; get the speed of the tank cmp ax, 0 ; are we stopped? jbe !turn32 ; Damn! We must have hit sumthin'! TURN AROUND! ipo 2, ax ; get the heat of the tank cmp ax, 300 ; too hot? jae !shutdown ; yes, go into shutdown mode until heat is under 150 add turret, 12 ; add 12 degrees to the turret counter cmp turret, 256 ; passed 256? ja !resetturret ; if so, reset the turret counter !turnturret opo 13, turret ; turn the turret cmp minetimer, 0 ; no more mines? (see the !nomoremines function) jb !scan ; no! jump to scan add minetimer, 1 ; add 1 to the minetimer cmp minetimer, 50 ; 50 ticks? ja !laymine ; lay a mine !scan ipo 7, ax ; scan, ax = range cmp ax, 2000 ; is target in range? ja !nothingfound ; if not, then start over... opo 15, -2 ; FIRE! opo 15, -1 ; FIRE! opo 15, -0 ; FIRE! opo 15, 1 ; FIRE! opo 15, 2 ; FIRE! jmp !scan ; scan again without turning turret, so we locks on target until it moves away !nothingfound jmp !start ; jump back to !start !resetturret mov turret, 0 ; reset the turret counter jmp !turnturret ; turn the turret !laymine ipo 22, ax ; get the mine count cmp ax, 0 ; no more mines? jbe !nomoremines ; no more mines! opo 22, 35 ; lay a mine with the detonate radius set to 35 mov minetimer, 0 ; reset the minetimer jmp !scan ; jump back !nomoremines mov minetimer, -1 ; set minetimer to -1, this tells the other part of the tank not to lay mines (for saving ticks) jmp !scan ; jump back !shutdown ipo 10, ax ; get a random number and ax, 5 ; fix it to 0-5 jmp ax ; jump to a random function :1 opo 1, -75 ; drive backwards jmp !shutdown2 :2 opo 14, 32 ; turn 32 degrees to the right jmp !shutdown2 :3 opo 14, -32 ; turn 32 degrees to the left jmp !shutdown2 :4 opo 14, 128 ; turn around jmp !shutdown2 :5 opo 1, 100 ; full throttle !shutdown2 ipo 2, ax ; get the heat cmp ax, 150 ; are we under 150? jb !start ; if so, begin shootin' again jmp !shutdown ; if not, wait again