Mercurial > eagle-eye
comparison agent.pl @ 56:6e0d5e781949
fixed a typo in agent.pl
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Tue, 21 Oct 2008 00:00:33 +0800 |
parents | ff00d108e955 |
children | 9307c559f9bf |
comparison
equal
deleted
inserted
replaced
55:ff00d108e955 | 56:6e0d5e781949 |
---|---|
85 my ($self, $city) = @_; | 85 my ($self, $city) = @_; |
86 my @wood = qw/udnef 0 70 98 65 129 236 402 594 849 1176 1586 2101 3208 4937 7171 10139 14537 18420 22896 28047 33934 40623 48017 56511 226044 452088 904176 1808352 3616704 7233408 14466816 28933632/; | 86 my @wood = qw/udnef 0 70 98 65 129 236 402 594 849 1176 1586 2101 3208 4937 7171 10139 14537 18420 22896 28047 33934 40623 48017 56511 226044 452088 904176 1808352 3616704 7233408 14466816 28933632/; |
87 my @marble = qw/undef 0 0 17 28 66 95 156 243 406 579 799 1348 2124 2951 4409 6461 8187 10176 12466 15082 18055 21381 25116 100464 200928 401856 803712 1607424 3214848 6429696 12859392/; | 87 my @marble = qw/undef 0 0 17 28 66 95 156 243 406 579 799 1348 2124 2951 4409 6461 8187 10176 12466 15082 18055 21381 25116 100464 200928 401856 803712 1607424 3214848 6429696 12859392/; |
88 | 88 |
89 my $level = $city->{buildings}->{townHall}; | 89 my $level = $city->{buildings}->{townHall}; |
90 if($city->{resources}->{woold} >= $wood[$level] && $city->{resources}->{marble} >= $marble[$level] ) { | 90 if($city->{resources}->{wood} >= $wood[$level] && $city->{resources}->{marble} >= $marble[$level] ) { |
91 return 1; | 91 return 1; |
92 } | 92 } |
93 warn("Resource is short for build city hall."); | 93 warn(sprintf("Resource is short for build city hall. wood [%d] marble [%d] ", $wood[$level], $marble[$level])); |
94 return 0; | 94 return 0; |
95 } | 95 } |
96 | 96 |
97 sub is_drydock_researched { | 97 sub is_drydock_researched { |
98 my ($self, $city) = @_; | 98 my ($self, $city) = @_; |