# HG changeset patch # User "Rex Tsai " # Date 1225705948 -28800 # Node ID b7af307a222d21bef07b51d4bc2b5b5c6c703e0b # Parent d9f17bcbf1f127ca821d6b36b2c9fda0b80407af added build safehouse diff -r d9f17bcbf1f1 -r b7af307a222d agent.pl --- a/agent.pl Mon Nov 03 17:20:51 2008 +0800 +++ b/agent.pl Mon Nov 03 17:52:28 2008 +0800 @@ -45,6 +45,12 @@ return ($city->{space}->{total} <= ($city->{space}->{occupied} + ($city->{growth}*8)) ? 0 : 1) } +sub is_safehouse_enough { + my ($self, $city) = @_; + return 0 if(!defined($city->{building}->{safehouse})); + return (($city->{building}->{townHall} <= ($city->{building}->{safehouse} + 4)) ? 0 : 1); +} + sub is_warehouse_enough { my ($self, $city) = @_; my @warehouse = (qw/undef undef 0 4 9 16 18 19 20 21 22 23 24 25/); diff -r d9f17bcbf1f1 -r b7af307a222d city.yaml --- a/city.yaml Mon Nov 03 17:20:51 2008 +0800 +++ b/city.yaml Mon Nov 03 17:52:28 2008 +0800 @@ -46,8 +46,11 @@ 1: - is_barracks_level_enough: 0: build_barracks + - is_safehouse_enough: + 0: build_safehouse - is_warehouse_enough: 0: build_warehouse + # TODO # build_safehouse # is_espionage_researched diff -r d9f17bcbf1f1 -r b7af307a222d scan.pl --- a/scan.pl Mon Nov 03 17:20:51 2008 +0800 +++ b/scan.pl Mon Nov 03 17:52:28 2008 +0800 @@ -107,7 +107,7 @@ foreach my $h_island (@islands) { - printf("checking island %d\n", $h_island->{id}); + # printf("checking island %d\n", $h_island->{id}); my $island; if($island = Ikariam::Island->retrieve($h_island->{id})) {