' SWARM
'
' Forms swarms to its tactical advantage
' Anti birth-tie
cond
start
.tie *.robage 1 add mult inc
.deltie inc
stop
' Swarm
cond
*.eye5 0 >
*.refeye *.myeye =
start
*.refaim .setaim *.refkills *.kills sub sgn 1 add mult store
*.refvelup .up store
stop
' Move
cond
*.eye5 0 =
start
5 .up store
*.eye9 *.eye1 sub 2 mult .aimdx store
stop
' Hunt prey
cond
*.eye5 0 >
*.refeye *.myeye !=
start
*.refvelup 50 add .up 50 *.eye5 sub sgn mult store
*.refxpos *.refypos angle .setaim *.robage sgn mult store
stop
' Attack
cond
*.eye5 34 >
*.refeye *.myeye !=
start
-6 .shoot store
16 .shootval store
stop
' Reproduce
cond
*.body 700 >
start
30 .repro store
stop
' Feed on and store body
cond
*.nrg 10000 >
start
100 .strbody store
stop
cond
*.nrg 1000 <
start
*.body 0 floor .fdbody *.body sgn mult store
stop
end