# HG changeset patch # User "Rex Tsai " # Date 1234444426 -28800 # Node ID f3bdbc706a379d28e580702608a4105c898ec7dc # Parent 6296a9cd6878d62ea054399c4961abe6601f0e9a# Parent fe740b1c6f942f612aa8dd3537e5c6a1a2f38b07 merged diff -r 6296a9cd6878 -r f3bdbc706a37 agent.pl --- a/agent.pl Thu Feb 12 21:13:39 2009 +0800 +++ b/agent.pl Thu Feb 12 21:13:46 2009 +0800 @@ -74,7 +74,7 @@ sub is_space_enough { my ($self, $city) = @_; # The maximum town hall is level 20, then we build new town - return 1 if($city->{buildings}->{townHall} >= 20); + return 1 if($city->{buildings}->{townHall} >= 15); # TODO 應該以 成長率 * 升級所需時間計算 # 6 hours earlier, we upgrade the twonHall. return ($city->{space}->{total} <= ($city->{space}->{occupied} + ($city->{growth}*12)) ? 0 : 1) @@ -113,6 +113,8 @@ sub is_warehouse_enougn_for_governorsresidence { my ($self, $city) = @_; + return (($city->{buildings}->{warehouse} >= 5) ? 0 : 1); + my @warehouse = (qw/undef undef 0 4 9 16 18 19 20 21 22 23 24 25/); my @cities = keys(%{$self->{ikariam}->{cities}}); my $citiesNumber = $#cities + 1;