… | |
… | |
156 | and die "map installation failed.\n"; |
156 | and die "map installation failed.\n"; |
157 | |
157 | |
158 | print "maps installed successfully.\n"; |
158 | print "maps installed successfully.\n"; |
159 | } |
159 | } |
160 | |
160 | |
|
|
161 | our %WALL_SUFFIX = ( |
|
|
162 | "0" => "⬤", |
|
|
163 | "1_3" => "╸", |
|
|
164 | "1_4" => "╺", |
|
|
165 | "2_1_2" => "━", |
|
|
166 | |
|
|
167 | "1_2" => "╹", |
|
|
168 | "2_2_4" => "┛", |
|
|
169 | "2_2_1" => "┗", |
|
|
170 | "3_1" => "┻", |
|
|
171 | |
|
|
172 | "1_1" => "╻", |
|
|
173 | "2_2_3" => "┓", |
|
|
174 | "2_2_2" => "┏", |
|
|
175 | "3_3" => "┳", |
|
|
176 | |
|
|
177 | "2_1_1" => "┃", |
|
|
178 | "3_4" => "┫", |
|
|
179 | "3_2" => "┣", |
|
|
180 | "4" => "╋", |
|
|
181 | ); |
|
|
182 | |
161 | sub autoglyph { |
183 | sub autoglyph { |
162 | my ($stem, $face) = @_; |
184 | my ($stem, $face) = @_; |
163 | |
185 | |
164 | if ($stem =~ /^wall\/|Nimwall/) { |
186 | if ($stem =~ /^wall\/|Nimwall/) { |
165 | # warn $stem; |
187 | while (my ($k, $v) = each %WALL_SUFFIX) { |
|
|
188 | return $v if $stem =~ /_$k.x11/; |
|
|
189 | } |
|
|
190 | |
166 | "+" |
191 | "+" |
|
|
192 | |
167 | } elsif ($stem =~ /^floor\/|^ground\/|Nimfloor/) { |
193 | } elsif ($stem =~ /^floor\/|^ground\/|Nimfloor/) { |
168 | "." |
194 | "." |
|
|
195 | |
|
|
196 | } elsif ($stem =~ /^player\//) { |
|
|
197 | "\@" |
|
|
198 | |
169 | } else { |
199 | } else { |
170 | substr $stem, 0, 1 |
200 | substr $stem, 0, 1 |
171 | } |
201 | } |
172 | } |
202 | } |
173 | |
203 | |
… | |
… | |
813 | make_hash $k, $v->{data64}, $v->{hash64}; |
843 | make_hash $k, $v->{data64}, $v->{hash64}; |
814 | |
844 | |
815 | #length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n"; |
845 | #length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n"; |
816 | #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n"; |
846 | #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n"; |
817 | |
847 | |
818 | my $stem = delete $v->{stem}; |
|
|
819 | $v->{glyph} //= autoglyph $stem, $v; |
|
|
820 | |
|
|
821 | if (my $magicmap = $v->{magicmap}) { |
848 | if (my $magicmap = $v->{magicmap}) { |
822 | $magicmap =~ y/A-Z_\-/a-z/d; |
849 | $magicmap =~ y/A-Z_\-/a-z/d; |
823 | $v->{magicmap} = $COLOR{$magicmap}; |
850 | $v->{magicmap} = $COLOR{$magicmap}; |
824 | } |
851 | } |
|
|
852 | |
|
|
853 | my $stem = delete $v->{stem}; |
|
|
854 | $v->{glyph} //= autoglyph $stem, $v; |
|
|
855 | $v->{glyph} = (chr $v->{magicmap}) . $v->{glyph}; |
825 | |
856 | |
826 | delete $v->{arc}; |
857 | delete $v->{arc}; |
827 | } |
858 | } |
828 | |
859 | |
829 | print "processing resources...\n" if $VERBOSE; |
860 | print "processing resources...\n" if $VERBOSE; |