});
} elsif (m/^vessels$/) {
@ctx= (sub {
- m/^ ([A-Z][a-z\ ]+[a-z]) \t\s*
- (small|medium|large) \t\s*
- (\d+) \s*\t\s*
- (\d+) $/x
+ return if m/^[-+|]+$/;
+ m/^ \| \s* ([A-Z][a-z\ ]+[a-z]) \s*
+ \| \s* (small|medium|large) \s*
+ \| \s* ([1-9][0-9,]+) \s*
+ \| \s* ([1-9][0-9,]+) \s*
+ \| $/x
or die;
- $vessels{$1}= {
- Shot => $2,
- Volume => $3,
- Mass => $4,
- };
+ my $name= $1;
+ my $v= { Shot => $2, Volume => $3, Mass => $4 };
+ foreach my $vm (qw(Volume Mass)) { $v->{$vm} =~ s/,//g; }
+ $vessels{$name}= $v;
});
} elsif (m/^shot$/) {
@ctx= (sub {
vessels
- Sloop small 20250 13500
- Cutter small 60750 40500
- Dhow medium 20250 13500
- Longship small 20250 13500
- Baghlah medium 27000 18000
- Merchant brig medium 135000 90000
- War brig medium 81000 54000
- Merchant galleon large 405000 270000
- Xebec medium 182250 121500
- War frigate large 324000 216000
- Grand frigate large 810000 540000
+#| Ship Name |Gun Size|Volume | Mass |
+ |Sloop |small |20,250 |13,500 |
+ |----------------+--------+-------+-------|
+ |Cutter |small |60,750 |40,500 |
+ |----------------+--------+-------+-------|
+ |Dhow |medium |20,250 |13,500 |
+ |----------------+--------+-------+-------|
+ |Longship |small |20,250 |13,500 |
+ |----------------+--------+-------+-------|
+ |Baghlah |medium |27,000 |18,000 |
+ |----------------+--------+-------+-------|
+ |Merchant brig |medium |135,000|90,000 |
+ |----------------+--------+-------+-------|
+ |War brig |medium |81,000 |54,000 |
+ |----------------+--------+-------+-------|
+ |Merchant galleon|large |405,000|270,000|
+ |----------------+--------+-------+-------|
+ |Xebec |medium |182,250|121,500|
+ |----------------+--------+-------+-------|
+ |War frigate |large |324,000|216,000|
+ |----------------+--------+-------+-------|
+ |Grand frigate |large |810,000|540,000|
+# From http://yppedia.puzzlepirates.com/Ship; when updating,
+# delete unused columns and check heading is the same as above.
+# If fields reordered must change parser in Commods.pm.
shot
small 2