changeset 80:7ab5fc8c847c

added some memo of TODO
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 24 Oct 2008 21:56:03 +0800
parents 9d92e8c12f58
children d57920014cb4
files Ikariam.pm agent.pl building.yaml
diffstat 3 files changed, 17 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Ikariam.pm	Fri Oct 24 21:46:33 2008 +0800
+++ b/Ikariam.pm	Fri Oct 24 21:56:03 2008 +0800
@@ -344,6 +344,12 @@
     my $param = shift;
     my $cityId = shift;
 
+    # TODO: 應該扣除買船之黃金, 以免誤計
+    # TODO: 加上所有之船隻
+    # my @cargoCost = qw/160 244 396 812 1240 1272 1832 1888 3848 3972 5204 5384 6868 7120 8864 9200 11268 11712 14108 14680 23320 24288 28664 29880 34956 36468 42348 44212 51024 53308 61236 64024 73096 76468 87020 91088 103224 116524 122072 137432 180060 202132 211964 237444 249108 278276 292076 306623 321963 338138 355198 373191 392171 412195 433320 455612 479135 503962 530166 557828 587031 617863 650420 684802 721113 759466 799981 842783 888005 935790 986286 1039654 1096062 1155689 1218724 1285369 1355837 1430353 1509159 1592508 1680670 1773932 1872597 1976989 2087448 2204338 2328045 2458976 2597567 2744276 2899594 3064040 3238163 3422550 3617820 3824635 4043693 4275738 4521561 4782000 5057946 5350345 5660202 5988585 6336630 6705540 7096598 7511164 7950683 8416694 8910828 9434823 9990523 10579889 11205006 11868090 12571498 13317734 14109462 14949514/;
+    # $city->{transporters}->{sum}
+ 
+    # TODO: 找買船最便宜之城市
     my @locations = @{$self->{'cities'}->{$cityId}->{locations}};
     foreach (1..2) {
         if($locations[$_] eq 'port') {
@@ -504,13 +510,12 @@
     gunzip \$res->content => \$content 
         or die "gunzip failed: $GunzipError\n";
 
-    open(OUT,">foo.html");
-    print OUT $content;
-    close(OUT);
- 
     # TODO
-    # $self->{'cities'}->{$cityId}->{force}->{attacks} = $1 if($content =~ /敵人攻擊: (\d+)/);
-    # $self->{'cities'}->{$cityId}->{force}->{wars} = $1 if($content =~ /我方軍隊行程: (\d+)/);
+    # military
+    $self->{'military'}->{wars}->{attacks} = 0;
+    $self->{'military'}->{wars}->{wars} = 0;
+    # $self->{'cities'}->{$cityId}->{wars}->{attacks} = $1 if($content =~ /敵人攻擊: (\d+)/);
+    # $self->{'cities'}->{$cityId}->{wars}->{wars} = $1 if($content =~ /我方軍隊行程: (\d+)/);
 
     # list down reports.
     # /index.php?view=militaryAdvisorReportView&amp;combatId=1887662
--- a/agent.pl	Fri Oct 24 21:46:33 2008 +0800
+++ b/agent.pl	Fri Oct 24 21:56:03 2008 +0800
@@ -19,7 +19,9 @@
 sub is_attacked {
     my ($self, $city) = @_;
     # XXX
-    return ($city->{wars}->{attacks} > 0 ) ? 1 : 0;
+    # $self->{'military'}->{wars}->{attacks}
+    # return ($city->{wars}->{attacks} > 0 ) ? 1 : 0;
+    return 0;
 }
 
 sub is_constructing {
--- a/building.yaml	Fri Oct 24 21:46:33 2008 +0800
+++ b/building.yaml	Fri Oct 24 21:56:03 2008 +0800
@@ -39,8 +39,9 @@
             # 預先計算可能需要的資源
          # let's find something to build up
          0:
-            - is_gold_enoughforcargo:
-               1: increaseTransporter
+            # XXX: 這樣會一口氣買同等城市數量的船耶
+            # - is_gold_enoughforcargo:
+               # 1: increaseTransporter
             - is_wall_enough:
                0: build_wall
             - is_space_enough: