ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/Deliantra.pm
(Generate patch)

Comparing deliantra/Deliantra/Deliantra.pm (file contents):
Revision 1.120 by root, Wed Dec 26 18:26:15 2007 UTC vs.
Revision 1.128 by root, Sun Sep 28 05:58:01 2008 UTC

4 4
5=cut 5=cut
6 6
7package Deliantra; 7package Deliantra;
8 8
9our $VERSION = '1.14'; 9our $VERSION = '1.222';
10 10
11use strict; 11use strict;
12 12
13use base 'Exporter'; 13use base 'Exporter';
14 14
24 editor_archs arch_extents 24 editor_archs arch_extents
25); 25);
26 26
27use JSON::XS qw(decode_json encode_json); 27use JSON::XS qw(decode_json encode_json);
28 28
29our $LIB = $ENV{DELIANTRA_LIBDIR} || $ENV{CROSSFIRE_LIBDIR}; 29our $LIB = $ENV{DELIANTRA_LIBDIR};
30
31our $OLDDIR = $ENV{HOME} ? "$ENV{HOME}/.crossfire"
32 : $ENV{AppData} ? "$ENV{APPDATA}/crossfire"
33 : File::Spec->tmpdir . "/crossfire";
34 30
35our $VARDIR = $ENV{HOME} ? "$ENV{HOME}/.deliantra" 31our $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
435sub normalize_arch($) { 431sub 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 = (
488} 486}
489 487
490sub attr_freeze($) { 488sub attr_freeze($) {
491 my ($ob) = @_; 489 my ($ob) = @_;
492 490
493 $ob->{attach} = Deliantra::encode_json $ob->{attach} 491 $ob->{attach} = JSON::XS->new->utf8->canonical->encode ($ob->{attach})
494 if exists $ob->{attach}; 492 if exists $ob->{attach};
495 493
496 $ob 494 $ob
497} 495}
498 496
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 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines