… | |
… | |
6 | |
6 | |
7 | =cut |
7 | =cut |
8 | |
8 | |
9 | package Deliantra; |
9 | package Deliantra; |
10 | |
10 | |
11 | our $VERSION = '1.30'; |
11 | our $VERSION = '2.0'; |
12 | |
12 | |
13 | use common::sense; |
13 | use common::sense; |
14 | |
14 | |
15 | use base 'Exporter'; |
15 | use base 'Exporter'; |
16 | |
16 | |
… | |
… | |
73 | elevation |
73 | elevation |
74 | |
74 | |
75 | name name_pl custom_name attach title race |
75 | name name_pl custom_name attach title race |
76 | slaying skill msg lore other_arch |
76 | slaying skill msg lore other_arch |
77 | sound sound_destroy face animation is_animated |
77 | sound sound_destroy face animation is_animated |
78 | magicmap smoothlevel smoothface |
78 | magicmap glyph smoothlevel smoothface |
79 | str dex con wis pow cha int |
79 | str dex con wis pow cha int |
80 | hp maxhp sp maxsp grace maxgrace |
80 | hp maxhp sp maxsp grace maxgrace |
81 | exp perm_exp expmul |
81 | exp perm_exp expmul |
82 | food dam luck wc ac x y speed speed_left move_state attack_movement |
82 | food dam luck wc ac x y speed speed_left move_state attack_movement |
83 | nrof level direction type subtype attacktype |
83 | nrof level direction type subtype attacktype |
… | |
… | |
131 | time => 8, |
131 | time => 8, |
132 | throw => 9, |
132 | throw => 9, |
133 | trigger => 10, |
133 | trigger => 10, |
134 | close => 11, |
134 | close => 11, |
135 | timer => 12, |
135 | timer => 12, |
|
|
136 | ); |
|
|
137 | |
|
|
138 | # 1 up 2 right 4 down 8 left |
|
|
139 | our %WALLDIR = ( |
|
|
140 | 0 => 0, |
|
|
141 | 1_2 => 1, |
|
|
142 | 1_4 => 2, |
|
|
143 | 2_2_1 => 3, |
|
|
144 | 1_1 => 4, |
|
|
145 | 2_1_1 => 5, |
|
|
146 | 2_2_2 => 6, |
|
|
147 | 3_2 => 7, |
|
|
148 | 1_3 => 8, |
|
|
149 | 2_2_4 => 9, |
|
|
150 | 2_1_2 => 10, |
|
|
151 | 3_1 => 11, |
|
|
152 | 2_2_3 => 12, |
|
|
153 | 3_4 => 13, |
|
|
154 | 3_3 => 14, |
|
|
155 | 4 => 15, |
136 | ); |
156 | ); |
137 | |
157 | |
138 | sub MOVE_WALK (){ 0x01 } |
158 | sub MOVE_WALK (){ 0x01 } |
139 | sub MOVE_FLY_LOW (){ 0x02 } |
159 | sub MOVE_FLY_LOW (){ 0x02 } |
140 | sub MOVE_FLY_HIGH (){ 0x04 } |
160 | sub MOVE_FLY_HIGH (){ 0x04 } |
… | |
… | |
990 | require Gtk2; |
1010 | require Gtk2; |
991 | |
1011 | |
992 | cache_file "$LIB/facedata", "$VARDIR/tilecache.pst", \&use_tilecache, |
1012 | cache_file "$LIB/facedata", "$VARDIR/tilecache.pst", \&use_tilecache, |
993 | sub { |
1013 | sub { |
994 | my %cache; |
1014 | my %cache; |
995 | my $facedata = Storable::retrieve "$LIB/facedata"; |
1015 | my $facedata = Storable::retrieve "$LIB/faceinfo"; |
|
|
1016 | |
|
|
1017 | open my $fh, "<", "$LIB/facedata" |
|
|
1018 | or die "$LIB/facedata: $!"; |
996 | |
1019 | |
997 | $facedata->{version} == 2 |
1020 | $facedata->{version} == 2 |
998 | or die "$LIB/facedata: version mismatch, cannot proceed."; |
1021 | or die "$LIB/facedata: version mismatch, cannot proceed."; |
999 | |
1022 | |
1000 | my $faces = $facedata->{faceinfo}; |
1023 | my $faces = $facedata->{faceinfo}; |
… | |
… | |
1002 | |
1025 | |
1003 | for (sort keys %$faces) { |
1026 | for (sort keys %$faces) { |
1004 | my ($face, $info) = ($_, $faces->{$_}); |
1027 | my ($face, $info) = ($_, $faces->{$_}); |
1005 | |
1028 | |
1006 | my $pb = new Gtk2::Gdk::PixbufLoader; |
1029 | my $pb = new Gtk2::Gdk::PixbufLoader; |
|
|
1030 | |
|
|
1031 | if (exists $info->{data32}) { |
1007 | $pb->write ($info->{data32}); |
1032 | $pb->write ($info->{data32}); |
|
|
1033 | } else { |
|
|
1034 | sysseek $fh, $info->{fofs32}, 0; |
|
|
1035 | sysread $fh, my $buf, $info->{size32}; |
|
|
1036 | $pb->write ($buf); |
|
|
1037 | } |
1008 | $pb->close; |
1038 | $pb->close; |
1009 | my $pb = $pb->get_pixbuf; |
1039 | my $pb = $pb->get_pixbuf; |
1010 | |
1040 | |
1011 | my $tile = $cache{$face} = { |
1041 | my $tile = $cache{$face} = { |
1012 | pb => $pb, |
1042 | pb => $pb, |