'*******************************/
'  Robottus Fisannis
'
'* C. Fisanne, 24 january 2003 */
'*******************************/

'******************/
'* REPRODUCTION   */
'******************/

cond
*.nrg
5000
>
start
50
.repro
store
stop

'******************************/
'* NO TARGET => CIRCLE SHAPE  */
'******************************/

cond
*.eye1
0
=
*.eye2
0
=
*.eye3
0
=
*.eye4
0
=
*.eye5
0
=
*.eye6
0
=
*.eye7
0
=
*.eye8
0
=
*.eye9
0
=
start
4
.aimsx
store
2
.up
store
stop

'*************************************/
'* TARGET = different robot and far  */
'* => firing & coming nearer         */
'*************************************/

cond
*.eye5
0
>
*.eye5
41
<
*.refeye
60
<
*.refeye
0
!=
start
-1
.shoot
store
10
.up
store
stop

'*********************************************/
'* TARGET = different firing robot and near  */
'* => to kill asap                           */
'*********************************************/

cond
*.eye5
0
>
*.eye5
40
>
*.refeye
60
<
*.refeye
0
!=
start
.dn
.shoot
store
10000
.shootval
store
stop

'**************************************/
'* TARGET = far VEG with enough nrg   */
'* => firing & coming nearer          */
'**************************************/

cond
*.eye5
0
>
*.eye5
41
<
*.refeye
0
=
*.refnrg
200
>
start
-1
.shoot
store
7
.up
store
stop

'**************************************/
'* TARGET = near VEG with enough nrg  */
'* => only firing                     */
'**************************************/

cond
*.eye5
0
>
*.eye5
40
>
*.refeye
0
=
*.refnrg
200
>
start
-1
.shoot
store
stop

'****************************************/
'* TARGET = VEG with poor nrg and robot */
'* enough nrg to reproduct => go away ! */
'****************************************/

cond
*.eye5
0
>
*.refeye
0
=
*.refnrg
201
<
*.nrg
5500
>
start
100
.aimdx
store
stop

'*******************************/
'* TARGET = wall => go away !  */
'*******************************/

cond
*.eye5
0
>
*.refeye
0
=
*.refnrg
10000
=
start
600
.aimdx
store
stop

'************************/
'* TARGET = same robot  */
'*  => go away !        */
'************************/

cond
*.eye5
0
>
*.refeye
59
>
start
300
.aimsx
store
stop

'**********************************/
'* research of the best heading   */
'**********************************/

'*******  eye6  *********/

cond
*.eye6
0
>
*.eye5
0
=
start
22
.aimdx
store
stop

'*******  eye4  *********/

cond
*.eye5
0
=
*.eye4
*.eye6
>
start
22
.aimsx
store
stop

'*******  eye7  *********/

cond
*.eye5
0
=
*.eye7
*.eye6
>
*.eye7
*.eye4
>
start
45
.aimdx
store
stop

'*******  eye3  *********/

cond
*.eye5
0
=
*.eye3
*.eye6
>
*.eye3
*.eye7
>
*.eye3
*.eye4
>
start
45
.aimsx
store
stop


'*******  eye8  *********/

cond
*.eye5
0
=
*.eye8
*.eye6
>
*.eye8
*.eye4
>
*.eye8
*.eye7
>
*.eye8
*.eye3
>
start
75
.aimdx
store
stop

'*******  eye2  *********/

cond
*.eye5
0
=
*.eye2
*.eye1
>
*.eye2
*.eye6
>
*.eye2
*.eye4
>
*.eye2
*.eye7
>
*.eye2
*.eye3
>
*.eye2
*.eye8
>
start
75
.aimsx
store
stop

'*******  eye9  *********/

cond
*.eye5
0
=
*.eye9
*.eye6
>
*.eye9
*.eye4
>
*.eye9
*.eye7
>
*.eye9
*.eye3
>
*.eye9
*.eye8
>
*.eye9
*.eye2
>
start
95
.aimdx
store
stop

'*******  eye1  *********/

cond
*.eye5
0
=
*.eye1
*.eye6
>
*.eye1
*.eye4
>
*.eye1
*.eye7
>
*.eye1
*.eye3
>
*.eye1
*.eye8
>
*.eye1
*.eye2
>
*.eye1
*.eye9
>
start
95
.aimsx
store
stop

'**********************************************/
'* IF the robot is shot and no robotic target */
'* => to aim the shooting robot               */
'**********************************************/

cond
*.shdn
0
!=
start
630
.aimdx
store
stop

cond
*.shdx
0
!=
start
315
.aimdx
store
stop

cond
*.shsx
0
!=
start
315
.aimsx
store
stop

end