Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 113224 | Differences between
and this patch

Collapse All | Expand All

(-)nethack-3.4.3/README.menucolor (+102 lines)
Line 0 Link Here
1
2
   This is version 1.4 of the menucolors patch.
3
4
   This patch allows the user to define in what color menus are shown.
5
   For example, putting
6
7
   OPTIONS=menucolors
8
   MENUCOLOR=" blessed "=green
9
   MENUCOLOR=" holy "=green
10
   MENUCOLOR=" cursed "=red
11
   MENUCOLOR=" unholy "=red
12
   MENUCOLOR=" cursed .* (being worn)"=orange&underline
13
14
   in the configuration file makes all known blessed items
15
   show up in green, all cursed items show up in red and
16
   all cursed worn items show up in orange and underlined
17
   when viewing inventory.
18
19
   If you have regex.h but it is not GNU (e.g. DJGPP, *BSD), uncomment
20
   #define MENU_COLOR_REGEX_POSIX in include/config.h
21
22
   If you do not have regex.h, comment
23
   #define MENU_COLOR_REGEX out from include/config.h
24
   and replace the MENUCOLOR lines in your config file with these:
25
26
   MENUCOLOR="* blessed *"=green
27
   MENUCOLOR="* holy *"=green
28
   MENUCOLOR="* cursed *"=red
29
   MENUCOLOR="* unholy *"=red
30
   MENUCOLOR="* cursed * (being worn)"=orange&underline
31
32
33
   Colors: black, red, green, brown, blue, magenta, cyan, gray, orange,
34
           lightgreen, yellow, lightblue, lightmagenta, lightcyan, white.
35
   Attributes: none, bold, dim, underline, blink, inverse.
36
37
   Note that the terminal is free to interpret the attributes however
38
   it wants.
39
40
41
   TODO/BUGS:
42
43
    o Only works with TTY
44
    o You can't use '=' or '&' in the match-string.
45
    o Maybe add color-field to tty_menu_item in include/wintty.h
46
      (so there's no need to find the color for the line again)
47
    o Guidebook is not up to date
48
    o Better place to put the functions, colornames[] and attrnames[]?
49
    o Some menus do not need coloring; maybe add new parameter
50
      to process_menu_window()?
51
52
53
   FIXES:
54
55
   v1.4:
56
    o Option to use standard instead of GNU regex functions.
57
58
   v1.3:
59
    o Updated to use 3.4.3 codebase.
60
    o Added a text to #version to show menucolors is compiled in.
61
62
   v1.2:
63
    o Updated to use 3.4.2 codebase.
64
65
   v1.1:
66
    o Updated to use 3.4.1 codebase.
67
    o replaced USE_REGEX_MATCH with MENU_COLOR_REGEX
68
69
   v1.04:
70
    o Oops! 1.03 worked only on *nixes... (GNU regex.h)
71
    o Compile-time option USE_REGEX_MATCH: if it's defined, use regex,
72
      otherwise use globbing. ('?' and '*' wildcards)
73
74
   v1.03:
75
76
    o Now using Nethack 3.4.0 codebase
77
    o Compile-time option MENU_COLOR
78
    o Strings match using regular expressions instead of globbing
79
    o You can use attribute with color (attr must come after '&')
80
    o Use ``MENUCOLOR="foo"=color'' instead of ``OPTIONS=menucolor=...''
81
      (Both work, but OPTIONS complains if you define menucolor
82
      more than once)
83
84
   v1.02:
85
86
    o Should now work with OS/2, thanks to Jukka Lahtinen
87
    o Strings match now using simple globbing. ('?' and '*' wildcards)
88
89
   v1.01:
90
91
    o Moved 'menucolors' boolean option, so now the options-menu
92
      is in alphabetical order.
93
    o Fixed 'menucolor' description in dat/opthelp.
94
    o menu_colorings is now initialized to null in src/decl.c.
95
96
   v1.0:
97
98
    o Initial release
99
100
--
101
 Pasi Kallinen
102
 pkalli@cs.joensuu.fi
(-)nethack-3.4.3/README.statuscolors (+57 lines)
Line 0 Link Here
1
Statuscolors is a patch for Nethack (version 3.4.3) that attempts to generalize
2
the hpmon patch to be more like the menucolors patch. Unlike menucolors, it
3
does not use regexps. Instead, it provides the following options:
4
5
To enable statuscolors:
6
    OPTIONS=statuscolors
7
8
To specify statuscolor options, write:
9
    STATUSCOLOR=<option>,<option>
10
11
Numeric options have the format <field>%<max-percent>:<color-option>. For
12
example:
13
    STATUSCOLOR=hp%15:red&bold,pw%100=green
14
15
Text options have the format <text>:<color-option>. Text is case-insensitive.
16
For example:
17
    STATUSCOLOR=hallu:orange,foodpois:red&inverse&blink
18
19
A color option is a <color> followed by an optional sequence of &<attr>. Color
20
and attribute names are case insensitive. Valid colors are:
21
    black blue brown cyan gray green lightblue lightcyan lightgreen
22
    lightmagenta magenta none orange red white yellow
23
24
Valid attributes are:
25
    blink bold dim inverse none underline
26
27
A reasonable set of defaults might be:
28
    # HP
29
    STATUSCOLOR=hp%100=green,hp%66=yellow,hp%50=orange
30
    STATUSCOLOR=hp%33=red&bold,hp%15:red&inverse,hp%0:red&inverse&blink
31
    # Pw
32
    STATUSCOLOR=pw%100=green,pw%66=yellow,pw%50:orange,pw%33=red&bold
33
    # Carry
34
    STATUSCOLOR=burdened:yellow,stressed:orange,strained:red&bold
35
    STATUSCOLOR=overtaxed:red&inverse,overloaded:red&inverse&blink
36
    # Hunger
37
    STATUSCOLOR=satiated:yellow,hungry:orange,weak:red&bold
38
    STATUSCOLOR=fainting:red&inverse,fainted:red&inverse&blink
39
    # Mental
40
    STATUSCOLOR=hallu:yellow,conf:orange,stun:red&bold
41
    # Health
42
    STATUSCOLOR=ill:red&inverse,foodpois:red&inverse,slime:red&inverse
43
    # Other
44
    STATUSCOLOR=held:red&inverse,blind:red&inverse
45
46
ChangeLog:
47
48
    v1.1:
49
      - Fixed several shameful bugs.
50
51
    v1.0:
52
      - Initial release.
53
54
---
55
Shachaf & Oren Ben-Kiki
56
shachaf+nethack@gmail.com
57
nethack-oren@ben-kiki.org
(-)nethack-3.4.3/dat/opthelp (+39 lines)
Lines 61-66 Link Here
61
Boolean option if MFLOPPY was set at compile time:
61
Boolean option if MFLOPPY was set at compile time:
62
checkspace check free disk space before writing files to disk     [TRUE]
62
checkspace check free disk space before writing files to disk     [TRUE]
63
Boolean option if PARANOID was set at compile time:
64
paranoid_hit   ask for explicit 'yes' when hitting peacefuls      [FALSE]
65
66
Boolean option if PARANOID was set at compile time:
67
paranoid_quit  ask for explicit 'yes' when quitting               [FALSE]
68
69
Boolean option if PARANOID was set at compile time:
70
paranoid_remove always show menu with the T and R commands        [FALSE]
71
72
Boolean option if SHOW_BORN was set at compile time:
73
showborn   show numbers of created monsters after the number
74
           vanquished                                             [FALSE]
75
63
Boolean option if EXP_ON_BOTL was set at compile time:
76
Boolean option if EXP_ON_BOTL was set at compile time:
64
showexp    display your accumulated experience points             [FALSE]
77
showexp    display your accumulated experience points             [FALSE]
Lines 71-76 Link Here
71
color      use different colors for objects on screen   [TRUE for micros]
84
color      use different colors for objects on screen   [TRUE for micros]
72
hilite_pet display pets in a highlighted manner                   [FALSE]
85
hilite_pet display pets in a highlighted manner                   [FALSE]
86
Boolean option if TEXTCOLOR and MENU_COLOR were set at compile time:
87
menucolors use different colors for menus               [TRUE for micros]
88
73
Boolean option if TIMED_DELAY was set at compile time (tty interface only):
89
Boolean option if TIMED_DELAY was set at compile time (tty interface only):
74
timed_delay    on unix and VMS, use a timer instead of sending
90
timed_delay    on unix and VMS, use a timer instead of sending
75
               extra screen output when attempting to pause for
91
               extra screen output when attempting to pause for
Lines 92-97 Link Here
92
boulder       override the default boulder symbol with another default: [`]
108
boulder       override the default boulder symbol with another default: [`]
93
disclose      the types of information you want offered at the end of the
109
disclose      the types of information you want offered at the end of the
94
              game  [ni na nv ng nc]
110
              game  [ni na nv ng nc]
111
dumpfile      the name of the file where to dump the disclosure information
112
              when the game ends (only if the patch has been compiled in)
113
              [none]
95
fruit         the name of a fruit you enjoy eating  [slime mold]
114
fruit         the name of a fruit you enjoy eating  [slime mold]
96
              (basically a whimsy which NetHack uses from time to time).
115
              (basically a whimsy which NetHack uses from time to time).
97
menustyle     user interface for selection of multiple objects:
116
menustyle     user interface for selection of multiple objects:
Lines 120-125 Link Here
120
scores        the parts of the score list you wish to see when the game ends
139
scores        the parts of the score list you wish to see when the game ends
121
              You choose a combination of top scores, scores around the top
140
              You choose a combination of top scores, scores around the top
122
              scores, and all of your own scores.  [!own/3 top/2 around]
141
              scores, and all of your own scores.  [!own/3 top/2 around]
142
sortloot      controls the sortloot patch [none]:
143
              full -- All pickup lists of items are sorted by item description
144
              loot -- When inventory letters are shown, has no effect.
145
                      Otherwise sorts by description
146
              none -- Works the traditional way, like without the patch
123
suppress_alert disable various version-specific warnings about changes
147
suppress_alert disable various version-specific warnings about changes
124
              in game play or the user interface, such as notification given
148
              in game play or the user interface, such as notification given
125
              for the 'Q' command that quitting is now done via #quit
149
              for the 'Q' command that quitting is now done via #quit
Lines 169-174 Link Here
169
           still denote your gender using the "male" and "female"
193
           still denote your gender using the "male" and "female"
170
           options, the "gender" option will take precedence.  [RANDOM]
194
           options, the "gender" option will take precedence.  [RANDOM]
171
horsename  the name of your first horse  [NONE]
195
horsename  the name of your first horse  [NONE]
196
menucolor  Set colors for menus. (menucolor:"regex_string"=color)
197
           If boolean option ``menucolors'' is true, menus will be shown
198
	   with different colors.
199
	   For example, setting ``menucolor:" blessed "=green'' shows
200
	   all lines in a menu with the text " blessed " in green.
201
	   The string is matched using regular expressions.
202
	   Valid values for the color are black, red, green, brown, blue,
203
	   magenta, cyan, gray, orange, lightgreen, yellow, lightblue,
204
	   lightmagenta, lightcyan and white.
205
	   You can define menucolor as many times as you wish; those
206
	   defined later will take precedence.
207
	   Instead of using this with OPTIONS, consider using
208
	   MENUCOLOR="regex_string"=color in the configuration file.
209
	   Setting menucolor has effect only if TEXTCOLOR and MENU_COLOR
210
	   were set at compile time.  [NONE]
172
menu_*     create single character accelerators for menu commands.  Below
211
menu_*     create single character accelerators for menu commands.  Below
173
           is a list of all commands.  Each is followed by a list of window-
212
           is a list of all commands.  Each is followed by a list of window-
174
           ports that implement them:  'x' is X11, 't' is tty, 'g' is Gem,
213
           ports that implement them:  'x' is X11, 't' is tty, 'g' is Gem,
(-)nethack-3.4.3/dat/wizhelp (+1 lines)
Lines 16-21 Link Here
16
#panic == panic test
16
#panic == panic test
17
#polyself == polymorph self
17
#polyself == polymorph self
18
#seenv == show seen vectors
18
#seenv == show seen vectors
19
#showkills == show numbers of monsters killed
19
#stats == show memory statistics
20
#stats == show memory statistics
20
#timeout == look at timeout queue
21
#timeout == look at timeout queue
21
#vision == show vision array
22
#vision == show vision array
(-)nethack-3.4.3/doc/Guidebook.mn (+31 lines)
Lines 1770-1775 Link Here
1770
.lp dogname
1770
.lp dogname
1771
Name your starting dog (ex. ``dogname:Fang'').
1771
Name your starting dog (ex. ``dogname:Fang'').
1772
Cannot be set with the `O' command.
1772
Cannot be set with the `O' command.
1773
.lp dumpfile
1774
The name of a file where the disclosure information is written when the
1775
game ends. You may use the macro %n that will be replaced with the name
1776
of your player character. The game must have write permissions to the
1777
directory where the file is written. Normally /tmp may be used for unix
1778
systems.
1773
.lp dungeon
1779
.lp dungeon
1774
Set the graphics symbols for displaying the dungeon
1780
Set the graphics symbols for displaying the dungeon
1775
(default \&``\ |--------||.-|++##.##<><>_|\e\e#{}.}..##\ #}'').
1781
(default \&``\ |--------||.-|++##.##<><>_|\e\e#{}.}..##\ #}'').
Lines 2027-2032 Link Here
2027
The value of this option should be a string containing the
2033
The value of this option should be a string containing the
2028
symbols for the various object types.  Any omitted types are filled in
2034
symbols for the various object types.  Any omitted types are filled in
2029
at the end from the previous order.
2035
at the end from the previous order.
2036
.lp paranoid_hit
2037
If true, asks you to type the word ``yes'' when hitting any peaceful
2038
monster, not just the letter ``y''.
2039
.lp paranoid_quit
2040
If true, asks you to type the word ``yes'' when quitting or entering
2041
Explore mode, not just the letter ``y''.
2042
.lp paranoid_remove
2043
If true, always show menu with the R and T commands even when there is
2044
only one item to remove or take off.
2030
.lp perm_invent
2045
.lp perm_invent
2031
If true, always display your current inventory in a window.  This only
2046
If true, always display your current inventory in a window.  This only
2032
makes sense for windowing system interfaces that implement this feature.
2047
makes sense for windowing system interfaces that implement this feature.
Lines 2088-2093 Link Here
2088
Control what parts of the score list you are shown at the end (ex.
2103
Control what parts of the score list you are shown at the end (ex.
2089
``scores:5 top scores/4 around my score/own scores'').  Only the first
2104
``scores:5 top scores/4 around my score/own scores'').  Only the first
2090
letter of each category (`t', `a', or `o') is necessary.
2105
letter of each category (`t', `a', or `o') is necessary.
2106
.lp showborn
2107
When the game ends, show the number of each monster created
2108
in the "Vanquished creatures" list, if it differs from the
2109
number of those monsters killed.
2091
.lp showexp
2110
.lp showexp
2092
Show your accumulated experience points on bottom line (default off).
2111
Show your accumulated experience points on bottom line (default off).
2093
.lp showrace
2112
.lp showrace
Lines 2098-2103 Link Here
2098
Show your approximate accumulated score on bottom line (default off).
2117
Show your approximate accumulated score on bottom line (default off).
2099
.lp "silent  "
2118
.lp "silent  "
2100
Suppress terminal beeps (default on).
2119
Suppress terminal beeps (default on).
2120
.lp sortloot
2121
Controls the behavior of the sortloot patch that sorts pickup lists for
2122
inventory and #loot commands and some others.
2123
The possible values are:
2124
.sd
2125
.si
2126
full - always sort the lists;
2127
loot - only sort the lists that don't use inventory
2128
       letters, like with the #loot and pickup commands;
2129
none - show lists the traditional way without sorting.
2130
.ei
2131
.ed
2101
.lp sortpack
2132
.lp sortpack
2102
Sort the pack contents by type when displaying inventory (default on).
2133
Sort the pack contents by type when displaying inventory (default on).
2103
.lp sound
2134
.lp sound
(-)nethack-3.4.3/doc/Guidebook.tex (+39 lines)
Lines 2209-2214 Link Here
2209
Name your starting dog (ex.\ ``{\tt dogname:Fang}'').
2209
Name your starting dog (ex.\ ``{\tt dogname:Fang}'').
2210
Cannot be set with the `{\tt O}' command.
2210
Cannot be set with the `{\tt O}' command.
2211
%.lp
2211
%.lp
2212
\item[\ib{dumpfile}]
2213
The name of a file where the disclosure information is written when the
2214
game ends. You may use the macro %n that will be replaced with the name
2215
of your player character. The game must have write permissions to the
2216
directory where the file is written. Normally /tmp may be used for unix
2217
systems.
2218
%.lp
2212
\item[\ib{dungeon}]
2219
\item[\ib{dungeon}]
2213
Set the graphics symbols for displaying the dungeon (default
2220
Set the graphics symbols for displaying the dungeon (default
2214
``\verb& |--------||.-|++##& \verb&.##<><>_|\\#{}.}..## #}&'').
2221
``\verb& |--------||.-|++##& \verb&.##<><>_|\\#{}.}..## #}&'').
Lines 2486-2491 Link Here
2486
containing the symbols for the various object types.  Any omitted types
2493
containing the symbols for the various object types.  Any omitted types
2487
are filled in at the end from the previous order.
2494
are filled in at the end from the previous order.
2488
%.lp
2495
%.lp
2496
\item[\ib{paranoid\_hit}]
2497
If true, asks you to type the word ``yes'' when hitting any peaceful
2498
monster, not just the letter ``y''.
2499
%.lp
2500
\item[\ib{paranoid\_quit}]
2501
If true, asks you to type the word ``yes'' when quitting or entering
2502
Explore mode, not just the letter ``y''.
2503
%.lp
2504
\item[\ib{paranoid\_remove}]
2505
If true, always show menu with the R and T commands even when there is
2506
only one item to remove or take off.
2507
%.lp
2489
\item[\ib{perm\_invent}]
2508
\item[\ib{perm\_invent}]
2490
If true, always display your current inventory in a window.  This only
2509
If true, always display your current inventory in a window.  This only
2491
makes sense for windowing system interfaces that implement this feature.
2510
makes sense for windowing system interfaces that implement this feature.
Lines 2559-2564 Link Here
2559
``{\tt scores:5top scores/4around my score/own scores}'').  Only the first
2578
``{\tt scores:5top scores/4around my score/own scores}'').  Only the first
2560
letter of each category (`{\tt t}', `{\tt a}' or `{\tt o}') is necessary.
2579
letter of each category (`{\tt t}', `{\tt a}' or `{\tt o}') is necessary.
2561
%.lp
2580
%.lp
2581
\item[\ib{showborn}]
2582
When the game ends, show the number of each monster created
2583
in the ``Vanquished creatures'' list, if it differs from the
2584
number of those monsters killed.
2585
%.lp
2562
\item[\ib{showexp}]
2586
\item[\ib{showexp}]
2563
Show your accumulated experience points on bottom line (default off).
2587
Show your accumulated experience points on bottom line (default off).
2564
%.lp
2588
%.lp
Lines 2573-2578 Link Here
2573
\item[\ib{silent}]
2597
\item[\ib{silent}]
2574
Suppress terminal beeps (default on).
2598
Suppress terminal beeps (default on).
2575
%.lp
2599
%.lp
2600
\item[\ib{sortloot}]
2601
Controls the behavior of the sortloot patch that sorts pickup lists for
2602
inventory and \#loot commands and some others.
2603
2604
The possible values are:
2605
%.sd
2606
%.si
2607
{\tt full} --- always sort the lists;\\
2608
{\tt loot} --- only sort the lists that don't use inventory
2609
       letters, like with the \#loot and pickup commands;\\
2610
{\tt none} --- show lists the traditional way without sorting.
2611
%.ei
2612
%.ed
2613
%.lp
2614
The default is 'none', the way an unpatched game works.
2576
\item[\ib{sortpack}]
2615
\item[\ib{sortpack}]
2577
Sort the pack contents by type when displaying inventory (default on).
2616
Sort the pack contents by type when displaying inventory (default on).
2578
%.lp
2617
%.lp
(-)nethack-3.4.3/doc/Guidebook.txt (+36 lines)
Lines 2274-2279 Link Here
2274
            Name  your  starting dog (ex. ``dogname:Fang'').  Cannot be set
2274
            Name  your  starting dog (ex. ``dogname:Fang'').  Cannot be set
2275
            with the `O' command.
2275
            with the `O' command.
2276
          dumpfile
2277
            The name of a file where the disclosure information is
2278
            written when the game ends. You may use the macro %n that
2279
            will be replaced with the name of your player character.
2280
            The game must have write permissions to the directory where
2281
            the file is written. Normally /tmp may be used for unixes.
2282
2276
          dungeon
2283
          dungeon
2277
            Set the graphics symbols for displaying  the  dungeon  (default
2284
            Set the graphics symbols for displaying  the  dungeon  (default
2278
            `` |--------||.-|++##.##<><>_|\\#{}.}..## #}'').   The  dungeon
2285
            `` |--------||.-|++##.##<><>_|\\#{}.}..## #}'').   The  dungeon
Lines 2607-2612 Link Here
2607
            Any  omitted  types  are filled in at the end from the previous
2614
            Any  omitted  types  are filled in at the end from the previous
2608
            order.
2615
            order.
2616
          paranoid_hit
2617
            If true, asks you to type the word ``yes'' when hitting any
2618
            peaceful monster, not just the letter ``y''.
2619
2620
          paranoid_quit
2621
            If true, asks you  to type the word ``yes'' when quitting or
2622
            entering Explore mode, not just the letter ``y''.
2623
2624
          paranoid_remove
2625
            If true, always show menu with the R and T commands even when
2626
            there is only one item to remove or take off.
2627
2609
          perm_invent
2628
          perm_invent
2610
            If true, always display your current  inventory  in  a  window.
2629
            If true, always display your current  inventory  in  a  window.
2611
            This  only makes sense for windowing system interfaces that im-
2630
            This  only makes sense for windowing system interfaces that im-
Lines 2693-2698 Link Here
2693
            Only the first letter of each category (`t', `a',  or  `o')  is
2712
            Only the first letter of each category (`t', `a',  or  `o')  is
2694
            necessary.
2713
            necessary.
2714
          showborn
2715
               When the game ends, show the number of each monster created
2716
               in the "Vanquished creatures" list, if it differs from the
2717
               number of those monsters killed.
2718
2695
          showexp
2719
          showexp
2696
            Show your accumulated experience points on bottom line (default
2720
            Show your accumulated experience points on bottom line (default
2697
            off).
2721
            off).
Lines 2723-2728 Link Here
2723
          silent
2747
          silent
2724
            Suppress terminal beeps (default on).
2748
            Suppress terminal beeps (default on).
2749
          sortloot
2750
            Controls the behavior of the sortloot patch that sorts
2751
            pickup lists for inventory and #loot commands and some
2752
            others.
2753
            The possible values are:
2754
2755
                 full - always sort the lists
2756
                 loot - only sort the lists that don't use inventory
2757
                        letters, like with the #loot and pickup commands
2758
                 none - show lists the traditional way without sorting
2759
            The default is 'none', the way an unpatched game works.
2760
2725
          sortpack
2761
          sortpack
2726
            Sort the pack contents by type when displaying  inventory  (de-
2762
            Sort the pack contents by type when displaying  inventory  (de-
2727
            fault on).
2763
            fault on).
(-)nethack-3.4.3/include/color.h (+41 lines)
Lines 5-10 Link Here
5
#ifndef COLOR_H
5
#ifndef COLOR_H
6
#define COLOR_H
6
#define COLOR_H
7
#ifdef MENU_COLOR
8
# ifdef MENU_COLOR_REGEX
9
#  include <regex.h>
10
# endif
11
#endif
12
7
/*
13
/*
8
 * The color scheme used is tailored for an IBM PC.  It consists of the
14
 * The color scheme used is tailored for an IBM PC.  It consists of the
9
 * standard 8 colors, folowed by their bright counterparts.  There are
15
 * standard 8 colors, folowed by their bright counterparts.  There are
Lines 49-52 Link Here
49
#define DRAGON_SILVER	CLR_BRIGHT_CYAN
55
#define DRAGON_SILVER	CLR_BRIGHT_CYAN
50
#define HI_ZAP		CLR_BRIGHT_BLUE
56
#define HI_ZAP		CLR_BRIGHT_BLUE
57
#ifdef MENU_COLOR
58
struct menucoloring {
59
# ifdef MENU_COLOR_REGEX
60
#  ifdef MENU_COLOR_REGEX_POSIX
61
    regex_t match;
62
#  else
63
    struct re_pattern_buffer match;
64
#  endif
65
# else
66
    char *match;
67
# endif
68
    int color, attr;
69
    struct menucoloring *next;
70
};
71
#endif /* MENU_COLOR */
72
73
#ifdef STATUS_COLORS
74
struct color_option {
75
    int color;
76
    int attr_bits;
77
};
78
79
struct percent_color_option {
80
	int percentage;
81
	struct color_option color_option;
82
	const struct percent_color_option *next;
83
};
84
85
struct text_color_option {
86
	const char *text;
87
	struct color_option color_option;
88
	const struct text_color_option *next;
89
};
90
#endif
91
51
#endif /* COLOR_H */
92
#endif /* COLOR_H */
(-)nethack-3.4.3/include/config.h (-6 / +23 lines)
Lines 169-176 Link Here
169
#ifdef UNIX
169
#ifdef UNIX
170
/* path and file name extension for compression program */
170
/* path and file name extension for compression program */
171
#define COMPRESS "/usr/bin/compress"	/* Lempel-Ziv compression */
171
#define COMPRESS "/bin/bzip2"	/* Lempel-Ziv compression */
172
#define COMPRESS_EXTENSION ".Z"		/* compress's extension */
172
#define COMPRESS_EXTENSION ".bz2"		/* compress's extension */
173
/* An example of one alternative you might want to use: */
173
/* An example of one alternative you might want to use: */
174
/* #define COMPRESS "/usr/local/bin/gzip" */	/* FSF gzip compression */
174
/* #define COMPRESS "/usr/local/bin/gzip" */	/* FSF gzip compression */
175
/* #define COMPRESS_EXTENSION ".gz" */		/* normal gzip extension */
175
/* #define COMPRESS_EXTENSION ".gz" */		/* normal gzip extension */
Lines 185-191 Link Here
185
 *	a tar-like file, thus making a neater installation.  See *conf.h
185
 *	a tar-like file, thus making a neater installation.  See *conf.h
186
 *	for detailed configuration.
186
 *	for detailed configuration.
187
 */
187
 */
188
/* #define DLB */	/* not supported on all platforms */
188
#define DLB 1	/* not supported on all platforms */
189
/*
189
/*
190
 *	Defining INSURANCE slows down level changes, but allows games that
190
 *	Defining INSURANCE slows down level changes, but allows games that
Lines 204-210 Link Here
204
 * otherwise it will be the current directory.
204
 * otherwise it will be the current directory.
205
 */
205
 */
206
# ifndef HACKDIR
206
# ifndef HACKDIR
207
#  define HACKDIR "/usr/games/lib/nethackdir"
207
#  define HACKDIR "GENTOO_HACKDIR"
208
# endif
208
# endif
209
/*
209
/*
Lines 300-306 Link Here
300
 * functions that have been macroized.
300
 * functions that have been macroized.
301
 */
301
 */
302
/* #define VISION_TABLES */ /* use vision tables generated at compile time */
302
#define VISION_TABLES 1 /* use vision tables generated at compile time */
303
#ifndef VISION_TABLES
303
#ifndef VISION_TABLES
304
# ifndef NO_MACRO_CPATH
304
# ifndef NO_MACRO_CPATH
305
#  define MACRO_CPATH	/* use clear_path macros instead of functions */
305
#  define MACRO_CPATH	/* use clear_path macros instead of functions */
Lines 338-344 Link Here
338
#endif
338
#endif
339
#define EXP_ON_BOTL	/* Show experience on bottom line */
339
#define EXP_ON_BOTL	/* Show experience on bottom line */
340
/* #define SCORE_ON_BOTL */	/* added by Gary Erickson (erickson@ucivax) */
340
#define SCORE_ON_BOTL  /* added by Gary Erickson (erickson@ucivax) */
341
/*
341
/*
342
 * Section 5:  EXPERIMENTAL STUFF
342
 * Section 5:  EXPERIMENTAL STUFF
Lines 348-356 Link Here
348
 * bugs left here.
348
 * bugs left here.
349
 */
349
 */
350
#define STATUS_COLORS
351
350
/*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
352
/*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
351
/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
353
/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
354
#define SHOW_BORN
355
#define SHOW_EXTINCT
356
#define DUMP_LOG
357
#define SORTLOOT
358
#define PARANOID
359
#define DYNKEY
360
#define MENU_COLOR
361
#define MENU_COLOR_REGEX
362
/* #define MENU_COLOR_REGEX_POSIX */
363
/* if MENU_COLOR_REGEX is defined, use regular expressions (regex.h,
364
 * GNU specific functions by default, POSIX functions with
365
 * MENU_COLOR_REGEX_POSIX).
366
 * otherwise use pmatch() to match menu color lines.
367
 * pmatch() provides basic globbing: '*' and '?' wildcards.
368
 */
352
/* End of Section 5 */
369
/* End of Section 5 */
353
#include "global.h"	/* Define everything else according to choices above */
370
#include "global.h"	/* Define everything else according to choices above */
(-)nethack-3.4.3/include/decl.h (+3 lines)
Lines 184-189 Link Here
184
E long done_money;
184
E long done_money;
185
#endif
185
#endif
186
E char killer_buf[BUFSZ];
186
E char killer_buf[BUFSZ];
187
#ifdef DUMP_LOG
188
E char dump_fn[];		/* dumpfile name (dump patch) */
189
#endif
187
E const char *configfile;
190
E const char *configfile;
188
E NEARDATA char plname[PL_NSIZ];
191
E NEARDATA char plname[PL_NSIZ];
189
E NEARDATA char dogname[];
192
E NEARDATA char dogname[];
(-)nethack-3.4.3/include/extern.h (+37 lines)
Lines 131-136 Link Here
131
E int FDECL(describe_level, (char *));
131
E int FDECL(describe_level, (char *));
132
E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P));
132
E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P));
133
E void NDECL(bot);
133
E void NDECL(bot);
134
#ifdef DUMP_LOG
135
E void FDECL(bot1str, (char *));
136
E void FDECL(bot2str, (char *));
137
#endif
134
/* ### cmd.c ### */
138
/* ### cmd.c ### */
Lines 166-171 Link Here
166
E int NDECL(extcmd_via_menu);
170
E int NDECL(extcmd_via_menu);
167
E void FDECL(enlightenment, (int));
171
E void FDECL(enlightenment, (int));
168
E void FDECL(show_conduct, (int));
172
E void FDECL(show_conduct, (int));
173
#ifdef DUMP_LOG
174
E void FDECL(dump_enlightenment, (int));
175
E void FDECL(dump_conduct, (int));
176
#endif
169
E int FDECL(xytod, (SCHAR_P,SCHAR_P));
177
E int FDECL(xytod, (SCHAR_P,SCHAR_P));
170
E void FDECL(dtoxy, (coord *,int));
178
E void FDECL(dtoxy, (coord *,int));
171
E int FDECL(movecmd, (CHAR_P));
179
E int FDECL(movecmd, (CHAR_P));
Lines 174-180 Link Here
174
E int FDECL(isok, (int,int));
182
E int FDECL(isok, (int,int));
175
E int FDECL(get_adjacent_loc, (const char *, const char *, XCHAR_P, XCHAR_P, coord *));
183
E int FDECL(get_adjacent_loc, (const char *, const char *, XCHAR_P, XCHAR_P, coord *));
176
E const char *FDECL(click_to_cmd, (int,int,int));
184
E const char *FDECL(click_to_cmd, (int,int,int));
185
#ifdef DYNKEY
186
E int FDECL(map_dkb, (char, char));
187
E char FDECL(keydesc2char, (char *));
188
E char FDECL(greadchar, (boolean));
189
#define readchar() greadchar(FALSE)
190
#else
177
E char NDECL(readchar);
191
E char NDECL(readchar);
192
#endif
178
#ifdef WIZARD
193
#ifdef WIZARD
179
E void NDECL(sanity_check);
194
E void NDECL(sanity_check);
180
#endif
195
#endif
Lines 281-286 Link Here
281
E void FDECL(row_refresh, (int,int,int));
296
E void FDECL(row_refresh, (int,int,int));
282
E void NDECL(cls);
297
E void NDECL(cls);
283
E void FDECL(flush_screen, (int));
298
E void FDECL(flush_screen, (int));
299
#ifdef DUMP_LOG
300
E void NDECL(dump_screen);
301
#endif
284
E int FDECL(back_to_glyph, (XCHAR_P,XCHAR_P));
302
E int FDECL(back_to_glyph, (XCHAR_P,XCHAR_P));
285
E int FDECL(zapdir_to_glyph, (int,int,int));
303
E int FDECL(zapdir_to_glyph, (int,int,int));
286
E int FDECL(glyph_at, (XCHAR_P,XCHAR_P));
304
E int FDECL(glyph_at, (XCHAR_P,XCHAR_P));
Lines 553-558 Link Here
553
#if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C)
571
#if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C)
554
E void FDECL(done, (int));
572
E void FDECL(done, (int));
555
E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P));
573
E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P));
574
#ifdef DUMP_LOG
575
E void FDECL(dump, (char *, char *));
576
E void FDECL(do_containerconts, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P));
577
#endif
556
E void FDECL(terminate, (int));
578
E void FDECL(terminate, (int));
557
E int NDECL(num_genocides);
579
E int NDECL(num_genocides);
Lines 790-795 Link Here
790
E char *FDECL(xprname, (struct obj *,const char *,CHAR_P,BOOLEAN_P,long,long));
812
E char *FDECL(xprname, (struct obj *,const char *,CHAR_P,BOOLEAN_P,long,long));
791
E int NDECL(ddoinv);
813
E int NDECL(ddoinv);
792
E char FDECL(display_inventory, (const char *,BOOLEAN_P));
814
E char FDECL(display_inventory, (const char *,BOOLEAN_P));
815
#ifdef DUMP_LOG
816
E char FDECL(dump_inventory, (const char *,BOOLEAN_P,BOOLEAN_P));
817
#endif
793
E int FDECL(display_binventory, (int,int,BOOLEAN_P));
818
E int FDECL(display_binventory, (int,int,BOOLEAN_P));
794
E struct obj *FDECL(display_cinventory,(struct obj *));
819
E struct obj *FDECL(display_cinventory,(struct obj *));
795
E struct obj *FDECL(display_minventory,(struct monst *,int,char *));
820
E struct obj *FDECL(display_minventory,(struct monst *,int,char *));
Lines 1360-1365 Link Here
1360
E boolean FDECL(not_fully_identified, (struct obj *));
1385
E boolean FDECL(not_fully_identified, (struct obj *));
1361
E char *FDECL(corpse_xname, (struct obj *,BOOLEAN_P));
1386
E char *FDECL(corpse_xname, (struct obj *,BOOLEAN_P));
1362
E char *FDECL(cxname, (struct obj *));
1387
E char *FDECL(cxname, (struct obj *));
1388
#ifdef SORTLOOT
1389
E char *FDECL(cxname2, (struct obj *));
1390
#endif
1363
E char *FDECL(killer_xname, (struct obj *));
1391
E char *FDECL(killer_xname, (struct obj *));
1364
E const char *FDECL(singular, (struct obj *,char *(*)(OBJ_P)));
1392
E const char *FDECL(singular, (struct obj *,char *(*)(OBJ_P)));
1365
E char *FDECL(an, (const char *));
1393
E char *FDECL(an, (const char *));
Lines 1401-1410 Link Here
1401
E void FDECL(set_wc_option_mod_status, (unsigned long, int));
1429
E void FDECL(set_wc_option_mod_status, (unsigned long, int));
1402
E void FDECL(set_wc2_option_mod_status, (unsigned long, int));
1430
E void FDECL(set_wc2_option_mod_status, (unsigned long, int));
1403
E void FDECL(set_option_mod_status, (const char *,int));
1431
E void FDECL(set_option_mod_status, (const char *,int));
1432
#ifdef DYNKEY
1433
E void FDECL(add_dkb, (char *, boolean));
1434
#endif
1404
#ifdef AUTOPICKUP_EXCEPTIONS
1435
#ifdef AUTOPICKUP_EXCEPTIONS
1405
E int FDECL(add_autopickup_exception, (const char *));
1436
E int FDECL(add_autopickup_exception, (const char *));
1406
E void NDECL(free_autopickup_exceptions);
1437
E void NDECL(free_autopickup_exceptions);
1407
#endif /* AUTOPICKUP_EXCEPTIONS */
1438
#endif /* AUTOPICKUP_EXCEPTIONS */
1439
#ifdef MENU_COLOR
1440
E boolean FDECL(add_menu_coloring, (char *));
1441
#endif /* MENU_COLOR */
1408
/* ### pager.c ### */
1442
/* ### pager.c ### */
Lines 2237-2242 Link Here
2237
E int NDECL(abon);
2271
E int NDECL(abon);
2238
E int NDECL(dbon);
2272
E int NDECL(dbon);
2239
E int NDECL(enhance_weapon_skill);
2273
E int NDECL(enhance_weapon_skill);
2274
#ifdef DUMP_LOG
2275
E void NDECL(dump_weapon_skill);
2276
#endif
2240
E void FDECL(unrestrict_weapon_skill, (int));
2277
E void FDECL(unrestrict_weapon_skill, (int));
2241
E void FDECL(use_skill, (int,int));
2278
E void FDECL(use_skill, (int,int));
2242
E void FDECL(add_weapon_skill, (int));
2279
E void FDECL(add_weapon_skill, (int));
(-)nethack-3.4.3/include/flag.h (+18 lines)
Lines 167-172 Link Here
167
	boolean  menu_tab_sep;	/* Use tabs to separate option menu fields */
