; The Mother ; By Leper ; ;I have commented this robot quite well so that other people can hopefully understand what is ;going on. ;I have tried to make it as efficient as possible by using @x calls rather than reading from ;ports which i only just realised take up alot of time. ;But in some places i know it is inefficient but i couldn't think of another way round of doing ;things. ; ; ; ;Mother is a modified version of Leper, it has some tweaks and some extra sub routines, i have ;tried to make the firing routines more accurate, because that always helps. ; ;A major weakness in Mother is that it sometimes it follows directly behind the enemy so it gets ;hit by a barrage of direct shots, zipper3 has a way to counter this but i dont want to copy it ;so i am just leaving it how it is, unless i think of another way to do it. #config scanner= 1 #config weapon= 3 #config armor= 3 #config engine= 4 #config heatsinks= 1 #config mines= 0 #config shield= 0 #def scanarc #def speed #msg Your Mother ;start up mov ax, 1 int 3 ;keep shift mov speed, 100 opo 11, speed ;gets robot moving at max speed mov scanarc, 64 opo 22, 15 opo 22, 15 ;lay mines opo 20, 500 ;max shutdown level :100 cmp @0, 0 ;get speed je !stopped :200 opo 17, scanarc ;set scan arc ipo 7, ax ;scan cmp ax, 1500 jgr !no_target cmp @0, 0 jls !flip_robot ;if going backwards and found a target turn around je !steering jne !steering :201 cmp scanarc, 8 jle !fire mov ax, 302 add ax, @3 je ax jne ax :300 ;accuracy = -2 mov bx, scanarc add bx, scanarc neg bx shr bx, 1 opo 12, bx ;turret faces where enemy was shr scanarc, 1 ;1/2scanarc je 100 jne 100 :301 ;accuracy = -1 mov bx, scanarc neg bx shr bx, 1 opo 12, bx ;turret faces where enemy was shr scanarc, 1 ;1/2scanarc je 100 jne 100 :302 ;accuracy = 0 opo 15 ;take a lucky shot opo 14, 64 ;going straight towards target, steer to avoid death shr scanarc, 1 ;1/2scanarc je 100 jne 100 :303 ;accuracy = 1 mov bx, scanarc shr bx, 1 opo 12, bx ;turret faces where enemy was shr scanarc, 1 ;1/2scanarc je 100 jne 100 :304 ;accuracy = 2 mov bx, scanarc add bx, scanarc shr bx, 1 opo 12, bx ;turret faces where enemy was shr scanarc, 1 ;1/2scanarc je 100 jne 100 !stopped neg speed opo 11, speed ;go opo 14, 48 ;turn a bit so if no target u dont just go back and forward je 200 jne 200 !no_target cmp scanarc, 64 je !flip_sensor shl scanarc, 1 ;double scanarc je 100 jne 100 !flip_sensor opo 12 ,128 ;turn turret to opposite direction je 100 jne 100 !steering opo 14, @2 ;steer to turret offset je 201 jne 201 !flip_robot opo 14, 128 ;about turn neg speed ;will make the speed positive opo 11, speed ;go je 201 jne 201 ;************************************************************* ;This is where the good stuff happens !fire ipo 2, ax ;testing heat cmp ax, 300 jgr 100 ;too hot cmp ax, 100 jls !overburn ;nice and cool :500 ipo 7, ax ;another scan to get new accuracy cmp ax, 150 jls !killer mov bx, @3 add bx, @3 opo 15, bx mov ax, 0 ;if overburn was on it turns it off int 4 je 100 jne 100 !overburn mov ax, 1 int 4 ;over burn on je 500 jne 500 !killer mov ax, 1 int 4 opo 17, 4 ipo 7, ax mov bx, @3 add bx, @3 opo 15, bx opo 15, bx opo 15, bx mov ax, 0 int 4 je 100 jne 100