#side Commune #author Devon 12-20 November 2002 Gatherers deliver energy to defenders and constructors on request. This is a communication-intensive side. The Revenge type used to be the star, but got displaced by these fancy syphoners. Problems: When there are very many cells, there are serious traffic problems. There is no offense. If enough Revenges could be built, they could go hunting as a group. Very vulnerable to missiles; an antimissile type would help. #color ddd #seed 3 2 1 1 2 Channel 2 contains places with lots of food. Channel 3 contains positions of Pregnants. Channel 4 contains positions of hungry Revenges. Channel 5 contains targets (sometimes imaginary). #type Revenge You don't have to be a giant to be effective in combat. #color c00 #hardware engine .1 energy 250 10 repair-rate .04 armor 400 blaster 25 2 10 robot-sensor 8 shot-sensor 7 processor 13 radio send receive #code #vector home #vector target #var next-call #vector callpos autorepair: energy 100 > max-repair-rate 0 ifev repair-rate! return call-for-help: speed ifr time next-call < position callpos radius in-range and ifr position 2 4 send time 1000 + next-call! position callpos! return #start position home! idle& jump hungry: 0 engine-power! 0 repair-rate! call-for-help do sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync sync call-for-help energy 120 < while-loop 5 clear-messages idle: 0 engine-power! do autorepair time robot-sensor-time 20 + >= if fire-robot-sensor sync robot-found fight& ifg then time shot-sensor-time 10 + >= if fire-shot-sensor sync shot-found chase-shot& ifg then 5 messages if armor 200 > and-if 5 receive drop target! chase& jump then energy 100 < call-for-help& ifc sync energy 70 > while-loop hungry& jump chase-shot: shot-position shot-velocity unitize -20 vs* v+ target! target 2 5 send chase: do target seek-location autorepair time robot-sensor-time 15 + >= if fire-robot-sensor sync robot-found fight& ifg then time shot-sensor-time 12 + >= if fire-shot-sensor sync shot-found chase-shot& ifg then armor 100 < energy 50 < or retreat& ifg target position 2 in-range until-loop go-home& jump fight: robot-position 2 5 send do robot-position robot-velocity 10 vs* v+ seek-location autorepair time robot-sensor-time blaster-reload-time + >= if fire-robot-sensor sync robot-found go-home& nifg robot-distance .8 robot-radius + < if robot-direction fire-blaster then then energy 30 > while-loop retreat& jump retreat: 5 clear-messages do energy 10 < hungry& ifg home seek-location autorepair home position 7 in-range until-loop idle& jump go-home: 5 clear-messages home 8 random-angle polar-to-rect v+ target! do energy 10 < hungry& ifg target seek-location autorepair time robot-sensor-time 20 + >= if fire-robot-sensor sync robot-found fight& ifg then time shot-sensor-time 10 + >= if fire-shot-sensor sync shot-found chase-shot& ifg then 5 messages if armor 200 > and-if 5 receive drop target! chase& jump then target position 8 in-range until-loop idle& jump #type Sustenance #color 0c0 #hardware friendly-syphon 2 energy 350 10 eater 2 engine .03 armor 150 shield .1 repair-rate .05 food-sensor 10 shot-sensor 8 processor 10 radio receive send #code #vector home #vector dest ;location #var last-armor #vector food-save #var last-food-announce autorepair: armor energy < max-repair-rate 0 ifev repair-rate! return #start position home! eat: 0 shield! 0 friendly-syphon-rate! armor last-armor! fire-food-sensor sync do autorepair food-found if food-position seek-location food-found food-energy 100 - * 1000 > if time last-food-announce 150 + >= and-if position 2 2 send time last-food-announce! then else energy 150 > full& ifg food-save and if food-save position 5 in-range not and-if food-save seek-location else 2 messages if 2 messages 2 - 2 skip-messages 2 receive drop food-save! food-save seek-location else 0 engine-power! then then then time food-sensor-time food-found 50 150 ifev + > eaten not and if fire-food-sensor sync then armor last-armor < if max-shield shield! position 2 5 send ;call for help armor 100 < run& ifg then armor last-armor! energy eaten 340 250 ifev > until-loop food-found if food-position else 0 0 then food-save! full& jump run: do autorepair home seek-location home position 7 in-range until-loop 0 shield! eat& jump full: 0 friendly-syphon-rate! do autorepair 4 messages if 4 messages 5 - 4 skip-messages 4 receive drop dest! feed& jump else 3 messages if 3 messages 6 - 3 skip-messages 3 receive drop dest! feed& jump then then home seek-location energy 60 > while-loop eat& jump feed: do position dest v- unitize dest v+ seek-location dest position 1.5 in-range if dest position v- rect-to-polar friendly-syphon-direction! radius - friendly-syphon-distance! friendly-syphon-max-rate negate friendly-syphon-rate! sync friendly-syphoned -1.5 > if energy 150 > full& eat& ifeg then then energy 25 > while-loop eat& jump #type Pregnant #color fc0 #hardware solar-cells .4 energy 200 0 constructor 1 radio send processor 3 armor 100 #code #var next-call new-baby: 2 type-population population 3 / <= if 2 else 1 type-population 3 type-population <= 1 3 ifev then constructor-type! return #start constructor-max-rate constructor-rate! do constructor-type new-baby& nifc time next-call >= speed not and if position 2 3 send time 500 + next-call! then sync forever #end