167
	boolean  menu_tab_sep;	/* Use tabs to separate option menu fields */
168
	boolean  menu_requested; /* Flag for overloaded use of 'm' prefix
168
	boolean  menu_requested; /* Flag for overloaded use of 'm' prefix
169
				  * on some non-move commands */
169
				  * on some non-move commands */
170
	int	chargfx;	/* one of ASCII_GRAPHICS, DEC_GRAPHICS, IBM_GRAPHICS, MAC_GRAPHICS */
170
	uchar num_pad_mode;
171
	uchar num_pad_mode;
171
	int	menu_headings;	/* ATR for menu headings */
172
	int	menu_headings;	/* ATR for menu headings */
172
	int      purge_monsters;	/* # of dead monsters still on fmon list */
173
	int      purge_monsters;	/* # of dead monsters still on fmon list */
Lines 183-188 Link Here
183
	char prevmsg_window;	/* type of old message window to use */
184
	char prevmsg_window;	/* type of old message window to use */
184
	boolean  extmenu;	/* extended commands use menu interface */
185
	boolean  extmenu;	/* extended commands use menu interface */
185
#endif
186
#endif
187
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
188
	boolean use_status_colors; /* use color in status line; only if wc_color */
189
#endif
190
#ifdef MENU_COLOR
191
	boolean use_menu_color;	/* use color in menus; only if wc_color */
192
#endif
186
#ifdef MFLOPPY
193
#ifdef MFLOPPY
187
	boolean  checkspace;	/* check disk space before writing files */
194
	boolean  checkspace;	/* check disk space before writing files */
188
				/* (in iflags to allow restore after moving
195
				/* (in iflags to allow restore after moving
Lines 216-221 Link Here
216
	boolean lan_mail;	/* mail is initialized */
223
	boolean lan_mail;	/* mail is initialized */
217
	boolean lan_mail_fetched; /* mail is awaiting display */
224
	boolean lan_mail_fetched; /* mail is awaiting display */
218
#endif
225
#endif
226
#ifdef SHOW_BORN
227
	boolean show_born;	/* show numbers of created monsters */
228
#endif
229
#ifdef SORTLOOT
230
	char sortloot;          /* sort items to loot alphabetically */
231
#endif
232
#ifdef PARANOID
233
	boolean  paranoid_hit;  /* Ask for 'yes' when hitting peacefuls */
234
	boolean  paranoid_quit; /* Ask for 'yes' when quitting */
235
	boolean  paranoid_remove; /* Always show menu for 'T' and 'R' */
236
#endif
219
/*
237
/*
220
 * Window capability support.
238
 * Window capability support.
221
 */
239
 */
(-)nethack-3.4.3/include/func_tab.h (+8 lines)
Lines 5-10 Link Here
5
#ifndef FUNC_TAB_H
5
#ifndef FUNC_TAB_H
6
#define FUNC_TAB_H
6
#define FUNC_TAB_H
7
#ifdef DYNKEY
8
struct dkb_tab {
9
        char bound_char;
10
        char cmd_char;
11
};
12
#endif
13
7
struct func_tab {
14
struct func_tab {
8
	char f_char;
15
	char f_char;
9
	boolean can_if_buried;
16
	boolean can_if_buried;
Lines 19-23 Link Here
19
};
26
};
20
extern struct ext_func_tab extcmdlist[];
27
extern struct ext_func_tab extcmdlist[];
28
extern struct dkb_tab *dkblist;
21
#endif /* FUNC_TAB_H */
29
#endif /* FUNC_TAB_H */
(-)nethack-3.4.3/include/unixconf.h (-4 / +4 lines)
Lines 37-43 Link Here
37
#define NETWORK		/* if running on a networked system */
37
#define NETWORK		/* if running on a networked system */
38
			/* e.g. Suns sharing a playground through NFS */
38
			/* e.g. Suns sharing a playground through NFS */
39
/* #define SUNOS4 */	/* SunOS 4.x */
39
/* #define SUNOS4 */	/* SunOS 4.x */
40
/* #define LINUX */	/* Another Unix clone */
40
#define LINUX 1	/* Another Unix clone */
41
/* #define CYGWIN32 */	/* Unix on Win32 -- use with case sensitive defines */
41
/* #define CYGWIN32 */	/* Unix on Win32 -- use with case sensitive defines */
42
/* #define GENIX */	/* Yet Another Unix Clone */
42
/* #define GENIX */	/* Yet Another Unix Clone */
43
/* #define HISX */	/* Bull Unix for XPS Machines */
43
/* #define HISX */	/* Bull Unix for XPS Machines */
Lines 96-108 Link Here
96
 */
96
 */
97
/* #define NO_FILE_LINKS */	/* if no hard links */
97
/* #define NO_FILE_LINKS */	/* if no hard links */
98
/* #define LOCKDIR "/usr/games/lib/nethackdir" */	/* where to put locks */
98
#define LOCKDIR "GENTOO_STATEDIR"
99
/*
99
/*
100
 * If you want the static parts of your playground on a read-only file
100
 * If you want the static parts of your playground on a read-only file
101
 * system, define VAR_PLAYGROUND to be where the variable parts are kept.
101
 * system, define VAR_PLAYGROUND to be where the variable parts are kept.
102
 */
102
 */
103
/* #define VAR_PLAYGROUND "/var/lib/games/nethack" */
103
#define VAR_PLAYGROUND "GENTOO_STATEDIR"
104
/*
104
/*
Lines 132-138 Link Here
132
 * "extra output" method is used, but not all systems provide access to
132
 * "extra output" method is used, but not all systems provide access to
133
 * a fine-grained timer.
133
 * a fine-grained timer.
134
 */
134
 */
135
/* #define TIMED_DELAY */	/* usleep() */
135
#define TIMED_DELAY 1
136
#endif
136
#endif
137
/*
137
/*
(-)nethack-3.4.3/src/Makefile (-1 / +1 lines)
Lines 231-237 Link Here
231
# WINTTYLIB = -lcurses
231
# WINTTYLIB = -lcurses
232
# WINTTYLIB = -lcurses16
232
# WINTTYLIB = -lcurses16
233
# WINTTYLIB = -lncurses
233
# WINTTYLIB = -lncurses
234
WINTTYLIB = -ltermlib
234
WINTTYLIB = -lncurses
235
#
235
#
236
# libraries for X11
236
# libraries for X11
237
# If USE_XPM is defined in config.h, you will also need -lXpm here.
237
# If USE_XPM is defined in config.h, you will also need -lXpm here.
(-)nethack-3.4.3/src/botl.c (-16 / +215 lines)
Lines 34-39 Link Here
34
#define MAXCO (COLNO+20)
34
#define MAXCO (COLNO+20)
35
#endif
35
#endif
36
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
37
38
extern const struct percent_color_option *hp_colors;
39
extern const struct percent_color_option *pw_colors;
40
extern const struct text_color_option *text_colors;
41
42
struct color_option
43
text_color_of(text, color_options)
44
const char *text;
45
const struct text_color_option *color_options;
46
{
47
	if (color_options == NULL) {
48
		struct color_option result = {NO_COLOR, 0};
49
		return result;
50
	}
51
	if (strstri(color_options->text, text)
52
	 || strstri(text, color_options->text))
53
		return color_options->color_option;
54
	return text_color_of(text, color_options->next);
55
}
56
57
struct color_option
58
percentage_color_of(value, max, color_options)
59
int value, max;
60
const struct percent_color_option *color_options;
61
{
62
	if (color_options == NULL) {
63
		struct color_option result = {NO_COLOR, 0};
64
		return result;
65
	}
66
	if (100 * value <= color_options->percentage * max)
67
		return color_options->color_option;
68
	return percentage_color_of(value, max, color_options->next);
69
}
70
71
void
72
start_color_option(color_option)
73
struct color_option color_option;
74
{
75
	int i;
76
	if (color_option.color != NO_COLOR)
77
		term_start_color(color_option.color);
78
	for (i = 0; (1 << i) <= color_option.attr_bits; ++i)
79
		if (i != ATR_NONE && color_option.attr_bits & (1 << i))
80
			term_start_attr(i);
81
}
82
83
void
84
end_color_option(color_option)
85
struct color_option color_option;
86
{
87
	int i;
88
	if (color_option.color != NO_COLOR)
89
		term_end_color(color_option.color);
90
	for (i = 0; (1 << i) <= color_option.attr_bits; ++i)
91
		if (i != ATR_NONE && color_option.attr_bits & (1 << i))
92
			term_end_attr(i);
93
}
94
95
void
96
apply_color_option(color_option, newbot2)
97
struct color_option color_option;
98
const char *newbot2;
99
{
100
	if (!iflags.use_status_colors) return;
101
	curs(WIN_STATUS, 1, 1);
102
	start_color_option(color_option);
103
	putstr(WIN_STATUS, 0, newbot2);
104
	end_color_option(color_option);
105
}
106
107
void
108
add_colored_text(text, newbot2)
109
const char *text;
110
char *newbot2;
111
{
112
	char *nb;
113
	struct color_option color_option;
114
115
	if (*text == '\0') return;
116
117
	if (!iflags.use_status_colors) {
118
		Sprintf(nb = eos(newbot2), " %s", text);
119
                return;
120
        }
121
122
	Strcat(nb = eos(newbot2), " ");
123
	curs(WIN_STATUS, 1, 1);
124
	putstr(WIN_STATUS, 0, newbot2);
125
126
	Strcat(nb = eos(nb), text);
127
	curs(WIN_STATUS, 1, 1);
128
       	color_option = text_color_of(text, text_colors);
129
	start_color_option(color_option);
130
	putstr(WIN_STATUS, 0, newbot2);
131
	end_color_option(color_option);
132
}
133
134
#endif
135
36
#ifndef OVLB
136
#ifndef OVLB
37
STATIC_DCL int mrank_sz;
137
STATIC_DCL int mrank_sz;
38
#else /* OVLB */
138
#else /* OVLB */
Lines 165-174 Link Here
165
}
265
}
166
#endif
266
#endif
267
#ifdef DUMP_LOG
268
void bot1str(char *newbot1)
269
#else
167
STATIC_OVL void
270
STATIC_OVL void
168
bot1()
271
bot1()
272
#endif
169
{
273
{
274
#ifndef DUMP_LOG
170
	char newbot1[MAXCO];
275
	char newbot1[MAXCO];
276
#endif
171
	register char *nb;
277
	register char *nb;
172
	register int i,j;
278
	register int i,j;
Lines 215-220 Link Here
215
	if (flags.showscore)
321
	if (flags.showscore)
216
	    Sprintf(nb = eos(nb), " S:%ld", botl_score());
322
	    Sprintf(nb = eos(nb), " S:%ld", botl_score());
217
#endif
323
#endif
324
#ifdef DUMP_LOG
325
}
326
STATIC_OVL void
327
bot1()
328
{
329
	char newbot1[MAXCO];
330
331
	bot1str(newbot1);
332
#endif
218
	curs(WIN_STATUS, 1, 0);
333
	curs(WIN_STATUS, 1, 0);
219
	putstr(WIN_STATUS, 0, newbot1);
334
	putstr(WIN_STATUS, 0, newbot1);
220
}
335
}
Lines 242-269 Link Here
242
	return ret;
357
	return ret;
243
}
358
}
359
#ifdef DUMP_LOG
360
void bot2str(newbot2)
361
char* newbot2;
362
#else
244
STATIC_OVL void
363
STATIC_OVL void
245
bot2()
364
bot2()
365
#endif
246
{
366
{
367
#ifndef DUMP_LOG
247
	char  newbot2[MAXCO];
368
	char  newbot2[MAXCO];
369
#endif
248
	register char *nb;
370
	register char *nb;
249
	int hp, hpmax;
371
	int hp, hpmax;
250
	int cap = near_capacity();
372
	int cap = near_capacity();
373
#if defined(STATUS_COLORS) && defined(TEXTCOLOR) && !defined(DUMP_LOG)
374
	struct color_option color_option;
375
	int save_botlx = flags.botlx;
376
#endif
251
	hp = Upolyd ? u.mh : u.uhp;
377
	hp = Upolyd ? u.mh : u.uhp;
252
	hpmax = Upolyd ? u.mhmax : u.uhpmax;
378
	hpmax = Upolyd ? u.mhmax : u.uhpmax;
253
	if(hp < 0) hp = 0;
379
	if(hp < 0) hp = 0;
254
	(void) describe_level(newbot2);
380
	(void) describe_level(newbot2);
255
	Sprintf(nb = eos(newbot2),
381
	Sprintf(nb = eos(newbot2), "%c:%-2ld", oc_syms[COIN_CLASS],
256
		"%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[COIN_CLASS],
257
#ifndef GOLDOBJ
382
#ifndef GOLDOBJ
258
		u.ugold,
383
		u.ugold
259
#else
384
#else
260
		money_cnt(invent),
385
		money_cnt(invent)
261
#endif
386
#endif
262
		hp, hpmax, u.uen, u.uenmax, u.uac);
387
	       );
388
389
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
390
	Strcat(nb = eos(newbot2), " HP:");
391
	curs(WIN_STATUS, 1, 1);
392
	putstr(WIN_STATUS, 0, newbot2);
393
	flags.botlx = 0;
394
395
	Sprintf(nb = eos(nb), "%d(%d)", hp, hpmax);
396
	apply_color_option(percentage_color_of(hp, hpmax, hp_colors), newbot2);
397
#else
398
	Sprintf(nb = eos(nb), " HP:%d(%d)", hp, hpmax);
399
#endif
400
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
401
	Strcat(nb = eos(nb), " Pw:");
402
	curs(WIN_STATUS, 1, 1);
403
	putstr(WIN_STATUS, 0, newbot2);
404
	Sprintf(nb = eos(nb), "%d(%d)", u.uen, u.uenmax);
405
	apply_color_option(percentage_color_of(u.uen, u.uenmax, pw_colors), newbot2);
406
#else
407
	Sprintf(nb = eos(nb), " Pw:%d(%d)", u.uen, u.uenmax);
408
#endif
409
	Sprintf(nb = eos(nb), " AC:%-2d", u.uac);
263
	if (Upolyd)
410
	if (Upolyd)
264
		Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel);
411
		Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel);
265
#ifdef EXP_ON_BOTL
412
#ifdef EXP_ON_BOTL
Lines 275-299 Link Here
275
	if(flags.time)
422
	if(flags.time)
276
	    Sprintf(nb = eos(nb), " T:%ld", moves);
423
	    Sprintf(nb = eos(nb), " T:%ld", moves);
277
	if(strcmp(hu_stat[u.uhs], "        ")) {
424
	if(strcmp(hu_stat[u.uhs], "        "))
278
		Sprintf(nb = eos(nb), " ");
425
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
279
		Strcat(newbot2, hu_stat[u.uhs]);
426
	     	add_colored_text(hu_stat[u.uhs], newbot2);
280
	}
427
#else
281
	if(Confusion)	   Sprintf(nb = eos(nb), " Conf");
428
		Sprintf(nb = eos(nb), " %s", hu_stat[u.uhs]);
429
#endif
430
	if(Confusion)
431
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
432
	     	add_colored_text("Conf", newbot2);
433
#else
434
		Strcat(nb = eos(nb), " Conf");
435
#endif
282
	if(Sick) {
436
	if(Sick) {
283
		if (u.usick_type & SICK_VOMITABLE)
437
		if (u.usick_type & SICK_VOMITABLE)
284
			   Sprintf(nb = eos(nb), " FoodPois");
438
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
439
			add_colored_text("FoodPois", newbot2);
440
#else
441
			Strcat(nb = eos(nb), " FoodPois");
442
#endif
285
		if (u.usick_type & SICK_NONVOMITABLE)
443
		if (u.usick_type & SICK_NONVOMITABLE)
286
			   Sprintf(nb = eos(nb), " Ill");
444
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
445
			add_colored_text("Ill", newbot2);
446
#else
447
			Strcat(nb = eos(nb), " Ill");
448
#endif
287
	}
449
	}
288
	if(Blind)	   Sprintf(nb = eos(nb), " Blind");
450
	if(Blind)
289
	if(Stunned)	   Sprintf(nb = eos(nb), " Stun");
451
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
290
	if(Hallucination)  Sprintf(nb = eos(nb), " Hallu");
452
	     	add_colored_text("Blind", newbot2);
291
	if(Slimed)         Sprintf(nb = eos(nb), " Slime");
453
#else
454
		Strcat(nb = eos(nb), " Blind");
455
#endif
456
	if(Stunned)
457
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
458
	     	add_colored_text("Stun", newbot2);
459
#else
460
		Strcat(nb = eos(nb), " Stun");
461
#endif
462
	if(Hallucination)
463
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
464
	     	add_colored_text("Hallu", newbot2);
465
#else
466
		Strcat(nb = eos(nb), " Hallu");
467
#endif
468
	if(Slimed)
469
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
470
	     	add_colored_text("Slime", newbot2);
471
#else
472
		Strcat(nb = eos(nb), " Slime");
473
#endif
292
	if(cap > UNENCUMBERED)
474
	if(cap > UNENCUMBERED)
475
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
476
		add_colored_text(enc_stat[cap], newbot2);
477
#else
293
		Sprintf(nb = eos(nb), " %s", enc_stat[cap]);
478
		Sprintf(nb = eos(nb), " %s", enc_stat[cap]);
