changeset 237:a254fb798eb9

rules for branchOffice
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 06 Nov 2008 22:03:07 +0800
parents cf08e01f5713
children 1a7b2d42fcbf
files agent.pl city.yaml
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/agent.pl	Thu Nov 06 20:36:24 2008 +0800
+++ b/agent.pl	Thu Nov 06 22:03:07 2008 +0800
@@ -51,6 +51,11 @@
     return ($city->{buildings}->{museum} >= 2 ?  1 : 0);
 }
 
+sub is_branchOffice_enough {
+    my ($self, $city) = @_;
+    return ($city->{buildings}->{branchOffice} >= 6 ?  1 : 0);
+}
+
 sub is_space_enough {
     my ($self, $city) = @_;
     # The maximum town hall is level 20, then we build new town
--- a/city.yaml	Thu Nov 06 20:36:24 2008 +0800
+++ b/city.yaml	Thu Nov 06 22:03:07 2008 +0800
@@ -67,6 +67,8 @@
                         - is_conservation_researched:
                            1: build_warehouse
                            0: build_academy
+                  - is_branchOffice_enough:
+                     0: build_branchOffice
 
 # 水晶島應該建設 
 # is_invention_researched