;Daemon - Devons main robot ;configs: #config shield=0 #config weapon=2 #config scanner=3 #config engine=1 #config heatsinks=4 #config mines=0 #config armor=2 #def arcwide #def searchdir #def direction #def fcount #def dist #def acc #def vel #def hot ;init program !start ; opo 24,1 mov arcwide,8 mov ax,1 int 3 mov searchdir, 8 mov direction,0 mov vel,100 mov hot,0 !begin int 12 cmp fx 0 ja !collide !acollide opo 14,direction opo 17,arcwide opo 11,vel ipo 7,dist cmp dist 700 jae !notfound jb !found !found mov vel,100 cmp dist,400 ja !closein cmp dist,100 jb !backoff ipo 4,ax sub ax,50 opo 14,ax !rangemod ipo 8,fx mov acc,fx cmp acc 0 je !firecontrol cmp acc -2 je !targlefta cmp acc -1 je !targleftb cmp acc 2 je !targrighta cmp acc 1 je !targrightb ; opo 11,0 ; ipo 8,ax ; cmp ax 0 jmp !firecontrol !targrighta opo 12,15 call !firecontrol opo 12,-5 jmp !begin !targrightb opo 12,5 call !firecontrol jmp !begin !targlefta opo 12,-10 call !firecontrol jmp !begin !targleftb opo 12,-5 call !firecontrol jmp !begin !firecontrol ; int 9 ; cmp ex 0 ; ja !fireright ; jb !fireleft ;!commencefire ipo 2,ax cmp ax,299 ja !cooldown cmp hot 0 jne !checkheat !heatok opo 15,-3 opo 15,0 opo 15,3 ret !cooldown mov hot,1 jmp !begin ;!fireright ; mov ax,ex ; div ax,8 ; opo 12,ax ; jmp !commencefire ;!fireleft ; mov ax,ex ; div ax,8 ; opo 12,-ax ; jmp !commencefire !notfound opo 12,searchdir jmp !begin !collide int 13 opo 14,60 cmp vel,100 je !back jne !forw !col2 jmp !begin !back mov vel,-75 jmp !col2 !forw mov vel,100 jmp !col2 !closein mov vel,100 ipo 4,ax opo 14,ax opo 15,0 jmp !rangemod !backoff ipo 4,ax opo 14,ax mov vel,-75 jmp !rangemod !checkheat ipo 2,ax cmp ax,50 ja !begin jb !heatok