'Slam Funk 1.1
'Uses simple genes and a simple conspec
'To survive at least against low level bots.
'Heavily based on Animal Minimalis,
'While very little of it was actually used.
'Best feature includes a very good vision system.
'It is able to follow its friends and break off to feed.


'CHANGELOG:
'Ver 1.10
'	Finalized edits, cleaned up code
'
'Ver 1.10c (Release Candidate 3)
'	Replaced defunct eye system with a new one
'
'Ver 1.10b (Release Candidate 2)
'	Fixed bug in shooting gene from missing custom variable
'	Fixed bug in birthtie remover
'
'Ver 1.10a (Release Candidate 1)
'	Removed dysfunctional testing genes
'	General genome cleanup work
'
'Ver 1.01c (Internal Build)
'	Further modified values
'	Added 'new' shooting gene (muahahaha...)
'       Now deletes birth ties
'
'Ver 1.01b (Internal Build)
'	Added energy cost to .repro
'	Increased shot power from 8 to 10 to 32
'	Added body to energy conversion. Should have been there in the first place.
'
'Ver 1.01a (Internal Build)
'	Removed poison and shell genes
'	Now fully F3 compliant
'	Replaced aiming component of shooting gene
'	Preliminary tuning done on major genes (repro, body)
'	Slowed base movement velocity from 30 to 10
'
'Ver 1.00
'	Original Build

def lead 987

' Get rid of birth tie
cond
start
 .deltie inc
stop

'Body storage gene.
cond
*.nrg *.body >
start
100 .strbody
stop

'Body feeding gene.
cond
*.nrg *.body <
start
100 .fdbody
stop

'See nothing, start looking. I wasn't content to just have it spin.
cond
*eye5 0 =
*.up 0 = and
start
10 .up store
stop

'Theres strength in numbers. This gene makes bots follow one another if they see a fellow bot.
cond
*.eye5 0 >
*.refeye *.myeye =
start
*.refveldx .dx store
*.refvelUp .up store
30 .aimdx store
stop

'Shhhh, if you know what this is, don't tell.
cond
*.eyef 0 >
*.refeye *.myeye =
*.in1 0 !=
*.in2 0 != or and
start
*.in1 *.in2 angle .setaim store
*.in1 *.in2 dist 500 div *.maxvel mult *.refvel add 0 floor *.maxvel ceil .up store
*.refveldx .dx store
*.in1 .out1 store
*.in2 .out2 store
stop

'Targeting genes. -Taken from Gimmick2.0

'eye4
cond
*.paralyzed 0 =
*.poisoned 0 =
*.eye5 0 =
*.eye4 0 >
*.eye4 *.eye3 >=
*.eye4 *.eye2 >=
*.eye4 *.eye1 >=
*.eye4 *.eye6 >=
*.eye4 *.eye7 >=
*.eye4 *.eye8 >=
*.eye4 *.eye9 >=
start
*.aim 35 add .setaim store
stop

'eye6
cond
*.paralyzed 0 =
*.poisoned 0 =
*.eye5 0 =
*.eye6 0 >
*.eye6 *.eye4 >
*.eye6 *.eye7 >=
*.eye6 *.eye8 >=
*.eye6 *.eye9 >=
*.eye6 *.eye1 >=
*.eye6 *.eye2 >=
*.eye6 *.eye3 >=
start
*.aim -35 add .setaim store
stop

'eye3
cond
*.paralyzed 0 =
*.poisoned 0 =
*.eye5 0 =
*.eye3 0 >
*.eye3 *.eye4 >
*.eye3 *.eye6 >
*.eye3 *.eye2 >=
*.eye3 *.eye1 >=
*.eye3 *.eye7 >=
*.eye3 *.eye8 >=
*.eye3 *.eye9 >=
start
*.aim 70 add .setaim store
stop

'eye7
cond
*.paralyzed 0 =
*.poisoned 0 =
*.eye7 0 >
*.eye5 0 =
*.eye7 *.eye4 >
*.eye7 *.eye6 >
*.eye7 *.eye3 >
*.eye7 *.eye2 >=
*.eye7 *.eye1 >=
*.eye7 *.eye8 >=
*.eye7 *.eye9 >=
start
*.aim -70 add .setaim store
stop

'eye2
cond
*.paralyzed 0 =
*.poisoned 0 =
*.eye2 0 >
*.eye5 0 =
*.eye2 *.eye4 >
*.eye2 *.eye3 >
*.eye2 *.eye7 >
*.eye2 *.eye6 >
*.eye2 *.eye1 >=
*.eye2 *.eye9 >=
*.eye2 *.eye8 >=
start
*.aim 105 add .setaim store
stop

'eye8
cond
*.paralyzed 0 =
*.poisoned 0 =
*.eye8 0 >
*.eye5 0 =
*.eye8 *.eye2 >
*.eye8 *.eye3 >
*.eye8 *.eye4 >
*.eye8 *.eye7 >
*.eye8 *.eye6 >
*.eye8 *.eye1 >=
*.eye8 *.eye9 >=
start
*.aim -105 add .setaim store
stop

'eye1 
cond
*.paralyzed 0 =
*.poisoned 0 =
*.eye5 0 =
*.eye1 0 >
*.eye1 *.eye2 >
*.eye1 *.eye3 >
*.eye1 *.eye4 >
*.eye1 *.eye6 >
*.eye1 *.eye7 >
*.eye1 *.eye8 >
*.eye1 *.eye9 >=
start
*.aim 140 add .setaim store
stop

'eye9
cond
*.paralyzed 0 =
*.poisoned 0 =
*.eye5 0 =
*.eye9 0 >
*.eye9 *.eye1 >
*.eye9 *.eye2 >
*.eye9 *.eye8 >
*.eye9 *.eye7 >
*.eye9 *.eye6 >
*.eye9 *.eye4 >
*.eye9 *.eye3 >
start
*.aim -140 add .setaim store
stop

'Ass-shot gene. Tested it against basicswarmer, swarmers beat the snot out of my bots by following them close behind so I stuck this in here.
cond
*.shflav 0 !=
*.shflav -2 !=
start
1256 *.shang sub .aimshoot store
32 .shootval store
-6 .shoot store
0 .shflav store
stop



'The shooting gene. It fires if the bot sighted fails the conspec check and is in range. And does some other things I won't divulge.
cond
*.eye5 40 >
*.refeye *.myeye != and
start
*.refxpos *.refypos dist *.refvelup add *.xpos add
*.ypos *.refvelsx add
angle
*.refxpos *.refypos angle add
.setaim store
*.refxpos *.refypos dist 30 sub 500 div *.maxvel mult *.refvel *.vel *.refeye sgn mult sub 1 mult add .up store
*.refveldx .dx store
*.refxpos .out1 store
*.refypos .out2 store
*.eyef *.refveldx 400 mult *.refbody div 4 add > 
-6 .shoot store
32 .shootval store
*.refnrg *.refbody <
*.refpoison *.refshell < or
-1 .shoot store
1600 *.refvelsx 2 pow sub sqr *.xpos add
*.ypos *.refvelsx add 
angle .lead store
*.refvelsx *.velsx <
1256 *.lead sub .lead store
dropbool
*.lead .aimshoot store
stop

'Reproduction gene. Gotta make mo' bots.
cond
*.nrg 3000 >
*.body 500 > and
start
40 .repro store
314 .aimdx store
stop

'Obligatory anti-viral gene
cond
 *.mkvirus 0 !=
start
 *.mkvirus .delgene store
stop


end


'#tag:Slam_Funk1.1(F3)(Ta-183)-4.26.09.txt
