diff agent.pl @ 304:cdbb428b464c

new rules for safehouse and academy
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 09 Dec 2008 03:16:31 +0800
parents 4c1eb583b97c
children f6f56a47f383
line wrap: on
line diff
--- a/agent.pl	Sun Dec 07 22:26:44 2008 +0800
+++ b/agent.pl	Tue Dec 09 03:16:31 2008 +0800
@@ -38,8 +38,8 @@
 
 sub is_academy_enough {
     my ($self, $city) = @_;
-    return ($city->{buildings}->{academy} >= 6 ?  1 : 0);
-    return ($city->{buildings}->{academy} >= 16 ?  1 : 0);
+    return ($city->{buildings}->{academy} >= 12 ?  1 : 0);
+# return ($city->{buildings}->{academy} >= 16 ?  1 : 0);
 }
 
 sub is_embassy_enough {
@@ -70,6 +70,7 @@
 sub is_safehouse_enough {
     my ($self, $city) = @_;
     return 0 if(!defined($city->{buildings}->{safehouse}));
+    return 1 if(($city->{buildings}->{townHall} - $city->{buildings}->{wall}) > 2);
     return 1 if($city->{buildings}->{townHall} >= 20);
 
     # build the higgest safehouse.