… | |
… | |
4 | |
4 | |
5 | =cut |
5 | =cut |
6 | |
6 | |
7 | package Deliantra; |
7 | package Deliantra; |
8 | |
8 | |
9 | our $VERSION = '1.14'; |
9 | our $VERSION = '1.222'; |
10 | |
10 | |
11 | use strict; |
11 | use strict; |
12 | |
12 | |
13 | use base 'Exporter'; |
13 | use base 'Exporter'; |
14 | |
14 | |
… | |
… | |
24 | editor_archs arch_extents |
24 | editor_archs arch_extents |
25 | ); |
25 | ); |
26 | |
26 | |
27 | use JSON::XS qw(decode_json encode_json); |
27 | use JSON::XS qw(decode_json encode_json); |
28 | |
28 | |
29 | our $LIB = $ENV{DELIANTRA_LIBDIR} || $ENV{CROSSFIRE_LIBDIR}; |
29 | our $LIB = $ENV{DELIANTRA_LIBDIR}; |
30 | |
|
|
31 | our $OLDDIR = $ENV{HOME} ? "$ENV{HOME}/.crossfire" |
|
|
32 | : $ENV{AppData} ? "$ENV{APPDATA}/crossfire" |
|
|
33 | : File::Spec->tmpdir . "/crossfire"; |
|
|
34 | |
30 | |
35 | our $VARDIR = $ENV{HOME} ? "$ENV{HOME}/.deliantra" |
31 | our $VARDIR = $ENV{HOME} ? "$ENV{HOME}/.deliantra" |
36 | : $ENV{AppData} ? "$ENV{APPDATA}/deliantra" |
32 | : $ENV{AppData} ? "$ENV{APPDATA}/deliantra" |
37 | : File::Spec->tmpdir . "/deliantra"; |
33 | : File::Spec->tmpdir . "/deliantra"; |
38 | |
34 | |
… | |
… | |
73 | |
69 | |
74 | elevation |
70 | elevation |
75 | |
71 | |
76 | name name_pl custom_name attach title race |
72 | name name_pl custom_name attach title race |
77 | slaying skill msg lore other_arch |
73 | slaying skill msg lore other_arch |
78 | face animation is_animated |
74 | sound sound_destroy face animation is_animated |
79 | magicmap smoothlevel smoothface |
75 | magicmap smoothlevel smoothface |
80 | str dex con wis pow cha int |
76 | str dex con wis pow cha int |
81 | hp maxhp sp maxsp grace maxgrace |
77 | hp maxhp sp maxsp grace maxgrace |
82 | exp perm_exp expmul |
78 | exp perm_exp expmul |
83 | food dam luck wc ac x y speed speed_left move_state attack_movement |
79 | food dam luck wc ac x y speed speed_left move_state attack_movement |
… | |
… | |
435 | sub normalize_arch($) { |
431 | sub normalize_arch($) { |
436 | my ($ob) = @_; |
432 | my ($ob) = @_; |
437 | |
433 | |
438 | normalize_object $ob; |
434 | normalize_object $ob; |
439 | |
435 | |
|
|
436 | return if $ob->{_atype} eq "object"; |
|
|
437 | |
440 | my $arch = $ARCH{$ob->{_name}} |
438 | my $arch = $ARCH{$ob->{_name}} |
441 | or (warn "$ob->{_name}: no such archetype", return $ob); |
439 | or (warn "$ob->{_name}: no such archetype", return $ob); |
442 | |
440 | |
443 | if ($arch->{type} == 22) { # map |
441 | if ($arch->{type} == 22) { # map |
444 | my %normalize = ( |
442 | my %normalize = ( |
… | |
… | |
518 | |
516 | |
519 | my %arc; |
517 | my %arc; |
520 | my ($more, $prev); |
518 | my ($more, $prev); |
521 | my $comment; |
519 | my $comment; |
522 | |
520 | |
523 | open my $fh, "<:raw:perlio:utf8", $path |
521 | open my $fh, "<:utf8", $path |
524 | or Carp::croak "$path: $!"; |
522 | or Carp::croak "$path: $!"; |
525 | |
523 | |
526 | # binmode $fh; |
524 | # binmode $fh; |
527 | |
525 | |
528 | my $parse_block; $parse_block = sub { |
526 | my $parse_block; $parse_block = sub { |