diff --git a/dat/rumors.tru b/dat/rumors.tru index 8181c5abc..0a6ff45b0 100644 --- a/dat/rumors.tru +++ b/dat/rumors.tru @@ -299,7 +299,7 @@ They say that the Leprechaun King is rich as Croesus. They say that the Wizard of Yendor is schizophrenic and suicidal. They say that the experienced character knows how to convert an altar. They say that the gods are happy when they drop objects at your feet. -They say that the idea of invisible Nazguls has a certain ring to it. +They say that the idea of invisible Nazgul has a certain ring to it. They say that the lady of the lake now lives in a fountain somewhere. They say that the local shopkeeper frowns upon the rude tourist. They say that the only door to the vampire's tower is on its lowest level. diff --git a/dat/symbols b/dat/symbols index d9e1ecef6..ae22419c5 100644 --- a/dat/symbols +++ b/dat/symbols @@ -1,4 +1,4 @@ -# NetHack 3.6 symbols $NHDT-Date: 1524689580 2018/04/25 20:53:00 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ +# NetHack 3.6 symbols $NHDT-Date: 1571314611 2019/10/17 12:16:51 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.20 $ # Copyright (c) 2006 by Michael Allison # NetHack may be freely redistributed. See license for details. # @@ -14,291 +14,35 @@ # of ordinary printable characters in the lowercase letter range. # NetHack encodes the request to use the alternate font here by # having the high bit set (in hexadecimal, \x80 is combined with -# a character code between \x60 and \x7f). +# a character code between \x5f and \x7e) (not 0x60 to 0x7f as was +# previously claimed). +# +# curses is an approximation of IBMgraphics which relies on DEC +# mode of operation, with a few characters missing. It is based +# on an old graphics mode for the Curses interface and is the default +# on that windowport if no symset is specified. The Curses interface +# can also use DECgraphics as-is; IBMgraphics probably won't work. -start: DECgraphics - Handling: DEC - S_vwall: \xf8 # meta-x, vertical rule - S_hwall: \xf1 # meta-q, horizontal rule - S_tlcorn: \xec # meta-l, top left corner - S_trcorn: \xeb # meta-k, top right corner - S_blcorn: \xed # meta-m, bottom left - S_brcorn: \xea # meta-j, bottom right - S_crwall: \xee # meta-n, cross - S_tuwall: \xf6 # meta-v, T up - S_tdwall: \xf7 # meta-w, T down - S_tlwall: \xf5 # meta-u, T left - S_trwall: \xf4 # meta-t, T right - S_ndoor: \xfe # meta-~, centered dot - S_vodoor: \xe1 # meta-a, solid block - S_hodoor: \xe1 # meta-a, solid block - S_bars: \xfb # meta-{, small pi - S_tree: \xe7 # meta-g, plus-or-minus - S_room: \xfe # meta-~, centered dot - S_upladder: \xf9 # meta-y, greater-than-or-equals - S_dnladder: \xfa # meta-z, less-than-or-equals - S_pool: \xe0 # meta-\, diamond - S_ice: \xfe # meta-~, centered dot - S_lava: \xe0 # meta-\, diamond - S_vodbridge: \xfe # meta-~, centered dot - S_hodbridge: \xfe # meta-~, centered dot - S_water: \xe0 # meta-\, diamond - S_vbeam: \xf8 # meta-x, vertical rule - S_hbeam: \xf1 # meta-q, horizontal rule - S_sw_tc: \xef # meta-o, high horizontal line - S_sw_ml: \xf8 # meta-x, vertical rule - S_sw_mr: \xf8 # meta-x, vertical rule - S_sw_bc: \xf3 # meta-s, low horizontal line - S_explode2: \xef # meta-o, high horizontal line - S_explode4: \xf8 # meta-x, vertical rule - S_explode6: \xf8 # meta-x, vertical rule - S_explode8: \xf3 # meta-s, low horizontal line -finish +# plain looks decent for room+corridor levels where there aren't a lot +# of wall corners and ones present tend to be spread out, but it looks +# awful for wallified mazes +start: plain + Description: same as default symbols, except '+' for corner walls + S_tlcorn: '+' + S_trcorn: '+' + S_blcorn: '+' + S_brcorn: '+' + S_crwall: '+' + S_tuwall: '+' + S_tdwall: '+' + S_tlwall: '+' + S_trwall: '+' +finish #plain -- other symbols implicitly retain their default values -start: IBMgraphics - Handling: IBM - S_vwall: \xb3 # meta-3, vertical rule - S_hwall: \xc4 # meta-D, horizontal rule - S_tlcorn: \xda # meta-Z, top left corner - S_trcorn: \xbf # meta-?, top right corner - S_blcorn: \xc0 # meta-@, bottom left - S_brcorn: \xd9 # meta-Y, bottom right - S_crwall: \xc5 # meta-E, cross - S_tuwall: \xc1 # meta-A, T up - S_tdwall: \xc2 # meta-B, T down - S_tlwall: \xb4 # meta-4, T left - S_trwall: \xc3 # meta-C, T right - S_ndoor: \xfa # meta-z, centered dot - S_vodoor: \xfe # meta-~, small centered square - S_hodoor: \xfe # meta-~, small centered square - S_bars: \xf0 # equivalence symbol - S_tree: \xf1 # plus or minus symbol - S_room: \xfa # meta-z, centered dot - S_corr: \xb0 # meta-0, light shading - S_litcorr: \xb1 # meta-1, medium shading - S_fountain: \xf4 # meta-t, integral top half - S_pool: \xf7 # meta-w, approx. equals - S_ice: \xfa # meta-z, centered dot - S_lava: \xf7 # meta-w, approx. equals - S_vodbridge: \xfa # meta-z, centered dot - S_hodbridge: \xfa # meta-z, centered dot - S_water: \xf7 # meta-w, approx. equals - S_vbeam: \xb3 # meta-3, vertical rule - S_hbeam: \xc4 # meta-D, horizontal rule - S_sw_ml: \xb3 # meta-3, vertical rule - S_sw_mr: \xb3 # meta-3, vertical rule - S_explode4: \xb3 # meta-3, vertical rule - S_explode6: \xb3 # meta-3, vertical rule -finish - -start: IBMGraphics_1 - Handling: IBM - S_vwall: \xb3 # meta-3, vertical rule - S_hwall: \xc4 # meta-D, horizontal rule - S_tlcorn: \xda # meta-Z, top left corner - S_trcorn: \xbf # meta-?, top right corner - S_blcorn: \xc0 # meta-@, bottom left - S_brcorn: \xd9 # meta-Y, bottom right - S_crwall: \xc5 # meta-E, cross - S_tuwall: \xc1 # meta-A, T up - S_tdwall: \xc2 # meta-B, T down - S_tlwall: \xb4 # meta-4, T left - S_trwall: \xc3 # meta-C, T right - S_vbeam: \xb3 # meta-3, vertical rule - S_hbeam: \xc4 # meta-D, horizontal rule - S_sw_ml: \xb3 # meta-3, vertical rule - S_sw_mr: \xb3 # meta-3, vertical rule - S_explode4: \xb3 # meta-3, vertical rule - S_explode6: \xb3 # meta-3, vertical rule -finish - -start: IBMGraphics_2 - Handling: IBM - S_vwall: \xb3 # meta-3, vertical rule - S_hwall: \xc4 # meta-D, horizontal rule - S_tlcorn: \xda # meta-Z, top left corner - S_trcorn: \xbf # meta-?, top right corner - S_blcorn: \xc0 # meta-@, bottom left - S_brcorn: \xd9 # meta-Y, bottom right - S_crwall: \xc5 # meta-E, cross - S_tuwall: \xc1 # meta-A, T up - S_tdwall: \xc2 # meta-B, T down - S_tlwall: \xb4 # meta-4, T left - S_trwall: \xc3 # meta-C, T right - S_vodoor: \xfe # meta-~, small centered square - S_hodoor: \xfe # meta-~, small centered square - S_corr: \xb0 # meta-0, light shading - S_litcorr: \xb1 # meta-1, medium shading - S_vbeam: \xb3 # meta-3, vertical rule - S_hbeam: \xc4 # meta-D, horizontal rule - S_sw_ml: \xb3 # meta-3, vertical rule - S_sw_mr: \xb3 # meta-3, vertical rule - S_explode4: \xb3 # meta-3, vertical rule - S_explode6: \xb3 # meta-3, vertical rule -finish - -start: MACgraphics - Handling: MAC - S_vwall: \xba - S_hwall: \xcd - S_tlcorn: \xc9 - S_trcorn: \xbb - S_blcorn: \xc8 - S_brcorn: \xbc - S_crwall: \xce - S_tuwall: \xca - S_tdwall: \xcb - S_tlwall: \xb9 - S_trwall: \xcc - S_ndoor: \xb0 - S_vodoor: \xee - S_hodoor: \xee - S_vcdoor: \xef - S_hcdoor: \xef - S_bars: \xf0 # equivalency symbol - S_tree: \xf1 # plus-or-minus - S_corr: \xb0 - S_grave: \xef # same as open door - S_pool: \xe0 -finish - -start: RogueIBM - Handling: IBM - Restrictions: rogue - S_weapon: \x29 - S_amulet: \x2c - S_food: \x3a - S_potion: \xad - S_scroll: \x3f - S_book: \x2b - S_wand: \xe7 - S_vwall: \xba # all walls now use - S_hwall: \xcd # double line graphics - S_tlcorn: \xc9 - S_trcorn: \xbb - S_blcorn: \xc8 - S_brcorn: \xbc - S_crwall: \xce - S_tuwall: \xca - S_tdwall: \xcb - S_tlwall: \xb9 - S_trwall: \xcc - S_ndoor: \xce - S_vodoor: \xce - S_hodoor: \xce - S_room: \xfa # centered dot - S_corr: \xb1 - S_litcorr: \xb2 - S_upstair: \xf0 # Greek Xi - S_dnstair: \xf0 -finish - -start: RogueEpyx - Description: Rogue level color symbol set like Epyx Rogue - Restrictions: rogue - Handling: IBM - Color: Yes - S_vwall: \xba # all walls now use - S_hwall: \xcd # double line graphics - S_tlcorn: \xc9 - S_trcorn: \xbb - S_blcorn: \xc8 - S_brcorn: \xbc - S_crwall: \xce - S_tuwall: \xca - S_tdwall: \xcb - S_tlwall: \xb9 - S_trwall: \xcc - S_ndoor: \xce - S_vodoor: \xce - S_hodoor: \xce - S_room: \xfa # centered dot - S_corr: \xb1 - S_litcorr: \xb2 - S_upstair: \xf0 # Greek Xi - S_dnstair: \xf0 - S_arrow_trap: \x04 # diamond (cards) - S_dart_trap: \x04 - S_falling_rock_trap: \x04 - S_squeaky_board: \x04 - S_bear_trap: \x04 - S_land_mine: \x04 - S_rolling_boulder_trap: \x04 - S_sleeping_gas_trap: \x04 - S_rust_trap: \x04 - S_fire_trap: \x04 - S_pit: \x04 - S_spiked_pit: \x04 - S_hole: \x04 - S_trap_door: \x04 - S_teleportation_trap: \x04 - S_level_teleporter: \x04 - S_magic_portal: \x04 - S_web: \x04 - S_statue_trap: \x04 - S_magic_trap: \x04 - S_anti_magic_trap: \x04 - S_polymorph_trap: \x04 - S_weapon: \x18 # up arrow -# ^J S_armor: \x0a # Vert rect with o - S_armor: \x5b # default: '[' -# ^I S_ring: \x09 # circle with arrow - S_ring: \x3d # default: '=' - S_amulet: \x0c # "female" symbol - S_tool: \x28 # default: '(' - S_food: \x05 # club (as in cards) - S_potion: \xad # upside down '!' - S_scroll: \x0e # musical note - S_book: \x2b # default: '+' - S_wand: \xe7 # greek tau - S_coin: \x0f # yes it's the same as gems - S_gem: \x0f # fancy '*' - S_rock: \x60 - S_ball: \x30 - S_chain: \x5f - S_venom: \x2e - S_rock: \x60 - S_ball: \x30 - S_chain: \x5f - S_venom: \x2e - S_human: \x01 -finish - -start: RogueWindows - Restrictions: rogue - Handling: IBM - S_weapon: \x29 - S_amulet: \x2c - S_food: \x3a - S_potion: \xad - S_scroll: \x3f - S_book: \x2b - S_wand: \xe7 - S_vwall: \xba # all walls now use - S_hwall: \xcd # double line graphics - S_tlcorn: \xc9 - S_trcorn: \xbb - S_blcorn: \xc8 - S_brcorn: \xbc - S_crwall: \xce - S_tuwall: \xca - S_tdwall: \xcb - S_tlwall: \xb9 - S_trwall: \xcc - S_ndoor: \xce - S_vodoor: \xce - S_hodoor: \xce - S_room: \xfa # centered dot - S_corr: \xb1 - S_litcorr: \xb2 - S_upstair: \xf0 # Greek Xi - S_dnstair: \xf0 -finish - -# Recommended symset for blind players +# Recommended symset for blind players # courtesy Michael Feir start: NHAccess - Description: Recommended for blind players + Description: recommended for blind players S_stone: \032 S_vwall: \124 S_hwall: \045 @@ -308,7 +52,7 @@ start: NHAccess S_brcorn: \124 S_crwall: \045 S_tuwall: \045 - S_tdwall: \045 + S_tdwall: \045 S_tlwall: \124 S_trwall: \124 S_ndoor: \046 @@ -320,7 +64,7 @@ start: NHAccess S_tree: \035 S_room: \035 S_corr: \060 - S_litcorr: \062 + S_litcorr: \062 S_upstair: \060 S_dnstair: \062 S_upladder: \095 @@ -329,35 +73,35 @@ start: NHAccess S_grave: \126 S_throne: \126 S_sink: \126 - S_fountain: \126 + S_fountain: \126 S_pool: \042 S_ice: \042 S_lava: \035 S_vodbridge: \035 - S_hodbridge: \032 + S_hodbridge: \032 S_vcdbridge: \035 S_hcdbridge: \126 S_arrow_trap: \094 S_dart_trap: \094 - S_falling_rock_trap: \094 + S_falling_rock_trap: \094 S_squeaky_board: \094 S_bear_trap: \094 S_land_mine: \094 - S_rolling_boulder_trap: \094 + S_rolling_boulder_trap: \094 S_sleeping_gas_trap: \094 S_rust_trap: \094 S_fire_trap: \094 S_pit: \094 S_spiked_pit: \094 S_hole: \094 - S_trap_door: \094 + S_trap_door: \094 S_teleportation_trap: \094 S_level_teleporter: \094 S_magic_portal: \094 S_web: \094 - S_statue_trap: \094 + S_statue_trap: \094 S_magic_trap: \094 - S_anti_magic_trap: \094 + S_anti_magic_trap: \094 S_polymorph_trap: \094 S_vbeam: \124 S_hbeam: \095 @@ -379,7 +123,7 @@ start: NHAccess S_sw_bl: \092 S_sw_bc: \045 S_sw_br: \047 - S_explode1: \047 + S_explode1: \047 S_explode2: \045 S_explode3: \092 S_explode4: \058 @@ -392,7 +136,7 @@ finish # All symbols are spaces start: Blank - Description: Completely blank symbols + Description: completely blank symbols S_air: \032 S_altar: \032 S_amulet: \032 @@ -569,15 +313,343 @@ start: Blank S_zruty: \032 finish -start: plain - Description: Same as Default symbols, except '+' for corner walls - S_tlcorn: '+' - S_trcorn: '+' - S_blcorn: '+' - S_brcorn: '+' - S_crwall: '+' - S_tuwall: '+' - S_tdwall: '+' - S_tlwall: '+' - S_trwall: '+' -finish #plain -- other symbols implicitly retain their default values +start: IBMgraphics + Description: special line-drawing characters used for walls +# Restrictions: primary + Handling: IBM + S_vwall: \xb3 # meta-3, vertical rule + S_hwall: \xc4 # meta-D, horizontal rule + S_tlcorn: \xda # meta-Z, top left corner + S_trcorn: \xbf # meta-?, top right corner + S_blcorn: \xc0 # meta-@, bottom left + S_brcorn: \xd9 # meta-Y, bottom right + S_crwall: \xc5 # meta-E, cross + S_tuwall: \xc1 # meta-A, T up + S_tdwall: \xc2 # meta-B, T down + S_tlwall: \xb4 # meta-4, T left + S_trwall: \xc3 # meta-C, T right + S_ndoor: \xfa # meta-z, centered dot + S_vodoor: \xfe # meta-~, small centered square + S_hodoor: \xfe # meta-~, small centered square + S_bars: \xf0 # equivalence symbol + S_tree: \xf1 # plus or minus symbol + S_room: \xfa # meta-z, centered dot + S_corr: \xb0 # meta-0, light shading + S_litcorr: \xb1 # meta-1, medium shading + S_fountain: \xf4 # meta-t, integral top half + S_pool: \xf7 # meta-w, approx. equals + S_ice: \xfa # meta-z, centered dot + S_lava: \xf7 # meta-w, approx. equals + S_vodbridge: \xfa # meta-z, centered dot + S_hodbridge: \xfa # meta-z, centered dot + S_water: \xf7 # meta-w, approx. equals + S_vbeam: \xb3 # meta-3, vertical rule + S_hbeam: \xc4 # meta-D, horizontal rule + S_sw_ml: \xb3 # meta-3, vertical rule + S_sw_mr: \xb3 # meta-3, vertical rule + S_explode4: \xb3 # meta-3, vertical rule + S_explode6: \xb3 # meta-3, vertical rule +finish + +start: IBMGraphics_1 +# Restrictions: primary + Handling: IBM + S_vwall: \xb3 # meta-3, vertical rule + S_hwall: \xc4 # meta-D, horizontal rule + S_tlcorn: \xda # meta-Z, top left corner + S_trcorn: \xbf # meta-?, top right corner + S_blcorn: \xc0 # meta-@, bottom left + S_brcorn: \xd9 # meta-Y, bottom right + S_crwall: \xc5 # meta-E, cross + S_tuwall: \xc1 # meta-A, T up + S_tdwall: \xc2 # meta-B, T down + S_tlwall: \xb4 # meta-4, T left + S_trwall: \xc3 # meta-C, T right + S_vbeam: \xb3 # meta-3, vertical rule + S_hbeam: \xc4 # meta-D, horizontal rule + S_sw_ml: \xb3 # meta-3, vertical rule + S_sw_mr: \xb3 # meta-3, vertical rule + S_explode4: \xb3 # meta-3, vertical rule + S_explode6: \xb3 # meta-3, vertical rule +finish + +start: IBMGraphics_2 +# Restrictions: primary + Handling: IBM + S_vwall: \xb3 # meta-3, vertical rule + S_hwall: \xc4 # meta-D, horizontal rule + S_tlcorn: \xda # meta-Z, top left corner + S_trcorn: \xbf # meta-?, top right corner + S_blcorn: \xc0 # meta-@, bottom left + S_brcorn: \xd9 # meta-Y, bottom right + S_crwall: \xc5 # meta-E, cross + S_tuwall: \xc1 # meta-A, T up + S_tdwall: \xc2 # meta-B, T down + S_tlwall: \xb4 # meta-4, T left + S_trwall: \xc3 # meta-C, T right + S_vodoor: \xfe # meta-~, small centered square + S_hodoor: \xfe # meta-~, small centered square + S_corr: \xb0 # meta-0, light shading + S_litcorr: \xb1 # meta-1, medium shading + S_vbeam: \xb3 # meta-3, vertical rule + S_hbeam: \xc4 # meta-D, horizontal rule + S_sw_ml: \xb3 # meta-3, vertical rule + S_sw_mr: \xb3 # meta-3, vertical rule + S_explode4: \xb3 # meta-3, vertical rule + S_explode6: \xb3 # meta-3, vertical rule +finish + +start: RogueIBM + Handling: IBM + Restrictions: rogue + S_weapon: \x29 + S_amulet: \x2c + S_food: \x3a + S_potion: \xad + S_scroll: \x3f + S_book: \x2b + S_wand: \xe7 + S_vwall: \xba # all walls now use + S_hwall: \xcd # double line graphics + S_tlcorn: \xc9 + S_trcorn: \xbb + S_blcorn: \xc8 + S_brcorn: \xbc + S_crwall: \xce + S_tuwall: \xca + S_tdwall: \xcb + S_tlwall: \xb9 + S_trwall: \xcc + S_ndoor: \xce + S_vodoor: \xce + S_hodoor: \xce + S_room: \xfa # centered dot + S_corr: \xb1 + S_litcorr: \xb2 + S_upstair: \xf0 # Greek Xi + S_dnstair: \xf0 +finish + +start: RogueEpyx + Description: rogue level color symbol set like Epyx Rogue + Restrictions: rogue + Handling: IBM + Color: Yes + S_vwall: \xba # all walls now use + S_hwall: \xcd # double line graphics + S_tlcorn: \xc9 + S_trcorn: \xbb + S_blcorn: \xc8 + S_brcorn: \xbc + S_crwall: \xce + S_tuwall: \xca + S_tdwall: \xcb + S_tlwall: \xb9 + S_trwall: \xcc + S_ndoor: \xce + S_vodoor: \xce + S_hodoor: \xce + S_room: \xfa # centered dot + S_corr: \xb1 + S_litcorr: \xb2 + S_upstair: \xf0 # Greek Xi + S_dnstair: \xf0 + S_arrow_trap: \x04 # diamond (cards) + S_dart_trap: \x04 + S_falling_rock_trap: \x04 + S_squeaky_board: \x04 + S_bear_trap: \x04 + S_land_mine: \x04 + S_rolling_boulder_trap: \x04 + S_sleeping_gas_trap: \x04 + S_rust_trap: \x04 + S_fire_trap: \x04 + S_pit: \x04 + S_spiked_pit: \x04 + S_hole: \x04 + S_trap_door: \x04 + S_teleportation_trap: \x04 + S_level_teleporter: \x04 + S_magic_portal: \x04 + S_web: \x04 + S_statue_trap: \x04 + S_magic_trap: \x04 + S_anti_magic_trap: \x04 + S_polymorph_trap: \x04 + S_weapon: \x18 # up arrow +# ^J S_armor: \x0a # Vert rect with o + S_armor: \x5b # default: '[' +# ^I S_ring: \x09 # circle with arrow + S_ring: \x3d # default: '=' + S_amulet: \x0c # "female" symbol + S_tool: \x28 # default: '(' + S_food: \x05 # club (as in cards) + S_potion: \xad # upside down '!' + S_scroll: \x0e # musical note + S_book: \x2b # default: '+' + S_wand: \xe7 # greek tau + S_coin: \x0f # yes it's the same as gems + S_gem: \x0f # fancy '*' + S_rock: \x60 + S_ball: \x30 + S_chain: \x5f + S_venom: \x2e + S_rock: \x60 + S_ball: \x30 + S_chain: \x5f + S_venom: \x2e + S_human: \x01 +finish + +start: RogueWindows + Restrictions: rogue + Handling: IBM + S_weapon: \x29 + S_amulet: \x2c + S_food: \x3a + S_potion: \xad + S_scroll: \x3f + S_book: \x2b + S_wand: \xe7 + S_vwall: \xba # all walls now use + S_hwall: \xcd # double line graphics + S_tlcorn: \xc9 + S_trcorn: \xbb + S_blcorn: \xc8 + S_brcorn: \xbc + S_crwall: \xce + S_tuwall: \xca + S_tdwall: \xcb + S_tlwall: \xb9 + S_trwall: \xcc + S_ndoor: \xce + S_vodoor: \xce + S_hodoor: \xce + S_room: \xfa # centered dot + S_corr: \xb1 + S_litcorr: \xb2 + S_upstair: \xf0 # Greek Xi + S_dnstair: \xf0 +finish + +start: curses + Description: approximation of IBMgraphics using DECgraphics + Restrictions: primary + Handling: DEC + S_vwall: \xf8 # meta-x, vertical rule + S_hwall: \xf1 # meta-q, horizontal rule + S_tlcorn: \xec # meta-l, top left corner + S_trcorn: \xeb # meta-k, top right corner + S_blcorn: \xed # meta-m, bottom left + S_brcorn: \xea # meta-j, bottom right + S_crwall: \xee # meta-n, cross + S_tuwall: \xf6 # meta-v, T up + S_tdwall: \xf7 # meta-w, T down + S_tlwall: \xf5 # meta-u, T left + S_trwall: \xf4 # meta-t, T right + S_ndoor: \xfe # meta-z, centered dot + S_tree: \xf1 # plus or minus symbol + S_room: \xfe # meta-z, centered dot + S_corr: \xe1 # meta-a, solid block + S_litcorr: \xe1 # meta-a, solid block + S_ice: \xfe # meta-z, centered dot + S_vodbridge: \xfe # meta-z, centered dot + S_hodbridge: \xfe # meta-z, centered dot + S_vbeam: \xf8 # meta-3, vertical rule + S_hbeam: \xf1 # meta-D, horizontal rule + S_sw_ml: \xf8 # meta-3, vertical rule + S_sw_mr: \xf8 # meta-3, vertical rule + S_explode4: \xf8 # meta-3, vertical rule + S_explode6: \xf8 # meta-3, vertical rule +finish + +start: DECgraphics + Description: special line-drawing characters used for walls + Restrictions: primary + Handling: DEC + S_vwall: \xf8 # meta-x, vertical rule + S_hwall: \xf1 # meta-q, horizontal rule + S_tlcorn: \xec # meta-l, top left corner + S_trcorn: \xeb # meta-k, top right corner + S_blcorn: \xed # meta-m, bottom left + S_brcorn: \xea # meta-j, bottom right + S_crwall: \xee # meta-n, cross + S_tuwall: \xf6 # meta-v, T up + S_tdwall: \xf7 # meta-w, T down + S_tlwall: \xf5 # meta-u, T left + S_trwall: \xf4 # meta-t, T right + S_ndoor: \xfe # meta-~, centered dot + S_vodoor: \xe1 # meta-a, solid block + S_hodoor: \xe1 # meta-a, solid block + S_bars: \xfb # meta-{, small pi + S_tree: \xe7 # meta-g, plus-or-minus + S_room: \xfe # meta-~, centered dot + S_upladder: \xf9 # meta-y, less-than-or-equals + S_dnladder: \xfa # meta-z, greater-than-or-equals + S_pool: \xe0 # meta-\, diamond + S_ice: \xfe # meta-~, centered dot + S_lava: \xe0 # meta-\, diamond + S_vodbridge: \xfe # meta-~, centered dot + S_hodbridge: \xfe # meta-~, centered dot + S_water: \xe0 # meta-\, diamond + S_vbeam: \xf8 # meta-x, vertical rule + S_hbeam: \xf1 # meta-q, horizontal rule + S_sw_tc: \xef # meta-o, high horizontal line + S_sw_ml: \xf8 # meta-x, vertical rule + S_sw_mr: \xf8 # meta-x, vertical rule + S_sw_bc: \xf3 # meta-s, low horizontal line + S_explode2: \xef # meta-o, high horizontal line + S_explode4: \xf8 # meta-x, vertical rule + S_explode6: \xf8 # meta-x, vertical rule + S_explode8: \xf3 # meta-s, low horizontal line +finish + +# +# This is commented out because specifying alternate default set isn't +# implemented. +# +# DECgraphics_2: underscore (default for altar) can be hard to see if +# hero or highlighted pet is on the spot below (south of) it, making +# it look like part of slightly bigger block cursor. Bars are usually +# within walls and we have something else for doorless doorway so '#' +# for bars shouldn't be mistaken for the corridor symbol even by someone +# used to DECgraphics, at least not often enough to pose a problem. +# The pi symbol is small like lowercase but flat-topped like uppercase +# so could represent a side view of a raised platform or table. +# +# start: DECgraphics_2 +# Defaults: DECgraphics # includes 'Handling: DEC' +# Description: variation of DECgraphics (iron bars:#, altar:pi) +# S_bars: '#' # (switch from pi to plain '#') +# S_altar: \xfb # meta-{, pi (switch from underscore) +# finish +# + +start: MACgraphics +# Description: (pre-OSX: obsolete?) +# Restrictions: primary + Handling: MAC + S_vwall: \xba + S_hwall: \xcd + S_tlcorn: \xc9 + S_trcorn: \xbb + S_blcorn: \xc8 + S_brcorn: \xbc + S_crwall: \xce + S_tuwall: \xca + S_tdwall: \xcb + S_tlwall: \xb9 + S_trwall: \xcc + S_ndoor: \xb0 + S_vodoor: \xee + S_hodoor: \xee + S_vcdoor: \xef + S_hcdoor: \xef + S_bars: \xf0 # equivalency symbol + S_tree: \xf1 # plus-or-minus + S_corr: \xb0 + S_grave: \xef # same as open door + S_pool: \xe0 +finish + +# symbols EOF diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 71572a441..b1b3b3e2c 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.126 $ $NHDT-Date: 1570408209 2019/10/07 00:30:09 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.140 $ $NHDT-Date: 1571352531 2019/10/17 22:48:51 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -178,6 +178,16 @@ avoid 'object lost' panic when polymorph causes loss of levitation boots or wasn't possible to tell where they were, unlike all other forms of multiple movement; stop running if/when an engraving is reached fix exploding land mine moving ball or chain and causing a sanity error +fix firing attached iron ball when swallowed causing a sanity error +fix vault guard impossible when he could not relocate in certain situation +fix temple priests or shopkeepers moving over other monsters +fix hero still hiding under a statue shattered by a land mine +fix helping a monster out of a pit addressing a deleted trap +fix launched rolling boulder code accessing deleted trap +fix monster stepping on a land mine code accessing deleted trap +revise 'O' to show symbol sets in the same order they appear in the symbols + file and order the sets in dat/symbols to yield a sensible symset menu +yellow dragons had green breath Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository @@ -198,6 +208,7 @@ monster throwing from stack of missiles (darts, daggers, spears) would cause crash if it wasn't wielding a weapon (bug in multi-shot shooting fix) surviving death while polymorphed would yield "You are a " without terminating period +'mksobj failure' commit resulted in wrong corpse types for dying monsters curses: sometimes the message window would show a blank line after a prompt curses: the change to show map in columns 1..79 instead of 2..80 made the highlight for '@' show up in the wrong place if clipped map had been @@ -210,8 +221,6 @@ tty: revert the attempt to fix "message line anomaly: if autodecribe feedback wrapped to second line, the wrapped portion wasn't erased when a shorter line was shown or getpos was dismissed" because it disrupted prompts that spanned more than one line, a more significant issue -unix: sysconf CHECK_PLNAME=1 wouldn't work if attempt to obtain unix username - failed even though it didn't need that username Platform- and/or Interface-Specific Fixes or Features @@ -270,6 +279,12 @@ curses: disable the attempt to support Ctrl+Left_click as an alternate way OSX 10.11) documentation and things didn't work as intended curses: menu coloring required that both 'menucolors' and 'guicolor' be On; for menus, override guicolor with more-specific menucolors +curses: support symset:DECgraphics for map display +curses: enable the 'use_inverse' boolean option (via wincap WC_INVERSE flag) + for extended monster detection and black&white lava; forced to True + to override default of False (for tty's benefit) +curses: force 'O' command's menus for 'symset' and 'roguesymset' options to + be wider so that fewer entries with set descriptions will wrap curses+'perm_invent': entries were wrapping without any control; usually not noticeable because next entry overwrote, but visible for final entry when whole inventory fit within the available height; looked ok with @@ -302,6 +317,10 @@ tty: take two, if/when autodecribe feedback wraps past top line, clear ['exposed by git' section has an entry for reversal of 'take one'] tty: video attributes (bold, inverse, &c) for status highlighting sometimes were scrambled +unix: sysconf CHECK_PLNAME=1 wouldn't work if attempt to obtain unix username + failed even though it didn't need that username +unix+curses: startup error only reset terminal for tty; one noticeable + example was answering 'n' to "Destroy old game?" Windows: some startup error messages were not being delivered successfully @@ -332,6 +351,9 @@ curses: give menus and text windows a minimum size of 5x25 since tiny ones can curses+'perm_invent': since persistent inventory is narrow, strip off "a", "an", or "the" prefix on inventory entries shown there so that a tiny bit more of the interesting portion is visible +curses+'curses': change the curses map display to use new symbol set 'curses' + instead of hard-coded values; it attempts to show IBMgraphics-style + map using DECgraphics characters; DECgraphics can also be used as-is NetHack Community Patches (or Variation) Included diff --git a/include/rm.h b/include/rm.h index e104fc20f..e914b6c32 100644 --- a/include/rm.h +++ b/include/rm.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 rm.h $NHDT-Date: 1559994624 2019/06/08 11:50:24 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.61 $ */ +/* NetHack 3.6 rm.h $NHDT-Date: 1571347960 2019/10/17 21:32:40 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.64 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2017. */ /* NetHack may be freely redistributed. See license for details. */ @@ -278,7 +278,8 @@ struct symsetentry { Bitfield(nocolor, 1); /* don't use color if set */ Bitfield(primary, 1); /* restricted for use as primary set */ Bitfield(rogue, 1); /* restricted for use as rogue lev set */ - /* 5 free bits */ + Bitfield(explicitly, 1); /* explicit symset set */ + /* 4 free bits */ }; /* @@ -298,6 +299,8 @@ struct symsetentry { #define H_IBM 1 #define H_DEC 2 #define H_CURS 3 +#define H_MAC 4 /* obsolete; needed so that the listing of available + * symsets by 'O' can skip it for !MAC_GRAPHICS_ENV */ extern const struct symdef defsyms[MAXPCHARS]; /* defaults */ #define WARNCOUNT 6 /* number of different warning levels */ diff --git a/src/decl.c b/src/decl.c index 76c7a0bad..9d57ab989 100644 --- a/src/decl.c +++ b/src/decl.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 decl.c $NHDT-Date: 1547025164 2019/01/09 09:12:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.141 $ */ +/* NetHack 3.6 decl.c $NHDT-Date: 1571352532 2019/10/17 22:48:52 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.146 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2009. */ /* NetHack may be freely redistributed. See license for details. */ @@ -40,6 +40,7 @@ NEARDATA struct obj *uwep, *uarm, *uswapwep, #ifdef TEXTCOLOR /* * This must be the same order as used for buzz() in zap.c. + * (They're only used in mapglyph.c so probably shouldn't be here.) */ const int zapcolors[NUM_ZAP] = { HI_ZAP, /* 0 - missile */ @@ -48,8 +49,10 @@ const int zapcolors[NUM_ZAP] = { HI_ZAP, /* 3 - sleep */ CLR_BLACK, /* 4 - death */ CLR_WHITE, /* 5 - lightning */ - CLR_YELLOW, /* 6 - poison gas */ - CLR_GREEN, /* 7 - acid */ + /* 3.6.3: poison gas zap used to be yellow and acid zap was green, + which conflicted with the corresponding dragon colors */ + CLR_GREEN, /* 6 - poison gas */ + CLR_YELLOW, /* 7 - acid */ }; #endif /* text color */ diff --git a/src/dothrow.c b/src/dothrow.c index 552c8e0fd..0ab919be4 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1292,7 +1292,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ || !index(in_rooms(mon->mx, mon->my, SHOPBASE), *u.ushops))) hot_pursuit(mon); - if (obj_gone) + if (obj_gone || obj == uball) g.thrownobj = (struct obj *) 0; } diff --git a/src/drawing.c b/src/drawing.c index dc59af9bd..3bc5e95f0 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 drawing.c $NHDT-Date: 1546656404 2019/01/05 02:46:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.59 $ */ +/* NetHack 3.6 drawing.c $NHDT-Date: 1571347973 2019/10/17 21:32:53 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.62 $ */ /* Copyright (c) NetHack Development Team 1992. */ /* NetHack may be freely redistributed. See license for details. */ @@ -246,9 +246,9 @@ static const uchar def_r_oc_syms[MAXOCLASSES] = { #undef C -#ifdef TERMLIB +#if defined(TERMLIB) || defined(CURSES_GRAPHICS) void NDECL((*decgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ -#endif /* TERMLIB */ +#endif /* TERMLIB || CURSES */ #ifdef PC9800 void NDECL((*ibmgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ @@ -487,17 +487,22 @@ int nondefault; #ifdef PC9800 if (SYMHANDLING(H_IBM) && ibmgraphics_mode_callback) (*ibmgraphics_mode_callback)(); - else if (!g.symset[g.currentgraphics].name && ascgraphics_mode_callback) + else if (SYMHANDLING(H_UNK) && ascgraphics_mode_callback) (*ascgraphics_mode_callback)(); #endif -#ifdef TERMLIB +#if defined(TERMLIB) || defined(CURSES_GRAPHICS) + /* curses doesn't assign any routine to dec..._callback but + probably does the expected initialization under the hood + for terminals capable of rendering DECgraphics */ if (SYMHANDLING(H_DEC) && decgraphics_mode_callback) (*decgraphics_mode_callback)(); -#endif # ifdef CURSES_GRAPHICS + /* there aren't any symbol sets with CURS handling, and the + curses interface never assigns a routine to curses..._callback */ if (SYMHANDLING(H_CURS) && cursesgraphics_mode_callback) (*cursesgraphics_mode_callback)(); # endif +#endif } else { init_l_symbols(); init_showsyms(); @@ -553,6 +558,7 @@ const char *known_handling[] = { "IBM", /* H_IBM */ "DEC", /* H_DEC */ "CURS", /* H_CURS */ + "MAC", /* H_MAC -- pre-OSX MACgraphics */ (const char *) 0, }; diff --git a/src/explode.c b/src/explode.c index ff5b71bc2..38e6cdf8d 100644 --- a/src/explode.c +++ b/src/explode.c @@ -771,6 +771,9 @@ struct obj *obj; /* only scatter this obj */ newsym(x, y); } newsym(sx, sy); + if (sx == u.ux && sy == u.uy && u.uundetected + && hides_under(g.youmonst.data)) + (void) hideunder(&g.youmonst); return total; } diff --git a/src/files.c b/src/files.c index 0aed6a08a..e4c215243 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 files.c $NHDT-Date: 1562719337 2019/07/10 00:42:17 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.252 $ */ +/* NetHack 3.6 files.c $NHDT-Date: 1571347976 2019/10/17 21:32:56 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.254 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2342,7 +2342,7 @@ const char *name; /* name of option for error message */ break; default: - gi_error: + gi_error: raw_printf("Syntax error in %s", name); wait_synch(); return count; @@ -3298,9 +3298,10 @@ boolean FDECL((*proc), (char *)); } ep = inbuf; - while (*ep == ' ' || *ep == '\t') ep++; + while (*ep == ' ' || *ep == '\t') + ++ep; - /* lines beginning with '#' are comments. ignore empty lines. */ + /* ingore empty lines and full-line comment lines */ if (!*ep || *ep == '#') ignoreline = TRUE; @@ -3309,9 +3310,9 @@ boolean FDECL((*proc), (char *)); /* merge now read line with previous ones, if necessary */ if (!ignoreline) { - len = strlen(inbuf) + 1; + len = (int) strlen(inbuf) + 1; if (buf) - len += strlen(buf); + len += (int) strlen(buf); tmpbuf = (char *) alloc(len); if (buf) { Sprintf(tmpbuf, "%s %s", buf, inbuf); @@ -3335,6 +3336,7 @@ boolean FDECL((*proc), (char *)); if (match_varname(buf, "CHOOSE", 6)) { char *section; char *bufp = find_optparam(buf); + if (!bufp) { config_error_add( "Format is CHOOSE=section1,section2,..."); @@ -3397,10 +3399,11 @@ int which_set; { FILE *fp; + g.symset[which_set].explicitly = FALSE; if (!(fp = fopen_sym_file())) return 0; - g.symset_count = 0; + g.symset[which_set].explicitly = TRUE; g.chosen_symset_start = g.chosen_symset_end = FALSE; g.symset_which_set = which_set; @@ -3419,7 +3422,14 @@ int which_set; || !strcmpi(g.symset[which_set].name, "default"))) clear_symsetentry(which_set, TRUE); config_error_done(); - return (g.symset[which_set].name == 0) ? 1 : 0; + + /* If name was defined, it was invalid... Then we're loading fallback */ + if (g.symset[which_set].name) { + g.symset[which_set].explicitly = FALSE; + return 0; + } + + return 1; } if (!g.chosen_symset_end) config_error_add("Missing finish for symset \"%s\"", @@ -3490,14 +3500,19 @@ int which_set; building a pick-list of possible symset values from the file, so only do that */ if (symp->range == SYM_CONTROL) { - struct symsetentry *tmpsp; + struct symsetentry *tmpsp, *lastsp; + for (lastsp = g.symset_list; lastsp; lastsp = lastsp->next) + if (!lastsp->next) + break; switch (symp->idx) { case 0: tmpsp = (struct symsetentry *) alloc(sizeof *tmpsp); - tmpsp->next = g.symset_list; - g.symset_list = tmpsp; - tmpsp->idx = g.symset_count++; + tmpsp->next = (struct symsetentry *) 0; + if (!lastsp) + g.symset_list = tmpsp; + else + lastsp->next = tmpsp; tmpsp->name = dupstr(bufp); tmpsp->desc = (char *) 0; tmpsp->handling = H_UNK; @@ -3508,21 +3523,22 @@ int which_set; break; case 2: /* handler type identified */ - tmpsp = g.symset_list; /* most recent symset */ + tmpsp = lastsp; /* most recent symset */ for (i = 0; known_handling[i]; ++i) if (!strcmpi(known_handling[i], bufp)) { tmpsp->handling = i; break; /* for loop */ } break; - case 3: /* description:something */ - tmpsp = g.symset_list; /* most recent symset */ + case 3: + /* description:something */ + tmpsp = lastsp; /* most recent symset */ if (tmpsp && !tmpsp->desc) tmpsp->desc = dupstr(bufp); break; case 5: /* restrictions: xxxx*/ - tmpsp = g.symset_list; /* most recent symset */ + tmpsp = lastsp; /* most recent symset */ for (i = 0; known_restrictions[i]; ++i) { if (!strcmpi(known_restrictions[i], bufp)) { switch (i) { @@ -4366,7 +4382,7 @@ unsigned oid; /* book identifier */ } } -cleanup: + cleanup: (void) dlb_fclose(fp); if (nowin_buf) { /* one-line buffer */ diff --git a/src/mkobj.c b/src/mkobj.c index 97c03edc4..300e29799 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mkobj.c $NHDT-Date: 1570569798 2019/10/08 21:23:18 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.153 $ */ +/* NetHack 3.6 mkobj.c $NHDT-Date: 1570872702 2019/10/12 09:31:42 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.155 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -235,15 +235,14 @@ boolean init, artif; struct obj *otmp; otmp = mksobj(otyp, init, artif); - if (otmp) { - add_to_migration(otmp); - otmp->owornmask = (long) MIGR_TO_SPECIES; - otmp->corpsenm = mflags2; - } + add_to_migration(otmp); + otmp->owornmask = (long) MIGR_TO_SPECIES; + otmp->corpsenm = mflags2; return otmp; } -/* mkobj(): select a type of item from a class, use mksobj() to create it */ +/* mkobj(): select a type of item from a class, use mksobj() to create it; + result is always non-Null */ struct obj * mkobj(oclass, artif) char oclass; @@ -309,8 +308,7 @@ struct obj *box; for (n = rn2(n + 1); n > 0; n--) { if (box->otyp == ICE_BOX) { - if (!(otmp = mksobj(CORPSE, TRUE, TRUE))) - continue; + otmp = mksobj(CORPSE, TRUE, TRUE); /* Note: setting age to 0 is correct. Age has a different * from usual meaning for objects stored in ice boxes. -KAA */ @@ -768,7 +766,7 @@ static const char dknowns[] = { WAND_CLASS, RING_CLASS, POTION_CLASS, SCROLL_CLASS, GEM_CLASS, SPBOOK_CLASS, WEAPON_CLASS, TOOL_CLASS, 0 }; -/* mksobj(): create a specific type of object */ +/* mksobj(): create a specific type of object; result it always non-Null */ struct obj * mksobj(otyp, init, artif) int otyp; @@ -1062,10 +1060,12 @@ boolean artif; case COIN_CLASS: break; /* do nothing */ default: - impossible("impossible mkobj %d, sym '%c'.", otmp->otyp, - objects[otmp->otyp].oc_class); - dealloc_obj(otmp); /* free() would suffice here */ - return (struct obj *) 0; + /* 3.6.3: this used to be impossible() followed by return 0 + but most callers aren't prepared to deal with Null result + and cluttering them up to do so is pointless */ + panic("mksobj tried to make type %d, class %d.", + (int) otmp->otyp, (int) objects[otmp->otyp].oc_class); + /*NOTREACHED*/ } } @@ -1473,6 +1473,7 @@ register struct obj *obj; static const int treefruits[] = { APPLE, ORANGE, PEAR, BANANA, EUCALYPTUS_LEAF }; +/* called when a tree is kicked; never returns Null */ struct obj * rnd_treefruit_at(x, y) int x, y; @@ -1480,15 +1481,17 @@ int x, y; return mksobj_at(treefruits[rn2(SIZE(treefruits))], x, y, TRUE, FALSE); } +/* create a stack of N gold pieces; never returns Null */ struct obj * mkgold(amount, x, y) long amount; int x, y; { - register struct obj *gold = g_at(x, y); + struct obj *gold = g_at(x, y); if (amount <= 0L) { long mul = rnd(30 / max(12-depth(&u.uz), 2)); + amount = (long) (1 + rnd(level_difficulty() + 2) * mul); } if (gold) { @@ -1501,12 +1504,14 @@ int x, y; return gold; } -/* return TRUE if the corpse has special timing */ -#define special_corpse(num) \ - (((num) == PM_LIZARD) || ((num) == PM_LICHEN) || (is_rider(&mons[num])) \ - || (mons[num].mlet == S_TROLL)) +/* return TRUE if the corpse has special timing; + lizards and lichen don't rot, trolls and Riders auto-revive */ +#define special_corpse(num) \ + (((num) == PM_LIZARD || (num) == PM_LICHEN) \ + || (mons[num].mlet == S_TROLL || is_rider(&mons[num]))) -/* +/* mkcorpstat: make a corpse or statue; never returns Null. + * * OEXTRA note: Passing mtmp causes mtraits to be saved * even if ptr passed as well, but ptr is always used for * the corpse type (corpsenm). That allows the corpse type @@ -1523,40 +1528,39 @@ struct permonst *ptr; int x, y; unsigned corpstatflags; { - register struct obj *otmp; + struct obj *otmp; boolean init = ((corpstatflags & CORPSTAT_INIT) != 0); if (objtype != CORPSE && objtype != STATUE) impossible("making corpstat type %d", objtype); if (x == 0 && y == 0) { /* special case - random placement */ otmp = mksobj(objtype, init, FALSE); - if (otmp) - (void) rloco(otmp); - } else + (void) rloco(otmp); + } else { otmp = mksobj_at(objtype, x, y, init, FALSE); - if (otmp) { - if (mtmp) { - struct obj *otmp2; + } - if (!ptr) - ptr = mtmp->data; - /* save_mtraits frees original data pointed to by otmp */ - otmp2 = save_mtraits(otmp, mtmp); - if (otmp2) - otmp = otmp2; - } - /* use the corpse or statue produced by mksobj() as-is - unless `ptr' is non-null */ - if (ptr) { - int old_corpsenm = otmp->corpsenm; + /* when 'mtmp' is non-null save the monster's details with the + corpse or statue; it will also force the 'ptr' override below */ + if (mtmp) { + /* save_mtraits updates otmp->oextra->omonst in place */ + (void) save_mtraits(otmp, mtmp); - otmp->corpsenm = monsndx(ptr); - otmp->owt = weight(otmp); - if (otmp->otyp == CORPSE && (special_corpse(old_corpsenm) - || special_corpse(otmp->corpsenm))) { - obj_stop_timers(otmp); - start_corpse_timeout(otmp); - } + if (!ptr) + ptr = mtmp->data; + } + + /* when 'ptr' is non-null it comes from our caller or from 'mtmp'; + override mkobjs()'s initialization of a random monster type */ + if (ptr) { + int old_corpsenm = otmp->corpsenm; + + otmp->corpsenm = monsndx(ptr); + otmp->owt = weight(otmp); + if (otmp->otyp == CORPSE && (special_corpse(old_corpsenm) + || special_corpse(otmp->corpsenm))) { + obj_stop_timers(otmp); + start_corpse_timeout(otmp); } } return otmp; @@ -1574,15 +1578,14 @@ int corpse_revive_type(obj) struct obj *obj; { - int revivetype; + int revivetype = obj->corpsenm; struct monst *mtmp; - if (has_omonst(obj) - && ((mtmp = get_mtraits(obj, FALSE)) != (struct monst *) 0)) { + + if (has_omonst(obj) && ((mtmp = get_mtraits(obj, FALSE)) != 0)) { /* mtmp is a temporary pointer to a monster's stored attributes, not a real monster */ revivetype = mtmp->mnum; - } else - revivetype = obj->corpsenm; + } return revivetype; } @@ -1658,26 +1661,29 @@ boolean copyof; return mnew; } -/* make an object named after someone listed in the scoreboard file */ +/* make an object named after someone listed in the scoreboard file; + never returns Null */ struct obj * mk_tt_object(objtype, x, y) int objtype; /* CORPSE or STATUE */ -register int x, y; +int x, y; { - register struct obj *otmp, *otmp2; + struct obj *otmp; boolean initialize_it; /* player statues never contain books */ initialize_it = (objtype != STATUE); - if ((otmp = mksobj_at(objtype, x, y, initialize_it, FALSE)) != 0) { - /* tt_oname will return null if the scoreboard is empty */ - if ((otmp2 = tt_oname(otmp)) != 0) - otmp = otmp2; - } + otmp = mksobj_at(objtype, x, y, initialize_it, FALSE); + /* tt_oname() will return null if the scoreboard is empty; + assigning an object name used to allocate a new obj but + doesn't any more so we can safely ignore the return value */ + (void) tt_oname(otmp); + return otmp; } -/* make a new corpse or statue, uninitialized if a statue (i.e. no books) */ +/* make a new corpse or statue, uninitialized if a statue (i.e. no books); + never returns Null */ struct obj * mk_named_object(objtype, ptr, x, y, nm) int objtype; /* CORPSE or STATUE */ @@ -1686,8 +1692,8 @@ int x, y; const char *nm; { struct obj *otmp; - unsigned corpstatflags = - (objtype != STATUE) ? CORPSTAT_INIT : CORPSTAT_NONE; + unsigned corpstatflags = (objtype != STATUE) ? CORPSTAT_INIT + : CORPSTAT_NONE; otmp = mkcorpstat(objtype, (struct monst *) 0, ptr, x, y, corpstatflags); if (nm) diff --git a/src/options.c b/src/options.c index 2ba829eb1..6d95f02a7 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 options.c $NHDT-Date: 1567240693 2019/08/31 08:38:13 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.369 $ */ +/* NetHack 3.6 options.c $NHDT-Date: 1571347977 2019/10/17 21:32:57 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.379 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -803,8 +803,9 @@ initoptions_init() iflags.wc_align_message = ALIGN_TOP; iflags.wc_align_status = ALIGN_BOTTOM; - /* these are currently only used by curses */ + /* used by tty and curses */ iflags.wc2_statuslines = 2; + /* only used by curses */ iflags.wc2_windowborders = 2; /* 'Auto' */ /* since this is done before init_objects(), do partial init here */ @@ -5268,8 +5269,8 @@ boolean setinitial, setfromfile; MENU_UNSELECTED); for (i = 0; i < numapes && ape; i++) { any.a_void = (opt_idx == 1) ? 0 : ape; - /* length of pattern plus quotes (plus '<'/'>') is less than - BUFSZ */ + /* length of pattern plus quotes (plus '<'/'>') is + less than BUFSZ */ Sprintf(apebuf, "\"%c%s\"", ape->grab ? '<' : '>', ape->pattern); add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, apebuf, @@ -5315,18 +5316,27 @@ boolean setinitial, setfromfile; g.symset[which_set].name = symset_name; if (res && g.symset_list) { - int thissize, biggest = 0; + int thissize, + biggest = (int) (sizeof "Default Symbols" - sizeof ""), + big_desc = 0; for (sl = g.symset_list; sl; sl = sl->next) { /* check restrictions */ if (rogueflag ? sl->primary : sl->rogue) continue; +#ifndef MAC_GRAPHICS_ENV + if (sl->handling == H_MAC) + continue; +#endif setcount++; /* find biggest name */ thissize = sl->name ? (int) strlen(sl->name) : 0; if (thissize > biggest) biggest = thissize; + thissize = sl->desc ? (int) strlen(sl->desc) : 0; + if (thissize > big_desc) + big_desc = thissize; } if (!setcount) { pline("There are no appropriate %s symbol sets available.", @@ -5334,10 +5344,48 @@ boolean setinitial, setfromfile; return TRUE; } - Sprintf(fmtstr, "%%-%ds %%s", biggest + 5); + Sprintf(fmtstr, "%%-%ds %%s", biggest + 2); tmpwin = create_nhwindow(NHW_MENU); start_menu(tmpwin); any = cg.zeroany; +#ifdef CURSES_GRAPHICS /* this ought to be handled within curses... */ + /* + * Symbol sets are formatted in two columns, "name description", + * on selectable lines. curses bases menu width on the length + * of non-selectable lines (main header, separators if present, + * with trailing spaces ignored) and defaults to half the map. + * Without something like this separator (shown after the menu + * title and a blank line which follows that) to force a wider + * menu, entries with long descriptions wrap. That would be + * ok if wrapping operated on the same two columns, but the + * menu doesn't know anything about those and the description + * is wrapping into the next line's name column, making long + * descriptions--and menus containing them--hard to read. + */ + if (WINDOWPORT("curses")) { + char tmp1[BUFSZ], tmp2[BUFSZ], bigbuf[BUFSZ + 1 + BUFSZ]; + + /* 4: room for space+letter+paren+space, fake selector; + 2: added to 'biggest' when constructing 'fmtstr'; + 1: space between symset name+2 and symset description */ + if (4 + biggest + 2 + 1 > (int) sizeof tmp1 - 1) + biggest = (int) sizeof tmp1 - 1 - (4 + 2 + 1); + (void) memset((genericptr_t) tmp1, '-', biggest); + tmp1[biggest] = '\0'; + if (big_desc > (int) sizeof tmp2 - 1) + big_desc = (int) sizeof tmp2 - 1; + (void) memset((genericptr_t) tmp2, '-', big_desc); + tmp2[big_desc] = '\0'; + Sprintf(bigbuf, "%4s", ""); + Sprintf(eos(bigbuf), fmtstr, tmp1, tmp2); + bigbuf[BUFSZ - 1] = '\0'; + any.a_int = 0; + add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, + bigbuf, MENU_UNSELECTED); + } +#else + nhUse(big_desc); +#endif any.a_int = 1; add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "Default Symbols", MENU_UNSELECTED); @@ -5346,6 +5394,10 @@ boolean setinitial, setfromfile; /* check restrictions */ if (rogueflag ? sl->primary : sl->rogue) continue; +#ifndef MAC_GRAPHICS_ENV + if (sl->handling == H_MAC) + continue; +#endif if (sl->name) { any.a_int = sl->idx + 2; diff --git a/src/priest.c b/src/priest.c index 08853e982..895443c92 100644 --- a/src/priest.c +++ b/src/priest.c @@ -118,6 +118,8 @@ pick_move: } if (nix != omx || niy != omy) { + if (MON_AT(nix, niy)) + return 0; remove_monster(omx, omy); place_monster(mtmp, nix, niy); newsym(nix, niy); diff --git a/src/sounds.c b/src/sounds.c index 614cba6ca..3c5ac261a 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 sounds.c $NHDT-Date: 1542765362 2018/11/21 01:56:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.81 $ */ +/* NetHack 3.6 sounds.c $NHDT-Date: 1570844005 2019/10/12 01:33:25 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.83 $ */ /* Copyright (c) 1989 Janet Walz, Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ @@ -496,7 +496,7 @@ register struct monst *mtmp; *verbl_msg = 0, /* verbalize() */ *verbl_msg_mcan = 0; /* verbalize() if cancelled */ struct permonst *ptr = mtmp->data; - int msound = ptr->msound; + int msound = ptr->msound, gnomeplan = 0; /* presumably nearness and sleep checks have already been made */ if (Deaf) @@ -512,8 +512,9 @@ register struct monst *mtmp; msound = mons[genus(monsndx(ptr), 1)].msound; /* some normally non-speaking types can/will speak if hero is similar */ else if (msound == MS_ORC /* note: MS_ORC is same as MS_GRUNT */ - && (same_race(ptr, g.youmonst.data) /* current form, */ - || same_race(ptr, &mons[Race_switch]))) /* unpoly'd form */ + && ((same_race(ptr, g.youmonst.data) /* current form, */ + || same_race(ptr, &mons[Race_switch])) /* unpoly'd form */ + || Hallucination)) msound = MS_HUMANOID; /* silliness, with slight chance to interfere with shopping */ else if (Hallucination && mon_is_gecko(mtmp)) @@ -588,13 +589,14 @@ register struct monst *mtmp; } else verbl_msg = "I only drink... potions."; } else { - int vampindex; static const char *const vampmsg[] = { /* These first two (0 and 1) are specially handled below */ "I vant to suck your %s!", "I vill come after %s without regret!", /* other famous vampire quotes can follow here if desired */ }; + int vampindex; + if (kindred) verbl_msg = "This is my hunting ground that you dare to prowl!"; @@ -803,6 +805,18 @@ register struct monst *mtmp; pline_msg = "talks about spellcraft."; else if (ptr->mlet == S_CENTAUR) pline_msg = "discusses hunting."; + else if (is_gnome(ptr) && Hallucination && (gnomeplan = rn2(4)) % 2) + /* skipped for rn2(4) result of 0 or 2; + gag from an early episode of South Park called "Gnomes"; + initially, Tweek (introduced in that episode) is the only + one aware of the tiny gnomes after spotting them sneaking + about; they are embarked upon a three-step business plan; + a diagram of the plan shows: + Phase 1 Phase 2 Phase 3 + Collect underpants ? Profit + and they never verbalize step 2 so we don't either */ + verbl_msg = (gnomeplan == 1) ? "Phase one, collect underpants." + : "Phase three, profit!"; else switch (monsndx(ptr)) { case PM_HOBBIT: diff --git a/src/trap.c b/src/trap.c index 12313d191..fe166f464 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1827,7 +1827,6 @@ int style; g.bhitpos.x += dx; g.bhitpos.y += dy; - t = t_at(g.bhitpos.x, g.bhitpos.y); if ((mtmp = m_at(g.bhitpos.x, g.bhitpos.y)) != 0) { if (otyp == BOULDER && throws_rocks(mtmp->data)) { @@ -1862,7 +1861,7 @@ int style; break; } } - if (t && otyp == BOULDER) { + if ((t = t_at(g.bhitpos.x, g.bhitpos.y)) != 0 && otyp == BOULDER) { switch (t->ttyp) { case LANDMINE: if (rn2(10) > 2) { @@ -2155,6 +2154,7 @@ register struct monst *mtmp; inescapable = g.force_mintrap || ((tt == HOLE || tt == PIT) && Sokoban && !trap->madeby_u); const char *fallverb; + xchar tx = trap->tx, ty = trap->ty; /* true when called from dotrap, inescapable is not an option */ if (mtmp == u.usteed) @@ -2637,7 +2637,7 @@ register struct monst *mtmp; trapkilled = TRUE; } /* a boulder may fill the new pit, crushing monster */ - fill_pit(trap->tx, trap->ty); + fill_pit(tx, ty); /* thitm may have already destroyed the trap */ if (DEADMONSTER(mtmp)) trapkilled = TRUE; if (unconscious()) { @@ -4325,8 +4325,8 @@ struct trap *ttmp; You("pull %s out of the pit.", mon_nam(mtmp)); mtmp->mtrapped = 0; - fill_pit(mtmp->mx, mtmp->my); reward_untrap(ttmp, mtmp); + fill_pit(mtmp->mx, mtmp->my); return 1; } diff --git a/src/vault.c b/src/vault.c index 1982a6271..06da2bbce 100644 --- a/src/vault.c +++ b/src/vault.c @@ -775,9 +775,10 @@ register struct monst *grd; if (!u_in_vault && (grd_in_vault || (in_fcorridor(grd, grd->mx, grd->my) && !in_fcorridor(grd, u.ux, u.uy)))) { - (void) rloc(grd, FALSE); + (void) rloc(grd, TRUE); wallify_vault(grd); - (void) clear_fcorr(grd, TRUE); + if (!in_fcorridor(grd, grd->mx, grd->my)) + (void) clear_fcorr(grd, TRUE); goto letknow; } if (!in_fcorridor(grd, grd->mx, grd->my)) diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c index dafbc8f44..3196f3b3d 100644 --- a/sys/share/unixtty.c +++ b/sys/share/unixtty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 unixtty.c $NHDT-Date: 1548372343 2019/01/24 23:25:43 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.25 $ */ +/* NetHack 3.6 unixtty.c $NHDT-Date: 1570652308 2019/10/09 20:18:28 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.26 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2006. */ /* NetHack may be freely redistributed. See license for details. */ @@ -243,6 +243,7 @@ const char *s; iflags.cbreak = (CBRKON(inittyb.cbrkflgs & CBRKMASK)) ? ON : OFF; curttyb.inputflags |= STRIPHI; setioctls(); + settty_needed = FALSE; } void @@ -471,6 +472,9 @@ VA_DECL(const char *, s) { VA_START(s); VA_INIT(s, const char *); + + if (iflags.window_inited) + exit_nhwindows((char *) 0); /* for tty, will call settty() */ if (settty_needed) settty((char *) 0); Vprintf(s, VA_ARGS); diff --git a/win/curses/cursinit.c b/win/curses/cursinit.c index 7d9144bb6..1b07395c6 100644 --- a/win/curses/cursinit.c +++ b/win/curses/cursinit.c @@ -782,17 +782,14 @@ curses_init_options() set_wc_option_mod_status(WC_ALIGN_MESSAGE | WC_ALIGN_STATUS, SET_IN_GAME); /* Remove a few options that are irrelevant to this windowport */ - /*set_option_mod_status("DECgraphics", SET_IN_FILE); */ set_option_mod_status("eight_bit_tty", SET_IN_FILE); - /* Make sure that DECgraphics is not set to true via the config - file, as this will cause display issues. We can't disable it in - options.c in case the game is compiled with both tty and curses. */ - if (!g.symset[PRIMARY].name - || !strcmpi(g.symset[PRIMARY].name, "DECgraphics")) { + /* If we don't have a symset defined, load the curses symset by default */ + if (!g.symset[PRIMARY].explicitly) load_symset("curses", PRIMARY); + if (!g.symset[ROGUESET].explicitly) load_symset("default", ROGUESET); - } + #ifdef PDCURSES /* PDCurses for SDL, win32 and OS/2 has the ability to set the terminal size programatically. If the user does not specify a @@ -819,6 +816,9 @@ curses_init_options() */ #endif /* PDCURSES */ + /* FIXME: this overrides explicit OPTIONS=!use_inverse */ + iflags.wc_inverse = TRUE; /* aka iflags.use_inverse; default is False */ + /* fix up pet highlighting */ if (iflags.wc2_petattr == -1) /* shouldn't happen */ iflags.wc2_petattr = A_NORMAL; diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index feadfe389..3561ddc1e 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -29,7 +29,8 @@ extern long curs_mesg_suppress_turn; /* from cursmesg.c */ /* Interface definition, for windows.c */ struct window_procs curses_procs = { "curses", - (WC_ALIGN_MESSAGE | WC_ALIGN_STATUS | WC_COLOR | WC_HILITE_PET + (WC_ALIGN_MESSAGE | WC_ALIGN_STATUS | WC_COLOR | WC_INVERSE + | WC_HILITE_PET #ifdef NCURSES_MOUSE_VERSION /* (this macro name works for PDCURSES too) */ | WC_MOUSE_SUPPORT #endif @@ -658,9 +659,9 @@ curses_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph, if ((special & MG_DETECT) && iflags.use_inverse) { attr = A_REVERSE; } - if (!g.symset[PRIMARY].name || !strcmpi(g.symset[PRIMARY].name, "curses")) { + if (SYMHANDLING(H_DEC)) ch = curses_convert_glyph(ch, glyph); - } + if (wid == NHW_MAP) { /* hilite stairs not in 3.6, yet if ((special & MG_STAIRS) && iflags.hilite_hidden_stairs) { @@ -673,6 +674,11 @@ curses_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph, else attr = A_REVERSE; } + /* water and lava look the same except for color; when color is off, + render lava in inverse video so that they look different */ + if ((special & MG_BW_LAVA) && iflags.use_inverse) { + attr = A_REVERSE; /* mapglyph() only sets this if color is off */ + } } curses_putch(wid, x, y, ch, color, attr); diff --git a/win/curses/cursmisc.c b/win/curses/cursmisc.c index e82039841..c31e3a385 100644 --- a/win/curses/cursmisc.c +++ b/win/curses/cursmisc.c @@ -74,7 +74,7 @@ curses_read_char() #ifdef KEY_RESIZE /* Handle resize events via get_nh_event, not this code */ if (ch == KEY_RESIZE) { - ch = '\033'; /* NetHack doesn't know what to do with KEY_RESIZE */ + ch = C('r'); /* NetHack doesn't know what to do with KEY_RESIZE */ } #endif @@ -463,62 +463,121 @@ curses_is_text(winid wid) } } - -/* Replace certain characters with portable drawing characters if -cursesgraphics option is enabled */ - +/* convert nethack's DECgraphics encoding into curses' ACS encoding */ int curses_convert_glyph(int ch, int glyph) { - int symbol; + /* The DEC line drawing characters use 0x5f through 0x7e instead + of the much more straightforward 0x60 through 0x7f, possibly + because 0x7f is effectively a control character (Rubout); + nethack ORs 0x80 to flag line drawing--that's stripped below */ + static int decchars[33]; /* for chars 0x5f through 0x7f (95..127) */ + ch &= 0xff; /* 0..255 only */ + if (!(ch & 0x80)) + return ch; /* no conversion needed */ + + /* this conversion routine is only called for SYMHANDLING(H_DEC) and + we decline to support special graphics symbols on the rogue level */ if (Is_rogue_level(&u.uz)) { + /* attempting to use line drawing characters will end up being + rendered as lowercase gibberish */ + ch &= ~0x80; return ch; } - /* Save some processing time by returning if the glyph represents - an object that we don't have custom characters for */ - if (!glyph_is_cmap(glyph)) { - return ch; + /* + * Curses has complete access to all characters that DECgraphics uses. + * However, their character value isn't consistent between terminals + * and implementations. For actual DEC terminals and faithful emulators, + * line-drawing characters are specified as lowercase letters (mostly) + * and a control code is sent to the terminal telling it to switch + * character sets (that's how the tty interface handles them). + * Curses remaps the characters instead. + */ + + /* one-time initialization; some ACS_x aren't compile-time constant */ + if (!decchars[0]) { + /* [0] is non-breakable space; irrelevant to nethack */ + decchars[0x5f - 0x5f] = ' '; /* NBSP */ + decchars[0x60 - 0x5f] = ACS_DIAMOND; /* [1] solid diamond */ + decchars[0x61 - 0x5f] = ACS_CKBOARD; /* [2] checkerboard */ + /* several "line drawing" characters are two-letter glyphs + which could be substituted for invisible control codes; + nethack's DECgraphics doesn't use any of them so we're + satisfied with conversion to a simple letter; + [3] "HT" as one char, with small raised upper case H over + and/or preceding small lowered upper case T */ + decchars[0x62 - 0x5f] = 'H'; /* "HT" (horizontal tab) */ + decchars[0x63 - 0x5f] = 'F'; /* "FF" as one char (form feed) */ + decchars[0x64 - 0x5f] = 'C'; /* "CR" as one (carriage return) */ + decchars[0x65 - 0x5f] = 'L'; /* [6] "LF" as one (line feed) */ + decchars[0x66 - 0x5f] = ACS_DEGREE; /* small raised circle */ + /* [8] plus or minus sign, '+' with horizontal line below */ + decchars[0x67 - 0x5f] = ACS_PLMINUS; + decchars[0x68 - 0x5f] = 'N'; /* [9] "NL" as one char (new line) */ + decchars[0x69 - 0x5f] = 'V'; /* [10] "VT" as one (vertical tab) */ + decchars[0x6a - 0x5f] = ACS_LRCORNER; /* lower right corner */ + decchars[0x6b - 0x5f] = ACS_URCORNER; /* upper right corner, 7-ish */ + decchars[0x6c - 0x5f] = ACS_ULCORNER; /* upper left corner */ + decchars[0x6d - 0x5f] = ACS_LLCORNER; /* lower left corner, 'L' */ + /* [15] center cross, like big '+' sign */ + decchars[0x6e - 0x5f] = ACS_PLUS; + decchars[0x6f - 0x5f] = ACS_S1; /* very high horizontal line */ + decchars[0x70 - 0x5f] = ACS_S3; /* medium high horizontal line */ + decchars[0x71 - 0x5f] = ACS_HLINE; /* centered horizontal line */ + decchars[0x72 - 0x5f] = ACS_S7; /* medium low horizontal line */ + decchars[0x73 - 0x5f] = ACS_S9; /* very low horizontal line */ + /* [21] left tee, 'H' with right-hand vertical stroke removed; + note on left vs right: the ACS name (also DEC's terminal + documentation) refers to vertical bar rather than cross stroke, + nethack's left/right refers to direction of the cross stroke */ + decchars[0x74 - 0x5f] = ACS_LTEE; /* ACS left tee, NH right tee */ + /* [22] right tee, 'H' with left-hand vertical stroke removed */ + decchars[0x75 - 0x5f] = ACS_RTEE; /* ACS right tee, NH left tee */ + /* [23] bottom tee, '+' with lower half of vertical stroke + removed and remaining stroke pointed up (unside-down 'T'); + nethack is inconsistent here--unlike with left/right, its + bottom/top directions agree with ACS */ + decchars[0x76 - 0x5f] = ACS_BTEE; /* bottom tee, stroke up */ + /* [24] top tee, '+' with upper half of vertical stroke removed */ + decchars[0x77 - 0x5f] = ACS_TTEE; /* top tee, stroke down, 'T' */ + decchars[0x78 - 0x5f] = ACS_VLINE; /* centered vertical line */ + decchars[0x79 - 0x5f] = ACS_LEQUAL; /* less than or equal to */ + /* [27] greater than or equal to, '>' with underscore */ + decchars[0x7a - 0x5f] = ACS_GEQUAL; + /* [28] Greek pi ('n'-like; case is ambiguous: small size + suggests lower case but flat top suggests upper case) */ + decchars[0x7b - 0x5f] = ACS_PI; + /* [29] not equal sign, combination of '=' and '/' */ + decchars[0x7c - 0x5f] = ACS_NEQUAL; + /* [30] British pound sign (curly 'L' with embellishments) */ + decchars[0x7d - 0x5f] = ACS_STERLING; + decchars[0x7e - 0x5f] = ACS_BULLET; /* [31] centered dot */ + /* [32] is not used for DEC line drawing but is a potential + value for someone who assumes that 0x60..0x7f is the valid + range, so we're prepared to accept--and sanitize--it */ + decchars[0x7f - 0x5f] = '?'; } - symbol = glyph_to_cmap(glyph); + /* high bit set means special handling */ + if (ch & 0x80) { + int convindx, symbol; - /* If user selected a custom character for this object, don't - override this. */ - if (((glyph_is_cmap(glyph)) && (ch != g.showsyms[symbol]))) { - return ch; - } - - switch (symbol) { - case S_vwall: - return ACS_VLINE; - case S_hwall: - return ACS_HLINE; - case S_tlcorn: - return ACS_ULCORNER; - case S_trcorn: - return ACS_URCORNER; - case S_blcorn: - return ACS_LLCORNER; - case S_brcorn: - return ACS_LRCORNER; - case S_crwall: - return ACS_PLUS; - case S_tuwall: - return ACS_BTEE; - case S_tdwall: - return ACS_TTEE; - case S_tlwall: - return ACS_RTEE; - case S_trwall: - return ACS_LTEE; - case S_tree: - return ACS_PLMINUS; - case S_corr: - return ACS_CKBOARD; - case S_litcorr: - return ACS_CKBOARD; + ch &= ~0x80; /* force plain ASCII for last resort */ + convindx = ch - 0x5f; + /* if it's in the lower case block of ASCII (which includes + a few punctuation characters), use the conversion table */ + if (convindx >= 0 && convindx < SIZE(decchars)) { + ch = decchars[convindx]; + /* in case ACS_foo maps to 0 when current terminal is unable + to handle a particular character; if so, revert to default + rather than using DECgr value with high bit stripped */ + if (!ch) { + symbol = glyph_to_cmap(glyph); + ch = (int) defsyms[symbol].sym; + } + } } return ch;