479
#endif
480
#ifdef DUMP_LOG
481
}
482
STATIC_OVL void
483
bot2()
484
{
485
	char newbot2[MAXCO];
486
	bot2str(newbot2);
487
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
488
	struct color_option color_option;
489
	int save_botlx = flags.botlx;
490
#endif
491
#endif
294
	curs(WIN_STATUS, 1, 1);
492
	curs(WIN_STATUS, 1, 1);
295
	putstr(WIN_STATUS, 0, newbot2);
493
	putstr(WIN_STATUS, 0, newbot2);
494
	flags.botlx = save_botlx;
296
}
495
}
297
void
496
void
(-)nethack-3.4.3/src/cmd.c (-5 / +517 lines)
Lines 123-128 Link Here
123
STATIC_PTR int NDECL(wiz_show_vision);
123
STATIC_PTR int NDECL(wiz_show_vision);
124
STATIC_PTR int NDECL(wiz_mon_polycontrol);
124
STATIC_PTR int NDECL(wiz_mon_polycontrol);
125
STATIC_PTR int NDECL(wiz_show_wmodes);
125
STATIC_PTR int NDECL(wiz_show_wmodes);
126
STATIC_PTR int NDECL(wiz_showkills);	/* showborn patch */
127
#ifdef SHOW_BORN
128
extern void FDECL(list_vanquished, (int, BOOLEAN_P)); /* showborn patch */
129
#endif /* SHOW_BORN */
126
#if defined(__BORLANDC__) && !defined(_WIN32)
130
#if defined(__BORLANDC__) && !defined(_WIN32)
127
extern void FDECL(show_borlandc_stats, (winid));
131
extern void FDECL(show_borlandc_stats, (winid));
128
#endif
132
#endif
Lines 478-486 Link Here
478
STATIC_PTR int
482
STATIC_PTR int
479
enter_explore_mode()
483
enter_explore_mode()
480
{
484
{
485
#ifdef PARANOID
486
	char buf[BUFSZ];
487
	int really_xplor = FALSE;
488
#endif
481
	if(!discover && !wizard) {
489
	if(!discover && !wizard) {
482
		pline("Beware!  From explore mode there will be no return to normal game.");
490
		pline("Beware!  From explore mode there will be no return to normal game.");
491
#ifdef PARANOID
492
		if (iflags.paranoid_quit) {
493
		  getlin ("Do you want to enter explore mode? [yes/no]?",buf);
494
		  (void) lcase (buf);
495
		  if (!(strcmp (buf, "yes"))) really_xplor = TRUE;
496
		} else {
497
		  if (yn("Do you want to enter explore mode?") == 'y') {
498
		    really_xplor = TRUE;
499
		  }
500
		}
501
		if (really_xplor) {
502
#else
483
		if (yn("Do you want to enter explore mode?") == 'y') {
503
		if (yn("Do you want to enter explore mode?") == 'y') {
504
#endif
484
			clear_nhwindow(WIN_MESSAGE);
505
			clear_nhwindow(WIN_MESSAGE);
485
			You("are now in non-scoring explore mode.");
506
			You("are now in non-scoring explore mode.");
486
			discover = TRUE;
507
			discover = TRUE;
Lines 756-761 Link Here
756
	return 0;
777
	return 0;
757
}
778
}
779
/* #showkills command */
780
STATIC_PTR int wiz_showkills()		/* showborn patch */
781
{
782
	list_vanquished('y', FALSE);
783
	return 0;
784
}
785
758
#endif /* WIZARD */
786
#endif /* WIZARD */
Lines 1126-1131 Link Here
1126
	return;
1154
	return;
1127
}
1155
}
1156
#ifdef DUMP_LOG
1157
void
1158
dump_enlightenment(final)
1159
int final;
1160
{
1161
	int ltmp;
1162
	char buf[BUFSZ];
1163
	char buf2[BUFSZ];
1164
	const char *enc_stat[] = { /* copied from botl.c */
1165
	     "",
1166
	     "burdened",
1167
	     "stressed",
1168
	     "strained",
1169
	     "overtaxed",
1170
	     "overloaded"
1171
	};
1172
	char *youwere = "  You were ";
1173
	char *youhave = "  You have ";
1174
	char *youhad  = "  You had ";
1175
	char *youcould = "  You could ";
1176
1177
	dump("", "Final attributes");
1178
1179
#ifdef ELBERETH
1180
	if (u.uevent.uhand_of_elbereth) {
1181
	    static const char * const hofe_titles[3] = {
1182
				"the Hand of Elbereth",
1183
				"the Envoy of Balance",
1184
				"the Glory of Arioch"
1185
	    };
1186
	    dump(youwere,
1187
		(char *)hofe_titles[u.uevent.uhand_of_elbereth - 1]);
1188
	}
1189
#endif
1190
1191
	if (u.ualign.record >= 20)
1192
		dump(youwere, "piously aligned");
1193
	else if (u.ualign.record > 13)
1194
	    dump(youwere, "devoutly aligned");
1195
	else if (u.ualign.record > 8)
1196
	    dump(youwere, "fervently aligned");
1197
	else if (u.ualign.record > 3)
1198
	    dump(youwere, "stridently aligned");
1199
	else if (u.ualign.record == 3)
1200
	    dump(youwere, "aligned");
1201
	else if (u.ualign.record > 0)
1202
	    dump(youwere, "haltingly aligned");
1203
	else if (u.ualign.record == 0)
1204
	    dump(youwere, "nominally aligned");
1205
	else if (u.ualign.record >= -3)	dump(youhave, "strayed");
1206
	else if (u.ualign.record >= -8)	dump(youhave, "sinned");
1207
	else dump("  You have ", "transgressed");
1208
	Sprintf(buf, " %d", u.ualign.record);
1209
	dump("  Your alignment was ", buf);
1210
1211
1212
	/*** Resistances to troubles ***/
1213
	if (Fire_resistance) dump(youwere, "fire resistant");
1214
	if (Cold_resistance) dump(youwere, "cold resistant");
1215
	if (Sleep_resistance) dump(youwere, "sleep resistant");
1216
	if (Disint_resistance) dump(youwere, "disintegration-resistant");
1217
	if (Shock_resistance) dump(youwere, "shock resistant");
1218
	if (Poison_resistance) dump(youwere, "poison resistant");
1219
	if (Drain_resistance) dump(youwere, "level-drain resistant");
1220
	if (Sick_resistance) dump(youwere, "immune to sickness");
1221
	if (Antimagic) dump(youwere, "magic-protected");
1222
	if (Acid_resistance) dump(youwere, "acid resistant");
1223
	if (Stone_resistance) dump(youwere, "petrification resistant");
1224
	if (Invulnerable) dump(youwere, "invulnerable");
1225
	if (u.uedibility) dump(youcould, "recognize detrimental food");
1226
1227
	/*** Troubles ***/
1228
	if (Halluc_resistance) 	dump("  ", "You resisted hallucinations");
1229
	if (Hallucination) dump(youwere, "hallucinating");
1230
	if (Stunned) dump(youwere, "stunned");
1231
	if (Confusion) dump(youwere, "confused");
1232
	if (Blinded) dump(youwere, "blinded");
1233
	if (Sick) {
1234
		if (u.usick_type & SICK_VOMITABLE)
1235
			dump(youwere, "sick from food poisoning");
1236
		if (u.usick_type & SICK_NONVOMITABLE)
1237
			dump(youwere, "sick from illness");
1238
	}
1239
	if (Stoned) dump(youwere, "turning to stone");
1240
	if (Slimed) dump(youwere, "turning into slime");
1241
	if (Strangled)
1242
		dump(youwere, (u.uburied) ? "buried" : "being strangled");
1243
	if (Glib) {
1244
		Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
1245
		dump(youhad, buf);
1246
	}
1247
	if (Fumbling) dump("  ", "You fumbled");
1248
	if (Wounded_legs
1249
#ifdef STEED
1250
	    && !u.usteed
1251
#endif
1252
			  ) {
1253
		Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
1254
		dump(youhad, buf);
1255
	}
1256
#ifdef STEED
1257
	if (Wounded_legs && u.usteed) {
1258
	    Strcpy(buf, x_monnam(u.usteed, ARTICLE_YOUR, (char *)0,
1259
		    SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION, FALSE));
1260
	    *buf = highc(*buf);
1261
	    Strcat(buf, " had wounded legs");
1262
	    dump("  ", buf);
1263
	}
1264
#endif
1265
	if (Sleeping) dump("  ", "You fell asleep");
1266
	if (Hunger) dump("  ", "You hungered rapidly");
1267
1268
	/*** Vision and senses ***/
1269
	if (See_invisible) dump("  ", "You saw invisible");
1270
	if (Blind_telepat) dump(youwere, "telepathic");
1271
	if (Warning) dump(youwere, "warned");
1272
	if (Warn_of_mon && flags.warntype) {
1273
		Sprintf(buf, "aware of the presence of %s",
1274
			(flags.warntype & M2_ORC) ? "orcs" :
1275
			(flags.warntype & M2_DEMON) ? "demons" :
1276
			something);
1277
		dump(youwere, buf);
1278
	}
1279
	if (Undead_warning) dump(youwere, "warned of undead");
1280
	if (Searching) dump(youhad, "automatic searching");
1281
	if (Clairvoyant) dump(youwere, "clairvoyant");
1282
	if (Infravision) dump(youhad, "infravision");
1283
	if (Detect_monsters)
1284
	  dump(youwere, "sensing the presence of monsters");
1285
	if (u.umconf) dump(youwere, "going to confuse monsters");
1286
1287
	/*** Appearance and behavior ***/
1288
	if (Adornment) {
1289
	    int adorn = 0;
1290
	    if(uleft && uleft->otyp == RIN_ADORNMENT) adorn += uleft->spe;
1291
	    if(uright && uright->otyp == RIN_ADORNMENT) adorn += uright->spe;
1292
	    if (adorn < 0)
1293
		dump(youwere, "poorly adorned");
1294
	    else
1295
		dump(youwere, "adorned");
1296
	}
1297
	if (Invisible) dump(youwere, "invisible");
1298
	else if (Invis) dump(youwere, "invisible to others");
1299
	/* ordinarily "visible" is redundant; this is a special case for
1300
	   the situation when invisibility would be an expected attribute */
1301
	else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis)
1302
	    dump(youwere, "visible");
1303
	if (Displaced) dump(youwere, "displaced");
1304
	if (Stealth) dump(youwere, "stealthy");
1305
	if (Aggravate_monster) dump("  ", "You aggravated monsters");
1306
	if (Conflict) dump("  ", "You caused conflict");
1307
1308
	/*** Transportation ***/
1309
	if (Jumping) dump(youcould, "jump");
1310
	if (Teleportation) dump(youcould, "teleport");
1311
	if (Teleport_control) dump(youhad, "teleport control");
1312
	if (Lev_at_will) dump(youwere, "levitating, at will");
1313
	else if (Levitation)
1314
	  dump(youwere, "levitating");	/* without control */
1315
	else if (Flying) dump(youcould, "fly");
1316
	if (Wwalking) dump(youcould, "walk on water");
1317
	if (Swimming) dump(youcould, "swim");
1318
	if (Breathless) dump(youcould, "survive without air");
1319
	else if (Amphibious) dump(youcould, "breathe water");
1320
	if (Passes_walls) dump(youcould, "walk through walls");
1321
#ifdef STEED
1322
	if (u.usteed && (final < 2 || strcmp(killer, "riding accident"))) {
1323
	    Sprintf(buf, "riding %s", y_monnam(u.usteed));
1324
	    dump(youwere, buf);
1325
	}
1326
#endif
1327
	if (u.uswallow) {
1328
	    Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck));
1329
#ifdef WIZARD
1330
	    if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim);
1331
#endif
1332
	    dump(youwere, buf);
1333
	} else if (u.ustuck) {
1334
	    Sprintf(buf, "%s %s",
1335
		    (Upolyd && sticks(youmonst.data)) ? "holding" : "held by",
1336
		    a_monnam(u.ustuck));
1337
	    dump(youwere, buf);
1338
	}
1339
1340
	/*** Physical attributes ***/
1341
	if (u.uhitinc)
1342
	    dump(youhad,
1343
		enlght_combatinc("to hit", u.uhitinc, final, buf));
1344
	if (u.udaminc)
1345
	    dump(youhad,
1346
		enlght_combatinc("damage", u.udaminc, final, buf));
1347
	if (Slow_digestion) dump(youhad, "slower digestion");
1348
	if (Regeneration) dump("  ", "You regenerated");
1349
	if (u.uspellprot || Protection) {
1350
	    int prot = 0;
1351
1352
	    if(uleft && uleft->otyp == RIN_PROTECTION) prot += uleft->spe;
1353
	    if(uright && uright->otyp == RIN_PROTECTION) prot += uright->spe;
1354
	    if (HProtection & INTRINSIC) prot += u.ublessed;
1355
	    prot += u.uspellprot;
1356
1357
	    if (prot < 0)
1358
		dump(youwere, "ineffectively protected");
1359
	    else
1360
		dump(youwere, "protected");
1361
	}
1362
	if (Protection_from_shape_changers)
1363
		dump(youwere, "protected from shape changers");
1364
	if (Polymorph) dump(youwere, "polymorphing");
1365
	if (Polymorph_control) dump(youhad, "polymorph control");
1366
	if (u.ulycn >= LOW_PM) {
1367
		Strcpy(buf, an(mons[u.ulycn].mname));
1368
		dump(youwere, buf);
1369
	}
1370
	if (Upolyd) {
1371
	    if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form");
1372
	    else Sprintf(buf, "polymorphed into %s",
1373
			 an(youmonst.data->mname));
1374
#ifdef WIZARD
1375
	    if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
1376
#endif
1377
	    dump(youwere, buf);
1378
	}
1379
	if (Unchanging)
1380
	  dump(youcould, "not change from your current form");
1381
	if (Fast) dump(youwere, Very_fast ? "very fast" : "fast");
1382
	if (Reflecting) dump(youhad, "reflection");
1383
	if (Free_action) dump(youhad, "free action");
1384
	if (Fixed_abil) dump(youhad, "fixed abilities");
1385
	if (Lifesaved)
1386
		dump("  ", "Your life would have been saved");
1387
	if (u.twoweap) dump(youwere, "wielding two weapons at once");
1388
1389
	/*** Miscellany ***/
1390
	if (Luck) {
1391
	    ltmp = abs((int)Luck);
1392
	    Sprintf(buf, "%s%slucky (%d)",
1393
		    ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "",
1394
		    Luck < 0 ? "un" : "", Luck);
1395
	    dump(youwere, buf);
1396
	}
1397
#ifdef WIZARD
1398
	 else if (wizard) dump("  ", "Your luck was zero");
1399
#endif
1400
	if (u.moreluck > 0) dump(youhad, "extra luck");
1401
	else if (u.moreluck < 0) dump(youhad, "reduced luck");
1402
	if (carrying(LUCKSTONE) || stone_luck(TRUE)) {
1403
	    ltmp = stone_luck(FALSE);
1404
	    if (ltmp <= 0)
1405
		dump("  ", "Bad luck did not time out for you");
1406
	    if (ltmp >= 0)
1407
		dump("  ", "Good luck did not time out for you");
1408
	}
1409
1410
	if (u.ugangr) {
1411
	    Sprintf(buf, " %sangry with you",
1412
		u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : "");
1413
#ifdef WIZARD
1414
	    if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr);
1415
#endif
1416
	    Sprintf(buf2, "%s was %s", u_gname(), buf);
1417
	    dump("  ", buf2);
1418
	}
1419
1420
    {
1421
	const char *p;
1422
1423
	buf[0] = '\0';
1424
	if (final < 2) {    /* quit/escaped/ascended */
1425
	    p = "survived after being killed ";
1426
	    switch (u.umortality) {
1427
	    case 0:  p = "survived";  break;
1428
	    case 1:  Strcpy(buf, "once");  break;
1429
	    case 2:  Strcpy(buf, "twice");  break;
1430
	    case 3:  Strcpy(buf, "thrice");  break;
1431
	    default: Sprintf(buf, "%d times", u.umortality);
1432
		     break;
1433
	    }
1434
	} else {		/* game ended in character's death */
1435
	    p = "are dead";
1436
	    switch (u.umortality) {
1437
	    case 0:  impossible("dead without dying?");
1438
	    case 1:  break;			/* just "are dead" */
1439
	    default: Sprintf(buf, " (%d%s time!)", u.umortality,
1440
			     ordin(u.umortality));
1441
		     break;
1442
	    }
1443
	}
1444
	if (p) {
1445
	  Sprintf(buf2, "You %s %s", p, buf);
1446
	  dump("  ", buf2);
1447
	}
1448
    }
1449
	dump("", "");
1450
	return;
1451
1452
} /* dump_enlightenment */
1453
#endif
1454
1128
/*
1455
/*
1129
 * Courtesy function for non-debug, non-explorer mode players
1456
 * Courtesy function for non-debug, non-explorer mode players
1130
 * to help refresh them about who/what they are.
1457
 * to help refresh them about who/what they are.
Lines 1341-1346 Link Here
1341
	destroy_nhwindow(en_win);
1668
	destroy_nhwindow(en_win);
1342
}
1669
}
1670
#ifdef DUMP_LOG
1671
void
1672
dump_conduct(final)
1673
int final;
1674
{
1675
	char buf[BUFSZ];
1676
	int ngenocided;
1677
1678
	dump("", "Voluntary challenges");
1679
1680
	if (!u.uconduct.food)
1681
	    dump("", "  You went without food");
1682
	    /* But beverages are okay */
1683
	else if (!u.uconduct.unvegan)
1684
	    dump("", "  You followed a strict vegan diet");
1685
	else if (!u.uconduct.unvegetarian)
1686
	    dump("", "  You were a vegetarian");
1687
	else if (Role_if(PM_MONK) && u.uconduct.unvegetarian < 10) {
1688
	    sprintf(buf, "  You ate non-vegetarian food %ld time%s.",
1689
		u.uconduct.unvegetarian, plur(u.uconduct.unvegetarian));
1690
	    dump("", buf);
1691
	}
1692
1693
	if (!u.uconduct.gnostic)
1694
	    dump("", "  You were an atheist");
1695
1696
	if (!u.uconduct.weaphit)
1697
	    dump("", "  You never hit with a wielded weapon");
1698
	else if (Role_if(PM_MONK) && u.uconduct.weaphit < 10) {
1699
	    Sprintf(buf, "  You hit with a wielded weapon %ld time%s",
1700
		    u.uconduct.weaphit, plur(u.uconduct.weaphit));
1701
	    dump("", buf);
1702
	}
1703
#ifdef WIZARD
1704
	else if (wizard) {
1705
	    Sprintf(buf, "hit with a wielded weapon %ld time%s",
1706
		    u.uconduct.weaphit, plur(u.uconduct.weaphit));
1707
	    dump("  You ", buf);
1708
	}
1709
#endif
1710
	if (!u.uconduct.killer)
1711
	    dump("", "  You were a pacifist");
1712
1713
	if (!u.uconduct.literate)
1714
	    dump("", "  You were illiterate");
1715
#ifdef WIZARD
1716
	else if (wizard) {
1717
	    Sprintf(buf, "read items or engraved %ld time%s",
1718
		    u.uconduct.literate, plur(u.uconduct.literate));
1719
	    dump("  You ", buf);
1720
	}
1721
#endif
1722
1723
	ngenocided = num_genocides();
1724
	if (ngenocided == 0) {
1725
	    dump("", "  You never genocided any monsters");
1726
	} else {
1727
	    Sprintf(buf, "genocided %d type%s of monster%s",
1728
		    ngenocided, plur(ngenocided), plur(ngenocided));
1729
	    dump("  You ", buf);
1730
	}
1731
1732
	if (!u.uconduct.polypiles)
1733
	    dump("", "  You never polymorphed an object");
1734
	else {
1735
	    Sprintf(buf, "polymorphed %ld item%s",
1736
		    u.uconduct.polypiles, plur(u.uconduct.polypiles));
1737
	    dump("  You ", buf);
1738
	}
1739
1740
	if (!u.uconduct.polyselfs)
1741
	    dump("", "  You never changed form");
1742
	else {
1743
	    Sprintf(buf, "changed form %ld time%s",
1744
		    u.uconduct.polyselfs, plur(u.uconduct.polyselfs));
1745
	    dump("  You ", buf);
1746
	}
1747
1748
	if (!u.uconduct.wishes)
1749
	    dump("", "  You used no wishes");
1750
	else {
1751
	    Sprintf(buf, "used %ld wish%s",
1752
		    u.uconduct.wishes, (u.uconduct.wishes > 1L) ? "es" : "");
1753
	    dump("  You ", buf);
1754
1755
	    if (!u.uconduct.wisharti)
1756
		dump("", "  You did not wish for any artifacts");
1757
	}
1758
1759
	dump("", "");
1760
}
1761
#endif /* DUMP_LOG */
1762
1343
#endif /* OVLB */
1763
#endif /* OVLB */
1344
#ifdef OVL1
1764
#ifdef OVL1
Lines 1474-1479 Link Here
1474
	{0,0,0,0}
1894
	{0,0,0,0}
1475
};
1895
};
1896
#ifdef DYNKEY
1897
1898
/* let's not get too dynamic */
1899
#define DYNKEY_SZ (sizeof(struct dkb_tab) * (26*4+40))
1900
1901
struct dkb_tab *dkblist = (struct dkb_tab *) 0;
1902
1903
static int dkblist_sz=-1;
1904
1905
int
1906
map_dkb(b, c)
1907
char b, c;
1908
{
1909
        if(dkblist_sz<0) {
1910
                dkblist=(struct dkb_tab *) alloc(DYNKEY_SZ+1); /* 0-term */
1911
                memset(dkblist, 0, DYNKEY_SZ+1);
1912
                dkblist_sz=0;
1913
        }
1914
        dkblist_sz++;
1915
        if(sizeof(struct dkb_tab) * dkblist_sz>DYNKEY_SZ)
1916
                return 0;
1917
        dkblist[dkblist_sz-1].bound_char=b;
1918
        dkblist[dkblist_sz-1].cmd_char=c;
1919
        return 1;
1920
}
1921
1922
char
1923
keydesc2char(desc)
1924
char *desc;
1925
{
1926
        char key;
1927
        int l=strlen(desc);
1928
1929
        if(l)
1930
                key=desc[l-1];
1931
        switch(l) {
1932
                case 1:
1933
                        return key;
1934
                case 3:
1935
                        if(desc[1]=='-')
1936
                                if(desc[0]=='M')
1937
                                        return M(key);
1938
                                else if(desc[0]=='C')
1939
                                        return C(key);
1940
                        /*fall through*/
1941
                default:
1942
                        return 0;
1943
        }
1944
}
1945
#undef DYNKEY_SZ
1946
#endif /* DYNKEY */
1947
1476
struct ext_func_tab extcmdlist[] = {
1948
struct ext_func_tab extcmdlist[] = {
1477
	{"adjust", "adjust inventory letters", doorganize, TRUE},
1949
	{"adjust", "adjust inventory letters", doorganize, TRUE},
1478
	{"chat", "talk to someone", dotalk, TRUE},	/* converse? */
1950
	{"chat", "talk to someone", dotalk, TRUE},	/* converse? */
Lines 1519-1524 Link Here
1519
	{(char *)0, (char *)0, donull, TRUE},
1991
	{(char *)0, (char *)0, donull, TRUE},
1520
#endif
1992
#endif
1521
	{(char *)0, (char *)0, donull, TRUE},
1993
	{(char *)0, (char *)0, donull, TRUE},
1994
	{(char *)0, (char *)0, donull, TRUE}, /* showkills (showborn patch) */
1522
        {(char *)0, (char *)0, donull, TRUE},
1995
        {(char *)0, (char *)0, donull, TRUE},
1523
	{(char *)0, (char *)0, donull, TRUE},
1996
	{(char *)0, (char *)0, donull, TRUE},
1524
	{(char *)0, (char *)0, donull, TRUE},
1997
	{(char *)0, (char *)0, donull, TRUE},
Lines 1544-1549 Link Here
1544
	{"portdebug", "wizard port debug command", wiz_port_debug, TRUE},
2017
	{"portdebug", "wizard port debug command", wiz_port_debug, TRUE},
1545
#endif
2018
#endif
1546
	{"seenv", "show seen vectors", wiz_show_seenv, TRUE},
2019
	{"seenv", "show seen vectors", wiz_show_seenv, TRUE},
2020
	{"showkills", "show list of monsters killed", wiz_showkills, TRUE},
1547
	{"stats", "show memory statistics", wiz_show_stats, TRUE},
2021
	{"stats", "show memory statistics", wiz_show_stats, TRUE},
1548
	{"timeout", "look at timeout queue", wiz_timeout_queue, TRUE},
2022
	{"timeout", "look at timeout queue", wiz_timeout_queue, TRUE},
1549
	{"vision", "show vision array", wiz_show_vision, TRUE},
2023
	{"vision", "show vision array", wiz_show_vision, TRUE},
Lines 2083-2091 Link Here
2083
#ifdef REDO
2557
#ifdef REDO
2084
	if(in_doagain || *readchar_queue)
2558
	if(in_doagain || *readchar_queue)
2085
	    dirsym = readchar();
2559
	    dirsym =
2086
	else
2560
#ifdef DYNKEY
2561
                    greadchar(TRUE);
2562
#else
2563
                    readchar();
2087
#endif
2564
#endif
2565
	else
2566
#endif /* REDO */
2088
	    dirsym = yn_function ((s && *s != '^') ? s : "In what direction?",
2567
	    dirsym = yn_function ((s && *s != '^') ? s : "In what direction?",
2089
					(char *)0, '\0');
2568
					(char *)0, '\0');
2090
#ifdef REDO
2569
#ifdef REDO
Lines 2331-2339 Link Here
2331
	flags.move = 1;
2810
	flags.move = 1;
2332
	flush_screen(1); /* Flush screen buffer. Put the cursor on the hero. */
2811
	flush_screen(1); /* Flush screen buffer. Put the cursor on the hero. */
2333
	if (!iflags.num_pad || (foo = readchar()) == 'n')
2812
	if (!iflags.num_pad || (foo =
2813
#ifdef DYNKEY
2814
                                greadchar(TRUE)
2815
#else
2816
                                readchar()
2817
#endif
2818
                               ) == 'n')
2334
	    for (;;) {
2819
	    for (;;) {
2335
		foo = readchar();
2820
		foo =
2821
#ifdef DYNKEY
2822
                        greadchar(TRUE);
2823
#else
2824
                        readchar();
2825
#endif
2336
		if (foo >= '0' && foo <= '9') {
2826
		if (foo >= '0' && foo <= '9') {
2337
		    multi = 10 * multi + foo - '0';
2827
		    multi = 10 * multi + foo - '0';
2338
		    if (multi < 0 || multi >= LARGEST_INT) multi = LARGEST_INT;
2828
		    if (multi < 0 || multi >= LARGEST_INT) multi = LARGEST_INT;
Lines 2371-2377 Link Here
2371
	in_line[1] = '\0';
2861
	in_line[1] = '\0';
2372
	if (foo == 'g' || foo == 'G' || foo == 'm' || foo == 'M' ||
2862
	if (foo == 'g' || foo == 'G' || foo == 'm' || foo == 'M' ||
2373
	    foo == 'F' || (iflags.num_pad && (foo == '5' || foo == '-'))) {
2863
	    foo == 'F' || (iflags.num_pad && (foo == '5' || foo == '-'))) {
2374
	    foo = readchar();
2864
            foo =
2865
#ifdef DYNKEY
2866
                    greadchar(TRUE);
2867
#else
2868
                    readchar();
2869
#endif
2870
2375
#ifdef REDO
2871
#ifdef REDO
2376
	    savech((char)foo);
2872
	    savech((char)foo);
2377
#endif
2873
#endif
Lines 2405-2411 Link Here
2405
#ifdef OVL0
2901
#ifdef OVL0
2406
char
2902
char
2903
#ifdef DYNKEY
2904
greadchar(dynkey)
2905
boolean dynkey;
2906
#else
2407
readchar()
2907
readchar()
2908
#endif
2408
{
2909
{
2409
	register int sym;
2910
	register int sym;
2410
	int x = u.ux, y = u.uy, mod = 0;
2911
	int x = u.ux, y = u.uy, mod = 0;
Lines 2443-2448 Link Here
2443
	    readchar_queue = click_to_cmd(x, y, mod);
2944
	    readchar_queue = click_to_cmd(x, y, mod);
2444
	    sym = *readchar_queue++;
2945
	    sym = *readchar_queue++;
2445
	}
2946
	}
2947
#ifdef DYNKEY
2948
        if(dkblist && dynkey) {
2949
                register const struct dkb_tab *dlist;
2950
2951
                for(dlist = dkblist; dlist->bound_char; dlist++) {
2952
                    if((sym & 0xff) != (dlist->bound_char & 0xff)) continue;
2953
                    sym=dlist->cmd_char;
2954
                    break;
2955
                }
2956
        }
2957
#endif
2446
	return((char) sym);
2958
	return((char) sym);
2447
}
2959
}
(-)nethack-3.4.3/src/decl.c (+13 lines)
Lines 209-214 Link Here
209
NEARDATA struct mvitals mvitals[NUMMONS];
209
NEARDATA struct mvitals mvitals[NUMMONS];
210
/* originally from end.c */
211
#ifdef DUMP_LOG
212
#ifdef DUMP_FN
213
char dump_fn[] = DUMP_FN;
214
#else
215
char dump_fn[PL_PSIZ] = DUMMY;
216
#endif
217
#endif /* DUMP_LOG */
218
210
NEARDATA struct c_color_names c_color_names = {
219
NEARDATA struct c_color_names c_color_names = {
211
	"black", "amber", "golden",
220
	"black", "amber", "golden",
212
	"light blue", "red", "green",
221
	"light blue", "red", "green",
Lines 235-240 Link Here
235
	"white",		/* CLR_WHITE */
244
	"white",		/* CLR_WHITE */
236
};
245
};
246
#ifdef MENU_COLOR
247
struct menucoloring *menu_colorings = 0;
248
#endif
249
237
struct c_common_strings c_common_strings = {
250
struct c_common_strings c_common_strings = {
238
	"Nothing happens.",		"That's enough tries!",
251
	"Nothing happens.",		"That's enough tries!",
239
	"That is a silly thing to %s.",	"shudder for a moment.",
252
	"That is a silly thing to %s.",	"shudder for a moment.",
(-)nethack-3.4.3/src/display.c (+100 lines)
Lines 1370-1375 Link Here
1370
/* ========================================================================= */
1370
/* ========================================================================= */
1371
#ifdef DUMP_LOG
1372
/* D: Added to dump screen to output file */
1373
STATIC_PTR uchar get_glyph_char(glyph)
1374
int glyph;
1375
{
1376
    uchar   ch;
1377
    register int offset;
1378
1379
    if (glyph >= NO_GLYPH)
1380
        return ' ';
1381
1382
    /*
1383
     *  Map the glyph back to a character.
1384
     *
1385
     *  Warning:  For speed, this makes an assumption on the order of
1386
     *		  offsets.  The order is set in display.h.
1387
     */
1388
    if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) {	/* a warning flash */
1389
	ch = def_warnsyms[offset].sym;
1390
    } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) {	/* swallow */
1391
	/* see swallow_to_glyph() in display.c */
1392
	ch = (uchar) defsyms[S_sw_tl + (offset & 0x7)].sym;
1393
    } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) {	/* zap beam */
1394
	/* see zapdir_to_glyph() in display.c */
1395
	ch = defsyms[S_vbeam + (offset & 0x3)].sym;
1396
    } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) {	/* cmap */
1397
	ch = defsyms[offset].sym;
1398
    } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) {	/* object */
1399
	ch = def_oc_syms[(int)objects[offset].oc_class];
1400
    } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */
1401
	ch = def_monsyms[(int)mons[offset].mlet];
1402
    } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) {	/* a corpse */
1403
	ch = def_oc_syms[(int)objects[CORPSE].oc_class];
1404
    } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */
1405
	ch = def_monsyms[(int)mons[offset].mlet];
1406
    } else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) {  /* invisible */
1407
	ch = DEF_INVISIBLE;
1408
    } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) {	/* a pet */
1409
	ch = def_monsyms[(int)mons[offset].mlet];
1410
    } else {						    /* a monster */
1411
	ch = monsyms[(int)mons[glyph].mlet];
1412
    }
1413
    return ch;
1414
}
1415
1416
#ifdef TTY_GRAPHICS
1417
extern const char * FDECL(compress_str, (const char *));
1418
#else
1419
const char*
1420
compress_str(str) /* copied from win/tty/wintty.c */
1421
const char *str;
1422
{
1423
	static char cbuf[BUFSZ];
1424
	/* compress in case line too long */
1425
	if((int)strlen(str) >= 80) {
1426
		register const char *bp0 = str;
1427
		register char *bp1 = cbuf;
1428
1429
		do {
1430
			if(*bp0 != ' ' || bp0[1] != ' ')
1431
				*bp1++ = *bp0;
1432
		} while(*bp0++);
1433
	} else
1434
	    return str;
1435
	return cbuf;
1436
}
1437
#endif /* TTY_GRAPHICS */
1438
1439
/* Take a screen dump */
1440
void dump_screen()
1441
{
1442
    register int x,y;
1443
    int lastc;
1444
    /* D: botl.c has a closer approximation to the size, but we'll go with
1445
     *    this */
1446
    char buf[300], *ptr;
1447
1448
    for (y = 0; y < ROWNO; y++) {
1449
	lastc = 0;
1450
	ptr = buf;
1451
	for (x = 1; x < COLNO; x++) {
1452
	    uchar c = get_glyph_char(gbuf[y][x].glyph);
1453
	    *ptr++ = c;
1454
	    if (c != ' ')
1455
		lastc = x;
1456
	}
1457
	buf[lastc] = '\0';
1458
	dump("", buf);
1459
    }
1460
    dump("", "");
1461
    bot1str(buf);
1462
    ptr = (char *) compress_str((const char *) buf);
1463
    dump("", ptr);
1464
    bot2str(buf);
1465
    dump("", buf);
1466
    dump("", "");
1467
    dump("", "");
1468
}
1469
#endif /* DUMP_LOG */
1470
1371
/*
1471
/*
1372
 * back_to_glyph()
1472
 * back_to_glyph()
1373
 *
1473
 *
(-)nethack-3.4.3/src/do.c (-1 / +11 lines)
Lines 789-795 Link Here
789
	}
789
	}
790
	if (!stairs_down && !ladder_down) {
790
	if (!stairs_down && !ladder_down) {
791
		if (!(trap = t_at(u.ux,u.uy)) ||
791
		if (!(trap = t_at(u.ux,u.uy)) ||
792
			(trap->ttyp != TRAPDOOR && trap->ttyp != HOLE)
792
			(trap->ttyp != TRAPDOOR && trap->ttyp != HOLE &&
793
			 trap->ttyp != PIT && trap->ttyp != SPIKED_PIT)
793
			|| !Can_fall_thru(&u.uz) || !trap->tseen) {
794
			|| !Can_fall_thru(&u.uz) || !trap->tseen) {
794
			if (flags.autodig && !flags.nopick &&
795
			if (flags.autodig && !flags.nopick &&
Lines 821-826 Link Here
821
		return(0);
822
		return(0);
822
	}
823
	}
824
	/* Move into the pit */
825
	if (trap && (trap->ttyp == PIT || trap->ttyp == SPIKED_PIT)) {
826
		You("carefully slide down into the %spit",
827
			trap->ttyp == SPIKED_PIT ? "spiked " : "");
828
		u.utraptype = TT_PIT;
829
		u.utrap = rn1(6,2);
830
		return(0);
831
	} else {
823
	if (trap)
832
	if (trap)
824
	    You("%s %s.", locomotion(youmonst.data, "jump"),
833
	    You("%s %s.", locomotion(youmonst.data, "jump"),
825
		trap->ttyp == HOLE ? "down the hole" : "through the trap door");
834
		trap->ttyp == HOLE ? "down the hole" : "through the trap door");
Lines 832-837 Link Here
832
		next_level(!trap);
841
		next_level(!trap);
833
		at_ladder = FALSE;
842
		at_ladder = FALSE;
834
	}
