comparison warfare.pl @ 241:64549ddddf4a

count by ally score
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 07 Nov 2008 15:18:23 +0800
parents 978a949602e5
children 5527133b7c7e
comparison
equal deleted inserted replaced
240:937fc672df56 241:64549ddddf4a
92 next if($island->tradegood == $tradegood); 92 next if($island->tradegood == $tradegood);
93 # Ignore the user in vacation which we can not attack. 93 # Ignore the user in vacation which we can not attack.
94 next if($city->status eq 'v'); 94 next if($city->status eq 'v');
95 unless ($city->status eq 'i') { 95 unless ($city->status eq 'i') {
96 unless (!defined($sheep->allyId) || $sheep->allyId == 0) { 96 unless (!defined($sheep->allyId) || $sheep->allyId == 0) {
97 my $ally = Ikariam::Ally->retrieve($sheep->allyId); 97 my $ally = Ikariam::Ally->retrieve($user->allyId);
98 # Ignore the ally which have more then 10 members. 98 my $targetAlly = Ikariam::Ally->retrieve($sheep->allyId);
99 # We don't want to piss off the big team. 99 # We don't want to piss off the big team.
100 next if(defined($ally) && $ally->members > 10); 100 next if($targetAlly->score > $ally->score);
101 # next if(defined($ally) && $ally->members > 10);
101 } 102 }
102 } 103 }
103 104
104 # check if we over-attacked 105 # check if we over-attacked
105 my $c = Ikariam::Report->search_victim($city->cityId, time - 24*60*60 - 7*60*60)->count(); 106 my $c = Ikariam::Report->search_victim($city->cityId, time - 24*60*60 - 7*60*60)->count();