changeset 205:d9f17bcbf1f1

we keep 10 transporters for prize
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 03 Nov 2008 17:20:51 +0800
parents 95d47d69c202
children b7af307a222d
files Ikariam.pm warfare.pl
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Ikariam.pm	Mon Nov 03 17:02:07 2008 +0800
+++ b/Ikariam.pm	Mon Nov 03 17:20:51 2008 +0800
@@ -749,7 +749,7 @@
     my %report;
 
     $report{id} = $combatId;
-    my $c = $extractor->{doc}->toString(1);
+    my $c = $extractor->{doc}->toString(0);
     
     # FIXME 城鎮  6 級)的城牆( 2 級)為防禦部隊增加了 7% 的防禦力。
     while($c =~ /城鎮\s+(\d+)/gs) {
@@ -1049,7 +1049,6 @@
 
     my $cost = 0;
     foreach(keys(%{$cities->{$cityId}->{army}})) {
-        # printf("%s %d = %d\n", $_, $cities->{$cityId}->{army}->{$_},  $cities->{$cityId}->{army}->{$_} * $troops->{$_}->{u});
         $cost += $cities->{$cityId}->{army}->{$_} * $troops->{$_}->{u};
     }
     return $cost;
--- a/warfare.pl	Mon Nov 03 17:02:07 2008 +0800
+++ b/warfare.pl	Mon Nov 03 17:20:51 2008 +0800
@@ -50,7 +50,8 @@
 
 sub is_transporters_available {
     my ($self, $city) = @_;
-    return ($city->{transporters}->{avail} > 0) ? 1 : 0;
+    # we keep 10 transporters for prize
+    return ($city->{transporters}->{avail} > 10) ? 1 : 0;
 }
 
 sub is_port_available {