843
	}
844
	}
835
	return(1);
845
	return(1);
836
}
846
}
(-)nethack-3.4.3/src/do_name.c (+14 lines)
Lines 69-75 Link Here
69
    lock_mouse_cursor(TRUE);
69
    lock_mouse_cursor(TRUE);
70
#endif
70
#endif
71
    for (;;) {
71
    for (;;) {
72
#ifdef DYNKEY
73
#include "func_tab.h"
74
#endif
72
	c = nh_poskey(&tx, &ty, &sidx);
75
	c = nh_poskey(&tx, &ty, &sidx);
76
#ifdef DYNKEY
77
        if(dkblist) {
78
                register const struct dkb_tab *dlist;
79
80
                for(dlist = dkblist; dlist->bound_char; dlist++) {
81
                    if((c & 0xff) != (dlist->bound_char & 0xff)) continue;
82
                    c=dlist->cmd_char;
83
                    break;
84
                }
85
        }
86
#endif
73
	if (c == '\033') {
87
	if (c == '\033') {
74
	    cx = cy = -10;
88
	    cx = cy = -10;
75
	    msg_given = TRUE;	/* force clear */
89
	    msg_given = TRUE;	/* force clear */
(-)nethack-3.4.3/src/do_wear.c (-2 / +10 lines)
Lines 1078-1084 Link Here
1078
			  "  Use 'R' command to remove accessories." : "");
1078
			  "  Use 'R' command to remove accessories." : "");
1079
		return 0;
1079
		return 0;
1080
	}
1080
	}
1081
	if (armorpieces > 1)
1081
	if (armorpieces > 1
1082
#ifdef PARANOID
1083
	    || iflags.paranoid_remove
1084
#endif
1085
	    )
1082
		otmp = getobj(clothes, "take off");
1086
		otmp = getobj(clothes, "take off");
1083
	if (otmp == 0) return(0);
1087
	if (otmp == 0) return(0);
1084
	if (!(otmp->owornmask & W_ARMOR)) {
1088
	if (!(otmp->owornmask & W_ARMOR)) {
Lines 1128-1134 Link Here
1128
		      "  Use 'T' command to take off armor." : "");
1132
		      "  Use 'T' command to take off armor." : "");
1129
		return(0);
1133
		return(0);
1130
	}
1134
	}
1131
	if (Accessories != 1) otmp = getobj(accessories, "remove");
1135
	if (Accessories != 1
1136
#ifdef PARANOID
1137
	    || iflags.paranoid_remove
1138
#endif
1139
	    ) otmp = getobj(accessories, "remove");
1132
	if(!otmp) return(0);
1140
	if(!otmp) return(0);
1133
	if(!(otmp->owornmask & (W_RING | W_AMUL | W_TOOL))) {
1141
	if(!(otmp->owornmask & (W_RING | W_AMUL | W_TOOL))) {
1134
		You("are not wearing that.");
1142
		You("are not wearing that.");
(-)nethack-3.4.3/src/drawing.c (-7 / +6 lines)
Lines 655-660 Link Here
655
switch_graphics(gr_set_flag)
655
switch_graphics(gr_set_flag)
656
int gr_set_flag;
656
int gr_set_flag;
657
{
657
{
658
  if ((gr_set_flag < ASCII_GRAPHICS) || (gr_set_flag > MAC_GRAPHICS))
659
    gr_set_flag = ASCII_GRAPHICS;
660
  iflags.chargfx = gr_set_flag;
658
    switch (gr_set_flag) {
661
    switch (gr_set_flag) {
659
	default:
662
	default:
660
	case ASCII_GRAPHICS:
663
	case ASCII_GRAPHICS:
Lines 672-679 Link Here
672
 * to the ISO 8859 character set.  We should probably do a VioSetCp() call to
675
 * to the ISO 8859 character set.  We should probably do a VioSetCp() call to
673
 * set the codepage to 437.
676
 * set the codepage to 437.
674
 */
677
 */
675
	    iflags.IBMgraphics = TRUE;
676
	    iflags.DECgraphics = FALSE;
677
	    assign_graphics(ibm_graphics, SIZE(ibm_graphics), MAXPCHARS, 0);
678
	    assign_graphics(ibm_graphics, SIZE(ibm_graphics), MAXPCHARS, 0);
678
#ifdef PC9800
679
#ifdef PC9800
679
	    if (ibmgraphics_mode_callback) (*ibmgraphics_mode_callback)();
680
	    if (ibmgraphics_mode_callback) (*ibmgraphics_mode_callback)();
Lines 685-692 Link Here
685
/*
686
/*
686
 * Use the VT100 line drawing character set.
687
 * Use the VT100 line drawing character set.
687
 */
688
 */
688
	    iflags.DECgraphics = TRUE;
689
	    iflags.IBMgraphics = FALSE;
690
	    assign_graphics(dec_graphics, SIZE(dec_graphics), MAXPCHARS, 0);
689
	    assign_graphics(dec_graphics, SIZE(dec_graphics), MAXPCHARS, 0);
691
	    if (decgraphics_mode_callback) (*decgraphics_mode_callback)();
690
	    if (decgraphics_mode_callback) (*decgraphics_mode_callback)();
692
	    break;
691
	    break;
Lines 795-801 Link Here
795
	for (i = 0; i < MAXMCLASSES; i++)
794
	for (i = 0; i < MAXMCLASSES; i++)
796
	    monsyms[i] = def_monsyms[i];
795
	    monsyms[i] = def_monsyms[i];
797
# if defined(ASCIIGRAPH) && !defined(MSWIN_GRAPHICS)
796
# if defined(ASCIIGRAPH) && !defined(MSWIN_GRAPHICS)
798
	if (iflags.IBMgraphics
797
	if (iflags.chargfx == IBM_GRAPHICS
799
#  if defined(USE_TILES) && defined(MSDOS)
798
#  if defined(USE_TILES) && defined(MSDOS)
800
		&& !iflags.grmode
799
		&& !iflags.grmode
801
#  endif
800
#  endif
Lines 812-818 Link Here
812
 */
811
 */
813
# ifdef ASCIIGRAPH
812
# ifdef ASCIIGRAPH
814
	if (!iflags.IBMgraphics
813
	if (!(iflags.chargfx == IBM_GRAPHICS)
815
#  if defined(USE_TILES) && defined(MSDOS)
814
#  if defined(USE_TILES) && defined(MSDOS)
816
		|| iflags.grmode
815
		|| iflags.grmode
817
#  endif
816
#  endif
Lines 871-877 Link Here
871
	for (i = 0; i < MAXOCLASSES; i++) {
870
	for (i = 0; i < MAXOCLASSES; i++) {
872
#ifdef ASCIIGRAPH
871
#ifdef ASCIIGRAPH
873
	    if (iflags.IBMgraphics
872
	    if (iflags.chargfx == IBM_GRAPHICS
874
# if defined(USE_TILES) && defined(MSDOS)
873
# if defined(USE_TILES) && defined(MSDOS)
875
		&& !iflags.grmode
874
		&& !iflags.grmode
876
# endif
875
# endif
(-)nethack-3.4.3/src/eat.c (+22 lines)
Lines 1888-1893 Link Here
1888
		}
1888
		}
1889
	}
1889
	}
1890
	/* Can't eat trapped food - Chris Becker (topher@csh.rit.edu) */
1891
	{
1892
		struct trap* ttmp = t_at(u.ux,u.uy);
1893
		if (ttmp) {
1894
			switch(ttmp->ttyp) {
1895
			case PIT:
1896
			case SPIKED_PIT:
1897
				if (!(u.utraptype == TT_PIT && u.utrap)) {
1898
					You("can't reach %s, it's at the bottom of the %s!", the(xname(otmp)),
1899
						ttmp->ttyp == PIT ? "pit" :	"spiked pit" );
1900
					return 0;
1901
				}
1902
				break;
1903
			case WEB:
1904
				You("can't eat %s, it's caught in the spider web%s!", the(xname(otmp)),
1905
					u.utraptype == TT_WEB && u.utrap ? " with you" : "" );
1906
				return 0;
1907
			default:
1908
				break;
1909
			}
1910
		}
1911
	}
1890
	/* We have to make non-foods take 1 move to eat, unless we want to
1912
	/* We have to make non-foods take 1 move to eat, unless we want to
1891
	 * do ridiculous amounts of coding to deal with partly eaten plate
1913
	 * do ridiculous amounts of coding to deal with partly eaten plate
1892
	 * mails, players who polymorph back to human in the middle of their
1914
	 * mails, players who polymorph back to human in the middle of their
(-)nethack-3.4.3/src/end.c (-35 / +403 lines)
Lines 39-46 Link Here
39
STATIC_DCL void FDECL(sort_valuables, (struct valuable_data *,int));
39
STATIC_DCL void FDECL(sort_valuables, (struct valuable_data *,int));
40
STATIC_DCL void FDECL(artifact_score, (struct obj *,BOOLEAN_P,winid));
40
STATIC_DCL void FDECL(artifact_score, (struct obj *,BOOLEAN_P,winid));
41
STATIC_DCL void FDECL(savelife, (int));
41
STATIC_DCL void FDECL(savelife, (int));
42
STATIC_DCL void FDECL(list_vanquished, (CHAR_P,BOOLEAN_P));
42
void FDECL(list_vanquished, (CHAR_P,BOOLEAN_P));
43
#ifdef DUMP_LOG
44
extern void NDECL(dump_spells);
45
void FDECL(do_vanquished, (int, BOOLEAN_P, BOOLEAN_P));
46
STATIC_DCL void FDECL(list_genocided, (int, BOOLEAN_P, BOOLEAN_P));
47
#else
43
STATIC_DCL void FDECL(list_genocided, (CHAR_P,BOOLEAN_P));
48
STATIC_DCL void FDECL(list_genocided, (CHAR_P,BOOLEAN_P));
49
#endif /* DUMP_LOG */
44
STATIC_DCL boolean FDECL(should_query_disclose_option, (int,char *));
50
STATIC_DCL boolean FDECL(should_query_disclose_option, (int,char *));
45
#if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2)
51
#if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2)
Lines 86-91 Link Here
86
extern const char * const killed_by_prefix[];	/* from topten.c */
92
extern const char * const killed_by_prefix[];	/* from topten.c */
93
#ifdef DUMP_LOG
94
FILE *dump_fp = (FILE *)0;  /* file pointer for dumps */
95
/* functions dump_init, dump_exit and dump are from the dump patch */
96
97
void
98
dump_init ()
99
{
100
  if (dump_fn[0]) {
101
    char *p = (char *) strstr(dump_fn, "%n");
102
    if (p) {
103
      int new_dump_fn_len = strlen(dump_fn)+strlen(plname)-2; /* %n */
104
      char *new_dump_fn = (char *) alloc((unsigned)(new_dump_fn_len+1));
105
      char *q = new_dump_fn;
106
      strncpy(q, dump_fn, p-dump_fn);
107
      q += p-dump_fn;
108
      strncpy(q, plname, strlen(plname) + 1);
109
      regularize(q);
110
      q[strlen(plname)] = '\0';
111
      q += strlen(q);
112
      p += 2;	/* skip "%n" */
113
      strncpy(q, p, strlen(p));
114
      new_dump_fn[new_dump_fn_len] = '\0';
115
116
      dump_fp = fopen(new_dump_fn, "w");
117
      if (!dump_fp) {
118
	pline("Can't open %s for output.", new_dump_fn);
119
	pline("Dump file not created.");
120
      }
121
      free(new_dump_fn);
122
123
    } else {
124
      dump_fp = fopen (dump_fn, "w");
125
126
      if (!dump_fp) {
127
	pline("Can't open %s for output.", dump_fn);
128
	pline("Dump file not created.");
129
      }
130
    }
131
  }
132
}
133
134
void
135
dump_exit ()
136
{
137
  if (dump_fp)
138
    fclose (dump_fp);
139
}
140
141
void dump (pre, str)
142
     char *pre, *str;
143
{
144
  if (dump_fp)
145
    fprintf (dump_fp, "%s%s\n", pre, str);
146
}
147
#endif  /* DUMP_LOG */
148
87
/*ARGSUSED*/
149
/*ARGSUSED*/
88
void
150
void
89
done1(sig_unused)   /* called as signal() handler, so sent at least one arg */
151
done1(sig_unused)   /* called as signal() handler, so sent at least one arg */
Lines 112-118 Link Here
112
int
174
int
113
done2()
175
done2()
114
{
176
{
177
#ifdef PARANOID
178
	char buf[BUFSZ];
179
	int really_quit = FALSE;
180
181
	if (iflags.paranoid_quit) {
182
	  getlin ("Really quit [yes/no]?",buf);
183
	  (void) lcase (buf);
184
	  if (!(strcmp (buf, "yes"))) really_quit = TRUE;
185
	} else {
186
	  if(yn("Really quit?") == 'y') really_quit = TRUE;
187
	}
188
	if (!really_quit) {
189
#else /* PARANOID */
115
	if(yn("Really quit?") == 'n') {
190
	if(yn("Really quit?") == 'n') {
191
#endif /* PARANOID */
116
#ifndef NO_SIGNAL
192
#ifndef NO_SIGNAL
117
		(void) signal(SIGINT, (SIG_RET_TYPE) done1);
193
		(void) signal(SIGINT, (SIG_RET_TYPE) done1);
118
#endif
194
#endif
Lines 366-383 Link Here
366
	    ask = should_query_disclose_option('i', &defquery);
442
	    ask = should_query_disclose_option('i', &defquery);
367
	    if (!done_stopprint) {
443
	    if (!done_stopprint) {
368
		c = ask ? yn_function(qbuf, ynqchars, defquery) : defquery;
444
		c = ask ? yn_function(qbuf, ynqchars, defquery) : defquery;
369
		if (c == 'y') {
445
	    } else {
446
		c = 'n';
447
	    }
448
		{
449
#ifdef DUMP_LOG
450
			boolean want_disp = (c == 'y')? TRUE: FALSE;
451
#endif
370
			struct obj *obj;
452
			struct obj *obj;
371
			for (obj = invent; obj; obj = obj->nobj) {
453
			for (obj = invent; obj; obj = obj->nobj) {
372
			    makeknown(obj->otyp);
454
			    makeknown(obj->otyp);
373
			    obj->known = obj->bknown = obj->dknown = obj->rknown = 1;
455
			    obj->known = obj->bknown = obj->dknown = obj->rknown = 1;
374
			}
456
			}
457
#ifdef DUMP_LOG
458
			(void) dump_inventory((char *)0, TRUE, want_disp);
459
			do_containerconts(invent, TRUE, TRUE, TRUE, want_disp);
460
#else
461
			if (c == 'y') {
375
			(void) display_inventory((char *)0, TRUE);
462
			(void) display_inventory((char *)0, TRUE);
376
			container_contents(invent, TRUE, TRUE);
463
			container_contents(invent, TRUE, TRUE);
464
			}
465
#endif /* DUMP_LOG */
377
		}
466
		}
378
		if (c == 'q')  done_stopprint++;
467
		if (c == 'q')  done_stopprint++;
379
	    }
380
	}
468
	}
381
	ask = should_query_disclose_option('a', &defquery);
469
	ask = should_query_disclose_option('a', &defquery);
Lines 388-401 Link Here
388
		enlightenment(how >= PANICKED ? 1 : 2); /* final */
476
		enlightenment(how >= PANICKED ? 1 : 2); /* final */
389
	    if (c == 'q') done_stopprint++;
477
	    if (c == 'q') done_stopprint++;
390
	}
478
	}
479
#ifdef DUMP_LOG
480
	if (dump_fp) {
481
	  dump_enlightenment((int) (how >= PANICKED ? 1 : 2));
482
	  dump_spells();
483
	}
484
#endif
391
	ask = should_query_disclose_option('v', &defquery);
485
	ask = should_query_disclose_option('v', &defquery);
486
#ifdef DUMP_LOG
487
	do_vanquished(defquery, ask, TRUE);
488
#else
392
	if (!done_stopprint)
489
	if (!done_stopprint)
393
	    list_vanquished(defquery, ask);
490
	    list_vanquished(defquery, ask);
491
#endif
394
	ask = should_query_disclose_option('g', &defquery);
492
	ask = should_query_disclose_option('g', &defquery);
395
	if (!done_stopprint)
493
	if (!done_stopprint)
494
#ifdef DUMP_LOG
495
	    list_genocided(defquery, ask,TRUE);
496
#else
396
	    list_genocided(defquery, ask);
497
	    list_genocided(defquery, ask);
498
#endif
397
	ask = should_query_disclose_option('c', &defquery);
499
	ask = should_query_disclose_option('c', &defquery);
398
	if (!done_stopprint) {
500
	if (!done_stopprint) {
Lines 405-410 Link Here
405
		show_conduct(how >= PANICKED ? 1 : 2);
507
		show_conduct(how >= PANICKED ? 1 : 2);
406
	    if (c == 'q') done_stopprint++;
508
	    if (c == 'q') done_stopprint++;
407
	}
509
	}
510
#ifdef DUMP_LOG
511
	if (dump_fp) {
512
	    dump_conduct(how >= PANICKED ? 1 : 2);
513
	    dump_weapon_skill();
514
	}
515
#endif
408
}
516
}
409
/* try to get the player back in a viable state after being killed */
517
/* try to get the player back in a viable state after being killed */
Lines 523-528 Link Here
523
			otmp->oartifact ? artifact_name(xname(otmp), &dummy) :
631
			otmp->oartifact ? artifact_name(xname(otmp), &dummy) :
524
				OBJ_NAME(objects[otmp->otyp]),
632
				OBJ_NAME(objects[otmp->otyp]),
525
			value, currency(value), points);
633
			value, currency(value), points);
634
#ifdef DUMP_LOG
635
		if (dump_fp)
636
		  dump("", pbuf);
637
		if (endwin != WIN_ERR)
638
#endif
526
		putstr(endwin, 0, pbuf);
639
		putstr(endwin, 0, pbuf);
527
	    }
640
	    }
528
	}
641
	}
Lines 536-541 Link Here
536
done(how)
649
done(how)
537
int how;
650
int how;
538
{
651
{
652
#if defined(WIZARD) && defined(PARANOID)
653
	char paranoid_buf[BUFSZ];
654
	int really_bon = TRUE;
655
#endif
539
	boolean taken;
656
	boolean taken;
540
	char kilbuf[BUFSZ], pbuf[BUFSZ];
657
	char kilbuf[BUFSZ], pbuf[BUFSZ];
541
	winid endwin = WIN_ERR;
658
	winid endwin = WIN_ERR;
Lines 614-619 Link Here
614
	program_state.gameover = 1;
731
	program_state.gameover = 1;
615
	/* in case of a subsequent panic(), there's no point trying to save */
732
	/* in case of a subsequent panic(), there's no point trying to save */
616
	program_state.something_worth_saving = 0;
733
	program_state.something_worth_saving = 0;
734
#ifdef DUMP_LOG
735
	/* D: Grab screen dump right here */
736
	if (dump_fn[0]) {
737
	  dump_init();
738
	  Sprintf(pbuf, "%s, %s %s %s %s", plname,
739
		  aligns[1 - u.ualign.type].adj,
740
		  genders[flags.female].adj,
741
		  urace.adj,
742
		  (flags.female && urole.name.f)?
743
		   urole.name.f : urole.name.m);
744
	  dump("", pbuf);
745
	  /* D: Add a line for clearance from the screen dump */
746
	  dump("", "");
747
	  dump_screen();
748
	}
749
#endif /* DUMP_LOG */
617
	/* render vision subsystem inoperative */
750
	/* render vision subsystem inoperative */
618
	iflags.vision_inited = 0;
751
	iflags.vision_inited = 0;
619
	/* might have been killed while using a disposable item, so make sure
752
	/* might have been killed while using a disposable item, so make sure
Lines 725-732 Link Here
725
	if (bones_ok) {
858
	if (bones_ok) {
726
#ifdef WIZARD
859
#ifdef WIZARD
860
# ifdef PARANOID
861
	    if(wizard) {
862
		getlin("Save WIZARD MODE bones? [no/yes]", paranoid_buf);
863
		(void) lcase (paranoid_buf);
864
		if (strcmp (paranoid_buf, "yes"))
865
		  really_bon = FALSE;
866
	    }
867
	    if(really_bon)
868
# else
727
	    if (!wizard || yn("Save bones?") == 'y')
869
	    if (!wizard || yn("Save bones?") == 'y')
728
#endif
870
# endif /* PARANOID */
871
#endif /* WIZARD */
729
		savebones(corpse);
872
		savebones(corpse);
730
	    /* corpse may be invalid pointer now so
873
	    /* corpse may be invalid pointer now so
731
		ensure that it isn't used again */
874
		ensure that it isn't used again */
Lines 770-784 Link Here
770
		/* don't bother counting to see whether it should be plural */
913
		/* don't bother counting to see whether it should be plural */
771
	}
914
	}
915
	Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname,
916
		how != ASCENDED ?
917
		   (const char *) ((flags.female && urole.name.f) ?
918
		      urole.name.f : urole.name.m) :
919
		   (const char *) (flags.female ? "Demigoddess" : "Demigod"));
772
	if (!done_stopprint) {
920
	if (!done_stopprint) {
773
	    Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname,
774
		   how != ASCENDED ?
775
		      (const char *) ((flags.female && urole.name.f) ?
776
		         urole.name.f : urole.name.m) :
777
		      (const char *) (flags.female ? "Demigoddess" : "Demigod"));
778
	    putstr(endwin, 0, pbuf);
921
	    putstr(endwin, 0, pbuf);
779
	    putstr(endwin, 0, "");
922
	    putstr(endwin, 0, "");
780
	}
923
	}
924
#ifdef DUMP_LOG
925
	if (dump_fp) dump("", pbuf);
926
#endif
781
	if (how == ESCAPED || how == ASCENDED) {
927
	if (how == ESCAPED || how == ASCENDED) {
782
	    register struct monst *mtmp;
928
	    register struct monst *mtmp;
Lines 805-835 Link Here
805
	    keepdogs(TRUE);
951
	    keepdogs(TRUE);
806
	    viz_array[0][0] |= IN_SIGHT; /* need visibility for naming */
952
	    viz_array[0][0] |= IN_SIGHT; /* need visibility for naming */
807
	    mtmp = mydogs;
953
	    mtmp = mydogs;
808
	    if (!done_stopprint) Strcpy(pbuf, "You");
954
	    Strcpy(pbuf, "You");
809
	    if (mtmp) {
955
	    if (mtmp) {
810
		while (mtmp) {
956
		while (mtmp) {
811
		    if (!done_stopprint)
957
		    Sprintf(eos(pbuf), " and %s", mon_nam(mtmp));
812
			Sprintf(eos(pbuf), " and %s", mon_nam(mtmp));
813
		    if (mtmp->mtame)
958
		    if (mtmp->mtame)
814
			u.urexp += mtmp->mhp;
959
			u.urexp += mtmp->mhp;
815
		    mtmp = mtmp->nmon;
960
		    mtmp = mtmp->nmon;
816
		}
961
		}
817
		if (!done_stopprint) putstr(endwin, 0, pbuf);
962
		if (!done_stopprint) putstr(endwin, 0, pbuf);
963
#ifdef DUMP_LOG
964
		if (dump_fp) dump("", pbuf);
965
#endif
818
		pbuf[0] = '\0';
966
		pbuf[0] = '\0';
819
	    } else {
967
	    } else {
820
		if (!done_stopprint) Strcat(pbuf, " ");
968
		if (!done_stopprint) Strcat(pbuf, " ");
821
	    }
969
	    }
822
	    if (!done_stopprint) {
970
	    Sprintf(eos(pbuf), "%s with %ld point%s,",
823
		Sprintf(eos(pbuf), "%s with %ld point%s,",
824
			how==ASCENDED ? "went to your reward" :
971
			how==ASCENDED ? "went to your reward" :
825
					"escaped from the dungeon",
972
					"escaped from the dungeon",
826
			u.urexp, plur(u.urexp));
973
			u.urexp, plur(u.urexp));
974
#ifdef DUMP_LOG
975
	    if (dump_fp) dump("", pbuf);
976
#endif
977
	    if (!done_stopprint) {
827
		putstr(endwin, 0, pbuf);
978
		putstr(endwin, 0, pbuf);
828
	    }
979
	    }
829
	    if (!done_stopprint)
980
	    if (!done_stopprint)
830
		artifact_score(invent, FALSE, endwin);	/* list artifacts */
981
		artifact_score(invent, FALSE, endwin);	/* list artifacts */
831
982
#ifdef DUMP_LOG
983
	    else
984
		artifact_score(invent, FALSE, WIN_ERR);
985
#endif
832
	    /* list valuables here */
986
	    /* list valuables here */
833
	    for (val = valuables; val->list; val++) {
987
	    for (val = valuables; val->list; val++) {
834
		sort_valuables(val->list, val->size);
988
		sort_valuables(val->list, val->size);
Lines 855-864 Link Here
855
				count, plur(count));
1009
				count, plur(count));
856
		    }
1010
		    }
857
		    putstr(endwin, 0, pbuf);
1011
		    putstr(endwin, 0, pbuf);
1012
#ifdef DUMP_LOG
1013
		    if (dump_fp) dump("", pbuf);
1014
#endif
858
		}
1015
		}
859
	    }
1016
	    }
