blob: dc3405f31159c8b68278e011af27d7a6a0695ea3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#!/usr/bin/perl -w
# Run gather_features -a if you want "A pigsty" rather than "pigsty".
my $art = grep /^-a$/, @ARGV;
sub articled($)
{
local $_ = $_[0];
return $_ unless $art;
return $_ if /^[A-Z]/ && !/ trap$/;
return "\u$_" if /^(?:the |an |a |some )/i;
return "A $_" if /^one-/i;
# Handle "rough-hewn floor" but not "escape hatch in the floor"
return "The $_" if $_ =~ /^(\S+\s+)?floor$/;
return /^[aeiou]/i ? "An $_" : "A $_";
}
open IN, "util/cpp_version directn.cc|" or die "Can't read directn.cc\n";
{ undef local $/; $_ = <IN>; }
close IN;
s/.*_base_feature_desc\(dungeon_feature_type(.*?)\n}\n.*/$1/s
or die "Can't find _base_feature_desc in directn.cc\n";
s|//.*$||mg;
for (/"([^"\n]*)"/g)
{
next if /^$/;
next if /^undefined trap$/;
next if /^Error/;
$features{articled($_)} = 1;
}
for (grep /\.des|\.des\.disabled|\.lua$/, `git ls-files`)
{
chomp;
open IN, "<", $_ or die "Can't read $_\n";
{ undef local $/; $_ = <IN>; }
close IN;
$features{articled($_)} = 1
for /set_feature_name\s*\(\s*"[^"\n"]+"\s*,[ \n:]*"([^"\n]+)"\s*\)/sg;
$features{articled($_)} = 1
for /\bdesc\s*=\s*"([^"]*)"/g;
}
$features{articled("gleaming silver wall")} = 1;
for (qw(open closed runed sealed))
{
$features{articled("large $_ door")} = 1;
$features{articled("$_ gate")} = 1;
$features{articled("huge $_ gate")} = 1;
}
print join("\n", sort keys %features), "\n";
|