comparison warfare.pl @ 260:a5bd0050dd12

fixed the wrong syntax.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Wed, 19 Nov 2008 12:23:30 +0800
parents a4e52feec5a5
children 2488d31240b7
comparison
equal deleted inserted replaced
259:a4e52feec5a5 260:a5bd0050dd12
86 } 86 }
87 87
88 # we don't fight with members in same ally. 88 # we don't fight with members in same ally.
89 next if($sheep->allyId == $user->allyId); 89 next if($sheep->allyId == $user->allyId);
90 90
91 # we fight for island which ownes differnet trade goods.
92 next if($island->tradegood == $tradegood) unless ($city->status eq 'i');
93
94 # Ignore the user in vacation which we can not attack. 91 # Ignore the user in vacation which we can not attack.
95 next if($city->status eq 'v'); 92 next if($city->status eq 'v');
96 unless ($city->status eq 'i') { 93 unless ($city->status eq 'i') {
94 # we fight for island which ownes differnet trade goods.
95 next CITY if($island->tradegood == $tradegood);
96
97 unless (!defined($sheep->allyId) || $sheep->allyId == 0) { 97 unless (!defined($sheep->allyId) || $sheep->allyId == 0) {
98 my $ally = Ikariam::Ally->retrieve($user->allyId); 98 my $ally = Ikariam::Ally->retrieve($user->allyId);
99 my $targetAlly = Ikariam::Ally->retrieve($sheep->allyId); 99 my $targetAlly = Ikariam::Ally->retrieve($sheep->allyId);
100 # We don't want to piss off the big team. 100 # We don't want to piss off the big team.
101 next if($ally->score == 0); 101 next CITY if($ally->score == 0);
102 next if($targetAlly->score > $ally->score); 102 next CITY if($targetAlly->score > $ally->score);
103 next if(defined($ally) && $ally->members > 12); 103 next CITY if(defined($ally) && $ally->members > 12);
104 } 104 }
105 } 105 }
106 106
107 # check if we over-attacked 107 # check if we over-attacked
108 my $c = Ikariam::Report->search_victim($city->cityId, time - 24*60*60 - 7*60*60)->count(); 108 my $c = Ikariam::Report->search_victim($city->cityId, time - 24*60*60 - 7*60*60)->count();