--- deliantra/server/utils/cfutil.in 2010/10/05 23:59:47 1.93 +++ deliantra/server/utils/cfutil.in 2010/10/06 03:44:55 1.100 @@ -158,44 +158,48 @@ print "maps installed successfully.\n"; } -our %WALL_SUFFIX = ( - "_0" => "⬤", - "_1_3" => "╸", - "_1_4" => "╺", - "_2_1_2" => "━", - - "_1_2" => "╹", - "_2_2_4" => "┛", - "_2_2_1" => "┗", - "_3_1" => "┻", - - "_1_1" => "╻", - "_2_2_3" => "┓", - "_2_2_2" => "┏", - "_3_3" => "┳", - - "_2_1_1" => "┃", - "_3_4" => "┫", - "_3_2" => "┣", - "_4" => "╋", -); +our @WALL_SUFFIX = qw(⬤ ╹ ╺ ┗ ╻ ┃ ┏ ┣ ╸ ┛ ━ ┻ ┓ ┫ ┳ ╋); +# used to create crude text glyphs for text-based clients sub autoglyph { my ($stem, $face) = @_; if ($stem =~ /^wall\/|Nimwall/) { - if ($stem =~ /((?:_[0-4])+).x11/) { - return $WALL_SUFFIX{$1} if exists $WALL_SUFFIX{$1}; - } + return $WALL_SUFFIX[hex $1] + if $stem =~ /(_[0-9A-F]).x11/; - "+" + "█" + + } elsif ($stem =~ /^traps\//) { + "☠" + + } elsif ($stem =~ /^armour\/shield/) { + "Ø" + + } elsif ($stem =~ /^armour\//) { + "A" + + } elsif ($stem =~ /^weapon\//) { + "†" + + } elsif ($stem =~ /^readable\//) { + "✉" + + } elsif ($stem =~ /^river\//) { + "~" } elsif ($stem =~ /^floor\/|^ground\/|Nimfloor/) { - "." + "·" + + } elsif ($stem =~ /^spells\//) { + "!" } elsif ($stem =~ /^player\//) { "\@" + } elsif ($stem =~ /^(?:monster|misc|class|connect|gods|indoor|inorganic|mining|music|skills).*\/(.)/) { + $1 + } else { substr $stem, 0, 1 }