changeset 243:dc93eb48a926

we build both museum and tavern at same time. build cityHall 12 hours agao.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Wed, 12 Nov 2008 15:52:06 +0800
parents 5f6f845bbb1d
children fd6c3660cd38
files agent.pl
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/agent.pl	Mon Nov 10 14:19:43 2008 +0800
+++ b/agent.pl	Wed Nov 12 15:52:06 2008 +0800
@@ -48,7 +48,7 @@
 
 sub is_museum_enough {
     my ($self, $city) = @_;
-    return ($city->{buildings}->{museum} >= 2 ?  1 : 0);
+    return ($city->{buildings}->{museum} >= ($city->{buildings}->{tavern}/2) ? 1 : 0);
 }
 
 sub is_branchOffice_enough {
@@ -62,7 +62,7 @@
     return 1 if($city->{buildings}->{townHall} >= 20);
     # TODO 應該以 成長率 * 升級所需時間計算
     # 6 hours earlier, we upgrade the twonHall.
-    return ($city->{space}->{total} <= ($city->{space}->{occupied} + ($city->{growth}*8)) ?  0 : 1)
+    return ($city->{space}->{total} <= ($city->{space}->{occupied} + ($city->{growth}*12)) ?  0 : 1)
 }
 
 sub is_safehouse_enough {
@@ -290,7 +290,6 @@
     my $assault = 'Swordsman';
     my $resistance = 'Phalanx';
 
-    # ok, we can build Flamethrower.
     if(($city->{'army'}->{$assault} / $city->{'army'}->{$resistance}) <= (2/1)) {
         return 302; # Swordsman
     } else {