860
	} else if (!done_stopprint) {
1017
	} else {
861
	    /* did not escape or ascend */
1018
	    /* did not escape or ascend */
862
	    if (u.uz.dnum == 0 && u.uz.dlevel <= 0) {
1019
	    if (u.uz.dnum == 0 && u.uz.dlevel <= 0) {
863
		/* level teleported out of the dungeon; `how' is DIED,
1020
		/* level teleported out of the dungeon; `how' is DIED,
Lines 878-898 Link Here
878
	    Sprintf(eos(pbuf), " with %ld point%s,",
1035
	    Sprintf(eos(pbuf), " with %ld point%s,",
879
		    u.urexp, plur(u.urexp));
1036
		    u.urexp, plur(u.urexp));
880
	    putstr(endwin, 0, pbuf);
1037
	    if (!done_stopprint) putstr(endwin, 0, pbuf);
1038
#ifdef DUMP_LOG
1039
	    if (dump_fp) dump("", pbuf);
1040
#endif
881
	}
1041
	}
882
	if (!done_stopprint) {
1042
	Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.",
883
	    Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.",
1043
	    umoney, plur(umoney), moves, plur(moves));
884
		    umoney, plur(umoney), moves, plur(moves));
1044
	if (!done_stopprint)  putstr(endwin, 0, pbuf);
885
	    putstr(endwin, 0, pbuf);
1045
#ifdef DUMP_LOG
1046
	if (dump_fp) {
1047
	  dump("", pbuf);
1048
	  Sprintf(pbuf, "Killer: %s", killer);
1049
	  dump("", pbuf);
886
	}
1050
	}
887
	if (!done_stopprint) {
1051
#endif
888
	    Sprintf(pbuf,
1052
	Sprintf(pbuf,
889
	     "You were level %d with a maximum of %d hit point%s when you %s.",
1053
	     "You were level %d with a maximum of %d hit point%s when you %s.",
890
		    u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]);
1054
		u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]);
1055
	if (!done_stopprint) {
891
	    putstr(endwin, 0, pbuf);
1056
	    putstr(endwin, 0, pbuf);
892
	    putstr(endwin, 0, "");
1057
	    putstr(endwin, 0, "");
893
	}
1058
	}
1059
#ifdef DUMP_LOG
1060
	    if (dump_fp) dump("", pbuf);
1061
#endif
894
	if (!done_stopprint)
1062
	if (!done_stopprint)
895
	    display_nhwindow(endwin, TRUE);
1063
	    display_nhwindow(endwin, TRUE);
896
	if (endwin != WIN_ERR)
1064
	if (endwin != WIN_ERR)
Lines 909-914 Link Here
909
		exit_nhwindows((char *)0);
1077
		exit_nhwindows((char *)0);
910
	    topten(how);
1078
	    topten(how);
911
	}
1079
	}
1080
#ifdef DUMP_LOG
1081
	if (dump_fp) dump_exit();
1082
#endif
912
	if(done_stopprint) { raw_print(""); raw_print(""); }
1083
	if(done_stopprint) { raw_print(""); raw_print(""); }
913
	terminate(EXIT_SUCCESS);
1084
	terminate(EXIT_SUCCESS);
Lines 919-926 Link Here
919
container_contents(list, identified, all_containers)
1090
container_contents(list, identified, all_containers)
920
struct obj *list;
1091
struct obj *list;
921
boolean identified, all_containers;
1092
boolean identified, all_containers;
1093
#ifdef DUMP_LOG
1094
{
1095
	do_containerconts(list, identified, all_containers, FALSE, TRUE);
1096
}
1097
1098
void do_containerconts(list, identified, all_containers, want_dump, want_disp)
1099
struct obj *list;
1100
boolean identified, all_containers, want_dump, want_disp;
1101
#endif
1102
/* The original container_contents function */
922
{
1103
{
923
	register struct obj *box, *obj;
1104
	register struct obj *box, *obj;
1105
#ifdef SORTLOOT
1106
	struct obj **oarray;
1107
	int i,j,n;
1108
	char *invlet;
1109
#endif /* SORTLOOT */
924
	char buf[BUFSZ];
1110
	char buf[BUFSZ];
925
	for (box = list; box; box = box->nobj) {
1111
	for (box = list; box; box = box->nobj) {
Lines 928-952 Link Here
928
		if (box->otyp == BAG_OF_TRICKS) {
1114
		if (box->otyp == BAG_OF_TRICKS) {
929
		    continue;	/* wrong type of container */
1115
		    continue;	/* wrong type of container */
930
		} else if (box->cobj) {
1116
		} else if (box->cobj) {
931
		    winid tmpwin = create_nhwindow(NHW_MENU);
1117
		    winid tmpwin;
1118
#ifdef DUMP_LOG
1119
		    if (want_disp)
1120
#endif
1121
		    tmpwin = create_nhwindow(NHW_MENU);
1122
#ifdef SORTLOOT
1123
		    /* count the number of items */
1124
		    for (n = 0, obj = box->cobj; obj; obj = obj->nobj) n++;
1125
		    /* Make a temporary array to store the objects sorted */
1126
		    oarray = (struct obj **) alloc(n*sizeof(struct obj*));
1127
1128
		    /* Add objects to the array */
1129
		    i = 0;
1130
		    invlet = flags.inv_order;
1131
		nextclass:
1132
		    for (obj = box->cobj; obj; obj = obj->nobj) {
1133
                      if (!flags.sortpack || obj->oclass == *invlet) {
1134
			if (iflags.sortloot == 'f'
1135
			    || iflags.sortloot == 'l') {
1136
			  /* Insert object at correct index */
1137
			  for (j = i; j; j--) {
1138
			    if (strcmpi(cxname2(obj), cxname2(oarray[j-1]))>0
1139
			    || (flags.sortpack &&
1140
				oarray[j-1]->oclass != obj->oclass))
1141
			      break;
1142
			    oarray[j] = oarray[j-1];
1143
			  }
1144
			  oarray[j] = obj;
1145
			  i++;
1146
			} else {
1147
			  /* Just add it to the array */
1148
			  oarray[i++] = obj;
1149
			}
1150
		      }
1151
		    } /* for loop */
1152
		    if (flags.sortpack) {
1153
		      if (*++invlet) goto nextclass;
1154
		    }
1155
#endif /* SORTLOOT */
932
		    Sprintf(buf, "Contents of %s:", the(xname(box)));
1156
		    Sprintf(buf, "Contents of %s:", the(xname(box)));
1157
#ifdef DUMP_LOG
1158
		    if (want_disp) {
1159
#endif
933
		    putstr(tmpwin, 0, buf);
1160
		    putstr(tmpwin, 0, buf);
934
		    putstr(tmpwin, 0, "");
1161
		    putstr(tmpwin, 0, "");
1162
#ifdef DUMP_LOG
1163
		    }
1164
		    if (dump_fp) dump("", buf);
1165
#endif
1166
#ifdef SORTLOOT
1167
		    for (i = 0; i < n; i++) {
1168
		      obj = oarray[i];
1169
#else
935
		    for (obj = box->cobj; obj; obj = obj->nobj) {
1170
		    for (obj = box->cobj; obj; obj = obj->nobj) {
1171
#endif
936
			if (identified) {
1172
			if (identified) {
937
			    makeknown(obj->otyp);
1173
			    makeknown(obj->otyp);
938
			    obj->known = obj->bknown =
1174
			    obj->known = obj->bknown =
939
			    obj->dknown = obj->rknown = 1;
1175
			    obj->dknown = obj->rknown = 1;
940
			}
1176
			}
1177
#ifdef DUMP_LOG
1178
			if (want_dump)  dump("  ", doname(obj));
1179
			if (want_disp)
1180
#endif
941
			putstr(tmpwin, 0, doname(obj));
1181
			putstr(tmpwin, 0, doname(obj));
942
		    }
1182
		    }
1183
#ifdef DUMP_LOG
1184
		    if (want_dump)  dump("","");
1185
		    if (want_disp) {
1186
#endif
943
		    display_nhwindow(tmpwin, TRUE);
1187
		    display_nhwindow(tmpwin, TRUE);
944
		    destroy_nhwindow(tmpwin);
1188
		    destroy_nhwindow(tmpwin);
945
		    if (all_containers)
1189
#ifdef DUMP_LOG
1190
		    }
1191
		    if (all_containers) {
1192
			do_containerconts(box->cobj, identified, TRUE,
1193
					  want_dump, want_disp);
1194
#else
1195
		    if (all_containers) {
946
			container_contents(box->cobj, identified, TRUE);
1196
			container_contents(box->cobj, identified, TRUE);
1197
#endif /* DUMP_LOG */
1198
		    }
947
		} else {
1199
		} else {
1200
#ifdef DUMP_LOG
1201
		    if (want_disp) {
1202
#endif
948
		    pline("%s empty.", Tobjnam(box, "are"));
1203
		    pline("%s empty.", Tobjnam(box, "are"));
949
		    display_nhwindow(WIN_MESSAGE, FALSE);
1204
		    display_nhwindow(WIN_MESSAGE, FALSE);
1205
#ifdef DUMP_LOG
1206
		    }
1207
		    if (want_dump) {
1208
		      dump(The(xname(box)), " is empty.");
1209
		      dump("", "");
1210
		    }
1211
#endif
950
		}
1212
		}
951
	    }
1213
	    }
952
	    if (!all_containers)
1214
	    if (!all_containers)
Lines 973-982 Link Here
973
	nethack_exit(status);
1235
	nethack_exit(status);
974
}
1236
}
975
STATIC_OVL void
1237
void		/* showborn patch */
976
list_vanquished(defquery, ask)
1238
list_vanquished(defquery, ask)
977
char defquery;
1239
char defquery;
978
boolean ask;
1240
boolean ask;
1241
#ifdef DUMP_LOG
1242
{
1243
  do_vanquished(defquery, ask, FALSE);
1244
}
1245
1246
void
1247
do_vanquished(defquery, ask, want_dump)
1248
int defquery;
1249
boolean ask;
1250
boolean want_dump;
1251
#endif
979
{
1252
{
980
    register int i, lev;
1253
    register int i, lev;
981
    int ntypes = 0, max_lev = 0, nkilled;
1254
    int ntypes = 0, max_lev = 0, nkilled;
Lines 996-1008 Link Here
996
     * includes all dead monsters, not just those killed by the player
1269
     * includes all dead monsters, not just those killed by the player
997
     */
1270
     */
998
    if (ntypes != 0) {
1271
    if (ntypes != 0) {
999
	c = ask ? yn_function("Do you want an account of creatures vanquished?",
1272
#ifdef DUMP_LOG
1273
	c = done_stopprint ? 'n': ask ?
1274
#else
1275
	c = ask ?
1276
#endif
1277
	  yn_function("Do you want an account of creatures vanquished?",
1000
			      ynqchars, defquery) : defquery;
1278
			      ynqchars, defquery) : defquery;
1001
	if (c == 'q') done_stopprint++;
1279
	if (c == 'q') done_stopprint++;
1002
	if (c == 'y') {
1280
	if (c == 'y') {
1003
	    klwin = create_nhwindow(NHW_MENU);
1281
	    klwin = create_nhwindow(NHW_MENU);
1004
	    putstr(klwin, 0, "Vanquished creatures:");
1282
	    putstr(klwin, 0, "Vanquished creatures:");
1005
	    putstr(klwin, 0, "");
1283
	    putstr(klwin, 0, "");
1284
#ifdef DUMP_LOG
1285
	} /* the original end of block removed by the patch */
1286
	    if (want_dump)  dump("", "Vanquished creatures");
1287
#endif
1006
	    /* countdown by monster "toughness" */
1288
	    /* countdown by monster "toughness" */
1007
	    for (lev = max_lev; lev >= 0; lev--)
1289
	    for (lev = max_lev; lev >= 0; lev--)
Lines 1029-1049 Link Here
1029
			else
1311
			else
1030
			    Sprintf(buf, "%d %s",
1312
			    Sprintf(buf, "%d %s",
1031
				    nkilled, makeplural(mons[i].mname));
1313
				    nkilled, makeplural(mons[i].mname));
1314
#ifdef SHOW_BORN
1315
			if (iflags.show_born && nkilled != mvitals[i].born)
1316
			    Sprintf(buf + strlen(buf), " (%d created)",
1317
				    (int) mvitals[i].born);
1318
#endif
1032
		    }
1319
		    }
1033
		    putstr(klwin, 0, buf);
1320
		    if (c == 'y') putstr(klwin, 0, buf);
1321
#ifdef DUMP_LOG
1322
		    if (want_dump)  dump("  ", buf);
1323
#endif
1034
		}
1324
		}
1035
	    /*
1325
	    /*
1036
	     * if (Hallucination)
1326
	     * if (Hallucination)
1037
	     *     putstr(klwin, 0, "and a partridge in a pear tree");
1327
	     *     putstr(klwin, 0, "and a partridge in a pear tree");
1038
	     */
1328
	     */
1039
	    if (ntypes > 1) {
1329
	    if (ntypes > 1) {
1040
		putstr(klwin, 0, "");
1330
		if (c == 'y') putstr(klwin, 0, "");
1041
		Sprintf(buf, "%ld creatures vanquished.", total_killed);
1331
		Sprintf(buf, "%ld creatures vanquished.", total_killed);
1042
		putstr(klwin, 0, buf);
1332
		if (c == 'y') putstr(klwin, 0, buf);
1333
#ifdef DUMP_LOG
1334
		if (want_dump)  dump("  ", buf);
1335
#endif
1043
	    }
1336
	    }
1337
	    if (c == 'y') {
1044
	    display_nhwindow(klwin, TRUE);
1338
	    display_nhwindow(klwin, TRUE);
1045
	    destroy_nhwindow(klwin);
1339
	    destroy_nhwindow(klwin);
1046
	}
1340
	    }
1341
#ifdef DUMP_LOG
1342
	    if (want_dump)  dump("", "");
1343
#else
1344
	} /* the original end of if (c == 'y') */
1345
#endif
1047
    }
1346
    }
1048
}
1347
}
Lines 1059-1101 Link Here
1059
    return n;
1358
    return n;
1060
}
1359
}
1360
#ifdef DUMP_LOG
1361
STATIC_OVL void
1362
list_genocided(defquery, ask, want_dump)
1363
int defquery;
1364
boolean ask;
1365
boolean want_dump;
1366
#else
1061
STATIC_OVL void
1367
STATIC_OVL void
1062
list_genocided(defquery, ask)
1368
list_genocided(defquery, ask)
1063
char defquery;
1369
char defquery;
1064
boolean ask;
1370
boolean ask;
1371
#endif
1065
{
1372
{
1066
    register int i;
1373
    register int i;
1067
    int ngenocided;
1374
    int ngenocided=0;
1375
#ifdef SHOW_EXTINCT
1376
    int nextincted=0;
1377
#endif
1068
    char c;
1378
    char c;
1069
    winid klwin;
1379
    winid klwin;
1070
    char buf[BUFSZ];
1380
    char buf[BUFSZ];
1381
    /* get totals first */
1382
#ifdef SHOW_EXTINCT
1383
    for (i = LOW_PM; i < NUMMONS; i++) {
1384
	if (mvitals[i].mvflags & G_GENOD)
1385
	    ngenocided++;
1386
	else if ( (mvitals[i].mvflags & G_GONE) && !(mons[i].geno & G_UNIQ) )
1387
	    nextincted++;
1388
    }
1071
    ngenocided = num_genocides();
1389
    ngenocided = num_genocides();
1390
#endif
1072
    /* genocided species list */
1391
    /* genocided species list */
1073
    if (ngenocided != 0) {
1392
    if (ngenocided != 0
1393
#ifdef SHOW_EXTINCT
1394
      || nextincted != 0
1395
#endif
1396
    ) {
1397
#ifdef SHOW_EXTINCT
1398
	if (nextincted != 0)
1399
	  c = ask ?
1400
	  yn_function("Do you want a list of species genocided or extinct?",
1401
		      ynqchars, defquery) : defquery;
1402
       else
1403
#endif
1074
	c = ask ? yn_function("Do you want a list of species genocided?",
1404
	c = ask ? yn_function("Do you want a list of species genocided?",
1075
			      ynqchars, defquery) : defquery;
1405
			      ynqchars, defquery) : defquery;
1076
	if (c == 'q') done_stopprint++;
1406
	if (c == 'q') done_stopprint++;
1077
	if (c == 'y') {
1407
	if (c == 'y') {
1078
	    klwin = create_nhwindow(NHW_MENU);
1408
	    klwin = create_nhwindow(NHW_MENU);
1079
	    putstr(klwin, 0, "Genocided species:");
1409
#ifdef SHOW_EXTINCT
1410
	    Sprintf(buf, "Genocided or extinct species:");
1411
#else
1412
	    Sprintf(buf, "Genocided species:");
1413
#endif
1414
	    putstr(klwin, 0, buf);
1080
	    putstr(klwin, 0, "");
1415
	    putstr(klwin, 0, "");
1416
#ifdef DUMP_LOG
1417
	    if (want_dump)  dump("", buf);
1418
#endif
1081
	    for (i = LOW_PM; i < NUMMONS; i++)
1419
	    for (i = LOW_PM; i < NUMMONS; i++)
1420
#ifdef SHOW_EXTINCT
1421
	      if (mvitals[i].mvflags & G_GONE && !(mons[i].geno & G_UNIQ) ){
1422
#else
1082
		if (mvitals[i].mvflags & G_GENOD) {
1423
		if (mvitals[i].mvflags & G_GENOD) {
1424
#endif
1083
		    if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST)
1425
		    if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST)
1084
			Sprintf(buf, "%s%s",
1426
			Sprintf(buf, "%s%s",
1085
				!type_is_pname(&mons[i]) ? "" : "the ",
1427
				!type_is_pname(&mons[i]) ? "" : "the ",
1086
				mons[i].mname);
1428
				mons[i].mname);
1087
		    else
1429
		    else
1088
			Strcpy(buf, makeplural(mons[i].mname));
1430
			Strcpy(buf, makeplural(mons[i].mname));
1431
#ifdef SHOW_EXTINCT
1432
		    if( !(mvitals[i].mvflags & G_GENOD) )
1433
			Strcat(buf, " (extinct)");
1434
#endif
1089
		    putstr(klwin, 0, buf);
1435
		    putstr(klwin, 0, buf);
1436
#ifdef DUMP_LOG
1437
		    if (want_dump)  dump("  ", buf);
1438
#endif
1090
		}
1439
		}
1091
	    putstr(klwin, 0, "");
1440
	    putstr(klwin, 0, "");
1441
#ifdef SHOW_EXTINCT
1442
	    if (ngenocided>0)  {
1443
#endif
1092
	    Sprintf(buf, "%d species genocided.", ngenocided);
1444
	    Sprintf(buf, "%d species genocided.", ngenocided);
1093
	    putstr(klwin, 0, buf);
1445
	    putstr(klwin, 0, buf);
1446
#ifdef DUMP_LOG
1447
	    if (want_dump)  dump("  ", buf);
1448
#endif
1449
#ifdef SHOW_EXTINCT
1450
	    }
1451
	    if (nextincted>0) {
1452
		Sprintf(buf, "%d species extinct.", nextincted);
1453
		putstr(klwin, 0, buf);
1454
#ifdef DUMP_LOG
1455
		if (want_dump) dump("  ", buf);
1456
#endif
1457
	    }
1458
#endif /* SHOW_EXTINCT */
1459
#ifdef DUMP_LOG
1460
	    if (want_dump)  dump("", "");
1461
#endif
1094
	    display_nhwindow(klwin, TRUE);
1462
	    display_nhwindow(klwin, TRUE);
1095
	    destroy_nhwindow(klwin);
1463
	    destroy_nhwindow(klwin);
(-)nethack-3.4.3/src/files.c (-1 / +15 lines)
Lines 999-1005 Link Here
999
#if defined(UNIX) && defined(QT_GRAPHICS)
999
#if defined(UNIX) && defined(QT_GRAPHICS)
1000
    int myuid=getuid();
1000
    int myuid=getuid();
1001
    struct dirent **namelist;
1001
    struct dirent **namelist;
1002
    int n = scandir("save", &namelist, 0, alphasort);;
1002
    int n = scandir(fqname("save",SAVEPREFIX,0), &namelist, 0, alphasort);;
1003
    if ( n > 0 ) {
1003
    if ( n > 0 ) {
1004
	int i,j=0;
1004
	int i,j=0;
1005
	char** result = (char**)alloc((n+1)*sizeof(char*)); /* at most */
1005
	char** result = (char**)alloc((n+1)*sizeof(char*)); /* at most */
Lines 1720-1725 Link Here
1720
	} else if (match_varname(buf, "AUTOPICKUP_EXCEPTION", 5)) {
1720
	} else if (match_varname(buf, "AUTOPICKUP_EXCEPTION", 5)) {
1721
		add_autopickup_exception(bufp);
1721
		add_autopickup_exception(bufp);
1722
#endif
1722
#endif
1723
#ifdef DYNKEY
1724
        } else if (match_varname(buf, "MAPPING", 3)) {
1725
                add_dkb(bufp, FALSE);
1726
        } else if (match_varname(buf, "SWAP", 4)) {
1727
                add_dkb(bufp, TRUE);
1728
#endif
1723
#ifdef NOCWD_ASSUMPTIONS
1729
#ifdef NOCWD_ASSUMPTIONS
1724
	} else if (match_varname(buf, "HACKDIR", 4)) {
1730
	} else if (match_varname(buf, "HACKDIR", 4)) {
1725
		adjust_prefix(bufp, HACKPREFIX);
1731
		adjust_prefix(bufp, HACKPREFIX);
Lines 1794-1799 Link Here
1794
	} else if (match_varname(buf, "BOULDER", 3)) {
1800
	} else if (match_varname(buf, "BOULDER", 3)) {
1795
	    (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE,
1801
	    (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE,
1796
			      1, "BOULDER");
1802
			      1, "BOULDER");
1803
	} else if (match_varname(buf, "MENUCOLOR", 9)) {
1804
#ifdef MENU_COLOR
1805
	    (void) add_menu_coloring(bufp);
1806
#endif
1807
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
1808
	} else if (match_varname(buf, "STATUSCOLOR", 11)) {
1809
	    (void) parse_status_color_options(bufp);
1810
#endif
1797
	} else if (match_varname(buf, "GRAPHICS", 4)) {
1811
	} else if (match_varname(buf, "GRAPHICS", 4)) {
1798
	    len = get_uchars(fp, buf, bufp, translate, FALSE,
1812
	    len = get_uchars(fp, buf, bufp, translate, FALSE,
1799
			     MAXPCHARS, "GRAPHICS");
1813
			     MAXPCHARS, "GRAPHICS");
(-)nethack-3.4.3/src/invent.c (-2 / +158 lines)
Lines 19-25 Link Here
19
STATIC_DCL boolean FDECL(putting_on, (const char *));
19
STATIC_DCL boolean FDECL(putting_on, (const char *));
20
STATIC_PTR int FDECL(ckunpaid,(struct obj *));
20
STATIC_PTR int FDECL(ckunpaid,(struct obj *));
21
STATIC_PTR int FDECL(ckvalidcat,(struct obj *));
21
STATIC_PTR int FDECL(ckvalidcat,(struct obj *));
22
#ifdef DUMP_LOG
23
static char FDECL(display_pickinv,
24
		 (const char *,BOOLEAN_P, long *, BOOLEAN_P, BOOLEAN_P));
25
#else
22
static char FDECL(display_pickinv, (const char *,BOOLEAN_P, long *));
26
static char FDECL(display_pickinv, (const char *,BOOLEAN_P, long *));
27
#endif /* DUMP_LOG */
23
#ifdef OVLB
28
#ifdef OVLB
24
STATIC_DCL boolean FDECL(this_type_only, (struct obj *));
29
STATIC_DCL boolean FDECL(this_type_only, (struct obj *));
25
STATIC_DCL void NDECL(dounpaid);
30
STATIC_DCL void NDECL(dounpaid);
Lines 1017-1023 Link Here
1017
		    if (ilet == '?' && !*lets && *altlets)
1022
		    if (ilet == '?' && !*lets && *altlets)
1018
			allowed_choices = altlets;
1023
			allowed_choices = altlets;
1019
		    ilet = display_pickinv(allowed_choices, TRUE,
1024
		    ilet = display_pickinv(allowed_choices, TRUE,
1020
					   allowcnt ? &ctmp : (long *)0);
1025
					   allowcnt ? &ctmp : (long *)0
1026
#ifdef DUMP_LOG
1027
					   , FALSE, TRUE
1028
#endif
1029
					   );
1021
		    if(!ilet) continue;
1030
		    if(!ilet) continue;
1022
		    if (allowcnt && ctmp >= 0) {
1031
		    if (allowcnt && ctmp >= 0) {
1023
			cnt = ctmp;
1032
			cnt = ctmp;
Lines 1689-1701 Link Here
1689
 * inventory and return a count as well as a letter. If out_cnt is not null,
1698
 * inventory and return a count as well as a letter. If out_cnt is not null,
1690
 * any count returned from the menu selection is placed here.
1699
 * any count returned from the menu selection is placed here.
1691
 */
1700
 */
1701
#ifdef DUMP_LOG
1702
static char
1703
display_pickinv(lets, want_reply, out_cnt, want_dump, want_disp)
1704
register const char *lets;
1705
boolean want_reply;
1706
long* out_cnt;
1707
boolean want_dump;
1708
boolean want_disp;
1709
#else
1692
static char
1710
static char
1693
display_pickinv(lets, want_reply, out_cnt)
1711
display_pickinv(lets, want_reply, out_cnt)
1694
register const char *lets;
1712
register const char *lets;
1695
boolean want_reply;
1713
boolean want_reply;
1696
long* out_cnt;
1714
long* out_cnt;
1715
#endif
1697
{
1716
{
1698
	struct obj *otmp;
1717
	struct obj *otmp;
1718
#ifdef SORTLOOT
1719
	struct obj **oarray;
1720
	int i, j;
1721
#endif
1699
	char ilet, ret;
1722
	char ilet, ret;
1700
	char *invlet = flags.inv_order;
1723
	char *invlet = flags.inv_order;
1701
	int n, classcount;
1724
	int n, classcount;
Lines 1704-1709 Link Here
1704
	anything any;
1727
	anything any;
1705
	menu_item *selected;
1728
	menu_item *selected;
1729
#ifdef DUMP_LOG
1730
	if (want_disp) {
1731
#endif
1706
	/* overriden by global flag */
1732
	/* overriden by global flag */
1707
	if (flags.perm_invent) {
1733
	if (flags.perm_invent) {
1708
	    win = (lets && *lets) ? local_win : WIN_INVEN;
1734
	    win = (lets && *lets) ? local_win : WIN_INVEN;
Lines 1713-1718 Link Here
1713
	} else
1739
	} else
1714
	    win = WIN_INVEN;
1740
	    win = WIN_INVEN;
1741
#ifdef DUMP_LOG
1742
	}
1743
	if (want_dump)   dump("", "Your inventory");
1744
#endif
1745
1715
	/*
1746
	/*
1716
	Exit early if no inventory -- but keep going if we are doing
1747
	Exit early if no inventory -- but keep going if we are doing
1717
	a permanent inventory update.  We need to keep going so the
1748
	a permanent inventory update.  We need to keep going so the
Lines 1725-1735 Link Here
1725
	to here is short circuited away.
1756
	to here is short circuited away.
1726
	*/
1757
	*/
1727
	if (!invent && !(flags.perm_invent && !lets && !want_reply)) {
1758
	if (!invent && !(flags.perm_invent && !lets && !want_reply)) {
1759
#ifdef DUMP_LOG
1760
	  if (want_disp) {
1761
#endif
1728
#ifndef GOLDOBJ
1762
#ifndef GOLDOBJ
1729
	    pline("Not carrying anything%s.", u.ugold ? " except gold" : "");
1763
	    pline("Not carrying anything%s.", u.ugold ? " except gold" : "");
1730
#else
1764
#else
1731
	    pline("Not carrying anything.");
1765
	    pline("Not carrying anything.");
1732
#endif
1766
#endif
1767
#ifdef DUMP_LOG
1768
	  }
1769
	  if (want_dump) {
1770
#ifdef GOLDOBJ
1771
	    dump("  ", "Not carrying anything");
1772
#else
1773
	    dump("  Not carrying anything", u.ugold ? " except gold." : ".");
1774
#endif
1775
	  }
1776
#endif
1733
	    return 0;
1777
	    return 0;
1734
	}
1778
	}
Lines 1743-1779 Link Here
1743
	    ret = '\0';
1787
	    ret = '\0';
1744
	    for (otmp = invent; otmp; otmp = otmp->nobj) {
1788
	    for (otmp = invent; otmp; otmp = otmp->nobj) {
1745
		if (otmp->invlet == lets[0]) {
1789
		if (otmp->invlet == lets[0]) {
1790
#ifdef DUMP_LOG
1791
		  if (want_disp) {
1792
#endif
1746
		    ret = message_menu(lets[0],
1793
		    ret = message_menu(lets[0],
1747
			  want_reply ? PICK_ONE : PICK_NONE,
1794
			  want_reply ? PICK_ONE : PICK_NONE,
1748
			  xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L));
1795
			  xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L));
1749
		    if (out_cnt) *out_cnt = -1L;	/* select all */
1796
		    if (out_cnt) *out_cnt = -1L;	/* select all */
1797
#ifdef DUMP_LOG
1798
		  }
1799
		  if (want_dump) {
1800
		    char letbuf[7];
1801
		    sprintf(letbuf, "  %c - ", lets[0]);
1802
		    dump(letbuf,
1803
			 xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L));
1804
		  }
1805
#endif
1750
		    break;
1806
		    break;
1751
		}
1807
		}
1752
	    }
1808
	    }
1753
	    return ret;
1809
	    return ret;
1754
	}
1810
	}
1811
#ifdef SORTLOOT
1812
	/* count the number of items */
1813
	for (n = 0, otmp = invent; otmp; otmp = otmp->nobj)
1814
	  if(!lets || !*lets || index(lets, otmp->invlet)) n++;
1815
1816
	/* Make a temporary array to store the objects sorted */
1817
	oarray = (struct obj **)alloc(n*sizeof(struct obj*));
1818
1819
	/* Add objects to the array */
1820
	i = 0;
1821
	for(otmp = invent; otmp; otmp = otmp->nobj)
1822
	  if(!lets || !*lets || index(lets, otmp->invlet)) {
1823
	    if (iflags.sortloot == 'f') {
1824
	      /* Insert object at correct index */
1825
	      for (j = i; j; j--) {
1826
		if (strcmpi(cxname2(otmp), cxname2(oarray[j-1]))>0) break;
1827
		oarray[j] = oarray[j-1];
1828
	      }
1829
	      oarray[j] = otmp;
1830
	      i++;
1831
	    } else {
1832
	      /* Just add it to the array */
1833
	      oarray[i++] = otmp;
1834
	    }
1835
	  }
1836
#endif /* SORTLOOT */
1837
1838
#ifdef DUMP_LOG
1839
	if (want_disp)
1840
#endif
1755
	start_menu(win);
1841
	start_menu(win);
1756
nextclass:
1842
nextclass:
1757
	classcount = 0;
1843
	classcount = 0;
1758
	any.a_void = 0;		/* set all bits to zero */
1844
	any.a_void = 0;		/* set all bits to zero */
1845
#ifdef SORTLOOT
1846
	for(i = 0; i < n; i++) {
1847
	  otmp = oarray[i];
1848
	  ilet = otmp->invlet;
1849
	  if (!flags.sortpack || otmp->oclass == *invlet) {
1850
	    if (flags.sortpack && !classcount) {
1851
	      any.a_void = 0;             /* zero */
1852
#ifdef DUMP_LOG
1853
	      if (want_dump)
1854
		dump("  ", let_to_name(*invlet, FALSE));
1855
	      if (want_disp)
1856
#endif
1857
	      add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
1858
		       let_to_name(*invlet, FALSE), MENU_UNSELECTED);
1859
	      classcount++;
1860
	    }
1861
	    any.a_char = ilet;
1862
#ifdef DUMP_LOG
1863
	    if (want_dump) {
1864
	      char letbuf[7];
1865
	      sprintf(letbuf, "  %c - ", ilet);
1866
	      dump(letbuf, doname(otmp));
1867
	    }
1868
	    if (want_disp)
1869
#endif
1870
	    add_menu(win, obj_to_glyph(otmp),
1871
		     &any, ilet, 0, ATR_NONE, doname(otmp),
1872
		     MENU_UNSELECTED);
1873
	  }
1874
	}
1875
#else /* SORTLOOT */
1759
	for(otmp = invent; otmp; otmp = otmp->nobj) {
1876
	for(otmp = invent; otmp; otmp = otmp->nobj) {
1760
		ilet = otmp->invlet;
1877
		ilet = otmp->invlet;
1761
		if(!lets || !*lets || index(lets, ilet)) {
1878
		if(!lets || !*lets || index(lets, ilet)) {
1762
			if (!flags.sortpack || otmp->oclass == *invlet) {
1879
			if (!flags.sortpack || otmp->oclass == *invlet) {
1763
			    if (flags.sortpack && !classcount) {
1880
			    if (flags.sortpack && !classcount) {
1764
				any.a_void = 0;		/* zero */
1881
				any.a_void = 0;		/* zero */
1882
#ifdef DUMP_LOG
1883
				if (want_dump)
1884
				    dump("  ", let_to_name(*invlet, FALSE));
1885
				if (want_disp)
1886
#endif
1765
				add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
1887
				add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
1766
				    let_to_name(*invlet, FALSE), MENU_UNSELECTED);
1888
				    let_to_name(*invlet, FALSE), MENU_UNSELECTED);
1767
				classcount++;
1889
				classcount++;
1768
			    }
1890
			    }
1769
			    any.a_char = ilet;
1891
			    any.a_char = ilet;
1892
#ifdef DUMP_LOG
1893
			    if (want_dump) {
1894
			      char letbuf[7];
1895
			      sprintf(letbuf, "  %c - ", ilet);
1896
			      dump(letbuf, doname(otmp));
1897
			    }
1898
			    if (want_disp)
1899
#endif
1770
			    add_menu(win, obj_to_glyph(otmp),
1900
			    add_menu(win, obj_to_glyph(otmp),
1771
					&any, ilet, 0, ATR_NONE, doname(otmp),
1901
					&any, ilet, 0, ATR_NONE, doname(otmp),
1772
					MENU_UNSELECTED);
1902
					MENU_UNSELECTED);
1773
			}
1903
			}
1774
		}
1904
		}
1775
	}
1905
	}
1906
#endif /* SORTLOOT */
1776
	if (flags.sortpack) {
1907
	if (flags.sortpack) {
1777
		if (*++invlet) goto nextclass;
1908
		if (*++invlet) goto nextclass;
1778
#ifdef WIZARD
1909
#ifdef WIZARD
Lines 1783-1788 Link Here
1783
		}
1914
		}
1784
#endif
1915
#endif
1785
	}
1916
	}
1917
#ifdef SORTLOOT
1918
	free(oarray);
1919
#endif
1920
#ifdef DUMP_LOG
1921
	if (want_disp) {
1922
#endif
1786
	end_menu(win, (char *) 0);
1923
	end_menu(win, (char *) 0);
1787
	n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected);
1924
	n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected);
