comparison enemy.pl @ 376:6ca0677a361e

refiend output format and fixed timing issue.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 14 Apr 2009 17:02:17 +0800
parents 2cfa03edc22e
children
comparison
equal deleted inserted replaced
375:0ec57ac68a4c 376:6ca0677a361e
83 printf("%s (%d)\t- ", $cities[$x]->{name}, $cities[$x]->{id}); 83 printf("%s (%d)\t- ", $cities[$x]->{name}, $cities[$x]->{id});
84 printf("Land %3d Ship %3d Catapult %3d Ram %3d\n", 84 printf("Land %3d Ship %3d Catapult %3d Ram %3d\n",
85 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 60), 85 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 60),
86 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 33), 86 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 33),
87 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 26), 87 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 26),
88 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 40), 88 travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 30),
89 ); 89 );
90 } 90 }
91 } 91 }
92 } 92 }
93 93
113 113
114 printf("Name: %s [%s:%s]\n", $city->cityname, $island->x, $island->y); 114 printf("Name: %s [%s:%s]\n", $city->cityname, $island->x, $island->y);
115 if(defined($city->status)) { 115 if(defined($city->status)) {
116 printf("Status: <<<%s>>>\n", $city->status); 116 printf("Status: <<<%s>>>\n", $city->status);
117 } 117 }
118 printf("Location: [%s:%s] http://%s/index.php?view=island&id=%s&selectCity=%d\n", 118 # printf("Location: [%s:%s] http://%s/index.php?view=island&id=%s&selectCity=%d\n",
119 $island->x, $island->y, $::server, $island->id, $city->cityId); 119 # $island->x, $island->y, $::server, $island->id, $city->cityId);
120 printf("Location: http://%s/index.php?view=island&id=%s&selectCity=%d\n",
121 $::server, $island->id, $city->cityId);
120 if(-f sprintf("spy-%d-dump.yaml", $city->cityId)) { 122 if(-f sprintf("spy-%d-dump.yaml", $city->cityId)) {
121 my $spydata = LoadFile(sprintf("spy-%d-dump.yaml", $city->cityId)); 123 my $spydata = LoadFile(sprintf("spy-%d-dump.yaml", $city->cityId));
122 if($spydata->{city}->{buildings}->{townHall} ne $city->citylevel) { 124 if($spydata->{city}->{buildings}->{townHall} ne $city->citylevel) {
123 printf("Hall: %s", $city->citylevel); 125 printf("Hall: %s", $city->citylevel);
124 printf("\n*OUTDATED* "); 126 printf("\n*OUTDATED* ");