#side Teledont #author Matt Burkholder #date 5 May 2002 #color 55f #type Megadont #color a0a #hardware processor 15 engine 0.15 constructor 1.2 energy 500 20 solar-cells .4 eater 1.7 robot-sensor 40 food-sensor 12 armor 649 repair-rate .75 blaster 74 39 30 #code #var destx 0 #var desty 0 #var targetx 50 #var targety 50 #var targetDirection 0 #var robot-sensor-next 0 #var food-sensor-next 0 food-sensor-range 0.6 * food-sensor-focus-distance! do energy 450 > constructor-max-rate 0 ifev constructor-rate! 1 constructor-type! armor max-armor < energy 20 > and max-repair-rate 0 ifev repair-rate! time robot-sensor-next < blaster-cooldown or energy 21 < or nif fire-robot-sensor sync robot-found if robot-position position v- robot-velocity 0.75 vs* velocity v- robot-distance blaster-speed / vs* v+ rect-to-polar fire-blaster drop ;robot-position targety! targetx! robot-direction robot-distance 25 < pi 0 ifev + targetDirection! else 50 50 position v- angle targetDirection! time 50 + robot-sensor-next! then then time food-sensor-next > if targetDirection food-sensor-focus-direction! fire-food-sensor sync food-found if 18000 food-sensor-next! food-position 2dup seek-location sync sync sync sync else time 50 + food-sensor-next! 0 0 then desty! destx! then destx if destx desty seek-location else targetx targety seek-location sync speed nif 30 70 random targetx! 30 70 random targety! then then speed energy 499 > or nif energy sync energy - constructor-rate - -1 > if time 5 + food-sensor-next min food-sensor-next! then then forever #end