summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util/gather_cards
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-05-19 03:30:17 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-05-20 13:21:53 +0200
commit319634ecdd8ffacac70e3e7d6041fc8224bb8341 (patch)
tree72c6c2c449335c93cda9e4a730d5026153a05bbe /crawl-ref/source/util/gather_cards
parentbae08004e6a60cb0dc0f7861f2ffcfa1ff90254b (diff)
downloadcrawl-ref-319634ecdd8ffacac70e3e7d6041fc8224bb8341.tar.gz
crawl-ref-319634ecdd8ffacac70e3e7d6041fc8224bb8341.zip
Scripts to gather the names of cards and monsters.
Diffstat (limited to 'crawl-ref/source/util/gather_cards')
-rwxr-xr-xcrawl-ref/source/util/gather_cards13
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/util/gather_cards b/crawl-ref/source/util/gather_cards
new file mode 100755
index 0000000000..cd3ef6db6c
--- /dev/null
+++ b/crawl-ref/source/util/gather_cards
@@ -0,0 +1,13 @@
+#!/usr/bin/perl -w
+
+undef $/;
+open IN, "<decks.cc" or die "Can't read decks.cc\n";
+$_ = <IN>;
+close IN;
+
+s/.*card_name\(card_type card\)\n{\n\s+switch(.*?)\n}\n.*/$1/s
+ or die "Can't find card_name() in decks.cc\n";
+
+@cards = map { /case CARD_[A-Z_]+:\s+return "([^"]+)";$/ ? ("$1") : () } split /\n/;
+
+print join("\n", sort @cards), "\n";