Lines 1792-1797 Link Here
1792
	    free((genericptr_t)selected);
1929
	    free((genericptr_t)selected);
1793
	} else
1930
	} else
1794
	    ret = !n ? '\0' : '\033';	/* cancelled */
1931
	    ret = !n ? '\0' : '\033';	/* cancelled */
1932
#ifdef DUMP_LOG
1933
	} /* want_disp */
1934
	if (want_dump)  dump("", "");
1935
#endif
1795
	return ret;
1936
	return ret;
1796
}
1937
}
Lines 1808-1815 Link Here
1808
register const char *lets;
1949
register const char *lets;
1809
boolean want_reply;
1950
boolean want_reply;
1810
{
1951
{
1811
	return display_pickinv(lets, want_reply, (long *)0);
1952
	return display_pickinv(lets, want_reply, (long *)0
1953
#ifdef DUMP_LOG
1954
			       , FALSE , TRUE
1955
#endif
1956
	);
1957
}
1958
1959
#ifdef DUMP_LOG
1960
/* See display_inventory. This is the same thing WITH dumpfile creation */
1961
char
1962
dump_inventory(lets, want_reply, want_disp)
1963
register const char *lets;
1964
boolean want_reply, want_disp;
1965
{
1966
  return display_pickinv(lets, want_reply, (long *)0, TRUE, want_disp);
1812
}
1967
}
1968
#endif
1813
/*
1969
/*
1814
 * Returns the number of unpaid items within the given list.  This includes
1970
 * Returns the number of unpaid items within the given list.  This includes
(-)nethack-3.4.3/src/mapglyph.c (-2 / +2 lines)
Lines 50-59 Link Here
50
#ifdef ROGUE_COLOR
50
#ifdef ROGUE_COLOR
51
# if defined(USE_TILES) && defined(MSDOS)
51
# if defined(USE_TILES) && defined(MSDOS)
52
#define HAS_ROGUE_IBM_GRAPHICS (iflags.IBMgraphics && !iflags.grmode && \
52
#define HAS_ROGUE_IBM_GRAPHICS (iflags.chargfx == IBM_GRAPHICS && !iflags.grmode && \
53
	Is_rogue_level(&u.uz))
53
	Is_rogue_level(&u.uz))
54
# else
54
# else
55
#define HAS_ROGUE_IBM_GRAPHICS (iflags.IBMgraphics && Is_rogue_level(&u.uz))
55
#define HAS_ROGUE_IBM_GRAPHICS (iflags.chargfx == IBM_GRAPHICS && Is_rogue_level(&u.uz))
56
# endif
56
# endif
57
#endif
57
#endif
(-)nethack-3.4.3/src/mcastu.c (+8 lines)
Lines 515-520 Link Here
515
	pline("A bolt of lightning strikes down at you from above!");
515
	pline("A bolt of lightning strikes down at you from above!");
516
	reflects = ureflects("It bounces off your %s%s.", "");
516
	reflects = ureflects("It bounces off your %s%s.", "");
517
518
	/* copied from zap.c
519
	 * Chris Becker (topher@csh.rit.edu)
520
	 */
521
    You("are blinded by the flash!");
522
    make_blinded((long)rnd(100),FALSE);
523
    if (!Blind) Your(vision_clears);
524
517
	if (reflects || Shock_resistance) {
525
	if (reflects || Shock_resistance) {
518
	    shieldeff(u.ux, u.uy);
526
	    shieldeff(u.ux, u.uy);
519
	    dmg = 0;
527
	    dmg = 0;
(-)nethack-3.4.3/src/objnam.c (+25 lines)
Lines 15-20 Link Here
15
#endif
15
#endif
16
static char *NDECL(nextobuf);
16
static char *NDECL(nextobuf);
17
static void FDECL(add_erosion_words, (struct obj *, char *));
17
static void FDECL(add_erosion_words, (struct obj *, char *));
18
#ifdef SORTLOOT
19
char * FDECL(xname2, (struct obj *, boolean));
20
#endif
18
struct Jitem {
21
struct Jitem {
19
	int item;
22
	int item;
Lines 233-238 Link Here
233
char *
236
char *
234
xname(obj)
237
xname(obj)
235
register struct obj *obj;
238
register struct obj *obj;
239
#ifdef SORTLOOT
240
{
241
	return xname2(obj, FALSE);
242
}
243
char *
244
xname2(obj, ignore_oquan)
245
register struct obj *obj;
246
boolean ignore_oquan;
247
#endif
236
{
248
{
237
	register char *buf;
249
	register char *buf;
238
	register int typ = obj->otyp;
250
	register int typ = obj->otyp;
Lines 469-474 Link Here
469
	default:
481
	default:
470
		Sprintf(buf,"glorkum %d %d %d", obj->oclass, typ, obj->spe);
482
		Sprintf(buf,"glorkum %d %d %d", obj->oclass, typ, obj->spe);
471
	}
483
	}
484
#ifdef SORTLOOT
485
	if (!ignore_oquan)
486
#endif
472
	if (obj->quan != 1L) Strcpy(buf, makeplural(buf));
487
	if (obj->quan != 1L) Strcpy(buf, makeplural(buf));
473
	if (obj->onamelth && obj->dknown) {
488
	if (obj->onamelth && obj->dknown) {
Lines 853-858 Link Here
853
	    return corpse_xname(obj, FALSE);
868
	    return corpse_xname(obj, FALSE);
854
	return xname(obj);
869
	return xname(obj);
855
}
870
}
871
#ifdef SORTLOOT
872
char *
873
cxname2(obj)
874
struct obj *obj;
875
{
876
	if (obj->otyp == CORPSE)
877
	    return corpse_xname(obj, TRUE);
878
	return xname2(obj, TRUE);
879
}
880
#endif /* SORTLOOT */
856
/* treat an object as fully ID'd when it might be used as reason for death */
881
/* treat an object as fully ID'd when it might be used as reason for death */
857
char *
882
char *
(-)nethack-3.4.3/src/options.c (-11 / +536 lines)
Lines 23-28 Link Here
23
#define PREFER_TILED FALSE
23
#define PREFER_TILED FALSE
24
#endif
24
#endif
25
static struct Char_Gfx {
26
  int gfx;
27
  char *txt;
28
  char let;
29
} const chargfx[] = {
30
  {ASCII_GRAPHICS,	"ASCII", 'a'},
31
  {DEC_GRAPHICS,	"DEC",	 'd'},
32
  {IBM_GRAPHICS,	"IBM",	 'i'},
33
#ifdef MAC_GRAPHICS_ENV
34
  {MAC_GRAPHICS,	"Mac",	 'm'},
35
#endif
36
};
37
38
25
/*
39
/*
26
 *  NOTE:  If you add (or delete) an option, please update the short
40
 *  NOTE:  If you add (or delete) an option, please update the short
27
 *  options help (option_help()), the long options help (dat/opthelp),
41
 *  options help (option_help()), the long options help (dat/opthelp),
Lines 76-82 Link Here
76
# endif
90
# endif
77
	{"confirm",&flags.confirm, TRUE, SET_IN_GAME},
91
	{"confirm",&flags.confirm, TRUE, SET_IN_GAME},
78
#if defined(TERMLIB) && !defined(MAC_GRAPHICS_ENV)
92
#if defined(TERMLIB) && !defined(MAC_GRAPHICS_ENV)
79
	{"DECgraphics", &iflags.DECgraphics, FALSE, SET_IN_GAME},
93
	{"DECgraphics", &iflags.DECgraphics, FALSE, SET_IN_FILE},
80
#else
94
#else
81
	{"DECgraphics", (boolean *)0, FALSE, SET_IN_FILE},
95
	{"DECgraphics", (boolean *)0, FALSE, SET_IN_FILE},
82
#endif
96
#endif
Lines 102-108 Link Here
102
	{"help", &flags.help, TRUE, SET_IN_GAME},
116
	{"help", &flags.help, TRUE, SET_IN_GAME},
103
	{"hilite_pet",    &iflags.wc_hilite_pet, FALSE, SET_IN_GAME},	/*WC*/
117
	{"hilite_pet",    &iflags.wc_hilite_pet, FALSE, SET_IN_GAME},	/*WC*/
104
#ifdef ASCIIGRAPH
118
#ifdef ASCIIGRAPH
105
	{"IBMgraphics", &iflags.IBMgraphics, FALSE, SET_IN_GAME},
119
	{"IBMgraphics", &iflags.IBMgraphics, FALSE, SET_IN_FILE},
106
#else
120
#else
107
	{"IBMgraphics", (boolean *)0, FALSE, SET_IN_FILE},
121
	{"IBMgraphics", (boolean *)0, FALSE, SET_IN_FILE},
108
#endif
122
#endif
Lines 116-122 Link Here
116
	{"lit_corridor", &flags.lit_corridor, FALSE, SET_IN_GAME},
130
	{"lit_corridor", &flags.lit_corridor, FALSE, SET_IN_GAME},
117
	{"lootabc", &iflags.lootabc, FALSE, SET_IN_GAME},
131
	{"lootabc", &iflags.lootabc, FALSE, SET_IN_GAME},
118
#ifdef MAC_GRAPHICS_ENV
132
#ifdef MAC_GRAPHICS_ENV
119
	{"Macgraphics", &iflags.MACgraphics, TRUE, SET_IN_GAME},
133
	{"Macgraphics", &iflags.MACgraphics, TRUE, SET_IN_FILE},
120
#else
134
#else
121
	{"Macgraphics", (boolean *)0, FALSE, SET_IN_FILE},
135
	{"Macgraphics", (boolean *)0, FALSE, SET_IN_FILE},
122
#endif
136
#endif
Lines 125-130 Link Here
125
#else
139
#else
126
	{"mail", (boolean *)0, TRUE, SET_IN_FILE},
140
	{"mail", (boolean *)0, TRUE, SET_IN_FILE},
127
#endif
141
#endif
142
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
143
	{"statuscolors", &iflags.use_status_colors, TRUE, SET_IN_GAME},
144
#else
145
	{"statuscolors", (boolean *)0, TRUE, SET_IN_GAME},
146
#endif
147
#ifdef MENU_COLOR
148
# ifdef MICRO
149
	{"menucolors", &iflags.use_menu_color, TRUE,  SET_IN_GAME},
150
# else
151
	{"menucolors", &iflags.use_menu_color, FALSE, SET_IN_GAME},
152
# endif
153
#else
154
	{"menucolors", (boolean *)0, FALSE, SET_IN_GAME},
155
#endif
128
#ifdef WIZARD
156
#ifdef WIZARD
129
	/* for menu debugging only*/
157
	/* for menu debugging only*/
130
	{"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME},
158
	{"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME},
Lines 143-148 Link Here
143
#else
171
#else
144
	{"page_wait", (boolean *)0, FALSE, SET_IN_FILE},
172
	{"page_wait", (boolean *)0, FALSE, SET_IN_FILE},
145
#endif
173
#endif
174
#ifdef PARANOID
175
	{"paranoid_hit", &iflags.paranoid_hit, FALSE, SET_IN_GAME},
176
	{"paranoid_quit", &iflags.paranoid_quit, FALSE, SET_IN_GAME},
177
	{"paranoid_remove", &iflags.paranoid_remove, FALSE, SET_IN_GAME},
178
#endif
146
	{"perm_invent", &flags.perm_invent, FALSE, SET_IN_GAME},
179
	{"perm_invent", &flags.perm_invent, FALSE, SET_IN_GAME},
147
	{"popup_dialog",  &iflags.wc_popup_dialog, FALSE, SET_IN_GAME},	/*WC*/
180
	{"popup_dialog",  &iflags.wc_popup_dialog, FALSE, SET_IN_GAME},	/*WC*/
148
	{"prayconfirm", &flags.prayconfirm, TRUE, SET_IN_GAME},
181
	{"prayconfirm", &flags.prayconfirm, TRUE, SET_IN_GAME},
Lines 160-165 Link Here
160
#else
193
#else
161
	{"sanity_check", (boolean *)0, FALSE, SET_IN_FILE},
194
	{"sanity_check", (boolean *)0, FALSE, SET_IN_FILE},
162
#endif
195
#endif
196
#ifdef SHOW_BORN
197
	{"showborn", &iflags.show_born, FALSE, SET_IN_GAME},
198
#endif
163
#ifdef EXP_ON_BOTL
199
#ifdef EXP_ON_BOTL
164
	{"showexp", &flags.showexp, FALSE, SET_IN_GAME},
200
	{"showexp", &flags.showexp, FALSE, SET_IN_GAME},
165
#else
201
#else
Lines 219-229 Link Here
219
						1, SET_IN_GAME },
255
						1, SET_IN_GAME },
220
	{ "catname",  "the name of your (first) cat (e.g., catname:Tabby)",
256
	{ "catname",  "the name of your (first) cat (e.g., catname:Tabby)",
221
						PL_PSIZ, DISP_IN_GAME },
257
						PL_PSIZ, DISP_IN_GAME },
258
	{ "chargfx",  "use special character set for display", PL_PSIZ, SET_IN_GAME },
222
	{ "disclose", "the kinds of information to disclose at end of game",
259
	{ "disclose", "the kinds of information to disclose at end of game",
223
						sizeof(flags.end_disclose) * 2,
260
						sizeof(flags.end_disclose) * 2,
224
						SET_IN_GAME },
261
						SET_IN_GAME },
225
	{ "dogname",  "the name of your (first) dog (e.g., dogname:Fang)",
262
	{ "dogname",  "the name of your (first) dog (e.g., dogname:Fang)",
226
						PL_PSIZ, DISP_IN_GAME },
263
						PL_PSIZ, DISP_IN_GAME },
264
#ifdef DUMP_LOG
265
	{ "dumpfile", "where to dump data (e.g., dumpfile:/tmp/dump.nh)",
266
#ifdef DUMP_FN
267
						PL_PSIZ, DISP_IN_GAME },
268
#else
269
						PL_PSIZ, SET_IN_GAME },
270
#endif
271
#endif
227
	{ "dungeon",  "the symbols to use in drawing the dungeon map",
272
	{ "dungeon",  "the symbols to use in drawing the dungeon map",
228
						MAXDCHARS+1, SET_IN_FILE },
273
						MAXDCHARS+1, SET_IN_FILE },
229
	{ "effects",  "the symbols to use in drawing special effects",
274
	{ "effects",  "the symbols to use in drawing special effects",
Lines 246-251 Link Here
246
	{ "horsename", "the name of your (first) horse (e.g., horsename:Silver)",
291
	{ "horsename", "the name of your (first) horse (e.g., horsename:Silver)",
247
						PL_PSIZ, DISP_IN_GAME },
292
						PL_PSIZ, DISP_IN_GAME },
248
	{ "map_mode", "map display mode under Windows", 20, DISP_IN_GAME },	/*WC*/
293
	{ "map_mode", "map display mode under Windows", 20, DISP_IN_GAME },	/*WC*/
294
	{ "menucolor", "set menu colors", PL_PSIZ, SET_IN_FILE },
249
	{ "menustyle", "user interface for object selection",
295
	{ "menustyle", "user interface for object selection",
250
						MENUTYPELEN, SET_IN_GAME },
296
						MENUTYPELEN, SET_IN_GAME },
251
	{ "menu_deselect_all", "deselect all items in a menu", 4, SET_IN_FILE },
297
	{ "menu_deselect_all", "deselect all items in a menu", 4, SET_IN_FILE },
Lines 306-314 Link Here
306
	{ "scroll_amount", "amount to scroll map when scroll_margin is reached",
352
	{ "scroll_amount", "amount to scroll map when scroll_margin is reached",
307
						20, DISP_IN_GAME }, /*WC*/
353
						20, DISP_IN_GAME }, /*WC*/
308
	{ "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/
354
	{ "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/
355
#ifdef SORTLOOT
356
	{ "sortloot", "sort object selection lists by description", 4, SET_IN_GAME },
357
#endif
309
#ifdef MSDOS
358
#ifdef MSDOS
310
	{ "soundcard", "type of sound card to use", 20, SET_IN_FILE },
359
	{ "soundcard", "type of sound card to use", 20, SET_IN_FILE },
311
#endif
360
#endif
361
	{ "statuscolor", "set status colors", PL_PSIZ, SET_IN_FILE },
312
	{ "suppress_alert", "suppress alerts about version-specific features",
362
	{ "suppress_alert", "suppress alerts about version-specific features",
313
						8, SET_IN_GAME },
363
						8, SET_IN_GAME },
314
	{ "tile_width", "width of tiles", 20, DISP_IN_GAME},	/*WC*/
364
	{ "tile_width", "width of tiles", 20, DISP_IN_GAME},	/*WC*/
Lines 532-537 Link Here
532
	flags.warnlevel = 1;
582
	flags.warnlevel = 1;
533
	flags.warntype = 0L;
583
	flags.warntype = 0L;
584
#ifdef SORTLOOT
585
	iflags.sortloot = 'n';
586
#endif
587
534
     /* assert( sizeof flags.inv_order == sizeof def_inv_order ); */
588
     /* assert( sizeof flags.inv_order == sizeof def_inv_order ); */
535
	(void)memcpy((genericptr_t)flags.inv_order,
589
	(void)memcpy((genericptr_t)flags.inv_order,
536
		     (genericptr_t)def_inv_order, sizeof flags.inv_order);
590
		     (genericptr_t)def_inv_order, sizeof flags.inv_order);
Lines 551-556 Link Here
551
	 */
605
	 */
552
	/* this detects the IBM-compatible console on most 386 boxes */
606
	/* this detects the IBM-compatible console on most 386 boxes */
553
	if ((opts = nh_getenv("TERM")) && !strncmp(opts, "AT", 2)) {
607
	if ((opts = nh_getenv("TERM")) && !strncmp(opts, "AT", 2)) {
608
		iflags.chargfx = IBM_GRAPHICS;
554
		switch_graphics(IBM_GRAPHICS);
609
		switch_graphics(IBM_GRAPHICS);
555
# ifdef TEXTCOLOR
610
# ifdef TEXTCOLOR
556
		iflags.use_color = TRUE;
611
		iflags.use_color = TRUE;
Lines 563-574 Link Here
563
	if ((opts = nh_getenv("TERM")) &&
618
	if ((opts = nh_getenv("TERM")) &&
564
	    !strncmpi(opts, "vt", 2) && AS && AE &&
619
	    !strncmpi(opts, "vt", 2) && AS && AE &&
565
	    index(AS, '\016') && index(AE, '\017')) {
620
	    index(AS, '\016') && index(AE, '\017')) {
621
		iflags.chargfx = DEC_GRAPHICS;
566
		switch_graphics(DEC_GRAPHICS);
622
		switch_graphics(DEC_GRAPHICS);
567
	}
623
	}
568
# endif
624
# endif
569
#endif /* UNIX || VMS */
625
#endif /* UNIX || VMS */
570
#ifdef MAC_GRAPHICS_ENV
626
#ifdef MAC_GRAPHICS_ENV
627
	iflags.chargfx = MAC_GRAPHICS;
571
	switch_graphics(MAC_GRAPHICS);
628
	switch_graphics(MAC_GRAPHICS);
572
#endif /* MAC_GRAPHICS_ENV */
629
#endif /* MAC_GRAPHICS_ENV */
573
	flags.menu_style = MENU_FULL;
630
	flags.menu_style = MENU_FULL;
Lines 891-896 Link Here
891
	return 1;
948
	return 1;
892
}
949
}
950
#ifdef MENU_COLOR
951
extern struct menucoloring *menu_colorings;
952
953
static const struct {
954
   const char *name;
955
   const int color;
956
} colornames[] = {
957
   {"black", CLR_BLACK},
958
   {"red", CLR_RED},
959
   {"green", CLR_GREEN},
960
   {"brown", CLR_BROWN},
961
   {"blue", CLR_BLUE},
962
   {"magenta", CLR_MAGENTA},
963
   {"cyan", CLR_CYAN},
964
   {"gray", CLR_GRAY},
965
   {"orange", CLR_ORANGE},
966
   {"lightgreen", CLR_BRIGHT_GREEN},
967
   {"yellow", CLR_YELLOW},
968
   {"lightblue", CLR_BRIGHT_BLUE},
969
   {"lightmagenta", CLR_BRIGHT_MAGENTA},
970
   {"lightcyan", CLR_BRIGHT_CYAN},
971
   {"white", CLR_WHITE}
972
};
973
974
static const struct {
975
   const char *name;
976
   const int attr;
977
} attrnames[] = {
978
     {"none", ATR_NONE},
979
     {"bold", ATR_BOLD},
980
     {"dim", ATR_DIM},
981
     {"underline", ATR_ULINE},
982
     {"blink", ATR_BLINK},
983
     {"inverse", ATR_INVERSE}
984
985
};
986
987
/* parse '"regex_string"=color&attr' and add it to menucoloring */
988
boolean
989
add_menu_coloring(str)
990
char *str;
991
{
992
    int i, c = NO_COLOR, a = ATR_NONE;
993
    struct menucoloring *tmp;
994
    char *tmps, *cs = strchr(str, '=');
995
#ifdef MENU_COLOR_REGEX_POSIX
996
    int errnum;
997
    char errbuf[80];
998
#endif
999
    const char *err = (char *)0;
1000
1001
    if (!cs || !str) return FALSE;
1002
1003
    tmps = cs;
1004
    tmps++;
1005
    while (*tmps && isspace(*tmps)) tmps++;
1006
1007
    for (i = 0; i < SIZE(colornames); i++)
1008
	if (strstri(tmps, colornames[i].name) == tmps) {
1009
	    c = colornames[i].color;
1010
	    break;
1011
	}
1012
    if ((i == SIZE(colornames)) && (*tmps >= '0' && *tmps <='9'))
1013
	c = atoi(tmps);
1014
1015
    if (c > 15) return FALSE;
1016
1017
    tmps = strchr(str, '&');
1018
    if (tmps) {
1019
	tmps++;
1020
	while (*tmps && isspace(*tmps)) tmps++;
1021
	for (i = 0; i < SIZE(attrnames); i++)
1022
	    if (strstri(tmps, attrnames[i].name) == tmps) {
1023
		a = attrnames[i].attr;
1024
		break;
1025
	    }
1026
	if ((i == SIZE(attrnames)) && (*tmps >= '0' && *tmps <='9'))
1027
	    a = atoi(tmps);
1028
    }
1029
1030
    *cs = '\0';
1031
    tmps = str;
1032
    if ((*tmps == '"') || (*tmps == '\'')) {
1033
	cs--;
1034
	while (isspace(*cs)) cs--;
1035
	if (*cs == *tmps) {
1036
	    *cs = '\0';
1037
	    tmps++;
1038
	}
1039
    }
1040
1041
    tmp = (struct menucoloring *)alloc(sizeof(struct menucoloring));
1042
#ifdef MENU_COLOR_REGEX
1043
#ifdef MENU_COLOR_REGEX_POSIX
1044
    errnum = regcomp(&tmp->match, tmps, REG_EXTENDED | REG_NOSUB);
1045
    if (errnum != 0)
1046
    {
1047
	regerror(errnum, &tmp->match, errbuf, sizeof(errbuf));
1048
	err = errbuf;
1049
    }
1050
#else
1051
    tmp->match.translate = 0;
1052
    tmp->match.fastmap = 0;
1053
    tmp->match.buffer = 0;
1054
    tmp->match.allocated = 0;
1055
    tmp->match.regs_allocated = REGS_FIXED;
1056
    err = re_compile_pattern(tmps, strlen(tmps), &tmp->match);
1057
#endif
1058
#else
1059
    tmp->match = (char *)alloc(strlen(tmps)+1);
1060
    (void) memcpy((genericptr_t)tmp->match, (genericptr_t)tmps, strlen(tmps)+1);
1061
#endif
1062
    if (err) {
1063
	raw_printf("\nMenucolor regex error: %s\n", err);
1064
	wait_synch();
1065
	free(tmp);
1066
	return FALSE;
1067
    } else {
1068
	tmp->next = menu_colorings;
1069
	tmp->color = c;
1070
	tmp->attr = a;
1071
	menu_colorings = tmp;
1072
	return TRUE;
1073
    }
1074
}
1075
#endif /* MENU_COLOR */
1076
893
void
1077
void
894
set_duplicate_opt_detection(on_or_off)
1078
set_duplicate_opt_detection(on_or_off)
895
int on_or_off;
1079
int on_or_off;
Lines 964-969 Link Here
964
	}
1148
	}
965
}
1149
}
1150
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
1151
1152
struct name_value {
1153
	char *name;
1154
	int value;
1155
};
1156
1157
const struct name_value status_colornames[] = {
1158
	{ "black",	CLR_BLACK },
1159
	{ "red",	CLR_RED },
1160
	{ "green",	CLR_GREEN },
1161
	{ "brown",	CLR_BROWN },
1162
	{ "blue",	CLR_BLUE },
1163
	{ "magenta",	CLR_MAGENTA },
1164
	{ "cyan",	CLR_CYAN },
1165
	{ "gray",	CLR_GRAY },
1166
	{ "orange",	CLR_ORANGE },
1167
	{ "lightgreen",	CLR_BRIGHT_GREEN },
1168
	{ "yellow",	CLR_YELLOW },
1169
	{ "lightblue",	CLR_BRIGHT_BLUE },
1170
	{ "lightmagenta", CLR_BRIGHT_MAGENTA },
1171
	{ "lightcyan",	CLR_BRIGHT_CYAN },
1172
	{ "white",	CLR_WHITE },
1173
	{ NULL,		-1 }
1174
};
1175
1176
const struct name_value status_attrnames[] = {
1177
	 { "none",	ATR_NONE },
1178
	 { "bold",	ATR_BOLD },
1179
	 { "dim",	ATR_DIM },
1180
	 { "underline",	ATR_ULINE },
1181
	 { "blink",	ATR_BLINK },
1182
	 { "inverse",	ATR_INVERSE },
1183
	 { NULL,	-1 }
1184
};
1185
1186
int
1187
value_of_name(name, name_values)
1188
const char *name;
1189
const struct name_value *name_values;
1190
{
1191
	while (name_values->name && !strstri(name_values->name, name))
1192
		++name_values;
1193
	return name_values->value;
1194
}
1195
1196
struct color_option
1197
parse_color_option(start)
1198
char *start;
1199
{
1200
	struct color_option result = {NO_COLOR, 0};
1201
	char last;
1202
	char *end;
1203
	int attr;
1204
1205
	for (end = start; *end != '&' && *end != '\0'; ++end);
1206
	last = *end;
1207
	*end = '\0';
1208
	result.color = value_of_name(start, status_colornames);
1209
1210
	while (last == '&') {
1211
		for (start = ++end; *end != '&' && *end != '\0'; ++end);
1212
		last = *end;
1213
		*end = '\0';
1214
		attr = value_of_name(start, status_attrnames);
1215
		if (attr >= 0)
1216
			result.attr_bits |= 1 << attr;
1217
	}
1218
1219
	return result;
1220
}
1221
1222
const struct percent_color_option *hp_colors = NULL;
1223
const struct percent_color_option *pw_colors = NULL;
1224
const struct text_color_option *text_colors = NULL;
1225
1226
struct percent_color_option *
1227
add_percent_option(new_option, list_head)
1228
struct percent_color_option *new_option;
1229
struct percent_color_option *list_head;
1230
{
1231
	if (list_head == NULL)
1232
		return new_option;
1233
	if (new_option->percentage <= list_head->percentage) {
1234
		new_option->next = list_head;
1235
		return new_option;
1236
	}
1237
	list_head->next = add_percent_option(new_option, list_head->next);
1238
	return list_head;
1239
}
1240
1241
boolean
1242
parse_status_color_option(start)
1243
char *start;
1244
{
1245
	char *middle;
1246
1247
	while (*start && isspace(*start)) start++;
1248
	for (middle = start; *middle != ':' && *middle != '=' && *middle != '\0'; ++middle);
1249
	*middle++ = '\0';
1250
	if (middle - start > 2 && start[2] == '%') {
1251
		struct percent_color_option *percent_color_option =
1252
			(struct percent_color_option *)alloc(sizeof(*percent_color_option));
1253
		percent_color_option->next = NULL;
1254
		percent_color_option->percentage = atoi(start + 3);
1255
		percent_color_option->color_option = parse_color_option(middle);
1256
		start[2] = '\0';
1257
		if (percent_color_option->color_option.color >= 0
1258
		 && percent_color_option->color_option.attr_bits >= 0) {
1259
			if (!strcmpi(start, "hp")) {
1260
				hp_colors = add_percent_option(percent_color_option, hp_colors);
1261
				return TRUE;
1262
			}
1263
			if (!strcmpi(start, "pw")) {
1264
				pw_colors = add_percent_option(percent_color_option, pw_colors);
1265
				return TRUE;
1266
			}
1267
		}
1268
		free(percent_color_option);
1269
		return FALSE;
1270
	} else {
1271
		int length = strlen(start) + 1;
1272
		struct text_color_option *text_color_option =
1273
			(struct text_color_option *)alloc(sizeof(*text_color_option));
1274
		text_color_option->next = NULL;
1275
		text_color_option->text = (char *)alloc(length);
1276
		memcpy((char *)text_color_option->text, start, length);
1277
		text_color_option->color_option = parse_color_option(middle);
1278
		if (text_color_option->color_option.color >= 0
1279
		 && text_color_option->color_option.attr_bits >= 0) {
1280
			text_color_option->next = text_colors;
1281
			text_colors = text_color_option;
1282
			return TRUE;
1283
		}
1284
		free(text_color_option->text);
1285
		free(text_color_option);
1286
		return FALSE;
1287
	}
1288
}
1289
1290
boolean
1291
parse_status_color_options(start)
1292
char *start;
1293
{
1294
	char last = ',';
1295
	char *end = start - 1;
1296
	boolean ok = TRUE;
1297
	while (last == ',') {
1298
		for (start = ++end; *end != ',' && *end != '\0'; ++end);
1299
		last = *end;
1300
		*end = '\0';
1301
		ok = parse_status_color_option(start) && ok;
1302
	}
1303
	return ok;
1304
}
1305
1306
1307
#endif /* STATUS_COLORS */
1308
966
void
1309
void
967
parseoptions(opts, tinitial, tfrom_file)
1310
parseoptions(opts, tinitial, tfrom_file)
968
register char *opts;
1311
register char *opts;
Lines 1077-1082 Link Here
1077
		return;
1420
		return;
1078
	}
1421
	}
1422
#ifdef DUMP_LOG
1423
	fullname = "dumpfile";
1424
	if (match_optname(opts, fullname, 3, TRUE)) {
1425
#ifndef DUMP_FN
1426
		if (negated) bad_negation(fullname, FALSE);
1427
		else if ((op = string_for_opt(opts, !tfrom_file)) != 0
1428
			&& strlen(op) > 1)
1429
			nmcpy(dump_fn, op, PL_PSIZ);
1430
#endif
1431
		return;
1432
       }
1433
#endif
1434
1079
	fullname = "horsename";
1435
	fullname = "horsename";
1080
	if (match_optname(opts, fullname, 5, TRUE)) {
1436
	if (match_optname(opts, fullname, 5, TRUE)) {
1081
		if (negated) bad_negation(fullname, FALSE);
1437
		if (negated) bad_negation(fullname, FALSE);
Lines 1114-1119 Link Here
1114
		return;
1470
		return;
1115
	}
1471
	}
1472
	fullname = "chargfx";
1473
	if (match_optname(opts, fullname, 5, TRUE)) {
1474
		if (negated) {
1475
			iflags.chargfx = ASCII_GRAPHICS;
1476
		} else if ((op = string_for_opt(opts, FALSE)) != 0) {
1477
		  int i;
1478
		  for (i = 0; i < SIZE(chargfx); i++)
1479
		    if (!strncmpi(op, chargfx[i].txt, strlen(op))) {
1480
		      iflags.chargfx = chargfx[i].gfx;
1481
		      need_redraw = TRUE;
1482
# ifdef REINCARNATION
1483
		      if (!initial && Is_rogue_level(&u.uz))
1484
			assign_rogue_graphics(FALSE);
1485
# endif
1486
		      switch_graphics(iflags.chargfx);
1487
# ifdef REINCARNATION
1488
		      if (!initial && Is_rogue_level(&u.uz))
1489
			assign_rogue_graphics(TRUE);
1490
# endif
1491
		      return;
1492
		    }
1493
		  badoption(opts);
1494
		}
1495
		return;
1496
	}
1497
1116
	fullname = "runmode";
1498
	fullname = "runmode";
1117
	if (match_optname(opts, fullname, 4, TRUE)) {
1499
	if (match_optname(opts, fullname, 4, TRUE)) {
1118
		if (negated) {
1500
		if (negated) {
Lines 1133-1138 Link Here
1133
		return;
1515
		return;
1134
	}
1516
	}
1517
	/* menucolor:"regex_string"=color */
1518
	fullname = "menucolor";
1519
	if (match_optname(opts, fullname, 9, TRUE)) {
1520
#ifdef MENU_COLOR
1521
	    if (negated) bad_negation(fullname, FALSE);
1522
	    else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
1523
		if (!add_menu_coloring(op))
1524
		    badoption(opts);
1525
#endif
1526
	    return;
1527
	}
1528
1529
	fullname = "statuscolor";
1530
	if (match_optname(opts, fullname, 11, TRUE)) {
1531
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
1532
		if (negated) bad_negation(fullname, FALSE);
1533
		else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
1534
			if (!parse_status_color_options(op))
1535
				badoption(opts);
1536
#endif
1537
	    return;
1538
	}
1539
1135
	fullname = "msghistory";
1540
	fullname = "msghistory";
1136
	if (match_optname(opts, fullname, 3, TRUE)) {
1541
	if (match_optname(opts, fullname, 3, TRUE)) {
1137
		op = string_for_env_opt(fullname, opts, negated);
1542
		op = string_for_env_opt(fullname, opts, negated);
Lines 1839-1844 Link Here
1839
	    return;
2244
	    return;
1840
	}
2245
	}
2246
#ifdef SORTLOOT
2247
	fullname = "sortloot";
2248
	if (match_optname(opts, fullname, 4, TRUE)) {
2249
		op = string_for_env_opt(fullname, opts, FALSE);
2250
		if (op) {
2251
			switch (tolower(*op)) {
2252
                        case 'n':
2253
                        case 'l':
2254
                        case 'f': iflags.sortloot = tolower(*op);
2255
				break;
2256
                        default:  badoption(opts);
2257
				return;
2258
			}
2259
		}
2260
		return;
2261
	}
2262
#endif /* SORTLOOT */
2263
1841
	fullname = "suppress_alert";
2264
	fullname = "suppress_alert";
1842
	if (match_optname(opts, fullname, 4, TRUE)) {
2265
	if (match_optname(opts, fullname, 4, TRUE)) {
1843
		op = string_for_opt(opts, negated);
2266
		op = string_for_opt(opts, negated);
Lines 2168-2186 Link Here
2168
			    need_redraw = TRUE;
2591
			    need_redraw = TRUE;
2169
# ifdef TERMLIB
2592
# ifdef TERMLIB
2170
			    if ((boolopt[i].addr) == &iflags.DECgraphics)
2593
			    if ((boolopt[i].addr) == &iflags.DECgraphics)
2171
				switch_graphics(iflags.DECgraphics ?
2594
			        iflags.chargfx = iflags.DECgraphics ?
2172
						DEC_GRAPHICS : ASCII_GRAPHICS);
2595
						DEC_GRAPHICS : ASCII_GRAPHICS;
2173
# endif
2596
# endif
2174
# ifdef ASCIIGRAPH
2597
# ifdef ASCIIGRAPH
2175
			    if ((boolopt[i].addr) == &iflags.IBMgraphics)
2598
			    if ((boolopt[i].addr) == &iflags.IBMgraphics)
2176
				switch_graphics(iflags.IBMgraphics ?
2599
				iflags.chargfx = iflags.IBMgraphics ?
2177
						IBM_GRAPHICS : ASCII_GRAPHICS);
2600
						IBM_GRAPHICS : ASCII_GRAPHICS;
2178
# endif
2601
# endif
2179
# ifdef MAC_GRAPHICS_ENV
2602
# ifdef MAC_GRAPHICS_ENV
2180
			    if ((boolopt[i].addr) == &iflags.MACgraphics)
2603
			    if ((boolopt[i].addr) == &iflags.MACgraphics)
2181
				switch_graphics(iflags.MACgraphics ?
2604
				iflags.chargfx = iflags.MACgraphics ?
2182
						MAC_GRAPHICS : ASCII_GRAPHICS);
2605
						MAC_GRAPHICS : ASCII_GRAPHICS;
2183
# endif
2606
# endif
2607
				switch_graphics(iflags.chargfx);
2184
# ifdef REINCARNATION
2608
# ifdef REINCARNATION
2185
			    if (!initial && Is_rogue_level(&u.uz))
2609
			    if (!initial && Is_rogue_level(&u.uz))
2186
				assign_rogue_graphics(TRUE);
2610
				assign_rogue_graphics(TRUE);
Lines 2263-2268 Link Here
2263
	"teleport", "run", "walk", "crawl"
2687
	"teleport", "run", "walk", "crawl"
2264
};
2688
};
2689
#ifdef SORTLOOT
2690
static NEARDATA const char *sortltype[] = {
2691
	"none", "loot", "full"
2692
};
2693
#endif
2694
2265
/*
2695
/*
2266
 * Convert the given string of object classes to a string of default object
2696
 * Convert the given string of object classes to a string of default object
2267
 * symbols.
2697
 * symbols.
Lines 2540-2546 Link Here
2540
    boolean retval = FALSE;
2970
    boolean retval = FALSE;
2541
    /* Special handling of menustyle, pickup_burden, pickup_types,
2971
    /* Special handling of menustyle, pickup_burden, pickup_types,
2542
     * disclose, runmode, msg_window, menu_headings, and number_pad options.
2972
     * disclose, runmode, msg_window, menu_headings, number_pad and sortloot
2543
#ifdef AUTOPICKUP_EXCEPTIONS
2973
#ifdef AUTOPICKUP_EXCEPTIONS
2544
     * Also takes care of interactive autopickup_exception_handling changes.
2974
     * Also takes care of interactive autopickup_exception_handling changes.
2545
#endif
2975
#endif
Lines 2565-2570 Link Here
2565
        }
2995
        }
2566
	destroy_nhwindow(tmpwin);
2996
	destroy_nhwindow(tmpwin);
2567
        retval = TRUE;
2997
        retval = TRUE;
2998
    } else if (!strcmp("chargfx", optname)) {
2999
	menu_item *gfx_pick = (menu_item *)0;
3000
	tmpwin = create_nhwindow(NHW_MENU);
3001
	start_menu(tmpwin);
3002
	for (i = 0; i < SIZE(chargfx); i++) {
3003
	    const char *t = chargfx[i].txt;
3004
	    any.a_int = chargfx[i].gfx + 1;
3005
	    add_menu(tmpwin, NO_GLYPH, &any, chargfx[i].let, 0, ATR_NONE, t, MENU_UNSELECTED);
3006
	}
3007
	end_menu(tmpwin, "Select character graphics type");
3008
	if (select_menu(tmpwin, PICK_ONE, &gfx_pick) > 0) {
3009
	    iflags.chargfx = gfx_pick->item.a_int-1;
3010
# ifdef REINCARNATION
3011
	    if (Is_rogue_level(&u.uz))
3012
		assign_rogue_graphics(FALSE);
3013
# endif
3014
	    switch_graphics(iflags.chargfx);
3015
# ifdef REINCARNATION
3016
	    if (Is_rogue_level(&u.uz))
3017
		assign_rogue_graphics(TRUE);
3018
# endif
3019
	    need_redraw = TRUE;
3020
	    free((genericptr_t)gfx_pick);
3021
	}
3022
	destroy_nhwindow(tmpwin);
3023
	retval = TRUE;
2568
    } else if (!strcmp("pickup_burden", optname)) {
3024
    } else if (!strcmp("pickup_burden", optname)) {
2569
	const char *burden_name, *burden_letters = "ubsntl";
3025
	const char *burden_name, *burden_letters = "ubsntl";
2570
	menu_item *burden_pick = (menu_item *)0;
3026
	menu_item *burden_pick = (menu_item *)0;
Lines 2761-2766 Link Here
2761
        }
3217
        }
2762
	destroy_nhwindow(tmpwin);
3218
	destroy_nhwindow(tmpwin);
2763
        retval = TRUE;
3219
        retval = TRUE;
3220
#ifdef SORTLOOT
3221
    } else if (!strcmp("sortloot", optname)) {
3222
	const char *sortl_name;
3223
	menu_item *sortl_pick = (menu_item *)0;
3224
	tmpwin = create_nhwindow(NHW_MENU);
3225
	start_menu(tmpwin);
3226
	for (i = 0; i < SIZE(sortltype); i++) {
3227
	    sortl_name = sortltype[i];
3228
	    any.a_char = *sortl_name;
3229
	    add_menu(tmpwin, NO_GLYPH, &any, *sortl_name, 0,
3230
		     ATR_NONE, sortl_name, MENU_UNSELECTED);
3231
	}
3232
	end_menu(tmpwin, "Select loot sorting type:");
3233
	if (select_menu(tmpwin, PICK_ONE, &sortl_pick) > 0) {
3234
	    iflags.sortloot = sortl_pick->item.a_char;
3235
	    free((genericptr_t)sortl_pick);
3236
	}
3237
	destroy_nhwindow(tmpwin);
3238
	retval = TRUE;
3239
#endif /* SORTLOOT */
2764
    } else if (!strcmp("menu_headings", optname)) {
3240
    } else if (!strcmp("menu_headings", optname)) {
2765
	static const char *mhchoices[3] = {"bold", "inverse", "underline"};
3241
	static const char *mhchoices[3] = {"bold", "inverse", "underline"};
2766
	const char *npletters = "biu";
3242
	const char *npletters = "biu";
Lines 2875-2880 Link Here
2875
	retval = TRUE;
3351
	retval = TRUE;
2876
#endif /* AUTOPICKUP_EXCEPTIONS */
3352
#endif /* AUTOPICKUP_EXCEPTIONS */
2877
    }
3353
    }
3354
    if (need_redraw)
3355
      (void) doredraw();
2878
    return retval;
3356
    return retval;
2879
}
3357
}
Lines 2920-2926 Link Here
2920
			iflags.bouldersym : oc_syms[(int)objects[BOULDER].oc_class]);
