changeset 57:9307c559f9bf

rule for research expansion
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 21 Oct 2008 00:13:52 +0800
parents 6e0d5e781949
children 46e60bb040ad
files agent.pl building.yaml
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/agent.pl	Tue Oct 21 00:00:33 2008 +0800
+++ b/agent.pl	Tue Oct 21 00:13:52 2008 +0800
@@ -94,6 +94,11 @@
     return 0;
 }
 
+sub is_expansion_researched {
+    my ($self, $city) = @_;
+    return (defined($city->{research}->{1030}) ?  1 : 0);
+}
+
 sub is_drydock_researched {
     my ($self, $city) = @_;
     return (defined($city->{research}->{4010}) ?  1 : 0);
--- a/building.yaml	Tue Oct 21 00:00:33 2008 +0800
+++ b/building.yaml	Tue Oct 21 00:13:52 2008 +0800
@@ -8,6 +8,8 @@
          # already building something.
          1:
            # adjust human resources
+            - is_expansion_researched:
+               0: research_seafaring
          # let's find something to build up
          0:
             # 確認是否為主城
@@ -30,7 +32,7 @@
                   - is_shipyard:
                      0: 
                         - is_drydock_researched: 
-                           0: resaerch_drydock
+                           0: resaerch_military
                            1: build_shipyard
             - is_happiness:
                0: