changeset 342:f3bdbc706a37

merged
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 12 Feb 2009 21:13:46 +0800
parents 6296a9cd6878 (current diff) fe740b1c6f94 (diff)
children 85d60a0569bf
files
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;