3398
			iflags.bouldersym : oc_syms[(int)objects[BOULDER].oc_class]);
2921
	else if (!strcmp(optname, "catname"))
3399
	else if (!strcmp(optname, "catname"))
2922
		Sprintf(buf, "%s", catname[0] ? catname : none );
3400
		Sprintf(buf, "%s", catname[0] ? catname : none );
2923
	else if (!strcmp(optname, "disclose")) {
3401
	else if (!strcmp(optname, "chargfx")) {
3402
		Sprintf(buf, "Unknown");
3403
		for (i = 0; i < SIZE(chargfx); i++)
3404
		    if (iflags.chargfx == chargfx[i].gfx) {
3405
		        Sprintf(buf, "%s", chargfx[i].txt);
3406
			break;
3407
		    }
3408
	} else if (!strcmp(optname, "disclose")) {
2924
		for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) {
3409
		for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) {
2925
			char topt[2];
3410
			char topt[2];
2926
			if (i) Strcat(buf," ");
3411
			if (i) Strcat(buf," ");
Lines 2933-2938 Link Here
2933
	}
3418
	}
2934
	else if (!strcmp(optname, "dogname"))
3419
	else if (!strcmp(optname, "dogname"))
2935
		Sprintf(buf, "%s", dogname[0] ? dogname : none );
3420
		Sprintf(buf, "%s", dogname[0] ? dogname : none );
3421
#ifdef DUMP_LOG
3422
	else if (!strcmp(optname, "dumpfile"))
3423
		Sprintf(buf, "%s", dump_fn[0] ? dump_fn: none );
3424
#endif
2936
	else if (!strcmp(optname, "dungeon"))
3425
	else if (!strcmp(optname, "dungeon"))
2937
		Sprintf(buf, "%s", to_be_done);
3426
		Sprintf(buf, "%s", to_be_done);
2938
	else if (!strcmp(optname, "effects"))
3427
	else if (!strcmp(optname, "effects"))
Lines 3072-3077 Link Here
3072
		if (iflags.wc_scroll_margin) Sprintf(buf, "%d",iflags.wc_scroll_margin);
3561
		if (iflags.wc_scroll_margin) Sprintf(buf, "%d",iflags.wc_scroll_margin);
3073
		else Strcpy(buf, defopt);
3562
		else Strcpy(buf, defopt);
3074
	}
3563
	}
3564
#ifdef SORTLOOT
3565
	else if (!strcmp(optname, "sortloot")) {
3566
		char *sortname = (char *)NULL;
3567
		for (i=0; i < SIZE(sortltype) && sortname==(char *)NULL; i++) {
3568
		   if (iflags.sortloot == sortltype[i][0])
3569
		     sortname = (char *)sortltype[i];
3570
		}
3571
		if (sortname != (char *)NULL)
3572
		   Sprintf(buf, "%s", sortname);
3573
	}
3574
#endif /* SORTLOOT */
3075
	else if (!strcmp(optname, "player_selection"))
3575
	else if (!strcmp(optname, "player_selection"))
3076
		Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog");
3576
		Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog");
3077
#ifdef MSDOS
3577
#ifdef MSDOS
Lines 3262-3267 Link Here
3262
}
3762
}
3263
#endif /* AUTOPICKUP_EXCEPTIONS */
3763
#endif /* AUTOPICKUP_EXCEPTIONS */
3764
#ifdef DYNKEY
3765
void
3766
add_dkb(bufp, swap)
3767
char *bufp;
3768
boolean swap;
3769
{
3770
        char *p;
3771
        char b, c;
3772
3773
        if(!(p=index(bufp,' '))) {
3774
                raw_printf("DYNKEY MAP: bad mapping: %s.", bufp);
3775
                return;
3776
        }
3777
        *p++='\0';
3778
3779
        b=keydesc2char(bufp);
3780
        c=keydesc2char(p);
3781
        if(b && c) {
3782
                if(!map_dkb(b, c) || (swap && !map_dkb(c, b)))
3783
                        raw_printf("DYNKEY MAP: map_dkb error");
3784
        } else
3785
                raw_printf("DYNKEY MAP: invalid key: %s.", b==0?bufp:p);
3786
}
3787
#endif /* DYNKEY */
3788
3264
/* data for option_help() */
3789
/* data for option_help() */
3265
static const char *opt_intro[] = {
3790
static const char *opt_intro[] = {
3266
	"",
3791
	"",
(-)nethack-3.4.3/src/pickup.c (+41 lines)
Lines 690-698 Link Here
690
int how;			/* type of query */
690
int how;			/* type of query */
691
boolean FDECL((*allow), (OBJ_P));/* allow function */
691
boolean FDECL((*allow), (OBJ_P));/* allow function */
692
{
692
{
693
#ifdef SORTLOOT
694
	int i, j;
695
#endif
693
	int n;
696
	int n;
694
	winid win;
697
	winid win;
695
	struct obj *curr, *last;
698
	struct obj *curr, *last;
699
#ifdef SORTLOOT
700
	struct obj **oarray;
701
#endif
696
	char *pack;
702
	char *pack;
697
	anything any;
703
	anything any;
698
	boolean printed_type_name;
704
	boolean printed_type_name;
Lines 717-722 Link Here
717
	    return 1;
723
	    return 1;
718
	}
724
	}
725
#ifdef SORTLOOT
726
	/* Make a temporary array to store the objects sorted */
727
	oarray = (struct obj **)alloc(n*sizeof(struct obj*));
728
729
	/* Add objects to the array */
730
	i = 0;
731
	for (curr = olist; curr; curr = FOLLOW(curr, qflags)) {
732
	  if ((*allow)(curr)) {
733
	    if (iflags.sortloot == 'f' ||
734
		(iflags.sortloot == 'l' && !(qflags & USE_INVLET)))
735
	      {
736
		/* Insert object at correct index */
737
		for (j = i; j; j--)
738
		  {
739
		    if (strcmpi(cxname2(curr), cxname2(oarray[j-1]))>0) break;
740
		    oarray[j] = oarray[j-1];
741
		  }
742
		oarray[j] = curr;
743
		i++;
744
	      } else {
745
		/* Just add it to the array */
746
		oarray[i++] = curr;
747
	      }
748
	  }
749
	}
750
#endif /* SORTLOOT */
751
719
	win = create_nhwindow(NHW_MENU);
752
	win = create_nhwindow(NHW_MENU);
720
	start_menu(win);
753
	start_menu(win);
721
	any.a_obj = (struct obj *) 0;
754
	any.a_obj = (struct obj *) 0;
Lines 730-736 Link Here
730
	pack = flags.inv_order;
763
	pack = flags.inv_order;
731
	do {
764
	do {
732
	    printed_type_name = FALSE;
765
	    printed_type_name = FALSE;
766
#ifdef SORTLOOT
767
	    for (i = 0; i < n; i++) {
768
		curr = oarray[i];
769
#else /* SORTLOOT */
733
	    for (curr = olist; curr; curr = FOLLOW(curr, qflags)) {
770
	    for (curr = olist; curr; curr = FOLLOW(curr, qflags)) {
771
#endif /* SORTLOOT */
734
		if ((qflags & FEEL_COCKATRICE) && curr->otyp == CORPSE &&
772
		if ((qflags & FEEL_COCKATRICE) && curr->otyp == CORPSE &&
735
		     will_feel_cockatrice(curr, FALSE)) {
773
		     will_feel_cockatrice(curr, FALSE)) {
736
			destroy_nhwindow(win);	/* stop the menu and revert */
774
			destroy_nhwindow(win);	/* stop the menu and revert */
Lines 758-763 Link Here
758
	    pack++;
796
	    pack++;
759
	} while (qflags & INVORDER_SORT && *pack);
797
	} while (qflags & INVORDER_SORT && *pack);
798
#ifdef SORTLOOT
799
	free(oarray);
800
#endif
760
	end_menu(win, qstr);
801
	end_menu(win, qstr);
761
	n = select_menu(win, how, pick_list);
802
	n = select_menu(win, how, pick_list);
762
	destroy_nhwindow(win);
803
	destroy_nhwindow(win);
(-)nethack-3.4.3/src/save.c (+65 lines)
Lines 48-53 Link Here
48
#define HUP
48
#define HUP
49
#endif
49
#endif
50
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
51
extern const struct percent_color_option *hp_colors;
52
extern const struct percent_color_option *pw_colors;
53
extern const struct text_color_option *text_colors;
54
#endif
55
56
#ifdef MENU_COLOR
57
extern struct menucoloring *menu_colorings;
58
#endif
59
50
/* need to preserve these during save to avoid accessing freed memory */
60
/* need to preserve these during save to avoid accessing freed memory */
51
static unsigned ustuck_id = 0, usteed_id = 0;
61
static unsigned ustuck_id = 0, usteed_id = 0;
Lines 953-964 Link Here
953
	return;
963
	return;
954
}
964
}
965
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
966
967
void
968
free_percent_color_options(list_head)
969
const struct percent_color_option *list_head;
970
{
971
	if (list_head == NULL) return;
972
	free_percent_color_options(list_head->next);
973
	free(list_head);
974
}
975
976
void
977
free_text_color_options(list_head)
978
const struct text_color_option *list_head;
979
{
980
	if (list_head == NULL) return;
981
	free_text_color_options(list_head->next);
982
	free(list_head->text);
983
	free(list_head);
984
}
985
986
void
987
free_status_colors()
988
{
989
	free_percent_color_options(hp_colors); hp_colors = NULL;
990
	free_percent_color_options(pw_colors); pw_colors = NULL;
991
	free_text_color_options(text_colors); text_colors = NULL;
992
}
993
#endif
994
995
#ifdef MENU_COLOR
996
void
997
free_menu_coloring()
998
{
999
    struct menucoloring *tmp = menu_colorings;
1000
1001
    while (tmp) {
1002
	struct menucoloring *tmp2 = tmp->next;
1003
# ifdef MENU_COLOR_REGEX
1004
	(void) regfree(&tmp->match);
1005
# else
1006
	free(tmp->match);
1007
# endif
1008
	free(tmp);
1009
	tmp = tmp2;
1010
    }
1011
}
1012
#endif /* MENU_COLOR */
1013
955
void
1014
void
956
freedynamicdata()
1015
freedynamicdata()
957
{
1016
{
958
	unload_qtlist();
1017
	unload_qtlist();
959
	free_invbuf();	/* let_to_name (invent.c) */
1018
	free_invbuf();	/* let_to_name (invent.c) */
960
	free_youbuf();	/* You_buf,&c (pline.c) */
1019
	free_youbuf();	/* You_buf,&c (pline.c) */
1020
#ifdef MENU_COLOR
1021
	free_menu_coloring();
1022
#endif
1023
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
1024
	free_status_colors();
1025
#endif
961
	tmp_at(DISP_FREEMEM, 0);	/* temporary display effects */
1026
	tmp_at(DISP_FREEMEM, 0);	/* temporary display effects */
962
#ifdef FREE_ALL_MEMORY
1027
#ifdef FREE_ALL_MEMORY
963
# define freeobjchn(X)	(saveobjchn(0, X, FREE_SAVE),  X = 0)
1028
# define freeobjchn(X)	(saveobjchn(0, X, FREE_SAVE),  X = 0)
(-)nethack-3.4.3/src/sit.c (-3 / +43 lines)
Lines 64-72 Link Here
64
	    register struct obj *obj;
64
	    register struct obj *obj;
65
	    obj = level.objects[u.ux][u.uy];
65
	    obj = level.objects[u.ux][u.uy];
66
	    You("sit on %s.", the(xname(obj)));
66
67
	    if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH))
67
	    /* Corpse effects when sitting - Chris Becker (topher@csh.rit.edu)
68
		pline("It's not very comfortable...");
68
	     */
69
	    if (obj->otyp == CORPSE ) {
70
	    	/* so we get the monster's name */
71
	    	You("sit on %s.", singular(obj, doname));
72
	    	if (touch_petrifies(&mons[obj->corpsenm]) && !uarm
73
	    		&& !Stone_resistance ) {
74
		    	char kbuf[BUFSZ];
75
		    		pline("Sitting on %s corpse without armor is a fatal mistake...",
76
				an(mons[obj->corpsenm].mname));
77
				Sprintf(kbuf, "sitting on %s corpse without armor",
78
					an(mons[obj->corpsenm].mname));
79
				instapetrify(kbuf);
80
	    	} else if (acidic(&mons[obj->corpsenm])) {
81
	    		if (!Acid_resistance) {
82
		    		pline( "Ouch! That burns!" );
83
		    		losehp(d(1,6), "sitting on an acidic corpse", KILLED_BY);
84
	    		}
85
	    		if (uarm && !rn2(3)) /* corrode armor */
86
		    			(void)rust_dmg(uarm, xname(uarm), 3, TRUE, &youmonst);
87
	    		if (obj->corpsenm == PM_GREEN_SLIME) {
88
	    		if (!uarm && !rn2(4)) { /* you touched it */
89
	    			if (flaming(youmonst.data) || Unchanging ||
90
							youmonst.data == &mons[PM_GREEN_SLIME]) {
91
					    pline_The("Yuck!");
92
					} else if (!Slimed) {
93
					    You("don't feel very well.");
94
					    Slimed = 10L;
95
					    flags.botl = 1;
96
					    killer_format = KILLED_BY_AN;
97
					    delayed_killer = (&mons[obj->corpsenm])->mname;
98
					}
99
	    		}
100
	    	} else {
101
	    			pline("It's not very comfortable...");
102
	    		}
103
	    	}
104
	    } else {
105
	    	You("sit on %s.", the(xname(obj)));
106
		    if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH))
107
			pline("It's not very comfortable...");
108
	    }
69
	} else if ((trap = t_at(u.ux, u.uy)) != 0 ||
109
	} else if ((trap = t_at(u.ux, u.uy)) != 0 ||
70
		   (u.utrap && (u.utraptype >= TT_LAVA))) {
110
		   (u.utrap && (u.utraptype >= TT_LAVA))) {
(-)nethack-3.4.3/src/spell.c (+29 lines)
Lines 1114-1119 Link Here
1114
	return FALSE;
1114
	return FALSE;
1115
}
1115
}
1116
#ifdef DUMP_LOG
1117
void
1118
dump_spells()
1119
{
1120
	int i;
1121
	char buf[BUFSZ];
1122
1123
	if (spellid(0) == NO_SPELL) {
1124
	    dump("", "You didn't know any spells.");
1125
	    dump("", "");
1126
	    return;
1127
	}
1128
	dump("", "Spells known in the end");
1129
1130
	Sprintf(buf, "%-20s   Level    %-12s Fail", "    Name", "Category");
1131
	dump("  ",buf);
1132
	for (i = 0; i < MAXSPELL && spellid(i) != NO_SPELL; i++) {
1133
		Sprintf(buf, "%c - %-20s  %2d%s   %-12s %3d%%",
1134
			spellet(i), spellname(i), spellev(i),
1135
			spellknow(i) ? " " : "*",
1136
			spelltypemnemonic(spell_skilltype(spellid(i))),
1137
			100 - percent_success(i));
1138
		dump("  ", buf);
1139
	}
1140
	dump("","");
1141
1142
} /* dump_spells */
1143
#endif
1144
1116
/* Integer square root function without using floating point. */
1145
/* Integer square root function without using floating point. */
1117
STATIC_OVL int
1146
STATIC_OVL int
1118
isqrt(val)
1147
isqrt(val)
(-)nethack-3.4.3/src/topten.c (-15 / +55 lines)
Lines 358-363 Link Here
358
	      "Since you were in %s mode, the score list will not be checked.",
358
	      "Since you were in %s mode, the score list will not be checked.",
359
		    wizard ? "wizard" : "discover");
359
		    wizard ? "wizard" : "discover");
360
		topten_print(pbuf);
360
		topten_print(pbuf);
361
#ifdef DUMP_LOG
362
		if (dump_fn[0]) {
363
		  dump("", pbuf);
364
		  dump("", "");
365
		}
366
#endif
361
	    }
367
	    }
362
	    goto showwin;
368
	    goto showwin;
363
	}
369
	}
Lines 378-383 Link Here
378
	}
384
	}
379
	HUP topten_print("");
385
	HUP topten_print("");
386
#ifdef DUMP_LOG
387
	dump("", "");
388
#endif
380
	/* assure minimum number of points */
389
	/* assure minimum number of points */
381
	if(t0->points < POINTSMIN) t0->points = 0;
390
	if(t0->points < POINTSMIN) t0->points = 0;
Lines 422-427 Link Here
422
				    t1->points);
431
				    t1->points);
423
			    topten_print(pbuf);
432
			    topten_print(pbuf);
424
			    topten_print("");
433
			    topten_print("");
434
#ifdef DUMP_LOG
435
			    dump("", pbuf);
436
			    dump("", "");
437
#endif
425
			}
438
			}
426
		    }
439
		    }
427
		    if(occ_cnt < 0) {
440
		    if(occ_cnt < 0) {
Lines 452-468 Link Here
452
			goto destroywin;
465
			goto destroywin;
453
		}
466
		}
454
#endif	/* UPDATE_RECORD_IN_PLACE */
467
#endif	/* UPDATE_RECORD_IN_PLACE */
455
		if(!done_stopprint) if(rank0 > 0){
468
		if(rank0 > 0){
456
		    if(rank0 <= 10)
469
		    if(rank0 <= 10) {
457
			topten_print("You made the top ten list!");
470
			if(!done_stopprint)
458
		    else {
471
			    topten_print("You made the top ten list!");
472
#ifdef DUMP_LOG
473
			dump("", "You made the top ten list!");
474
#endif
475
		    } else {
459
			char pbuf[BUFSZ];
476
			char pbuf[BUFSZ];
460
			Sprintf(pbuf,
477
			Sprintf(pbuf,
461
			  "You reached the %d%s place on the top %d list.",
478
			  "You reached the %d%s place on the top %d list.",
462
				rank0, ordin(rank0), ENTRYMAX);
479
				rank0, ordin(rank0), ENTRYMAX);
463
			topten_print(pbuf);
480
			if(!done_stopprint) topten_print(pbuf);
481
#ifdef DUMP_LOG
482
			dump("", pbuf);
483
#endif
464
		    }
484
		    }
465
		    topten_print("");
485
		    if(!done_stopprint) topten_print("");
486
#ifdef DUMP_LOG
487
		    dump("", "");
488
#endif
466
		}
489
		}
