;The MicroComputer. Programmed by Jude Hungerford. Work began on 17/10/2000. ;Don't copy anything from this without giving me some credit. I have taken ;ideas, but no direct code, from many robots. Credit should go to, in no ;particular order: Zitgun, Zipper3, Warblade, Coroner, and probably some ;others. ;Last modified on 19/10/2000. Version 0.18 ;Modlist- For mods extending back to before version 0.18, check micromod.txt ;. If you don't have this file, and you're actually interested in reading my ;commentary on the progress of this robot, please feel free to email me at ;jedwardh@my-deja.com, and I'll send you the file. ;0.17 - 0.18: ;Make the firing routines a bit more aggressive. ;... Success. Finally. They're pretty close, but it looks like 0.18 is a bit ;better in 1on1 battles than 0.09. !init #config scanner= 3 #config weapon= 2 #config armor= 2 #config engine= 4 #config heatsinks= 1 #config mines= 0 #config shield= 0 mov AX, 1 int 3 ;keepshift off. out 17, 64 ;wide scan out 18, 0 ;No overburn out 11, 100 ;Full throttle. out 22 ;lay mine nop nop nop nop nop nop out 22 ;lay mine jmp !flip ;turn radar !flip out 12, 126 ;turn radar 121 degrees. jmp !scan128 ;scan for enemies !arc128 out 17, 64 ;set radar arc to 128 degree scans (64 each way). jmp !scan128 ;and scan. !arc34 out 17, 17 ;set radar arc to 34 degree scans (17 each way). cmp @3, 0 ;is it left or right? jls !arc34l ;if left, jump to appropriate label. jgr !arc34r ;if right, jump to appropriate label. jmp !arc34e ;otherwise, end function. !arc34l cmp @3, -2 ;How far left? jgr !arc34l1 ;if 1, move radar 17 degrees left. out 12, -34 ;if 2, move radar 34+17 degrees left !arc34l1 out 12, -17 ;execute the 17 degree turn. jmp !arc34e ;and end function. !arc34r cmp @3, 2 ;How far right? jls !arc34r1 ;if 1, move radar 17 degrees right. out 12, 34 ;if 2, move radar 34+17 degrees right !arc34r1 out 12, 17 ;execute the 17 degree turn. jmp !arc34e ;and end function. !arc34e jmp !scan34 ;scan with new radar settings. !arc10 out 17, 5 ;set radar arc to 10 degree scans (5 each way). cmp @3, 0 ;is it left or right? jls !arc10l ;if left, jump to appropriate label. jgr !arc10r ;if right, jump to appropriate label. jmp !arc10e ;otherwise, end function. !arc10l cmp @3, -2 ;How far left? jgr !arc10l1 ;if 1, move radar 5 degrees left. out 12, -10 ;if 2, move radar 10+5 degrees left !arc10l1 out 12, -5 ;execute the 5 degree turn. jmp !arc10e ;and end function. !arc10r cmp @3, 2 ;How far right? jls !arc10r1 ;if 1, move radar 5 degrees right. out 12, 10 ;if 2, move radar 10+5 degrees right !arc10r1 out 12, 5 ;execute the 5 degree turn jmp !arc10e ;and end function. !arc10e jmp !scan10 ;and scan. !arc4 call !mshot ;take a shot at the object that triggered arc4. out 17, 2 ;set radar arc to 4 degree scans (2 each way). cmp @3, 0 ;is it left or right? jls !arc4l ;if left, jump to appropriate label. jgr !arc4r ;if right, jump to appropriate label. jmp !arc4e ;otherwise, end function. !arc4l cmp @3, -2 ;How far left? jgr !arc4l1 ;if 1, move radar 2 degrees left. out 12, -4 ;if 2, move radar 4+2 degrees left !arc4l1 out 12, -2 ;execute the 2 degree turn. jmp !arc4e ;and end function. !arc4r cmp @3, 2 ;How far right? jls !arc4r1 ;if 1, move radar 2 degrees right. out 12, 4 ;if 2, move radar 4+2 degrees right !arc4r1 out 12, 2 ;execute the 2 degree turn jmp !arc4e ;and end function. !arc4e jmp !scan4 ;and scan. !scan128 in 7, EX ;scan cmp EX, 1500 ;anyone there? jls !arc34 ;if yes, narrow the scan. call !steer ;else, check steering- jmp !flip ;and continue scanning. !scan34 in 7, EX ;scan cmp EX, 1500 ;anyone there? jls !arc10 ;if yes, narrow the scan. out 17, 64 ;else, increase the arc and call !steer jmp !scan128 ;continue scanning. !scan10 in 7, EX ;scan cmp EX, 1500 ;anyone there? jls !arc4 ;if yes, narrow the scan. out 17, 17 ;else, increase the arc and call !steer jmp !scan34 ;continue scanning. !scan4 in 7, EX ;scan cmp EX, 1500 ;anyone there? jls !kill ;if yes, fire. out 17, 5 ;Otherwise, increase the scan arc, and call !steer jmp !scan10 ;continue scanning. !kill out 12, @3 ;turn turret to target in 2, FX ;check heat cmp FX, 280 ;too hot? jgr !scan4 ;if yes, keep the lock but don't fire. Otherwise: cmp @13, 0 ;check speed of target. je !overspit ;if stationary, fire overburn bullets. cmp EX, 300 ;is the enemy close? jls !overspit ;if yes, fire overburn bullets. cmp EX, 600 ;is enemy within decent range? jls !spit ;if yes, fire normal bullets. call !potshot ;if no, fire a single bullet. jmp !scan4 ;and continue scanning. !overspit mov AX, 1 int 4 ;Overburn on. out 15, 0 ;fire . out 15, 0 ;fire . mov AX, 0 int 4 ;overburn off. mov EX, @2 ;turret offset shr EX, 1 ;halve out 14, EX ;turn body halfway to face enemy. jmp !scan4 ;keep scanning. !spit out 15, 0 ;fire unmodified. out 15, 0 ;fire unmodified. mov EX, @2 ;turret offset shr EX, 1 ;halve out 14, EX ;turn body halfway to face enemy. out 11, 100 ;make sure we're moving. jmp !scan4 ;keep scanning. !potshot out 15, @3 ;fire modified shot. out 14, @2 ;turn body toward enemy. out 11, 100 ;make sure we're moving. ret ;keep scanning. !steer out 11, 100 ;make sure we're moving (takes no time) int 12 ;Check if we've hit something. cmp FX, 0 ;If yes, jnz !rcol ;respond. ret ;if not, return to scans. !rcol int 13 ;set collision count to 0. out 11, -75 ;move backwards nop nop nop nop nop nop nop nop nop nop ;wait a bit out 14, 108 ;turn 108 degrees (of 256) out 11, 100 ;start moving again. ret ;go back to scanning. !mshot out 15, @3 ;take a modified shot, out 14, @2 ;turn body, ret ;return.