Example client: Invest energy/5 into attack, instead of fixed 100

This commit is contained in:
Petr Baudis 2011-12-23 18:49:14 +01:00
parent 60989d7588
commit 3889fba5d4

View file

@ -170,7 +170,7 @@ sub take_action($$) {
# Execute actions! # Execute actions!
if ($attack[dirindex($max)]) { if ($attack[dirindex($max)]) {
print $socket $state->{tick}." attack_dir $max->[0] $max->[1] 100\r\n"; print $socket $state->{tick}." attack_dir $max->[0] $max->[1] ".($state->{energy}/5)."\r\n";
} else { } else {
print $socket $state->{tick}." move_dir $max->[0] $max->[1]\r\n"; print $socket $state->{tick}." move_dir $max->[0] $max->[1]\r\n";
} }