467
	}
490
	}
468
	if(rank0 == 0) rank0 = rank1;
491
	if(rank0 == 0) rank0 = rank1;
Lines 475-481 Link Here
475
		    && rank >= rank0
498
		    && rank >= rank0
476
#endif
499
#endif
477
		) writeentry(rfile, t1);
500
		) writeentry(rfile, t1);
478
	    if (done_stopprint) continue;
501
	    /* if (done_stopprint) continue; */
479
	    if (rank > flags.end_top &&
502
	    if (rank > flags.end_top &&
480
		    (rank < rank0 - flags.end_around ||
503
		    (rank < rank0 - flags.end_around ||
481
		     rank > rank0 + flags.end_around) &&
504
		     rank > rank0 + flags.end_around) &&
Lines 488-495 Link Here
488
		)) continue;
511
		)) continue;
489
	    if (rank == rank0 - flags.end_around &&
512
	    if (rank == rank0 - flags.end_around &&
490
		    rank0 > flags.end_top + flags.end_around + 1 &&
513
		    rank0 > flags.end_top + flags.end_around + 1 &&
491
		    !flags.end_own)
514
		    !flags.end_own) {
492
		topten_print("");
515
		if(!done_stopprint) topten_print("");
516
#ifdef DUMP_LOG
517
		dump("", "");
518
#endif
519
	    }
493
	    if(rank != rank0)
520
	    if(rank != rank0)
494
		outentry(rank, t1, FALSE);
521
		outentry(rank, t1, FALSE);
495
	    else if(!rank1)
522
	    else if(!rank1)
Lines 546-552 Link Here
546
	bp = eos(linebuf);
573
	bp = eos(linebuf);
547
	while(bp < linebuf + COLNO - 9) *bp++ = ' ';
574
	while(bp < linebuf + COLNO - 9) *bp++ = ' ';
548
	Strcpy(bp, "Hp [max]");
575
	Strcpy(bp, "Hp [max]");
549
	topten_print(linebuf);
576
	if(!done_stopprint) topten_print(linebuf);
577
#ifdef DUMP_LOG
578
	dump("", linebuf);
579
#endif
550
}
580
}
551
/* so>0: standout line; so=0: ordinary line */
581
/* so>0: standout line; so=0: ordinary line */
Lines 664-672 Link Here
664
	    if (so) {
694
	    if (so) {
665
		while (bp < linebuf + (COLNO-1)) *bp++ = ' ';
695
		while (bp < linebuf + (COLNO-1)) *bp++ = ' ';
666
		*bp = 0;
696
		*bp = 0;
667
		topten_print_bold(linebuf);
697
		if(!done_stopprint) topten_print_bold(linebuf);
668
	    } else
698
#ifdef DUMP_LOG
669
		topten_print(linebuf);
699
		dump("*", linebuf[0]==' '? linebuf+1: linebuf);
700
#endif
701
	    } else {
702
		if(!done_stopprint) topten_print(linebuf);
703
#ifdef DUMP_LOG
704
		dump(" ", linebuf[0]==' '? linebuf+1: linebuf);
705
#endif
706
	    }
670
	    Sprintf(linebuf, "%15s %s", "", linebuf3);
707
	    Sprintf(linebuf, "%15s %s", "", linebuf3);
671
	    lngr = strlen(linebuf);
708
	    lngr = strlen(linebuf);
672
	}
709
	}
Lines 688-696 Link Here
688
	    if (so >= COLNO) so = COLNO-1;
725
	    if (so >= COLNO) so = COLNO-1;
689
	    while (bp < linebuf + so) *bp++ = ' ';
726
	    while (bp < linebuf + so) *bp++ = ' ';
690
	    *bp = 0;
727
	    *bp = 0;
691
	    topten_print_bold(linebuf);
728
	    if(!done_stopprint) topten_print_bold(linebuf);
692
	} else
729
	} else
693
	    topten_print(linebuf);
730
	    if(!done_stopprint) topten_print(linebuf);
731
#ifdef DUMP_LOG
732
	dump(" ", linebuf[0]==' '? linebuf+1: linebuf);
733
#endif
694
}
734
}
695
STATIC_OVL int
735
STATIC_OVL int
(-)nethack-3.4.3/src/uhitm.c (+24 lines)
Lines 99-104 Link Here
99
struct obj *wep;	/* uwep for attack(), null for kick_monster() */
99
struct obj *wep;	/* uwep for attack(), null for kick_monster() */
100
{
100
{
101
	char qbuf[QBUFSZ];
101
	char qbuf[QBUFSZ];
102
#ifdef PARANOID
103
	char buf[BUFSZ];
104
#endif
102
	/* if you're close enough to attack, alert any waiting monster */
105
	/* if you're close enough to attack, alert any waiting monster */
103
	mtmp->mstrategy &= ~STRAT_WAITMASK;
106
	mtmp->mstrategy &= ~STRAT_WAITMASK;
Lines 199-209 Link Here
199
			return(FALSE);
202
			return(FALSE);
200
		}
203
		}
201
		if (canspotmon(mtmp)) {
204
		if (canspotmon(mtmp)) {
205
#ifdef PARANOID
206
			Sprintf(qbuf, "Really attack %s? [no/yes]",
207
				mon_nam(mtmp));
208
			if (iflags.paranoid_hit) {
209
				getlin (qbuf, buf);
210
				(void) lcase (buf);
211
				if (strcmp (buf, "yes")) {
212
				  flags.move = 0;
213
				  return(TRUE);
214
				}
215
			} else {
216
#endif
202
			Sprintf(qbuf, "Really attack %s?", mon_nam(mtmp));
217
			Sprintf(qbuf, "Really attack %s?", mon_nam(mtmp));
203
			if (yn(qbuf) != 'y') {
218
			if (yn(qbuf) != 'y') {
204
				flags.move = 0;
219
				flags.move = 0;
205
				return(TRUE);
220
				return(TRUE);
206
			}
221
			}
222
#ifdef PARANOID
223
			}
224
#endif
207
		}
225
		}
208
	}
226
	}
Lines 597-602 Link Here
597
			if (mdat != &mons[PM_SHADE])
615
			if (mdat != &mons[PM_SHADE])
598
			    tmp++;
616
			    tmp++;
599
		    }
617
		    }
618
			/* silver arrows do silver damage - Chris Becker (topher@csh.rit.edu) */
619
			if (objects[obj->otyp].oc_material == SILVER
620
				&& hates_silver(mdat)) {
621
			silvermsg = TRUE; silverobj = TRUE;
622
			tmp += rnd(20);
623
		    }
600
		} else {
624
		} else {
601
		    tmp = dmgval(obj, mon);
625
		    tmp = dmgval(obj, mon);
602
		    /* a minimal hit doesn't exercise proficiency */
626
		    /* a minimal hit doesn't exercise proficiency */
(-)nethack-3.4.3/src/version.c (-3 / +18 lines)
Lines 16-21 Link Here
16
/* #define BETA_INFO "" */	/* "[ beta n]" */
16
/* #define BETA_INFO "" */	/* "[ beta n]" */
17
/* Don't store SCORE_ON_BOTL option in save file or bones */
18
#define HIDDEN_FEATURES (1L << 21)
19
17
/* fill buffer with short version (so caller can avoid including date.h) */
20
/* fill buffer with short version (so caller can avoid including date.h) */
18
char *
21
char *
19
version_string(buf)
22
version_string(buf)
Lines 70-75 Link Here
70
const char *filename;
73
const char *filename;
71
boolean complain;
74
boolean complain;
72
{
75
{
76
	boolean check=TRUE;
77
#ifdef HIDDEN_FEATURES
78
	unsigned long true_features = version_data->feature_set;
79
	version_data->feature_set &= ~HIDDEN_FEATURES;
80
#endif
73
	if (
81
	if (
74
#ifdef VERSION_COMPATIBILITY
82
#ifdef VERSION_COMPATIBILITY
75
	    version_data->incarnation < VERSION_COMPATIBILITY ||
83
	    version_data->incarnation < VERSION_COMPATIBILITY ||
Lines 80-86 Link Here
80
	  ) {
88
	  ) {
81
	    if (complain)
89
	    if (complain)
82
		pline("Version mismatch for file \"%s\".", filename);
90
		pline("Version mismatch for file \"%s\".", filename);
83
	    return FALSE;
91
	    check = FALSE;
84
	} else if (
92
	} else if (
85
#ifndef IGNORED_FEATURES
93
#ifndef IGNORED_FEATURES
86
		   version_data->feature_set != VERSION_FEATURES ||
94
		   version_data->feature_set != VERSION_FEATURES ||
Lines 93-101 Link Here
93
	    if (complain)
101
	    if (complain)
94
		pline("Configuration incompatibility for file \"%s\".",
102
		pline("Configuration incompatibility for file \"%s\".",
95
		      filename);
103
		      filename);
96
	    return FALSE;
104
	    check = FALSE;
97
	}
105
	}
98
	return TRUE;
106
#ifdef HIDDEN_FEATURES
107
	version_data->feature_set = true_features;
108
#endif
109
	return check;
99
}
110
}
100
/* this used to be based on file date and somewhat OS-dependant,
111
/* this used to be based on file date and somewhat OS-dependant,
Lines 130-136 Link Here
130
int fd;
141
int fd;
131
{
142
{
132
	const static struct version_info version_data = {
143
	const static struct version_info version_data = {
144
#ifdef HIDDEN_FEATURES
145
			VERSION_NUMBER, VERSION_FEATURES & ~HIDDEN_FEATURES,
146
#else
133
			VERSION_NUMBER, VERSION_FEATURES,
147
			VERSION_NUMBER, VERSION_FEATURES,
148
#endif
134
			VERSION_SANITY1, VERSION_SANITY2
149
			VERSION_SANITY1, VERSION_SANITY2
135
	};
150
	};
(-)nethack-3.4.3/src/weapon.c (+66 lines)
Lines 9-14 Link Here
9
 */
9
 */
10
#include "hack.h"
10
#include "hack.h"
11
#ifdef DUMP_LOG
12
STATIC_DCL int FDECL(enhance_skill, (boolean));
13
#endif
14
11
/* Categories whose names don't come from OBJ_NAME(objects[type])
15
/* Categories whose names don't come from OBJ_NAME(objects[type])
12
 */
16
 */
13
#define PN_BARE_HANDED			(-1)	/* includes martial arts */
17
#define PN_BARE_HANDED			(-1)	/* includes martial arts */
Lines 851-856 Link Here
851
 */
855
 */
852
int
856
int
853
enhance_weapon_skill()
857
enhance_weapon_skill()
858
#ifdef DUMP_LOG
859
{
860
	return enhance_skill(FALSE);
861
}
862
863
void dump_weapon_skill()
864
{
865
	enhance_skill(TRUE);
866
}
867
868
int enhance_skill(boolean want_dump)
869
/* This is the original enhance_weapon_skill() function slightly modified
870
 * to write the skills to the dump file. I added the wrapper functions just
871
 * because it looked like the easiest way to add a parameter to the
872
 * function call. - Jukka Lahtinen, August 2001
873
 */
874
#endif
854
{
875
{
855
    int pass, i, n, len, longest,
876
    int pass, i, n, len, longest,
856
	to_advance, eventually_advance, maxxed_cnt;
877
	to_advance, eventually_advance, maxxed_cnt;
Lines 860-867 Link Here
860
    anything any;
881
    anything any;
861
    winid win;
882
    winid win;
862
    boolean speedy = FALSE;
883
    boolean speedy = FALSE;
884
#ifdef DUMP_LOG
885
    char buf2[BUFSZ];
886
    boolean logged;
887
#endif
863
#ifdef WIZARD
888
#ifdef WIZARD
889
#ifdef DUMP_LOG
890
	if (!want_dump)
891
#endif
864
	if (wizard && yn("Advance skills without practice?") == 'y')
892
	if (wizard && yn("Advance skills without practice?") == 'y')
865
	    speedy = TRUE;
893
	    speedy = TRUE;
866
#endif
894
#endif
Lines 878-883 Link Here
878
		else if (peaked_skill(i)) maxxed_cnt++;
906
		else if (peaked_skill(i)) maxxed_cnt++;
879
	    }
907
	    }
908
#ifdef DUMP_LOG
909
	    if (want_dump)
910
		dump("","Your skills at the end");
911
	    else {
912
#endif
880
	    win = create_nhwindow(NHW_MENU);
913
	    win = create_nhwindow(NHW_MENU);
881
	    start_menu(win);
914
	    start_menu(win);
Lines 905-910 Link Here
905
		add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE,
938
		add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE,
906
			     "", MENU_UNSELECTED);
939
			     "", MENU_UNSELECTED);
907
	    }
940
	    }
941
#ifdef DUMP_LOG
942
	    } /* want_dump or not */
943
#endif
908
	    /* List the skills, making ones that could be advanced
944
	    /* List the skills, making ones that could be advanced
909
	       selectable.  List the miscellaneous skills first.
945
	       selectable.  List the miscellaneous skills first.
Lines 916-923 Link Here
916
		/* Print headings for skill types */
952
		/* Print headings for skill types */
917
		any.a_void = 0;
953
		any.a_void = 0;
918
		if (i == skill_ranges[pass].first)
954
		if (i == skill_ranges[pass].first)
955
#ifdef DUMP_LOG
956
		if (want_dump) {
957
		    dump("  ",(char *)skill_ranges[pass].name);
958
		    logged=FALSE;
959
		} else
960
#endif
919
		    add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
961
		    add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
920
			     skill_ranges[pass].name, MENU_UNSELECTED);
962
			     skill_ranges[pass].name, MENU_UNSELECTED);
963
#ifdef DUMP_LOG
964
		if (want_dump) {
965
		    if (P_SKILL(i) > P_UNSKILLED) {
966
		 	Sprintf(buf2,"%-*s [%s]",
967
			    longest, P_NAME(i),skill_level_name(i, buf));
968
			dump("    ",buf2);
969
			logged=TRUE;
970
		    } else if (i == skill_ranges[pass].last && !logged) {
971
			dump("    ","(none)");
972
		    }
973
               } else {
974
#endif
921
		if (P_RESTRICTED(i)) continue;
975
		if (P_RESTRICTED(i)) continue;
922
		/*
976
		/*
Lines 962-967 Link Here
962
		any.a_int = can_advance(i, speedy) ? i+1 : 0;
1016
		any.a_int = can_advance(i, speedy) ? i+1 : 0;
963
		add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE,
1017
		add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE,
964
			 buf, MENU_UNSELECTED);
1018
			 buf, MENU_UNSELECTED);
1019
#ifdef DUMP_LOG
1020
		} /* !want_dump */
1021
#endif
965
	    }
1022
	    }
966
	    Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" :
1023
	    Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" :
Lines 971-976 Link Here
971
		Sprintf(eos(buf), "  (%d slot%s available)",
1028
		Sprintf(eos(buf), "  (%d slot%s available)",
972
			u.weapon_slots, plur(u.weapon_slots));
1029
			u.weapon_slots, plur(u.weapon_slots));
973
#endif
1030
#endif
1031
#ifdef DUMP_LOG
1032
	    if (want_dump) {
1033
		dump("","");
1034
		n=0;
1035
	    } else {
1036
#endif
974
	    end_menu(win, buf);
1037
	    end_menu(win, buf);
975
	    n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected);
1038
	    n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected);
976
	    destroy_nhwindow(win);
1039
	    destroy_nhwindow(win);
Lines 987-992 Link Here
987
		    }
1050
		    }
988
		}
1051
		}
989
	    }
1052
	    }
1053
#ifdef DUMP_LOG
1054
	    }
1055
#endif
990
	} while (speedy && n > 0);
1056
	} while (speedy && n > 0);
991
	return 0;
1057
	return 0;
992
}
1058
}
(-)nethack-3.4.3/sys/wince/mhfont.c (-1 / +1 lines)
Lines 154-160 Link Here
154
UINT mswin_charset()
154
UINT mswin_charset()
155
{
155
{
156
	CHARSETINFO cis;
156
	CHARSETINFO cis;
157
	if( iflags.IBMgraphics )
157
	if( iflags.chargfx == IBM_GRAPHICS )
158
		if( TranslateCharsetInfo((DWORD*)GetOEMCP(), &cis, TCI_SRCCODEPAGE) )
158
		if( TranslateCharsetInfo((DWORD*)GetOEMCP(), &cis, TCI_SRCCODEPAGE) )
159
			return cis.ciCharset;
159
			return cis.ciCharset;
160
		else
160
		else
(-)nethack-3.4.3/util/Makefile (-4 / +4 lines)
Lines 101-111 Link Here
101
# yacc/lex programs to use to generate *_comp.h, *_lex.c, and *_yacc.c.
101
# yacc/lex programs to use to generate *_comp.h, *_lex.c, and *_yacc.c.
102
# if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
102
# if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
103
YACC     = yacc
103
#YACC     = yacc
104
LEX      = lex
104
#LEX      = lex
105
# YACC     = bison -y
105
 YACC     = bison -y
106
# YACC     = byacc
106
# YACC     = byacc
107
# LEX      = flex
107
 LEX      = flex
108
# these are the names of the output files from YACC/LEX. Under MS-DOS
108
# these are the names of the output files from YACC/LEX. Under MS-DOS
109
# and similar systems, they may differ
109
# and similar systems, they may differ
(-)nethack-3.4.3/util/makedefs.c (+77 lines)
Lines 417-422 Link Here
417
 * This should go away in the next version update.
417
 * This should go away in the next version update.
418
 */
418
 */
419
#define IGNORED_FEATURES	( 0L \
419
#define IGNORED_FEATURES	( 0L \
420
				| (1L << 17)	/* TEXTCOLOR */ \
421
				| (1L << 20)	/* EXP_ON_BOTL */ \
422
				| (1L << 21)	/* SCORE_ON_BOTL */ \
420
				| (1L << 23)	/* TIMED_DELAY */ \
423
				| (1L << 23)	/* TIMED_DELAY */ \
421
				)
424
				)
Lines 679-684 Link Here
679
#ifdef MAIL
682
#ifdef MAIL
680
		"mail daemon",
683
		"mail daemon",
681
#endif
684
#endif
685
#ifdef MENU_COLOR
686
# ifdef MENU_COLOR_REGEX
687
		"menu colors via regular expressions",
688
# else
689
		"menu colors via pmatch",
690
# endif
691
#endif
682
#ifdef GNUDOS
692
#ifdef GNUDOS
683
		"MSDOS protected mode",
693
		"MSDOS protected mode",
684
#endif
694
#endif
Lines 775-780 Link Here
775
		"zero-compressed save files",
785
		"zero-compressed save files",
776
#endif
786
#endif
777
		save_bones_compat_buf,
787
		save_bones_compat_buf,
788
#ifdef AOY_CONTAINER
789
		"patch: baggable special items",
790
#endif
791
#ifdef HPMON
792
		"patch: colored Hp monitor",
793
#endif
794
#ifdef DUMP_LOG
795
		"patch: dump game end info",
796
#endif
797
#ifdef DYNKEY
798
		"patch: dynamic keybinding",
799
#endif
800
#ifdef DEATH_EXPLORE
801
		"patch: explore mode at death",
802
#endif
803
#ifdef GERMANKB
804
		"patch: german keyboard (hardcoded)",
805
#endif
806
#ifdef HELPLESS
807
		"patch: helplessness reasons",
808
#endif
809
#if defined(ITEMCAT) || defined(ITEMCAT_JP)
810
		"patch: item categories",
811
#endif
812
#ifdef LOG_MOVES
813
		"patch: log move counter",
814
#endif
815
#ifdef FORGET_QUITTER
816
		"patch: no record entry for quitting",
817
#endif
818
#ifdef SHOP_CREDIT
819
		"patch: no shop credit",
820
#endif
821
#ifdef QWERTZ
822
		"patch: optionally change y/z commands",
823
#endif
824
#ifdef ARTI_WITH_OWNER
825
		"patch: owned artifacts",
826
#endif
827
#ifdef PARANOID
828
		"patch: paranoid",
829
#endif
830
#ifdef PROMPT_LOGEXP
831
		"patch: prompt explore/wizard mode logging",
832
#endif
833
#ifdef SHOW_EXTINCT
834
		"patch: show extinct monsters",
835
#endif
836
#ifdef SHOW_BORN
837
		"patch: show monsters born",
838
#endif
839
#ifdef SORTLOOT
840
		"patch: sortloot",
841
#endif
842
#ifdef ADJSPLIT
843
		"patch: splittable #adjust",
844
#endif
845
#ifdef MENU_COLOR
846
# ifdef MENU_COLOR_REGEX
847
		"patch: tty menu colors via regular expressions",
848
# else
849
		"patch: tty menu colors via pmatch",
850
# endif
851
#endif
852
#ifdef WIN_EDGE
853
		"patch: win_edge",
854
#endif
778
		"basic NetHack features"
855
		"basic NetHack features"
779
	};
856
	};
(-)nethack-3.4.3/win/tty/termcap.c (-4 / +4 lines)
Lines 397-403 Link Here
397
	 * Do not select NA ASCII as the primary font since people may
397
	 * Do not select NA ASCII as the primary font since people may
398
	 * reasonably be using the UK character set.
398
	 * reasonably be using the UK character set.
399
	 */
399
	 */
400
	if (iflags.DECgraphics) xputs("\033)0");
400
	if (iflags.chargfx == DEC_GRAPHICS) xputs("\033)0");
401
#ifdef PC9800
401
#ifdef PC9800
402
	init_hilite();
402
	init_hilite();
403
#endif
403
#endif
Lines 460-478 Link Here
460
	xputs(TI);
460
	xputs(TI);
461
	xputs(VS);
461
	xputs(VS);
462
#ifdef PC9800
462
#ifdef PC9800
463
    if (!iflags.IBMgraphics && !iflags.DECgraphics)
463
	if (!(iflags.chargfx == IBM_GRAPHICS) && !(iflags.chargfx == DEC_GRAPHICS))
464
	    tty_ascgraphics_hilite_fixup();
464
	    tty_ascgraphics_hilite_fixup();
465
    /* set up callback in case option is not set yet but toggled later */
465
    /* set up callback in case option is not set yet but toggled later */
466
    ascgraphics_mode_callback = tty_ascgraphics_hilite_fixup;
466
    ascgraphics_mode_callback = tty_ascgraphics_hilite_fixup;
467
# ifdef ASCIIGRAPH
467
# ifdef ASCIIGRAPH
468
    if (iflags.IBMgraphics) init_hilite();
468
    if (iflags.chargfx == IBM_GRAPHICS) init_hilite();
469
    /* set up callback in case option is not set yet but toggled later */
469
    /* set up callback in case option is not set yet but toggled later */
470
    ibmgraphics_mode_callback = init_hilite;
470
    ibmgraphics_mode_callback = init_hilite;
471
# endif
471
# endif
472
#endif /* PC9800 */
472
#endif /* PC9800 */
473
#ifdef TERMLIB
473
#ifdef TERMLIB
474
	if (iflags.DECgraphics) tty_decgraphics_termcap_fixup();
474
	if (iflags.chargfx == DEC_GRAPHICS) tty_decgraphics_termcap_fixup();
475
	/* set up callback in case option is not set yet but toggled later */
475
	/* set up callback in case option is not set yet but toggled later */
476
	decgraphics_mode_callback = tty_decgraphics_termcap_fixup;
476
	decgraphics_mode_callback = tty_decgraphics_termcap_fixup;
477
#endif
477
#endif
(-)nethack-3.4.3/win/tty/wintty.c (-3 / +50 lines)
Lines 125-130 Link Here
125
static char winpanicstr[] = "Bad window id %d";
125
static char winpanicstr[] = "Bad window id %d";
126
char defmorestr[] = "--More--";
126
char defmorestr[] = "--More--";
127
#ifdef MENU_COLOR
128
extern struct menucoloring *menu_colorings;
129
#endif
130
127
#ifdef CLIPPING
131
#ifdef CLIPPING
128
# if defined(USE_TILES) && defined(MSDOS)
132
# if defined(USE_TILES) && defined(MSDOS)
129
boolean clipping = FALSE;	/* clipping on? */
133
boolean clipping = FALSE;	/* clipping on? */
Lines 162-168 Link Here
162
STATIC_DCL void FDECL(process_menu_window, (winid,struct WinDesc *));
166
STATIC_DCL void FDECL(process_menu_window, (winid,struct WinDesc *));
163
STATIC_DCL void FDECL(process_text_window, (winid,struct WinDesc *));
167
STATIC_DCL void FDECL(process_text_window, (winid,struct WinDesc *));
164
STATIC_DCL tty_menu_item *FDECL(reverse, (tty_menu_item *));
168
STATIC_DCL tty_menu_item *FDECL(reverse, (tty_menu_item *));
165
STATIC_DCL const char * FDECL(compress_str, (const char *));
169
const char * FDECL(compress_str, (const char *));
166
STATIC_DCL void FDECL(tty_putsym, (winid, int, int, CHAR_P));
170
STATIC_DCL void FDECL(tty_putsym, (winid, int, int, CHAR_P));
167
static char *FDECL(copy_of, (const char *));
171
static char *FDECL(copy_of, (const char *));
168
STATIC_DCL void FDECL(bail, (const char *));	/* __attribute__((noreturn)) */
172
STATIC_DCL void FDECL(bail, (const char *));	/* __attribute__((noreturn)) */
Lines 1128-1133 Link Here
1128
    }
1132
    }
1129
}
1133
}
1134
#ifdef MENU_COLOR
1135
STATIC_OVL boolean
1136
get_menu_coloring(str, color, attr)
1137
char *str;
1138
int *color, *attr;
1139
{
1140
    struct menucoloring *tmpmc;
1141
    if (iflags.use_menu_color)
1142
	for (tmpmc = menu_colorings; tmpmc; tmpmc = tmpmc->next)
1143
# ifdef MENU_COLOR_REGEX
1144
#  ifdef MENU_COLOR_REGEX_POSIX
1145
	    if (regexec(&tmpmc->match, str, 0, NULL, 0) == 0) {
1146
#  else
1147
	    if (re_search(&tmpmc->match, str, strlen(str), 0, 9999, 0) >= 0) {
1148
#  endif
1149
# else
1150
	    if (pmatch(tmpmc->match, str)) {
1151
# endif
1152
		*color = tmpmc->color;
1153
		*attr = tmpmc->attr;
1154
		return TRUE;
1155
	    }
1156
    return FALSE;
1157
}
1158
#endif /* MENU_COLOR */
1159
1130
STATIC_OVL void
1160
STATIC_OVL void
1131
process_menu_window(window, cw)
1161
process_menu_window(window, cw)
1132
winid window;
1162
winid window;
Lines 1204-1209 Link Here
1204
		for (page_lines = 0, curr = page_start;
1234
		for (page_lines = 0, curr = page_start;
1205
			curr != page_end;
1235
			curr != page_end;
1206
			page_lines++, curr = curr->next) {
1236
			page_lines++, curr = curr->next) {
1237
#ifdef MENU_COLOR
1238
		    int color = NO_COLOR, attr = ATR_NONE;
1239
		    boolean menucolr = FALSE;
1240
#endif
1207
		    if (curr->selector)
1241
		    if (curr->selector)
1208
			*rp++ = curr->selector;
1242
			*rp++ = curr->selector;
Lines 1219-1224 Link Here
1219
		     * actually output the character.  We're faster doing
1253
		     * actually output the character.  We're faster doing
1220
		     * this.
1254
		     * this.
1221
		     */
1255
		     */
1256
#ifdef MENU_COLOR
1257
		   if (iflags.use_menu_color &&
1258
		       (menucolr = get_menu_coloring(curr->str, &color,&attr))) {
1259
		       term_start_attr(attr);
1260
		       if (color != NO_COLOR) term_start_color(color);
1261
		   } else
1262
#endif
1222
		    term_start_attr(curr->attr);
1263
		    term_start_attr(curr->attr);
1223
		    for (n = 0, cp = curr->str;
1264
		    for (n = 0, cp = curr->str;
1224
#ifndef WIN32CON
1265
#ifndef WIN32CON
Lines 1236-1241 Link Here
1236
				(void) putchar('#'); /* count selected */
1277
				(void) putchar('#'); /* count selected */
1237
			} else
1278
			} else
1238
			    (void) putchar(*cp);
1279
			    (void) putchar(*cp);
1280
#ifdef MENU_COLOR
1281
		   if (iflags.use_menu_color && menucolr) {
1282
		       if (color != NO_COLOR) term_end_color();
1283
		       term_end_attr(attr);
1284
		   } else
1285
#endif
1239
		    term_end_attr(curr->attr);
1286
		    term_end_attr(curr->attr);
1240
		}
1287
		}
1241
	    } else {
1288
	    } else {
Lines 1722-1728 Link Here
1722
}
1769
}
1723
STATIC_OVL const char*
1770
const char*
1724
compress_str(str)
1771
compress_str(str)
1725
const char *str;
1772
const char *str;
1726
{
1773
{
Lines 2328-2334 Link Here
2328
    register char ch = (char)in_ch;
2375
    register char ch = (char)in_ch;
2329
# if defined(ASCIIGRAPH) && !defined(NO_TERMS)
2376
# if defined(ASCIIGRAPH) && !defined(NO_TERMS)
2330
    if (iflags.IBMgraphics || iflags.eight_bit_tty) {
2377
    if (iflags.chargfx == IBM_GRAPHICS || iflags.eight_bit_tty) {
2331
	/* IBM-compatible displays don't need other stuff */
2378
	/* IBM-compatible displays don't need other stuff */
2332
	(void) putchar(ch);
2379
	(void) putchar(ch);
2333
    } else if (ch & 0x80) {
2380
    } else if (ch & 0x80) {
(-)nethack-3.4.3/win/win32/mhfont.c (-1 / +1 lines)
Lines 182-188 Link Here
182
UINT mswin_charset()
182
UINT mswin_charset()
183
{
183
{
184
	CHARSETINFO cis;
184
	CHARSETINFO cis;
185
	if( iflags.IBMgraphics )
185
	if( iflags.chargfx == IBM_GRAPHICS )
186
		if( TranslateCharsetInfo((DWORD*)GetOEMCP(), &cis, TCI_SRCCODEPAGE) )
186
		if( TranslateCharsetInfo((DWORD*)GetOEMCP(), &cis, TCI_SRCCODEPAGE) )
187
			return cis.ciCharset;
187
			return cis.ciCharset;
188
		else
188
		else

Return to bug 113224