# HG changeset patch # User "Rex Tsai " # Date 1231085950 -28800 # Node ID 4fb6b8154524b04e1ad7a91314c25a9180948b72 # Parent 9e8dccf177e88ec6854b732ab08f59770bd3b56c# Parent 6aeedda23e3a67cb3fde945980b1a05ccbf3cc61 merged diff -r 9e8dccf177e8 -r 4fb6b8154524 agent.pl --- 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); diff -r 9e8dccf177e8 -r 4fb6b8154524 city.yaml --- 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: