# HG changeset patch # User "Rex Tsai " # Date 1227029747 -28800 # Node ID a4e52feec5a5eaa4aea09b84152c6ede8758672b # Parent 689c4c9fa56b69d7ab5442438c29a1d46a70511e fixed a typo in is_attacked. fixed actionPoint number. diff -r 689c4c9fa56b -r a4e52feec5a5 warfare.pl --- a/warfare.pl Tue Nov 18 02:28:45 2008 +0800 +++ b/warfare.pl Wed Nov 19 01:35:47 2008 +0800 @@ -40,12 +40,12 @@ sub is_attacked { my ($self, $city) = @_; - return ($self->{'ikariam'}->{'military'}->{attacks} > 0 ) ? 1 : 0; + return ($self->{'ikariam'}->{'military'}->{attack} > 0 ) ? 1 : 0; } sub is_actionPoint_enough { my ($self, $city) = @_; - return ($city->{actionPoints} > ($city->{maxActionPoints}/2) ) ? 1 : 0; + return ($city->{actionPoints} > ($city->{maxActionPoints}/3) ) ? 1 : 0; } sub is_transporters_available { @@ -89,7 +89,8 @@ next if($sheep->allyId == $user->allyId); # we fight for island which ownes differnet trade goods. - next if($island->tradegood == $tradegood); + next if($island->tradegood == $tradegood) unless ($city->status eq 'i'); + # Ignore the user in vacation which we can not attack. next if($city->status eq 'v'); unless ($city->status eq 'i') { @@ -97,8 +98,9 @@ my $ally = Ikariam::Ally->retrieve($user->allyId); my $targetAlly = Ikariam::Ally->retrieve($sheep->allyId); # We don't want to piss off the big team. + next if($ally->score == 0); next if($targetAlly->score > $ally->score); - # next if(defined($ally) && $ally->members > 10); + next if(defined($ally) && $ally->members > 12); } } @@ -154,6 +156,8 @@ $i->checkFriends(); foreach my $cityId (keys(%$cities)) { + # next if($cityId == 12345); + print Dump($i->{'military'}); # build and upgrade for cities my $tree = LoadFile('warfare.yaml');