'Sledgehammer by googlyeyesultra.
'Has powerful defenses and powers up shots to dish out damage quickly.
'Stockpiles huge amounts of resources before reproducing, but rarely dies.

def idcheck 999
def tieid 998

start
'=============Eyes============
*.eye5width 1221 !=
1221 .eye5width store

0 *.focuseye !=
0 .focuseye store

0 *.eye5dir !=
0 .eye5dir store

'===========ID===========
'0 = Ally.
'1 = Veggie.
'2 = Hostile.

*.refeye *.myeye = *.refshoot *.myshoot = and
0 .idcheck store

*.refeye *.myeye != *.refshoot *.myshoot != or
2 .idcheck store

*.refeye *.refshoot add 0 =
1 .idcheck store

'===========Pursuit===========
*.eye5 0 != *.eye5 25 < and *.idcheck 0 != and
*.refxpos *.refypos angle .setaim store
*.maxvel *.velup sub .up store
*.refveldx *.veldx sub .dx store

'===========Follow===========
*.eye5 25 >= *.idcheck 0 != and
*.refxpos *.refypos angle .setaim store
*.refvelup *.velup sub .up store
*.refveldx *.veldx sub .dx store

'===========Wander===========
*.eye5 0 =
30 *.velup sub .up store

'===========Avoid===========
*.eye5 0 > *.idcheck 0 = *.robage 1 > and *.reftype 0 != or and
*.refxpos *.refypos angle 628 add .setaim store
*.eye5 .up store

'===========Reproduction===========
'Reproduce.
*.nrg 30000 > *.body 15000 > and
49 .repro store

'Birthtie cut
*.robage 1 =
.tie inc
*.robage 2 =
.deltie inc

'===========Defenses===========
'Make poison if hit by nrg shot or info shot.
*.shflav -1 = *.shflav sgn 1 = or
.shoot .ploc store
*.nrg 50 div 300 *.poison 3 div sub ceil .strpoison store
0 .shflav store

'Make shell if hit by body shot or venom.
*.shflav -6 = *.shflav -3 = or
*.nrg 50 div 300 *.shell 3 div sub ceil .mkshell store
0 .shflav store

'===========Body Regulation===========
'Nrg -> Body.
*.nrg 2 div *.body >
*.nrg 2 div *.body sub .strbody store

'Body -> Nrg.
*.body *.nrg 2 div >
*.body *.nrg 2 div sub .fdbody store

'===========Shooting===========
'Select type of shot.
*.idcheck 0 != *.refpoison >= *.refshell and *.eye5 15 > *.idcheck 2 = and *.eye5 30 > or and
-6 .shoot store

*.idcheck 0 != *.refshell > *.refpoison and *.eye5 15 > *.idcheck 2 = and *.eye5 30 > or and
-1 .shoot store

'Select shootval.
*.eye5 30 < *.eye5 15 > and *.idcheck 2 = and
*.refxpos *.refypos dist 100 div -1 mult .shootval store

*.eye5 30 >= *.idcheck 2 = and
5 .shootval store

'===========Ties===========

'Set a tieid.
*.tieid 0 =
998 rnd 1 add .tieid store

'Tie to an enemy.
*.idcheck 0 != *.eye5 30 > and
*.tieid .tie store

'Tiefeed if tied.
*.numties 0 !=
*.tieid .tienum store
-1000 .tieval store
*.tieval 1000 div .tieloc store

'Delete enemy ties.
*.numties 0 != *.tiepres *.tieid != and
*.tiepres .deltie store

'Sharefeed if multi.
*.multi 0 !=
1256 .tieang1 store
1 .tielen1 store
100 .sharenrg store
100 .shareslime store
100 .shareshell store

'===========Waste Removal===========
.sharewaste inc

*.waste 50 >
-4 .shoot store
*.waste .shootval store

'=============Chameleon=============
*.in1 0 != *.in1 *.out1 != and *.in1 *.refage != and
*.in1 .out1 store

*.in2 0 != *.in2 *.out2 != and *.in2 *.refage != and
*.in2 .out2 store

*.in1 *.refage =
*.robage .out1 store

*.in2 *.refage =
*.robage .out2 store

'===========Antivirus===========
*.repro 49 != *.repro 0 != and
0 .repro store

*.fixed 0 !=
0 .fixpos store

*.shoot -2 =
0 .shoot store

*.mrepro 0 !=
0 .mrepro store

*.sexrepro 0 !=
0 .sexrepro store

*.focuseye 0 !=
0 .focuseye store

*.mkvirus 0 !=
0 .mkvirus store

*.vshoot 0 !=
0 .vshoot store

stop
