changeset 312:4fb6b8154524

merged
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 05 Jan 2009 00:19:10 +0800
parents 9e8dccf177e8 (current diff) 6aeedda23e3a (diff)
children a5d85719155d 97a838fcdd05
files
diffstat 2 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/agent.pl	Sun Jan 04 23:53:15 2009 +0800
+++ b/agent.pl	Mon Jan 05 00:19:10 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:53:15 2009 +0800
+++ b/city.yaml	Mon Jan 05 00:19:10 2009 +0800
@@ -53,7 +53,6 @@
                      0: build_wall
                   - is_academy_enough:
                      0: build_academy
-                  # 大使館
                   - is_embassy_enough:
                      0:
                         - is_foreigncultures_researched: