; Pi Bot v2! ; --not yet complete(!) ; --okay in 1-on-1, great in chaos! ; written by Chris King (e-mail: ctk314@yahoo.com) ; visit my web site, soon to be loaded with bushels of stuff about AT-robots: ; www.geocities.com/area51/crater/7404 ; ; Sorry if you'd like a version number; Pi Bot gets updated daily. ; The file size is a good version number, though - ; Pi Bot generally always gets bigger. ; ; +-----------------------------------+ ; | +--- --+-- +--- --- --+-- | ; | | | | | | | | | | ; | +--- | +--- | | | | ; | | | | | | | | | ; | | --+-- +--- --- | | ; +-----------------------------------+ ; ; Pi Bot originally went around in a circle, firing at anything he saw. Then ; he barfed at anything he saw (I don't know how else to describe it!). Then ; he actually tracked people and barfed at them when they got stuck on a wall. ; Then he went straight when he bumped into something or got fired at. Then he ; went backwards when he bumped into something. Then he ran away from people. ; Then he dropped two strategically (?) placed mines, in hopes that his ; pursuer would run into them. Then he dynamically barfed, based on heat and ; armor conditions. Then he ran away from people even faster. Then he ; purposefully hugged the walls (most robots avoid them), his best hunting ; ground! And he lives happily ever after... as number 4 in the ongoing ATR ; competition (Standard class) at the ATR homepage! >:) ; ; The End (<- this should be in fancy lettering) #config scanner=3 #config weapon=1 #config armor=5 #config engine=0 #config heatsinks=3 #config shield=0 #config mines=0 #msg 3.14159265358979323 #def gostr #def lastblip #def rotdir #def scanarc #def scanarcs #def cdir #def throttle ;opo 19,314 ;change transponder ID to 314 opo 17,64 ;scanner arc=64 mov scanarc,64 mov scanarcs,5 mov ax,1 int 3 ;keepshift on mov cdir,5 mov throttle,100;throttle at 100% !loop ;ipo 2,ax ;if cool ;cmp ax,80 ;jae !chkrun ;mov ax,@2 ;opo 13,rotdir ;opo 15,0 ;fire a little bit ;opo 13,ax ;!chkrun cmp gostr,0 ;check if already running away jne !chkfire2 cmp throttle,0 jne !chkfire mov throttle,100 mov gostr,12 jeq !chkfire2 !chkfire int 11 ;check if being fired at cmp ex,20 jgr !chkfire2 ;int 2 ;which wall is closest? ;cmp ex,500 ;jae !hider ;mov ax,192 ;go left ;!rtw2 int 4 ;overburn to run away faster! ;sub ax,@1 ;opo 14,ax mov throttle,100;throttle at 100% mov gostr,12 ;move fwd 12 jls !loopp2 !chkfire2 cmp ex,100 ;if in saftey jls !loopp2 mov ax,0 ;then turn overburn off int 4 !loopp2 inc lastblip ;increase time since last sighting cmp lastblip,1000;check if nobody found jls !checkarmor mov lastblip,0 ;reset counter mov gostr,12 ;move fwd 12 !checkarmor ;ipo 6,ax ;self-destruct - for chaos mode ;cmp ax,5 ;check if almost dead ;jgr !checkcoll ;mov ax,1 ;overburn for more damage! ;int 4 ;opo 22,20 ;drop mines! ;opo 22,20 ;int 0 ;self destruct! HA HA HA! ;!checkcoll int 12 ;check if collision cmp fx,0 jeq !move int 13 cmp gostr,0 ;am I hiding? jeq !backup opo 14,160 ;turn around mov throttle,0 ;stop mov gostr,6 ;and wait jne !move !backup cmp throttle,0 ;which way are we headed? jls !movef mov throttle,-75;go backwards !checkcoll2 opo 14,32 ;turn some mov gostr,12 ;move fwd 12 !move opo 11,throttle ;set throttle cmp gostr,0 ;go straight? jeq !circles dec gostr cmp gostr,0 jgr !look neg cdir ;go the other way mov throttle,100;go forwards !look ipo 9,bx ;check radar gsb !chkscan ;check scanner cmp ax,1500 ;in range? jgr !bigarc shr ax,8 shr bx,8 cmp ax,bx ;am I firing at the closest target? jne !bigarc mov rotdir,@3 ;find accuracy cmp scanarcs,0 ;adjust for scanner size jeq !fire shl rotdir,scanarcs dec scanarcs ;shrink scanner size shr scanarc,1 opo 17,scanarc !fire opo 12,rotdir ;follow target ipo 2,ax ;check heat cmp ax,80 ;if cool, jae !loop ;FIRE!!! mov bx,@13 ;get target's speed shr bx,7 add bx,scanarcs mov ax,@2 ;add ax,128 opo 14,ax ;turn away from target opo 15,0 ;fire a little cmp bx,1 ;if target is fast jgr !loop ;then loop opo 15,1 opo 15,-1 ipo 7,bx ;re-aim cmp bx,1500 jgr !loop opo 12,@3 shr bx,4 sub bx,15 del 15 ;wait opo 15,0 ;fire more opo 15,1 opo 15,-1 del bx ;wait more add bx,55 int 11 cmp fx,bx jgr !loop mov ax,1 ;overburn for more damage! int 4 !fireloop0 ipo 2,ax ;check heat cmp ax,300 jae !fire3 int 11 ;am I hitting target? ;err fx cmp fx,15 jgr !fireloop1 opo 15,0 jbe !fireloop0 !fireloop1 ipo 2,ax ;check heat cmp ax,300 jae !fire3 int 11 ;am I hitting target? ;err fx cmp fx,20 jgr !fireloop2 opo 15,1 opo 15,-1 jbe !fireloop1 !fireloop2 ipo 2,ax ;check heat cmp ax,300 jae !fire3 int 11 ;am I hitting target? ;err fx cmp fx,25 jgr !fireloop3 opo 15,2 opo 15,-2 jbe !fireloop2 !fireloop3 ipo 2,ax ;check heat cmp ax,300 jae !fire3 int 11 ;am I hitting target? ;err fx cmp fx,30 jgr !fireloop4 opo 15,3 opo 15,-3 jbe !fireloop3 !fireloop4 ipo 2,ax ;check heat cmp ax,300 jae !fire3 int 11 ;am I hitting target? ;err fx cmp fx,35 jgr !fire3 opo 15,4 opo 15,-4 jbe !fireloop4 !fire3 mov ax,0 ;turn overburn off int 4 jgr !loop !circles int 2 ;check if near a wall cmp ex,50 jbe !circles2 cmp ex,950 jae !circles2 cmp fx,50 jbe !circles2 cmp fx,950 jae !circles2 opo 14,64 ;if not, then go to one. mov gostr,24 !circles2 opo 14,cdir ;go in circles! jeq !look jne !look !movef mov throttle,100;go forward jls !checkcoll2 !chkscan ipo 7,ax ;check scanner cmp gostr,0 ;if not going straight jne !rfma ;and cmp ax,200 ;if too close jgr !rfma ;then move away mov bx,@2 sub bx,127 ;which way should I turn? sub bx,@1 opo 14,bx ;turn! ;mov gostr,6 ;go straight cmp ax,50 ;if really close jgr !rfma ipo 22,bx ;and have mines cmp bx,0 jeq !rfma opo 22,20 ;then lay a mine !rfma ret ;!hider ;mov ax,64 ;turn right ;jae !rtw2 !bigarc cmp scanarcs,5 jeq !aimstr inc scanarcs shl scanarc,1 opo 17,scanarc jne !loop !aimstr opo 12,128 jeq !loop