# HG changeset patch # User "Rex Tsai " # Date 1225732479 -28800 # Node ID 5f94d8d8370a5a8e5db439549e8a2615fe954438 # Parent 541bc1fba446cd416a6e061e11f0431b2c28dbd7 build embassy, museum, academy diff -r 541bc1fba446 -r 5f94d8d8370a agent.pl --- a/agent.pl Mon Nov 03 23:02:36 2008 +0800 +++ b/agent.pl Tue Nov 04 01:14:39 2008 +0800 @@ -36,6 +36,21 @@ return ($city->{buildings}->{wall} >= $city->{buildings}->{townHall} ? 1 : 0); } +sub is_academy_enough { + my ($self, $city) = @_; + return ($city->{buildings}->{academy} >= 6 ? 1 : 0); +} + +sub is_embassy_enough { + my ($self, $city) = @_; + return ($city->{buildings}->{embassy} >= 6 ? 1 : 0); +} + +sub is_museum_enough { + my ($self, $city) = @_; + return ($city->{buildings}->{museum} >= 2 ? 1 : 0); +} + sub is_space_enough { my ($self, $city) = @_; # The maximum town hall is level 20, then we build new town @@ -139,7 +154,7 @@ return (defined($self->{'ikariam'}->{research}->{1030}) ? 1 : 0); } -sub is_culturalexchange_researched { +sub is_foreigncultures_researched { my ($self) = @_; return (defined($self->{'ikariam'}->{research}->{1040}) ? 1 : 0); } @@ -149,6 +164,11 @@ return (defined($self->{'ikariam'}->{research}->{1060}) ? 1 : 0); } +sub is_conservation_researched { + my ($self) = @_; + return (defined($self->{'ikariam'}->{research}->{2010}) ? 1 : 0); +} + sub is_wealth_researched { my ($self) = @_; return (defined($self->{'ikariam'}->{research}->{2030}) ? 1 : 0); diff -r 541bc1fba446 -r 5f94d8d8370a city.yaml --- a/city.yaml Mon Nov 03 23:02:36 2008 +0800 +++ b/city.yaml Tue Nov 04 01:14:39 2008 +0800 @@ -43,25 +43,28 @@ - is_professionalarmy_researched: 1: build_barracks - is_safehouse_enough: - 0: build_safehouse + 0: + - is_espionage_researched: + 1: build_safehouse - is_warehouse_enough: - 0: build_warehouse - - # TODO - # build_safehouse - # is_espionage_researched - # 1: - # - build_hideout + 0: + - is_conservation_researched: + 1: build_warehouse + 0: build_academy + - is_academy_enough: + 0: build_academy + # 大使館 + - is_embassy_enough: + 0: + - is_foreigncultures_researched: + 1: build_embassy + - is_museum_enough: + 0: + - is_culturalexchange_resaerched: + 1: + - build_museum - # 水晶島應該建設 - # is_invention_researched - # 1: - # - build_workshop - # build_academy - - # 大使館 - # build_embassy - - # is_culturalexchange_resaerched - # 1: - # - build_museum +# 水晶島應該建設 +# is_invention_researched +# 1: +# - build_workshop