changeset 315:97a838fcdd05

merged
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 05 Jan 2009 00:19:40 +0800
parents 995862190853 (current diff) 4fb6b8154524 (diff)
children 73430da45eec
files
diffstat 2 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/agent.pl	Sun Jan 04 23:51:37 2009 +0800
+++ b/agent.pl	Mon Jan 05 00:19:40 2009 +0800
@@ -44,6 +44,7 @@
 
 sub is_embassy_enough {
     my ($self, $city) = @_;
+    return ($city->{buildings}->{embassy} >= 1 ?  1 : 0);
     return ($city->{buildings}->{embassy} >= 6 ?  1 : 0);
 }
 
@@ -183,6 +184,11 @@
     return (defined($self->{'ikariam'}->{research}->{1060}) ?  1 : 0);
 }
 
+sub is_paddlewheelengine_researched {
+    my ($self) = @_;
+    return (defined($self->{'ikariam'}->{research}->{1100}) ?  1 : 0);
+}
+
 sub is_conservation_researched {
     my ($self) = @_;
     return (defined($self->{'ikariam'}->{research}->{2010}) ?  1 : 0);
@@ -228,9 +234,19 @@
     return (defined($self->{'ikariam'}->{research}->{4010}) ?  1 : 0);
 }
 
+sub is_robotics_researched {
+    my ($self) = @_;
+    return (defined($self->{'ikariam'}->{research}->{4110}) ?  1 : 0);
+}
+
+
 sub is_barracks_level_enough {
     my ($self, $city) = @_;
     return 0 if(!defined($city->{buildings}->{barracks}));
+    if($self->is_robotics_researched() eq 1) {
+        return ($city->{buildings}->{barracks} >= 16 ? 1 : 0);
+    }
+
     if($city->{buildings}->{townHall} >= 10) {
         # optimum is 5
         return ($city->{buildings}->{barracks} >= 5 ? 1 : 0);
@@ -249,7 +265,9 @@
 sub is_shipyard_level_enough {
     my ($self, $city) = @_;
     return 0 if(!defined($city->{buildings}->{shipyard}));
-    if ($self->is_greekfire_researched() eq 1) {
+    if ($self->is_paddlewheelengine_researched() eq 1) {
+        return ($city->{buildings}->{shipyard} >= 10 ? 1 : 0);
+    } elsif ($self->is_greekfire_researched() eq 1) {
         return ($city->{buildings}->{shipyard} >= 5 ? 1 : 0);
     } else {
         return ($city->{buildings}->{shipyard} >= 3 ? 1 : 0);
--- a/city.yaml	Sun Jan 04 23:51:37 2009 +0800
+++ b/city.yaml	Mon Jan 05 00:19:40 2009 +0800
@@ -53,7 +53,6 @@
                      0: build_wall
                   - is_academy_enough:
                      0: build_academy
-                  # 大使館
                   - is_embassy_enough:
                      0:
                         - is_foreigncultures_researched: