… | |
… | |
12 | my $OPTIPNG = "@OPTIPNG@"; |
12 | my $OPTIPNG = "@OPTIPNG@"; |
13 | my $RSYNC = "@RSYNC@"; |
13 | my $RSYNC = "@RSYNC@"; |
14 | my $PNGNQ = "@PNGNQ@"; |
14 | my $PNGNQ = "@PNGNQ@"; |
15 | |
15 | |
16 | use Getopt::Long; |
16 | use Getopt::Long; |
|
|
17 | use File::Temp; |
|
|
18 | use POSIX (); |
|
|
19 | use Carp; |
|
|
20 | |
17 | use Coro::EV; |
21 | use Coro::EV; |
18 | use AnyEvent; |
22 | use AnyEvent; |
19 | use YAML::XS (); |
23 | use YAML::XS (); |
20 | use JSON::XS (); |
24 | use JSON::XS (); |
21 | use IO::AIO (); |
25 | use IO::AIO (); |
22 | use File::Temp; |
26 | |
23 | use Deliantra; |
|
|
24 | use Coro 5.12; |
27 | use Coro 5.12; |
25 | use Coro::AIO; |
28 | use Coro::AIO; |
26 | use Coro::Util; |
29 | use Coro::Util; |
27 | use POSIX (); |
|
|
28 | use Carp; |
|
|
29 | use Coro::Channel; |
30 | use Coro::Channel; |
30 | use Coro::Storable; $Storable::canonical = 1; |
31 | use Coro::Storable; $Storable::canonical = 1; |
|
|
32 | |
|
|
33 | use Deliantra; |
31 | |
34 | |
32 | $SIG{QUIT} = sub { Carp::cluck "QUIT" }; |
35 | $SIG{QUIT} = sub { Carp::cluck "QUIT" }; |
33 | |
36 | |
34 | sub usage { |
37 | sub usage { |
35 | warn <<EOF; |
38 | warn <<EOF; |
… | |
… | |
601 | } |
604 | } |
602 | } |
605 | } |
603 | }; |
606 | }; |
604 | } |
607 | } |
605 | |
608 | |
|
|
609 | sub generate_plurals { |
|
|
610 | # use Lingua::EN::Inflect (); |
|
|
611 | # Lingua::EN::Inflect::classical; |
|
|
612 | # Lingua::EN::Inflect::def_noun 'talisman' => 'talismans'; |
|
|
613 | # Lingua::EN::Inflect::def_noun '(.*)boots' => '$1boots'; # hack |
|
|
614 | # |
|
|
615 | # for my $a (@ARC) { |
|
|
616 | # my $name = $a->{name} || $a->{_name}; |
|
|
617 | # |
|
|
618 | # next unless $a->{name_pl}; |
|
|
619 | # |
|
|
620 | # |
|
|
621 | # my $test = Lingua::EN::Inflect::PL_N_eq $name, Lingua::EN::Inflect::PL $name; |
|
|
622 | # my $pl = $test =~ /^(?:eq|p:.)$/ |
|
|
623 | # ? $name |
|
|
624 | # : Lingua::EN::Inflect::PL $name; |
|
|
625 | # die "$test $pl" if $pl =~ /bootss/;#d# |
|
|
626 | # |
|
|
627 | # if ($pl ne $a->{name_pl}) { |
|
|
628 | # warn "$a->{_name}: plural differs, $pl vs $a->{name_pl}\n"; |
|
|
629 | # } |
|
|
630 | # } |
|
|
631 | } |
|
|
632 | |
606 | sub inst_arch($) { |
633 | sub inst_arch($) { |
607 | my (undef, $path) = @_; |
634 | my (undef, $path) = @_; |
608 | |
635 | |
609 | $PATH = $path; |
636 | $PATH = $path; |
610 | |
637 | |
… | |
… | |
688 | } |
715 | } |
689 | |
716 | |
690 | # remove base classes (by naming scheme, should use something like "baseclass xxx" to inherit |
717 | # remove base classes (by naming scheme, should use something like "baseclass xxx" to inherit |
691 | @ARC = grep $_->{_name} !~ /^(?:type|class)_/, @ARC; |
718 | @ARC = grep $_->{_name} !~ /^(?:type|class)_/, @ARC; |
692 | |
719 | |
|
|
720 | print "generating plurals...\n" if $VERBOSE; |
|
|
721 | generate_plurals; |
|
|
722 | |
693 | print "writing archetypes...\n" if $VERBOSE; |
723 | print "writing archetypes...\n" if $VERBOSE; |
694 | open my $fh, ">:utf8", "$DATADIR/archetypes~" |
724 | open my $fh, ">:utf8", "$DATADIR/archetypes~" |
695 | or die "$DATADIR/archetypes~: $!"; |
725 | or die "$DATADIR/archetypes~: $!"; |
696 | print $fh Deliantra::archlist_to_string [sort { $a->{_name} cmp $b->{_name} } @ARC]; |
726 | print $fh Deliantra::archlist_to_string [sort { $a->{_name} cmp $b->{_name} } @ARC]; |
697 | } |
727 | } |