summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util/gather_species
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2014-01-07 19:30:19 +0100
committerAdam Borowski <kilobyte@angband.pl>2014-01-07 19:30:19 +0100
commitd418f8165430ec4b7898dd98e75b34212ce0d30b (patch)
tree36ef273350c8e1da863262413fb60b80fd7886d3 /crawl-ref/source/util/gather_species
parenta3d096c09f3c956ff6797f7d70c1ef4adcee0f20 (diff)
downloadcrawl-ref-d418f8165430ec4b7898dd98e75b34212ce0d30b.tar.gz
crawl-ref-d418f8165430ec4b7898dd98e75b34212ce0d30b.zip
Teach db_lint how to check species.txt
Diffstat (limited to 'crawl-ref/source/util/gather_species')
-rwxr-xr-xcrawl-ref/source/util/gather_species24
1 files changed, 24 insertions, 0 deletions
diff --git a/crawl-ref/source/util/gather_species b/crawl-ref/source/util/gather_species
new file mode 100755
index 0000000000..8db9b644c4
--- /dev/null
+++ b/crawl-ref/source/util/gather_species
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -w
+
+# Use -d if you want only newgame ones (ie, without coloured dracs).
+my $db = grep /^-d$/, @ARGV;
+
+undef $/;
+open IN, "util/cpp_version enum.h|" or die "Can't read enum.h\n";
+$_ = <IN>;
+close IN;
+
+s/.*enum species_type\n\{(.*?)LAST_VALID_SPECIES.*/$1/s
+ or die "Can't find species_type in enum.h\n";
+
+for (/SP_([A-Z_]+)/g)
+{
+ s/_/ /g;
+ s/\b([A-Z])([A-Z]+)/\u$1\L$2/g;
+ if ($db)
+ {
+ print "Draconian\n" if /Base Draconian/;
+ next if /Draconian/;
+ }
+ print "$_\n";
+}