#side Tactical's Productive My first ever Grobot! The Factories talk to each other to spread themselves out in a curve. The bombs talk to each other so the new bombs run into areas where bombs are not (ie, enemy areas) And the little factorys just kinda spread out from the main factory line. Really just designed to duel Telbot. :) (20020927) Added MiniBombs just for Eventually #author Daniel Von Fange http://www.braino.org - blog. :) botman@daniel-labs.com Fixed Channels 2 BombBot public X home 3 BombBot public Y home 4 Factory public X home 5 Factory public Y home #date September 25th 2002 #color 962000 #type Factory #color 962000 #hardware energy 1 0 processor 30 armor 100 constructor 2 repair-rate 0.01 shot-sensor 4 robot-sensor 0 food-sensor 0 engine .2 eater 0 solar-cells 2 #code #vector myHome #vector myDestination #start constructor-max-rate constructor-rate! newHomeAsDestination^ goToDestination^ do constructor-type not newSpawnBot& ifc goToDestination^ forever newSpawnBot: time 1000 < littleFactory& ifg 1 2 random-int 0 1 random-int + constructor-type! return; littleFactory: 1 constructor-type! return newHomeAsDestination: sync 5 read 4 read myHome! ;note backwards receiving here myHome + 1 < pickInitialHome& ifc ;Get angle to center of world myHome 50 50 v- angle ;flip and add some randomness/offset to it 3 4 random + ;now for some distance 4 ;get it back into shape swap polar-to-rect ;Add it to current home myHome v+ ;pray that it works, and send it out 4 write 5 write myHome myDestination! return pickInitialHome: position swap 50 < south& ifg north: 99 swap 50 > northwest& ifg ;east 1 storeIt& jump northwest: 99 storeIt& jump south: 1 swap 50 > southwest& ifg ;east 1 storeIt& jump southwest: 99 storeIt& jump storeIt: myHome! myHome 4 write 5 write return goToDestination: do myDestination seek-location myDestination position radius in-range ifr constructor-type not newSpawnBot& ifc forever #type BombBot #color FFFFFF #hardware energy 25 0 processor 10 armor 200 constructor 0 repair-rate 0.01 shot-sensor 0 robot-sensor 20 2 food-sensor 0 engine 0.2 shield 0.1 eater 0 solar-cells 0.4 bomb 1300 radio write read #code #vector myHome #vector myDestination #const HOME_RADIUS 10 #start max-shield shield! engine-max-power engine-power! constructor-max-rate constructor-rate! 1 robot-sensor-sees-enemies! 0 robot-sensor-sees-friends! getNewHome^ myHome + 1 < getRandomNewHome& ifc checkPublicHome^ ramble: do myHome myDestination! goToDestination^ sync getRandomNewHome^ forever seek: do robot-position seek-location sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync enemy-collision if die then sync fire-robot-sensor sync robot-found ramble& nifg forever goToDestination: do myDestination seek-location myDestination position radius in-range ifr sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync fire-robot-sensor sync robot-found seek& ifg checkPublicHome^ forever ; ; Functions ; checkPublicHome: 2 read 3 read myHome HOME_RADIUS in-range not ifr 1 99 random 2 write 1 99 random 3 write return getNewHome: 2 read 3 read myHome! return; getRandomNewHome: 1 99 random 1 99 random myHome! return #type AuxFactory #color 962000 #hardware energy 1 0 processor 2 armor 60 constructor 1 repair-rate 0.00 shot-sensor 0 robot-sensor 0 food-sensor 0 engine 0 eater 0 solar-cells 1 force-field 0 0 radio write read #code #var scanTime #vector myHome #const HOME_RADIUS 15 #start constructor-max-rate constructor-rate! do constructor-type not newSpawnBot& ifc scanTime time > scanAndShoot& ifc checkPublicHome^ forever newSpawnBot: 2 5 random-int 4 min constructor-type! return; scanAndShoot: return scanTime 50 + fire-robot-sensor sync robot-found not ifr robot-position rect-to-polar force-field-direction! .5 - force-field-distance force-field-max-power force-field-power! sync 0 force-field-power! scanAndShoot& jump return checkPublicHome: 2 read 3 read myHome HOME_RADIUS 2 * in-range not ifr 1 99 random 2 write 1 99 random 3 write return #type MiniBombBot #color FFFFFF #hardware energy 25 0 processor 10 armor 20 constructor 0 repair-rate 0.01 shot-sensor 0 robot-sensor 10 1 food-sensor 0 engine 0.02 shield 0.01 eater 0 solar-cells 0.05 bomb 130 radio write read #code #vector myHome #vector myDestination #const HOME_RADIUS 10 #start max-shield shield! engine-max-power engine-power! constructor-max-rate constructor-rate! 1 robot-sensor-sees-enemies! 0 robot-sensor-sees-friends! getNewHome^ myHome + 1 < getRandomNewHome& ifc checkPublicHome^ ramble: do myHome myDestination! goToDestination^ sync forever seek: do robot-position seek-location sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync enemy-collision if die then sync fire-robot-sensor sync robot-found ramble& nifg forever goToDestination: do myDestination seek-location myDestination position radius in-range ifr sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync fire-robot-sensor sync robot-found seek& ifg checkPublicHome^ forever ; ; Functions ; checkPublicHome: 2 read 3 read myHome HOME_RADIUS in-range not ifr 1 99 random 2 write 1 99 random 3 write return getNewHome: 2 read 3 read myHome! return; getRandomNewHome: 1 99 random 1 99 random myHome! return #end