# HG changeset patch # User "Rex Tsai " # Date 1225487342 -28800 # Node ID 1499b0d496b68fbdaa215db18cdab151a17a288d # Parent 637314cc57ed1fb0d12bd7a9237960b726e55e45# Parent 25dcc1fffeef33f226286a6bba338030902ad935 merged. diff -r 637314cc57ed -r 1499b0d496b6 agent.pl --- a/agent.pl Sat Nov 01 05:05:15 2008 +0800 +++ b/agent.pl Sat Nov 01 05:09:02 2008 +0800 @@ -117,6 +117,11 @@ return (defined($self->{'ikariam'}->{research}->{1040}) ? 1 : 0); } +sub is_greekfire_researched { + my ($self) = @_; + return (defined($self->{'ikariam'}->{research}->{1060}) ? 1 : 0); +} + sub is_wealth_researched { my ($self) = @_; return (defined($self->{'ikariam'}->{research}->{2030}) ? 1 : 0); @@ -142,6 +147,11 @@ return (defined($self->{'ikariam'}->{research}->{3040}) ? 1 : 0); } +sub is_culturalexchange_researched { + my ($self) = @_; + return (defined($self->{'ikariam'}->{research}->{3060}) ? 1 : 0); +} + sub is_professionalarmy_researched { my ($self) = @_; return (defined($self->{'ikariam'}->{research}->{4030}) ? 1 : 0); @@ -152,10 +162,6 @@ return (defined($self->{'ikariam'}->{research}->{4010}) ? 1 : 0); } -sub is_greekfire_researched { - my ($self) = @_; - return (defined($self->{'ikariam'}->{research}->{6077}) ? 1 : 0); -} sub is_barracks_level_enough { my ($self, $city) = @_; diff -r 637314cc57ed -r 1499b0d496b6 overall.yaml --- a/overall.yaml Sat Nov 01 05:05:15 2008 +0800 +++ b/overall.yaml Sat Nov 01 05:09:02 2008 +0800 @@ -28,5 +28,9 @@ # 希臘火, 建造噴火船 - is_greekfire_researched: 0: research_seafaring + # 文化交流, 建造博物館 + - is_culturalexchange_researched: + 0: research_knowledge + 1: run_defence # we are being attacked!!!!!!!!!!!!! diff -r 637314cc57ed -r 1499b0d496b6 warfare.pl --- a/warfare.pl Sat Nov 01 05:05:15 2008 +0800 +++ b/warfare.pl Sat Nov 01 05:09:02 2008 +0800 @@ -60,12 +60,16 @@ sub locateVictim { my ($self, $city, $x, $y, $tradegood) = @_; + + my $user = Ikariam::User->search('name' => $::user); + my @cities = Ikariam::Cities->search_sheeps(($x + 6), ($x - 6), ($y + 6), ($y - 6)); - foreach my $city (@cities) { my $sheep = $city->user; my $island = $city->island; + # we don't fight with members in same ally. + next if($sheep->allyId == $user->allyId); # we fight for island which ownes differnet trade goods. next if($island->tradegood == $tradegood); # Ignore the user in vacation which we can not attack.