Mercurial > eagle-eye
changeset 155:1499b0d496b6
merged.
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Sat, 01 Nov 2008 05:09:02 +0800 |
parents | 637314cc57ed (current diff) 25dcc1fffeef (diff) |
children | ba7a805b3fe4 d4b7d8f51e9f |
files | warfare.pl |
diffstat | 3 files changed, 19 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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) = @_;
--- 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!!!!!!!!!!!!!
--- 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.