Mercurial > eagle-eye
comparison warfare.pl @ 270:6bce423892f4
updated plunderCity and blockadeCity
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Sun, 30 Nov 2008 03:39:52 +0800 |
parents | 285d5b39ef2c |
children | d194ff3edb2f |
comparison
equal
deleted
inserted
replaced
269:c7f4a6f0fbde | 270:6bce423892f4 |
---|---|
98 | 98 |
99 unless (!defined($sheep->allyId) || $sheep->allyId == 0) { | 99 unless (!defined($sheep->allyId) || $sheep->allyId == 0) { |
100 my $ally = Ikariam::Ally->retrieve($user->allyId); | 100 my $ally = Ikariam::Ally->retrieve($user->allyId); |
101 my $targetAlly = Ikariam::Ally->retrieve($sheep->allyId); | 101 my $targetAlly = Ikariam::Ally->retrieve($sheep->allyId); |
102 # We don't want to piss off the big team. | 102 # We don't want to piss off the big team. |
103 next CITY if(!defined($ally)); | |
103 next CITY if($ally->score == 0); | 104 next CITY if($ally->score == 0); |
104 next CITY if($targetAlly->score > $ally->score); | 105 next CITY if($targetAlly->score > $ally->score); |
105 next CITY if(defined($ally) && $ally->members > 12); | 106 next CITY if(defined($ally) && $ally->members > 12); |
106 } | 107 } |
107 } | 108 } |
143 sub engagement { | 144 sub engagement { |
144 my ($self, $cityId, $x, $y, $tradegood) = @_; | 145 my ($self, $cityId, $x, $y, $tradegood) = @_; |
145 my $victim = $self->locateVictim($cityId, $x, $y, $tradegood); | 146 my $victim = $self->locateVictim($cityId, $x, $y, $tradegood); |
146 if(defined($victim)) { | 147 if(defined($victim)) { |
147 $self->{ikariam}->changeCity($cityId); | 148 $self->{ikariam}->changeCity($cityId); |
148 $self->{ikariam}->plunderCity($victim); | 149 $self->{ikariam}->plunderCity($victim, |
150 { | |
151 # cargo_army_302 => '2', # 劍士 | |
152 cargo_army_303 => '3', # 方陣 | |
153 } | |
154 ); | |
149 } | 155 } |
150 } | 156 } |
151 | 157 |
152 1; | 158 1; |
153 | 159 |