| 1 |
#!/usr/bin/env perl |
| 2 |
|
| 3 |
use warnings; |
| 4 |
|
| 5 |
# Use -d if you want only newgame ones (ie, without coloured dracs). |
| 6 |
my $db = grep /^-d$/, @ARGV; |
| 7 |
|
| 8 |
undef $/; |
| 9 |
open IN, "util/cpp_version species-type.h|" or die "Can't read species-type.h\n"; |
| 10 |
$_ = <IN>; |
| 11 |
close IN; |
| 12 |
|
| 13 |
s/.*enum species_type.*\{(.*?)NUM_SPECIES.*/$1/s |
| 14 |
or die "Can't find species_type in species-type.h\n"; |
| 15 |
|
| 16 |
for (/SP_([A-Z_]+)/g) |
| 17 |
{ |
| 18 |
s/_/ /g; |
| 19 |
s/\b([A-Z])([A-Z]+)/\u$1\L$2/g; |
| 20 |
if ($db) |
| 21 |
{ |
| 22 |
print "Draconian\n" if /Base Draconian/; |
| 23 |
next if /Draconian/; |
| 24 |
} |
| 25 |
print "$_\n"; |
| 26 |
} |