comparison warfare.pl @ 332:118605b58d09

random fight
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 12 Feb 2009 03:23:06 +0800
parents d194ff3edb2f
children 824f949bc484
comparison
equal deleted inserted replaced
331:6eac624efc80 332:118605b58d09
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 # we attack one city maximum 4 times a day. 120 next CITY if($c >= 1);
121 if ($city->status eq 'i') {
122 next CITY if($c >= 6);
123 } else {
124 next CITY if($c >= 4);
125 }
126 121
127 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;
128 next if($capture < 1500); 123 next if($capture < 1500);
129 124
130 # { 125 # {
146 my $victim = $self->locateVictim($cityId, $x, $y, $tradegood); 141 my $victim = $self->locateVictim($cityId, $x, $y, $tradegood);
147 if(defined($victim)) { 142 if(defined($victim)) {
148 $self->{ikariam}->changeCity($cityId); 143 $self->{ikariam}->changeCity($cityId);
149 $self->{ikariam}->plunderCity($victim, 144 $self->{ikariam}->plunderCity($victim,
150 { 145 {
151 # cargo_army_302 => '2', # 劍士
152 cargo_army_303 => '2', # 方陣 146 cargo_army_303 => '2', # 方陣
147 transporter => 5, # transporter
153 } 148 }
154 ); 149 );
155 } 150 }
156 } 151 }
157 152