# HG changeset patch # User "Rex Tsai " # Date 1231085905 -28800 # Node ID 6aeedda23e3a67cb3fde945980b1a05ccbf3cc61 # Parent 68138c99ee168f8bbdec6dfa5cc5c4e3bd78992f refined the level of barracks and shipyard diff -r 68138c99ee16 -r 6aeedda23e3a agent.pl --- a/agent.pl Sun Jan 04 23:52:55 2009 +0800 +++ b/agent.pl Mon Jan 05 00:18:25 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 68138c99ee16 -r 6aeedda23e3a city.yaml --- a/city.yaml Sun Jan 04 23:52:55 2009 +0800 +++ b/city.yaml Mon Jan 05 00:18:25 2009 +0800 @@ -53,7 +53,6 @@ 0: build_wall - is_academy_enough: 0: build_academy - # 大使館 - is_embassy_enough: 0: - is_foreigncultures_researched: