comparison warfare.pl @ 338:824f949bc484

we attack zero army victim every 3 days
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 12 Feb 2009 03:59:24 +0800
parents 118605b58d09
children
comparison
equal deleted inserted replaced
337:025a36717f2c 338:824f949bc484
106 next CITY if(defined($ally) && $ally->members > 12); 106 next CITY if(defined($ally) && $ally->members > 12);
107 } 107 }
108 } 108 }
109 109
110 # check if we over-attacked 110 # check if we over-attacked
111 my $c = Ikariam::Report->search_victim($city->cityId, time - 24*60*60 - 7*60*60)->count(); 111 my $c = Ikariam::Report->search_victim($city->cityId, time - 24*60*60 * 3)->count();
112 # check the current plunders 112 # check the current plunders
113 foreach (@{$self->{ikariam}->{'military'}->{'homeland'}}) { 113 foreach (@{$self->{ikariam}->{'military'}->{'homeland'}}) {
114 # counting for both leaving and coming back. 114 # counting for both leaving and coming back.
115 $c++ if($_->{to} == $city->cityId || $_->{from} == $city->cityId); 115 $c++ if($_->{to} == $city->cityId || $_->{from} == $city->cityId);
116 116
117 # we don't attack same city twice at same time. 117 # we don't attack same city twice at same time.
118 next CITY if($_->{to} == $city->cityId); 118 next CITY if($_->{to} == $city->cityId);
119 } 119 }
120 next CITY if($c >= 1); 120 next CITY if($c ge 1);
121 121
122 my $capture = $city->citylevel * ($city->citylevel - 1) * $sheep->trader_score_secondary / 10000; 122 my $capture = $city->citylevel * ($city->citylevel - 1) * $sheep->trader_score_secondary / 10000;
123 next if($capture < 1500); 123 next if($capture < 1500);
124 124
125 # { 125 # {