• ; I'm not even going to try to explain this barrier routine.  It works at least.
  • ; It's gotten to the point even I'm afraid to mess with it.
  • ; Okay, I *tried* to comment this.
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • barrier:
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  •  
  • ; Check for missile frag.
  •  
  • if missile ready then if value ~v2 > 4.8 then if value ~v2 < 5.2 then goto gotcha__ 2
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then gosub 2
  •  
  • ; Reset barrier count.
  •  
  • assign vz 0
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  •  
  • ; These subrouttines are explained at them.
  •  
  • gosub bright_ #cur_head
  •  
  • ; Actually random navigation when you get right down to it.
  •  
  • generate random
  •  
  • ; Little mixed up due to subclicks.
  •  
  • if value #random >= 3 then turn right
  • if value #random <= 2 then turn left
  • if value #random >= 3 then goto bright2
  • if value #random <= 2 then goto bleft2
  •  
  • ; This is used for more than just right hand turns, but originally I thought I'd need left as well.
  • ; These assign tests and values for different headings.
  • ; Torque doesn't react to bugs on the other side of the wall thanks to these.
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bright_ 1:
  • assign vj 1
  • math vl = #y_pos - 2
  • assign vk >=
  • if value #inbound = 0 then if value #enemy_y <> #y_pos then if value #x_pos <> #enemy_x then return
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound <> 0 then goto locked_ #cur_head #inbound
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bright_ 3:
  • assign vj 1
  • math vl = #y_pos + 2
  • assign vk <=
  • if value #inbound = 0 then if value #enemy_y <> #y_pos then if value #x_pos <> #enemy_x then return
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound <> 0 then goto locked_ #cur_head #inbound
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bright_ 2:
  • assign vj 2
  • math vl = #x_pos + 2
  • assign vk <=
  • if value #inbound = 0 then if value #enemy_y <> #y_pos then if value #x_pos <> #enemy_x then return
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound <> 0 then goto locked_ #cur_head #inbound
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bright_ 4:
  • assign vj 2
  • math vl = #x_pos - 2
  • assign vk >=
  • if value #inbound = 0 then if value #enemy_y <> #y_pos then if value #x_pos <> #enemy_x then return
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound <> 0 then goto locked_ #cur_head #inbound
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bright:
  • turn right
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bright2:
  •  
  • ; Assess what's ahead.
  •  
  • long range scan
  •  
  • ; Reset step count.
  •  
  • assign vb 0
  •  
  • ; Go to quick, no relative 1 scanning routine.
  •  
  • if scan found barrier then goto fastbrmove_ ~vj
  • if scan found flag then goto getflag
  •  
  • ; Gonna have to do it the hard way.
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • minerchk:
  • scan forward
  • if value #scan <> 0 then goto brmove_ ~vj
  •  
  • ; It's safe to move ahead 4 spaces without much scanning.
  •  
  • assign vb 4
  • goto fastbrmove_ ~vj
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • ; Slow, mine testing mode.  Call only as last resort.
  •  
  • brmove_ 1:
  • scan perimeter
  • if value #scan <> 3 then goto #scan
  • scan relative 8
  •  
  • ; Finish up this routine here.
  •  
  • if scan found nothing then goto boo_r
  •  
  • ; This is what the bright routines did.
  •  
  • if value #x_pos = #enemy_x then if value #enemy_y ~vk ~vl then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • scan relative 1
  • if value #scan <> 0 then goto brightchk
  • move forward
  • if value #x_pos = #enemy_x then if value #enemy_y ~vk ~vl then goto same_x_ #cur_head
  • if value #enemy_y <> #y_pos then if value #cur_fuel > 300 then if value #inbound = 0 then if damage is = 0 then if value #cur_ammo >= 10 then goto brmove_ ~vj
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • if value #cur_fuel <= 300 then goto lowfuel
  • if value #cur_ammo < 10 then goto lowfuel
  • if damage is > 0 then attempt repairs
  • if value #x_pos = #enemy_x then if value #enemy_y ~vk ~vl then goto same_x_ #cur_head
  • if value #enemy_y <> #y_pos if value #inbound = 0 then goto brmove_ ~vj
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • goto brmove_ ~vj
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • ; Second one due to the bright subroutines need two different checks.
  •  
  • brmove_ 2:
  • scan perimeter
  • if value #scan <> 3 then goto #scan
  • scan relative 8
  • if scan found nothing then goto boo_r
  • if value #y_pos = #enemy_y then if value #enemy_x ~vk ~vl then goto same_y_ #cur_head
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • scan relative 1
  • if value #scan <> 0 then goto brightchk
  • move forward
  • if value #y_pos = #enemy_y then if value #enemy_x ~vk ~vl then goto same_y_ #cur_head
  • if value #enemy_x <> #x_pos then if value #cur_fuel > 300 then if value #inbound = 0 then if damage is = 0 then if value #cur_ammo >= 10 then goto brmove_ ~vj
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • if value #cur_fuel <= 300 then goto lowfuel
  • if value #cur_ammo < 10 then goto lowfuel
  • if damage is > 0 then attempt repairs
  • if value #y_pos = #enemy_y then if value #enemy_x ~vk ~vl then goto same_y_ #cur_head
  • if value #enemy_x <> #x_pos then if value #inbound = 0 then goto brmove_ ~vj
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • goto brmove_ ~vj
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • ; The speedy version.  Fires in one click.
  •  
  • fastbrmove_ 1:
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • math vb = ~vb - 1
  • scan relative 8
  • if value #scan <> 0 then move forward
  • if value #x_pos = #enemy_x then if value #enemy_y ~vk ~vl then goto same_x_ #cur_head
  • if value ~vb <> 0 then if value #scan <> 0 then if value #enemy_y <> #y_pos then if value #cur_fuel > 75 then if value #inbound = 0 then if damage is = 0 then if not bump barrier then goto fastbrmove_ ~vj
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if scan found nothing then gosub boo_r
  • if value #inbound >= 1 then gosub locked_ #cur_head #inbound
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • if value ~vb = 0 then goto minerchk
  • if damage is > 0 then attempt repairs
  • if value #x_pos = #enemy_x then if value #enemy_y ~vk ~vl then goto same_x_ #cur_head
  • if not bump barrier then if value #cur_fuel > 75 then if value #enemy_y <> #y_pos then if value #inbound = 0 then goto fastbrmove_ ~vj
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • if bump barrier then goto brightchk
  • if value #cur_fuel <= 75 then goto lowfuel
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • fastbrmove_ 2:
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • math vb = ~vb - 1
  • scan relative 8
  • if value #scan <> 0 then move forward
  • if value #y_pos = #enemy_y then if value #enemy_x ~vk ~vl then goto same_y_ #cur_head
  • if value ~vb <> 0 then if value #scan <> 0 then if value #enemy_x <> #x_pos then if value #cur_fuel > 75 then if value #inbound = 0 then if damage is = 0 then if not bump barrier then goto fastbrmove_ ~vj
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if scan found nothing then gosub boo_r
  • if value #inbound >= 1 then gosub locked_ #cur_head #inbound
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • if value ~vb = 0 then goto minerchk
  • if damage is > 0 then attempt repairs
  • if value #y_pos = #enemy_y then if value #enemy_x ~vk ~vl then goto same_y_ #cur_head
  • if not bump barrier then if value #cur_fuel > 75 then if value #enemy_x <> #x_pos then if value #inbound = 0 then goto fastbrmove_ ~vj
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • if bump barrier then goto brightchk
  • if value #cur_fuel <= 75 then goto lowfuel
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • ; When we hit a barrier while tracing another one.
  •  
  • brightchk:
  •  
  • ; If we've already turned around once, turn and keep tracing the wall.
  •  
  • if value ~vz = 1 then gosub bright_ #cur_head
  • if value ~vz = 1 then goto bright
  •  
  • ; Otherwise, turn around and remember you did.
  •  
  • assign vz 1
  • turn left
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound <> 0 then goto locked_ #cur_head #inbound
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • gosub bright_ #cur_head
  • if value #inbound = 0 then if value #enemy_y <> #y_pos then if value #x_pos <> #enemy_x then goto bleft
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound <> 0 then goto locked_ #cur_head #inbound
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • ; You've made it to a corner, carefully step around it.
  •  
  • boo_r:
  • scan relative 1
  • cmath vq = ((#cur_head-2)*(#cur_head-3)*(#cur_head-4)*(#y_pos-#enemy_y)/-6)+((#cur_head-1)*(#cur_head-3)*(#cur_head-4)*(#enemy_x-#x_pos)/2)+((#cur_head-1)*(#cur_head-2)*(#cur_head-4)*(#enemy_y-#y_pos)/-2)+((#cur_head-1)*(#cur_head-2)*(#cur_head-3)*(#x_pos-#enemy_x)/6)
  • if value #scan <> 0 then goto brightchk
  • if value #scan = 0 then if value ~vq <> 1 then move forward
  •  
  • ; This means an enemy is around the corner.
  •  
  • if value ~vq = 1 then if missile ready then gosub closechk2_ #cur_head
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • if value ~vq = 1 then assign vz 1
  • if value ~vq <> 1 then gosub bright_ #cur_head
  • if value ~vq <> 1 then turn left
  • if value ~vq = 1 then goto brightchk
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • scan perimeter
  • if value #scan <> 3 then goto #scan
  • assign vx 1
  • move forward
  • if value #inbound = 0 then if value #enemy_x <> #x_pos then if value #enemy_y <> #y_pos then goto bprogress_ #cur_head
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • ; Same as bright.
  •  
  • bleft:
  • turn left
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bleft2:
  • long range scan
  • assign vb 0
  • if scan found barrier then goto fastblmove_ ~vj
  • if scan found flag then goto getflag
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • minelchk:
  • scan forward
  • if value #scan <> 0 then goto blmove_ ~vj
  • assign vb 4
  • goto fastblmove_ ~vj
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • blmove_ 1:
  • scan perimeter
  • if value #scan <> 3 then goto #scan
  • scan relative 2
  • if scan found nothing then goto boo_l
  • if value #x_pos = #enemy_x then if value #enemy_y ~vk ~vl then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • scan relative 1
  • if value #scan <> 0 then goto bleftchk
  • move forward
  • if value #x_pos = #enemy_x then if value #enemy_y ~vk ~vl then goto same_x_ #cur_head
  • if value #enemy_y <> #y_pos then if value #cur_fuel > 300 then if value #inbound = 0 then if damage is = 0 then if value #cur_ammo >= 10 then goto blmove_ ~vj
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • if value #cur_fuel <= 300 then goto lowfuel
  • if value #cur_ammo < 10 then goto lowfuel
  • if damage is > 0 then attempt repairs
  • if value #x_pos = #enemy_x then if value #enemy_y ~vk ~vl then goto same_x_ #cur_head
  • if value #enemy_y <> #y_pos if value #inbound = 0 then goto blmove_ ~vj
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • blmove_ 2:
  • scan perimeter
  • if value #scan <> 3 then goto #scan
  • scan relative 2
  • if scan found nothing then goto boo_l
  • if value #y_pos = #enemy_y then if value #enemy_x ~vk ~vl then goto same_y_ #cur_head
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • scan relative 1
  • if value #scan <> 0 then goto bleftchk
  • move forward
  • if value #y_pos = #enemy_y then if value #enemy_x ~vk ~vl then goto same_y_ #cur_head
  • if value #enemy_x <> #x_pos then if value #cur_fuel > 300 then if value #inbound = 0 then if damage is = 0 then if value #cur_ammo >= 10 then goto blmove_ ~vj
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • if value #cur_fuel <= 300 then goto lowfuel
  • if value #cur_ammo < 10 then goto lowfuel
  • if damage is > 0 then attempt repairs
  • if value #y_pos = #enemy_y then if value #enemy_x ~vk ~vl then goto same_y_ #cur_head
  • if value #enemy_x <> #x_pos then if value #inbound = 0 then goto goto blmove_ ~vj
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • fastblmove_ 1:
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • math vb = ~vb - 1
  • scan relative 2
  • if value #scan <> 0 then move forward
  • if value #x_pos = #enemy_x then if value #enemy_y ~vk ~vl then goto same_x_ #cur_head
  • if value ~vb <> 0 then if value #scan <> 0 then if value #enemy_y <> #y_pos then if value #cur_fuel > 75 then if value #inbound = 0 then if damage is = 0 then if not bump barrier then goto fastblmove_ ~vj
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if scan found nothing then gosub boo_l
  • if value #inbound >= 1 then gosub locked_ #cur_head #inbound
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • if value ~vb = 0 then goto minelchk
  • if damage is > 0 then attempt repairs
  • if value #x_pos = #enemy_x then if value #enemy_y ~vk ~vl then goto same_x_ #cur_head
  • if not bump barrier then if value #cur_fuel > 75 then if value #enemy_y <> #y_pos then if value #inbound = 0 then goto fastblmove_ ~vj
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • if bump barrier then goto bleftchk
  • if value #cur_fuel <= 75 then goto lowfuel
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • fastblmove_ 2:
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • math vb = ~vb - 1
  • scan relative 2
  • if value #scan <> 0 then move forward
  • if value #y_pos = #enemy_y then if value #enemy_x ~vk ~vl then goto same_y_ #cur_head
  • if value ~vb <> 0 then if value #scan <> 0 then if value #enemy_x <> #x_pos then if value #cur_fuel > 75 then if value #inbound = 0 then if damage is = 0 then if not bump barrier then goto fastblmove_ ~vj
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if scan found nothing then gosub boo_l
  • if value #inbound >= 1 then gosub locked_ #cur_head #inbound
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • if value ~vb = 0 then goto minelchk
  • if damage is > 0 then attempt repairs
  • if value #y_pos = #enemy_y then if value #enemy_x ~vk ~vl then goto same_y_ #cur_head
  • if not bump barrier then if value #cur_fuel > 75 then if value #enemy_x <> #x_pos then if value #inbound = 0 then goto fastblmove_ ~vj
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • if bump barrier then goto bleftchk
  • if value #cur_fuel <= 75 then goto lowfuel
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bleftchk:
  • if value ~vz = 1 then gosub bright_ #cur_head
  • if value ~vz = 1 then goto bleft
  • assign vz 1
  • turn right
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound <> 0 then goto locked_ #cur_head #inbound
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • gosub bright_ #cur_head
  • if value #inbound = 0 then if value #enemy_y <> #y_pos then if value #x_pos <> #enemy_x then goto bright
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound <> 0 then goto locked_ #cur_head #inbound
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • boo_l:
  • scan relative 1
  • cmath vq = ((#cur_head-2)*(#cur_head-3)*(#cur_head-4)*(#y_pos-#enemy_y)/-6)+((#cur_head-1)*(#cur_head-3)*(#cur_head-4)*(#enemy_x-#x_pos)/2)+((#cur_head-1)*(#cur_head-2)*(#cur_head-4)*(#enemy_y-#y_pos)/-2)+((#cur_head-1)*(#cur_head-2)*(#cur_head-3)*(#x_pos-#enemy_x)/6)
  • if value #scan <> 0 then goto bleftchk
  • if value #scan = 0 then if value ~vq <> 1 then move forward
  • if value ~vq = 1 then if missile ready then gosub closechk2_ #cur_head
  • math v2 = #x_pos - #enemy_x - #enemy_x * #x_pos / #enemy_x + #enemy_x * #enemy_x / #y_pos + #y_pos - #enemy_y - #enemy_y * #y_pos / #enemy_y + #enemy_y * #enemy_y
  • if value ~v2 < 3 then if value #enemy_x <> 0 then if value ~v9 = ~v9 then goto 2
  • if value ~vq = 1 then assign vz 0
  • if value ~vq <> 1 then gosub bright_ #cur_head
  • if value ~vq <> 1 then turn right
  • if value ~vq = 1 then goto bleftchk
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  • scan perimeter
  • if value #scan <> 3 then goto #scan
  • assign vx 0
  • move forward
  • if value #inbound = 0 then if value #enemy_x <> #x_pos then if value #enemy_y <> #y_pos then goto bprogress_ #cur_head
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  •  
  • ; After you make it around a corner, see if the enemy is in front of you.
  • ; If not, keep tracing the new wall.
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bprogress_ 1:
  • scan perimeter
  • if value #enemy_y < #y_pos then goto end_bprogress2
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #scan <> 3 then goto #scan
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • end_bprogress:
  • if value ~vx = 0 then goto bleft2
  • if value ~vx = 1 then goto bright2
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • end_bprogress2:
  • goto #scan
  • math vq = 2 * #enemy_x - #x_pos / #x_pos / #y_pos + #y_pos / #enemy_y - 2 * #x_pos * #x_pos / #enemy_x / #enemy_x - 2 * #enemy_y / #y_pos + 1 * #enemy_x / #x_pos - 2 * #y_pos / #enemy_y + 4 * #y_pos / #enemy_y - 2 * #x_pos + #enemy_x * #enemy_x / #x_pos + #x_pos * #x_pos - 1 * #enemy_y / #y_pos + 2 * #enemy_y - #y_pos * #y_pos / #enemy_x - #enemy_x * #enemy_x + 1
  • if value ~vq > 1 then move forward
  • if value #inbound = 0 then if value #enemy_x <> #x_pos then if value #enemy_y <> #y_pos then goto start_ #cur_head
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #inbound >= 1 then goto locked_ #cur_head #inbound
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bprogress_ 3:
  • scan perimeter
  • if value #enemy_y > #y_pos then goto end_bprogress2
  • if value #y_pos = #enemy_y then goto same_y_ #cur_head
  • if value #scan <> 3 then goto #scan
  • goto end_bprogress
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bprogress_ 2:
  • scan perimeter
  • if value #enemy_x > #x_pos then goto end_bprogress2
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #scan <> 3 then goto #scan
  • goto end_bprogress
  •  
  • [JAMES] -- I haven't got around to explaining this section yet, but all of the links still work OK.
  •  
  • bprogress_ 4:
  • scan perimeter
  • if value #enemy_x < #x_pos then goto end_bprogress2
  • if value #x_pos = #enemy_x then goto same_x_ #cur_head
  • if value #scan <> 3 then goto #scan
  • goto end_bprogress