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
63
64
Boolean option if PARANOID was set at compile time:
65
paranoid_hit   ask for explicit 'yes' when hitting peacefuls      [FALSE]
66
67
Boolean option if PARANOID was set at compile time:
68
paranoid_quit  ask for explicit 'yes' when quitting               [FALSE]
69
70
Boolean option if PARANOID was set at compile time:
71
paranoid_remove always show menu with the T and R commands        [FALSE]
72
73
Boolean option if SHOW_BORN was set at compile time:
74
showborn   show numbers of created monsters after the number
75
           vanquished                                             [FALSE]
76
64
Boolean option if EXP_ON_BOTL was set at compile time:
77
Boolean option if EXP_ON_BOTL was set at compile time:
65
showexp    display your accumulated experience points             [FALSE]
78
showexp    display your accumulated experience points             [FALSE]
66
79
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]
73
86
87
Boolean option if TEXTCOLOR and MENU_COLOR were set at compile time:
88
menucolors use different colors for menus               [TRUE for micros]
89
74
Boolean option if TIMED_DELAY was set at compile time (tty interface only):
90
Boolean option if TIMED_DELAY was set at compile time (tty interface only):
75
timed_delay    on unix and VMS, use a timer instead of sending
91
timed_delay    on unix and VMS, use a timer instead of sending
76
               extra screen output when attempting to pause for
92
               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
2276
2277
          dumpfile
2278
            The name of a file where the disclosure information is
2279
            written when the game ends. You may use the macro %n that
2280
            will be replaced with the name of your player character.
2281
            The game must have write permissions to the directory where
2282
            the file is written. Normally /tmp may be used for unixes.
2283
2277
          dungeon
2284
          dungeon
2278
            Set the graphics symbols for displaying  the  dungeon  (default
2285
            Set the graphics symbols for displaying  the  dungeon  (default
2279
            `` |--------||.-|++##.##<><>_|\\#{}.}..## #}'').   The  dungeon
2286
            `` |--------||.-|++##.##<><>_|\\#{}.}..## #}'').   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.
2609
2616
2617
          paranoid_hit
2618
            If true, asks you to type the word ``yes'' when hitting any
2619
            peaceful monster, not just the letter ``y''.
2620
2621
          paranoid_quit
2622
            If true, asks you  to type the word ``yes'' when quitting or
2623
            entering Explore mode, not just the letter ``y''.
2624
2625
          paranoid_remove
2626
            If true, always show menu with the R and T commands even when
2627
            there is only one item to remove or take off.
2628
2610
          perm_invent
2629
          perm_invent
2611
            If true, always display your current  inventory  in  a  window.
2630
            If true, always display your current  inventory  in  a  window.
2612
            This  only makes sense for windowing system interfaces that im-
2631
            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.
2695
2714
2715
          showborn
2716
               When the game ends, show the number of each monster created
2717
               in the "Vanquished creatures" list, if it differs from the
2718
               number of those monsters killed.
2719
2696
          showexp
2720
          showexp
2697
            Show your accumulated experience points on bottom line (default
2721
            Show your accumulated experience points on bottom line (default
2698
            off).
2722
            off).
Lines 2723-2728 Link Here
2723
          silent
2747
          silent
2724
            Suppress terminal beeps (default on).
2748
            Suppress terminal beeps (default on).
2725
2749
2750
          sortloot
2751
            Controls the behavior of the sortloot patch that sorts
2752
            pickup lists for inventory and #loot commands and some
2753
            others.
2754
            The possible values are:
2755
2756
                 full - always sort the lists
2757
                 loot - only sort the lists that don't use inventory
2758
                        letters, like with the #loot and pickup commands
2759
                 none - show lists the traditional way without sorting
2760
            The default is 'none', the way an unpatched game works.
2761
2726
          sortpack
2762
          sortpack
2727
            Sort the pack contents by type when displaying  inventory  (de-
2763
            Sort the pack contents by type when displaying  inventory  (de-
2728
            fault on).
2764
            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
7
8
#ifdef MENU_COLOR
9
# ifdef MENU_COLOR_REGEX
10
#  include <regex.h>
11
# endif
12
#endif
13
8
/*
14
/*
9
 * The color scheme used is tailored for an IBM PC.  It consists of the
15
 * The color scheme used is tailored for an IBM PC.  It consists of the
10
 * standard 8 colors, folowed by their bright counterparts.  There are
16
 * 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
51
57
58
#ifdef MENU_COLOR
59
struct menucoloring {
60
# ifdef MENU_COLOR_REGEX
61
#  ifdef MENU_COLOR_REGEX_POSIX
62
    regex_t match;
63
#  else
64
    struct re_pattern_buffer match;
65
#  endif
66
# else
67
    char *match;
68
# endif
69
    int color, attr;
70
    struct menucoloring *next;
71
};
72
#endif /* MENU_COLOR */
73
74
#ifdef STATUS_COLORS
75
struct color_option {
76
    int color;
77
    int attr_bits;
78
};
79
80
struct percent_color_option {
81
	int percentage;
82
	struct color_option color_option;
83
	const struct percent_color_option *next;
84
};
85
86
struct text_color_option {
87
	const char *text;
88
	struct color_option color_option;
89
	const struct text_color_option *next;
90
};
91
#endif
92
52
#endif /* COLOR_H */
93
#endif /* COLOR_H */
(-)nethack-3.4.3/include/config.h (-6 / +23 lines)
Lines 169-176 Link Here
169
169
170
#ifdef UNIX
170
#ifdef UNIX
171
/* path and file name extension for compression program */
171
/* path and file name extension for compression program */
172
#define COMPRESS "/usr/bin/compress"	/* Lempel-Ziv compression */
172
#define COMPRESS "/bin/bzip2"	/* Lempel-Ziv compression */
173
#define COMPRESS_EXTENSION ".Z"		/* compress's extension */
173
#define COMPRESS_EXTENSION ".bz2"		/* compress's extension */
174
/* An example of one alternative you might want to use: */
174
/* An example of one alternative you might want to use: */
175
/* #define COMPRESS "/usr/local/bin/gzip" */	/* FSF gzip compression */
175
/* #define COMPRESS "/usr/local/bin/gzip" */	/* FSF gzip compression */
176
/* #define COMPRESS_EXTENSION ".gz" */		/* normal gzip extension */
176
/* #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
/*
190
/*
191
 *	Defining INSURANCE slows down level changes, but allows games that
191
 *	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
210
/*
210
/*
Lines 300-306 Link Here
300
 * functions that have been macroized.
300
 * functions that have been macroized.
301
 */
301
 */
302
302
303
/* #define VISION_TABLES */ /* use vision tables generated at compile time */
303
#define VISION_TABLES 1 /* use vision tables generated at compile time */
304
#ifndef VISION_TABLES
304
#ifndef VISION_TABLES
305
# ifndef NO_MACRO_CPATH
305
# ifndef NO_MACRO_CPATH
306
#  define MACRO_CPATH	/* use clear_path macros instead of functions */
306
#  define MACRO_CPATH	/* use clear_path macros instead of functions */
Lines 338-344 Link Here
338
#endif
338
#endif
339
339
340
#define EXP_ON_BOTL	/* Show experience on bottom line */
340
#define EXP_ON_BOTL	/* Show experience on bottom line */
341
/* #define SCORE_ON_BOTL */	/* added by Gary Erickson (erickson@ucivax) */
341
#define SCORE_ON_BOTL  /* added by Gary Erickson (erickson@ucivax) */
342
342
343
/*
343
/*
344
 * Section 5:  EXPERIMENTAL STUFF
344
 * Section 5:  EXPERIMENTAL STUFF
Lines 348-356 Link Here
348
 * bugs left here.
348
 * bugs left here.
349
 */
349
 */
350
350
351
#define STATUS_COLORS
352
351
/*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
353
/*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
352
/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
354
/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
353
355
356
#define SHOW_BORN
357
#define SHOW_EXTINCT
358
#define DUMP_LOG
359
#define SORTLOOT
360
#define PARANOID
361
#define DYNKEY
362
#define MENU_COLOR
363
#define MENU_COLOR_REGEX
364
/* #define MENU_COLOR_REGEX_POSIX */
365
/* if MENU_COLOR_REGEX is defined, use regular expressions (regex.h,
366
 * GNU specific functions by default, POSIX functions with
367
 * MENU_COLOR_REGEX_POSIX).
368
 * otherwise use pmatch() to match menu color lines.
369
 * pmatch() provides basic globbing: '*' and '?' wildcards.
370
 */
354
/* End of Section 5 */
371
/* End of Section 5 */
355
372
356
#include "global.h"	/* Define everything else according to choices above */
373
#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
138
135
/* ### cmd.c ### */
139
/* ### cmd.c ### */
136
140
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);
558
580
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
1442
1409
/* ### pager.c ### */
1443
/* ### pager.c ### */
1410
1444
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
7
8
#ifdef DYNKEY
9
struct dkb_tab {
10
        char bound_char;
11
        char cmd_char;
12
};
13
#endif
14
8
struct func_tab {
15
struct func_tab {
9
	char f_char;
16
	char f_char;
10
	boolean can_if_buried;
17
	boolean can_if_buried;
Lines 19-23 Link Here
19
};
26
};
20
27
21
extern struct ext_func_tab extcmdlist[];
28
extern struct ext_func_tab extcmdlist[];
29
extern struct dkb_tab *dkblist;
22
30
23
#endif /* FUNC_TAB_H */
31
#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
97
98
/* #define NO_FILE_LINKS */	/* if no hard links */
98
/* #define NO_FILE_LINKS */	/* if no hard links */
99
/* #define LOCKDIR "/usr/games/lib/nethackdir" */	/* where to put locks */
99
#define LOCKDIR "GENTOO_STATEDIR"
100
100
101
/*
101
/*
102
 * If you want the static parts of your playground on a read-only file
102
 * If you want the static parts of your playground on a read-only file
103
 * system, define VAR_PLAYGROUND to be where the variable parts are kept.
103
 * system, define VAR_PLAYGROUND to be where the variable parts are kept.
104
 */
104
 */
105
/* #define VAR_PLAYGROUND "/var/lib/games/nethack" */
105
#define VAR_PLAYGROUND "GENTOO_STATEDIR"
106
106
107
107
108
/*
108
/*
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
138
/*
138
/*
(-)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
36
37
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
38
39
extern const struct percent_color_option *hp_colors;
40
extern const struct percent_color_option *pw_colors;
41
extern const struct text_color_option *text_colors;
42
43
struct color_option
44
text_color_of(text, color_options)
45
const char *text;
46
const struct text_color_option *color_options;
47
{
48
	if (color_options == NULL) {
49
		struct color_option result = {NO_COLOR, 0};
50
		return result;
51
	}
52
	if (strstri(color_options->text, text)
53
	 || strstri(text, color_options->text))
54
		return color_options->color_option;
55
	return text_color_of(text, color_options->next);
56
}
57
58
struct color_option
59
percentage_color_of(value, max, color_options)
60
int value, max;
61
const struct percent_color_option *color_options;
62
{
63
	if (color_options == NULL) {
64
		struct color_option result = {NO_COLOR, 0};
65
		return result;
66
	}
67
	if (100 * value <= color_options->percentage * max)
68
		return color_options->color_option;
69
	return percentage_color_of(value, max, color_options->next);
70
}
71
72
void
73
start_color_option(color_option)
74
struct color_option color_option;
75
{
76
	int i;
77
	if (color_option.color != NO_COLOR)
78
		term_start_color(color_option.color);
79
	for (i = 0; (1 << i) <= color_option.attr_bits; ++i)
80
		if (i != ATR_NONE && color_option.attr_bits & (1 << i))
81
			term_start_attr(i);
82
}
83
84
void
85
end_color_option(color_option)
86
struct color_option color_option;
87
{
88
	int i;
89
	if (color_option.color != NO_COLOR)
90
		term_end_color(color_option.color);
91
	for (i = 0; (1 << i) <= color_option.attr_bits; ++i)
92
		if (i != ATR_NONE && color_option.attr_bits & (1 << i))
93
			term_end_attr(i);
94
}
95
96
void
97
apply_color_option(color_option, newbot2)
98
struct color_option color_option;
99
const char *newbot2;
100
{
101
	if (!iflags.use_status_colors) return;
102
	curs(WIN_STATUS, 1, 1);
103
	start_color_option(color_option);
104
	putstr(WIN_STATUS, 0, newbot2);
105
	end_color_option(color_option);
106
}
107
108
void
109
add_colored_text(text, newbot2)
110
const char *text;
111
char *newbot2;
112
{
113
	char *nb;
114
	struct color_option color_option;
115
116
	if (*text == '\0') return;
117
118
	if (!iflags.use_status_colors) {
119
		Sprintf(nb = eos(newbot2), " %s", text);
120
                return;
121
        }
122
123
	Strcat(nb = eos(newbot2), " ");
124
	curs(WIN_STATUS, 1, 1);
125
	putstr(WIN_STATUS, 0, newbot2);
126
127
	Strcat(nb = eos(nb), text);
128
	curs(WIN_STATUS, 1, 1);
129
       	color_option = text_color_of(text, text_colors);
130
	start_color_option(color_option);
131
	putstr(WIN_STATUS, 0, newbot2);
132
	end_color_option(color_option);
133
}
134
135
#endif
136
37
#ifndef OVLB
137
#ifndef OVLB
38
STATIC_DCL int mrank_sz;
138
STATIC_DCL int mrank_sz;
39
#else /* OVLB */
139
#else /* OVLB */
Lines 165-174 Link Here
165
}
265
}
166
#endif
266
#endif
167
267
268
#ifdef DUMP_LOG
269
void bot1str(char *newbot1)
270
#else
168
STATIC_OVL void
271
STATIC_OVL void
169
bot1()
272
bot1()
273
#endif
170
{
274
{
275
#ifndef DUMP_LOG
171
	char newbot1[MAXCO];
276
	char newbot1[MAXCO];
277
#endif
172
	register char *nb;
278
	register char *nb;
173
	register int i,j;
279
	register int i,j;
174
280
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
}
244
359
360
#ifdef DUMP_LOG
361
void bot2str(newbot2)
362
char* newbot2;
363
#else
245
STATIC_OVL void
364
STATIC_OVL void
246
bot2()
365
bot2()
366
#endif
247
{
367
{
368
#ifndef DUMP_LOG
248
	char  newbot2[MAXCO];
369
	char  newbot2[MAXCO];
370
#endif
249
	register char *nb;
371
	register char *nb;
250
	int hp, hpmax;
372
	int hp, hpmax;
251
	int cap = near_capacity();
373
	int cap = near_capacity();
374
#if defined(STATUS_COLORS) && defined(TEXTCOLOR) && !defined(DUMP_LOG)
375
	struct color_option color_option;
376
	int save_botlx = flags.botlx;
377
#endif
252
378
253
	hp = Upolyd ? u.mh : u.uhp;
379
	hp = Upolyd ? u.mh : u.uhp;
254
	hpmax = Upolyd ? u.mhmax : u.uhpmax;
380
	hpmax = Upolyd ? u.mhmax : u.uhpmax;
255
381
256
	if(hp < 0) hp = 0;
382
	if(hp < 0) hp = 0;
257
	(void) describe_level(newbot2);
383
	(void) describe_level(newbot2);
258
	Sprintf(nb = eos(newbot2),
384
	Sprintf(nb = eos(newbot2), "%c:%-2ld", oc_syms[COIN_CLASS],
259
		"%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[COIN_CLASS],
260
#ifndef GOLDOBJ
385
#ifndef GOLDOBJ
261
		u.ugold,
386
		u.ugold
262
#else
387
#else
263
		money_cnt(invent),
388
		money_cnt(invent)
264
#endif
389
#endif
265
		hp, hpmax, u.uen, u.uenmax, u.uac);
390
	       );
391
392
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
393
	Strcat(nb = eos(newbot2), " HP:");
394
	curs(WIN_STATUS, 1, 1);
395
	putstr(WIN_STATUS, 0, newbot2);
396
	flags.botlx = 0;
397
398
	Sprintf(nb = eos(nb), "%d(%d)", hp, hpmax);
399
	apply_color_option(percentage_color_of(hp, hpmax, hp_colors), newbot2);
400
#else
401
	Sprintf(nb = eos(nb), " HP:%d(%d)", hp, hpmax);
402
#endif
403
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
404
	Strcat(nb = eos(nb), " Pw:");
405
	curs(WIN_STATUS, 1, 1);
406
	putstr(WIN_STATUS, 0, newbot2);
266
407
408
	Sprintf(nb = eos(nb), "%d(%d)", u.uen, u.uenmax);
409
	apply_color_option(percentage_color_of(u.uen, u.uenmax, pw_colors), newbot2);
410
#else
411
	Sprintf(nb = eos(nb), " Pw:%d(%d)", u.uen, u.uenmax);
412
#endif
413
	Sprintf(nb = eos(nb), " AC:%-2d", u.uac);
267
	if (Upolyd)
414
	if (Upolyd)
268
		Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel);
415
		Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel);
269
#ifdef EXP_ON_BOTL
416
#ifdef EXP_ON_BOTL
Lines 275-299 Link Here
275
422
276
	if(flags.time)
423
	if(flags.time)
277
	    Sprintf(nb = eos(nb), " T:%ld", moves);
424
	    Sprintf(nb = eos(nb), " T:%ld", moves);
278
	if(strcmp(hu_stat[u.uhs], "        ")) {
425
	if(strcmp(hu_stat[u.uhs], "        "))
279
		Sprintf(nb = eos(nb), " ");
426
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
280
		Strcat(newbot2, hu_stat[u.uhs]);
427
	     	add_colored_text(hu_stat[u.uhs], newbot2);
281
	}
428
#else
282
	if(Confusion)	   Sprintf(nb = eos(nb), " Conf");
429
		Sprintf(nb = eos(nb), " %s", hu_stat[u.uhs]);
430
#endif
431
	if(Confusion)
432
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
433
	     	add_colored_text("Conf", newbot2);
434
#else
435
		Strcat(nb = eos(nb), " Conf");
436
#endif
283
	if(Sick) {
437
	if(Sick) {
284
		if (u.usick_type & SICK_VOMITABLE)
438
		if (u.usick_type & SICK_VOMITABLE)
285
			   Sprintf(nb = eos(nb), " FoodPois");
439
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
440
			add_colored_text("FoodPois", newbot2);
441
#else
442
			Strcat(nb = eos(nb), " FoodPois");
443
#endif
286
		if (u.usick_type & SICK_NONVOMITABLE)
444
		if (u.usick_type & SICK_NONVOMITABLE)
287
			   Sprintf(nb = eos(nb), " Ill");
445
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
446
			add_colored_text("Ill", newbot2);
447
#else
448
			Strcat(nb = eos(nb), " Ill");
449
#endif
288
	}
450
	}
289
	if(Blind)	   Sprintf(nb = eos(nb), " Blind");
451
	if(Blind)
290
	if(Stunned)	   Sprintf(nb = eos(nb), " Stun");
452
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
291
	if(Hallucination)  Sprintf(nb = eos(nb), " Hallu");
453
	     	add_colored_text("Blind", newbot2);
292
	if(Slimed)         Sprintf(nb = eos(nb), " Slime");
454
#else
455
		Strcat(nb = eos(nb), " Blind");
456
#endif
457
	if(Stunned)
458
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
459
	     	add_colored_text("Stun", newbot2);
460
#else
461
		Strcat(nb = eos(nb), " Stun");
462
#endif
463
	if(Hallucination)
464
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
465
	     	add_colored_text("Hallu", newbot2);
466
#else
467
		Strcat(nb = eos(nb), " Hallu");
468
#endif
469
	if(Slimed)
470
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
471
	     	add_colored_text("Slime", newbot2);
472
#else
473
		Strcat(nb = eos(nb), " Slime");
474
#endif
293
	if(cap > UNENCUMBERED)
475
	if(cap > UNENCUMBERED)
476
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
477
		add_colored_text(enc_stat[cap], newbot2);
478
#else
294
		Sprintf(nb = eos(nb), " %s", enc_stat[cap]);
479
		Sprintf(nb = eos(nb), " %s", enc_stat[cap]);
480
#endif
481
#ifdef DUMP_LOG
482
}
483
STATIC_OVL void
484
bot2()
485
{
486
	char newbot2[MAXCO];
487
	bot2str(newbot2);
488
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
489
	struct color_option color_option;
490
	int save_botlx = flags.botlx;
491
#endif
492
#endif
295
	curs(WIN_STATUS, 1, 1);
493
	curs(WIN_STATUS, 1, 1);
296
	putstr(WIN_STATUS, 0, newbot2);
494
	putstr(WIN_STATUS, 0, newbot2);
495
	flags.botlx = save_botlx;
297
}
496
}
298
497
299
void
498
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
}
758
779
780
/* #showkills command */
781
STATIC_PTR int wiz_showkills()		/* showborn patch */
782
{
783
	list_vanquished('y', FALSE);
784
	return 0;
785
}
786
759
#endif /* WIZARD */
787
#endif /* WIZARD */
760
788
761
789
Lines 1126-1131 Link Here
1126
	return;
1154
	return;
1127
}
1155
}
1128
1156
1157
#ifdef DUMP_LOG
1158
void
1159
dump_enlightenment(final)
1160
int final;
1161
{
1162
	int ltmp;
1163
	char buf[BUFSZ];
1164
	char buf2[BUFSZ];
1165
	const char *enc_stat[] = { /* copied from botl.c */
1166
	     "",
1167
	     "burdened",
1168
	     "stressed",
1169
	     "strained",
1170
	     "overtaxed",
1171
	     "overloaded"
1172
	};
1173
	char *youwere = "  You were ";
1174
	char *youhave = "  You have ";
1175
	char *youhad  = "  You had ";
1176
	char *youcould = "  You could ";
1177
1178
	dump("", "Final attributes");
1179
1180
#ifdef ELBERETH
1181
	if (u.uevent.uhand_of_elbereth) {
1182
	    static const char * const hofe_titles[3] = {
1183
				"the Hand of Elbereth",
1184
				"the Envoy of Balance",
1185
				"the Glory of Arioch"
1186
	    };
1187
	    dump(youwere,
1188
		(char *)hofe_titles[u.uevent.uhand_of_elbereth - 1]);
1189
	}
1190
#endif
1191
1192
	if (u.ualign.record >= 20)
1193
		dump(youwere, "piously aligned");
1194
	else if (u.ualign.record > 13)
1195
	    dump(youwere, "devoutly aligned");
1196
	else if (u.ualign.record > 8)
1197
	    dump(youwere, "fervently aligned");
1198
	else if (u.ualign.record > 3)
1199
	    dump(youwere, "stridently aligned");
1200
	else if (u.ualign.record == 3)
1201
	    dump(youwere, "aligned");
1202
	else if (u.ualign.record > 0)
1203
	    dump(youwere, "haltingly aligned");
1204
	else if (u.ualign.record == 0)
1205
	    dump(youwere, "nominally aligned");
1206
	else if (u.ualign.record >= -3)	dump(youhave, "strayed");
1207
	else if (u.ualign.record >= -8)	dump(youhave, "sinned");
1208
	else dump("  You have ", "transgressed");
1209
	Sprintf(buf, " %d", u.ualign.record);
1210
	dump("  Your alignment was ", buf);
1211
1212
1213
	/*** Resistances to troubles ***/
1214
	if (Fire_resistance) dump(youwere, "fire resistant");
1215
	if (Cold_resistance) dump(youwere, "cold resistant");
1216
	if (Sleep_resistance) dump(youwere, "sleep resistant");
1217
	if (Disint_resistance) dump(youwere, "disintegration-resistant");
1218
	if (Shock_resistance) dump(youwere, "shock resistant");
1219
	if (Poison_resistance) dump(youwere, "poison resistant");
1220
	if (Drain_resistance) dump(youwere, "level-drain resistant");
1221
	if (Sick_resistance) dump(youwere, "immune to sickness");
1222
	if (Antimagic) dump(youwere, "magic-protected");
1223
	if (Acid_resistance) dump(youwere, "acid resistant");
1224
	if (Stone_resistance) dump(youwere, "petrification resistant");
1225
	if (Invulnerable) dump(youwere, "invulnerable");
1226
	if (u.uedibility) dump(youcould, "recognize detrimental food");
1227
1228
	/*** Troubles ***/
1229
	if (Halluc_resistance) 	dump("  ", "You resisted hallucinations");
1230
	if (Hallucination) dump(youwere, "hallucinating");
1231
	if (Stunned) dump(youwere, "stunned");
1232
	if (Confusion) dump(youwere, "confused");
1233
	if (Blinded) dump(youwere, "blinded");
1234
	if (Sick) {
1235
		if (u.usick_type & SICK_VOMITABLE)
1236
			dump(youwere, "sick from food poisoning");
1237
		if (u.usick_type & SICK_NONVOMITABLE)
1238
			dump(youwere, "sick from illness");
1239
	}
1240
	if (Stoned) dump(youwere, "turning to stone");
1241
	if (Slimed) dump(youwere, "turning into slime");
1242
	if (Strangled)
1243
		dump(youwere, (u.uburied) ? "buried" : "being strangled");
1244
	if (Glib) {
1245
		Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
1246
		dump(youhad, buf);
1247
	}
1248
	if (Fumbling) dump("  ", "You fumbled");
1249
	if (Wounded_legs
1250
#ifdef STEED
1251
	    && !u.usteed
1252
#endif
1253
			  ) {
1254
		Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
1255
		dump(youhad, buf);
1256
	}
1257
#ifdef STEED
1258
	if (Wounded_legs && u.usteed) {
1259
	    Strcpy(buf, x_monnam(u.usteed, ARTICLE_YOUR, (char *)0, 
1260
		    SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION, FALSE));
1261
	    *buf = highc(*buf);
1262
	    Strcat(buf, " had wounded legs");
1263
	    dump("  ", buf);
1264
	}
1265
#endif
1266
	if (Sleeping) dump("  ", "You fell asleep");
1267
	if (Hunger) dump("  ", "You hungered rapidly");
1268
1269
	/*** Vision and senses ***/
1270
	if (See_invisible) dump("  ", "You saw invisible");
1271
	if (Blind_telepat) dump(youwere, "telepathic");
1272
	if (Warning) dump(youwere, "warned");
1273
	if (Warn_of_mon && flags.warntype) {
1274
		Sprintf(buf, "aware of the presence of %s",
1275
			(flags.warntype & M2_ORC) ? "orcs" :
1276
			(flags.warntype & M2_DEMON) ? "demons" :
1277
			something); 
1278
		dump(youwere, buf);
1279
	}
1280
	if (Undead_warning) dump(youwere, "warned of undead");
1281
	if (Searching) dump(youhad, "automatic searching");
1282
	if (Clairvoyant) dump(youwere, "clairvoyant");
1283
	if (Infravision) dump(youhad, "infravision");
1284
	if (Detect_monsters)
1285
	  dump(youwere, "sensing the presence of monsters");
1286
	if (u.umconf) dump(youwere, "going to confuse monsters");
1287
1288
	/*** Appearance and behavior ***/
1289
	if (Adornment) {
1290
	    int adorn = 0;
1291
	    if(uleft && uleft->otyp == RIN_ADORNMENT) adorn += uleft->spe;
1292
	    if(uright && uright->otyp == RIN_ADORNMENT) adorn += uright->spe;
1293
	    if (adorn < 0)
1294
		dump(youwere, "poorly adorned");
1295
	    else
1296
		dump(youwere, "adorned");
1297
	}
1298
	if (Invisible) dump(youwere, "invisible");
1299
	else if (Invis) dump(youwere, "invisible to others");
1300
	/* ordinarily "visible" is redundant; this is a special case for
1301
	   the situation when invisibility would be an expected attribute */
1302
	else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis)
1303
	    dump(youwere, "visible");
1304
	if (Displaced) dump(youwere, "displaced");
1305
	if (Stealth) dump(youwere, "stealthy");
1306
	if (Aggravate_monster) dump("  ", "You aggravated monsters");
1307
	if (Conflict) dump("  ", "You caused conflict");
1308
1309
	/*** Transportation ***/
1310
	if (Jumping) dump(youcould, "jump");
1311
	if (Teleportation) dump(youcould, "teleport");
1312
	if (Teleport_control) dump(youhad, "teleport control");
1313
	if (Lev_at_will) dump(youwere, "levitating, at will");
1314
	else if (Levitation)
1315
	  dump(youwere, "levitating");	/* without control */
1316
	else if (Flying) dump(youcould, "fly");
1317
	if (Wwalking) dump(youcould, "walk on water");
1318
	if (Swimming) dump(youcould, "swim");
1319
	if (Breathless) dump(youcould, "survive without air");
1320
	else if (Amphibious) dump(youcould, "breathe water");
1321
	if (Passes_walls) dump(youcould, "walk through walls");
1322
#ifdef STEED
1323
	if (u.usteed && (final < 2 || strcmp(killer, "riding accident"))) {
1324
	    Sprintf(buf, "riding %s", y_monnam(u.usteed));
1325
	    dump(youwere, buf);
1326
	}
1327
#endif
1328
	if (u.uswallow) {
1329
	    Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck));
1330
#ifdef WIZARD
1331
	    if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim);
1332
#endif
1333
	    dump(youwere, buf);
1334
	} else if (u.ustuck) {
1335
	    Sprintf(buf, "%s %s",
1336
		    (Upolyd && sticks(youmonst.data)) ? "holding" : "held by",
1337
		    a_monnam(u.ustuck));
1338
	    dump(youwere, buf);
1339
	}
1340
1341
	/*** Physical attributes ***/
1342
	if (u.uhitinc)
1343
	    dump(youhad,
1344
		enlght_combatinc("to hit", u.uhitinc, final, buf));
1345
	if (u.udaminc)
1346
	    dump(youhad,
1347
		enlght_combatinc("damage", u.udaminc, final, buf));
1348
	if (Slow_digestion) dump(youhad, "slower digestion");
1349
	if (Regeneration) dump("  ", "You regenerated");
1350
	if (u.uspellprot || Protection) {
1351
	    int prot = 0;
1352
1353
	    if(uleft && uleft->otyp == RIN_PROTECTION) prot += uleft->spe;
1354
	    if(uright && uright->otyp == RIN_PROTECTION) prot += uright->spe;
1355
	    if (HProtection & INTRINSIC) prot += u.ublessed;
1356
	    prot += u.uspellprot;
1357
	    
1358
	    if (prot < 0)
1359
		dump(youwere, "ineffectively protected");
1360
	    else
1361
		dump(youwere, "protected");
1362
	}
1363
	if (Protection_from_shape_changers)
1364
		dump(youwere, "protected from shape changers");
1365
	if (Polymorph) dump(youwere, "polymorphing");
1366
	if (Polymorph_control) dump(youhad, "polymorph control");
1367
	if (u.ulycn >= LOW_PM) {
1368
		Strcpy(buf, an(mons[u.ulycn].mname));
1369
		dump(youwere, buf);
1370
	}
1371
	if (Upolyd) {
1372
	    if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form");
1373
	    else Sprintf(buf, "polymorphed into %s",
1374
			 an(youmonst.data->mname));
1375
#ifdef WIZARD
1376
	    if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
1377
#endif
1378
	    dump(youwere, buf);
1379
	}
1380
	if (Unchanging)
1381
	  dump(youcould, "not change from your current form");
1382
	if (Fast) dump(youwere, Very_fast ? "very fast" : "fast");
1383
	if (Reflecting) dump(youhad, "reflection");
1384
	if (Free_action) dump(youhad, "free action");
1385
	if (Fixed_abil) dump(youhad, "fixed abilities");
1386
	if (Lifesaved)
1387
		dump("  ", "Your life would have been saved");
1388
	if (u.twoweap) dump(youwere, "wielding two weapons at once");
1389
1390
	/*** Miscellany ***/
1391
	if (Luck) {
1392
	    ltmp = abs((int)Luck);
1393
	    Sprintf(buf, "%s%slucky (%d)",
1394
		    ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "",
1395
		    Luck < 0 ? "un" : "", Luck);
1396
	    dump(youwere, buf);
1397
	}
1398
#ifdef WIZARD
1399
	 else if (wizard) dump("  ", "Your luck was zero");
1400
#endif
1401
	if (u.moreluck > 0) dump(youhad, "extra luck");
1402
	else if (u.moreluck < 0) dump(youhad, "reduced luck");
1403
	if (carrying(LUCKSTONE) || stone_luck(TRUE)) {
1404
	    ltmp = stone_luck(FALSE);
1405
	    if (ltmp <= 0)
1406
		dump("  ", "Bad luck did not time out for you");
1407
	    if (ltmp >= 0)
1408
		dump("  ", "Good luck did not time out for you");
1409
	}
1410
1411
	if (u.ugangr) {
1412
	    Sprintf(buf, " %sangry with you",
1413
		u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : "");
1414
#ifdef WIZARD
1415
	    if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr);
1416
#endif
1417
	    Sprintf(buf2, "%s was %s", u_gname(), buf);
1418
	    dump("  ", buf2);
1419
	}
1420
1421
    {
1422
	const char *p;
1423
1424
	buf[0] = '\0';
1425
	if (final < 2) {    /* quit/escaped/ascended */
1426
	    p = "survived after being killed ";
1427
	    switch (u.umortality) {
1428
	    case 0:  p = "survived";  break;
1429
	    case 1:  Strcpy(buf, "once");  break;
1430
	    case 2:  Strcpy(buf, "twice");  break;
1431
	    case 3:  Strcpy(buf, "thrice");  break;
1432
	    default: Sprintf(buf, "%d times", u.umortality);
1433
		     break;
1434
	    }
1435
	} else {		/* game ended in character's death */
1436
	    p = "are dead";
1437
	    switch (u.umortality) {
1438
	    case 0:  impossible("dead without dying?");
1439
	    case 1:  break;			/* just "are dead" */
1440
	    default: Sprintf(buf, " (%d%s time!)", u.umortality,
1441
			     ordin(u.umortality));
1442
		     break;
1443
	    }
1444
	}
1445
	if (p) {
1446
	  Sprintf(buf2, "You %s %s", p, buf);
1447
	  dump("  ", buf2);
1448
	}
1449
    }
1450
	dump("", "");
1451
	return;
1452
1453
} /* dump_enlightenment */
1454
#endif
1455
1129
/*
1456
/*
1130
 * Courtesy function for non-debug, non-explorer mode players
1457
 * Courtesy function for non-debug, non-explorer mode players
1131
 * to help refresh them about who/what they are.
1458
 * 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
}
1343
1670
1671
#ifdef DUMP_LOG
1672
void
1673
dump_conduct(final)
1674
int final;
1675
{
1676
	char buf[BUFSZ];
1677
	int ngenocided;
1678
1679
	dump("", "Voluntary challenges");
1680
1681
	if (!u.uconduct.food)
1682
	    dump("", "  You went without food");
1683
	    /* But beverages are okay */
1684
	else if (!u.uconduct.unvegan)
1685
	    dump("", "  You followed a strict vegan diet");
1686
	else if (!u.uconduct.unvegetarian)
1687
	    dump("", "  You were a vegetarian");
1688
	else if (Role_if(PM_MONK) && u.uconduct.unvegetarian < 10) {
1689
	    sprintf(buf, "  You ate non-vegetarian food %ld time%s.", 
1690
		u.uconduct.unvegetarian, plur(u.uconduct.unvegetarian));
1691
	    dump("", buf);
1692
	}
1693
1694
	if (!u.uconduct.gnostic)
1695
	    dump("", "  You were an atheist");
1696
1697
	if (!u.uconduct.weaphit)
1698
	    dump("", "  You never hit with a wielded weapon");
1699
	else if (Role_if(PM_MONK) && u.uconduct.weaphit < 10) {
1700
	    Sprintf(buf, "  You hit with a wielded weapon %ld time%s",
1701
		    u.uconduct.weaphit, plur(u.uconduct.weaphit));
1702
	    dump("", buf);
1703
	}
1704
#ifdef WIZARD
1705
	else if (wizard) {
1706
	    Sprintf(buf, "hit with a wielded weapon %ld time%s",
1707
		    u.uconduct.weaphit, plur(u.uconduct.weaphit));
1708
	    dump("  You ", buf);
1709
	}
1710
#endif
1711
	if (!u.uconduct.killer)
1712
	    dump("", "  You were a pacifist");
1713
1714
	if (!u.uconduct.literate)
1715
	    dump("", "  You were illiterate");
1716
#ifdef WIZARD
1717
	else if (wizard) {
1718
	    Sprintf(buf, "read items or engraved %ld time%s",
1719
		    u.uconduct.literate, plur(u.uconduct.literate));
1720
	    dump("  You ", buf);
1721
	}
1722
#endif
1723
1724
	ngenocided = num_genocides();
1725
	if (ngenocided == 0) {
1726
	    dump("", "  You never genocided any monsters");
1727
	} else {
1728
	    Sprintf(buf, "genocided %d type%s of monster%s",
1729
		    ngenocided, plur(ngenocided), plur(ngenocided));
1730
	    dump("  You ", buf);
1731
	}
1732
1733
	if (!u.uconduct.polypiles)
1734
	    dump("", "  You never polymorphed an object");
1735
	else {
1736
	    Sprintf(buf, "polymorphed %ld item%s",
1737
		    u.uconduct.polypiles, plur(u.uconduct.polypiles));
1738
	    dump("  You ", buf);
1739
	}
1740
1741
	if (!u.uconduct.polyselfs)
1742
	    dump("", "  You never changed form");
1743
	else {
1744
	    Sprintf(buf, "changed form %ld time%s",
1745
		    u.uconduct.polyselfs, plur(u.uconduct.polyselfs));
1746
	    dump("  You ", buf);
1747
	}
1748
1749
	if (!u.uconduct.wishes)
1750
	    dump("", "  You used no wishes");
1751
	else {
1752
	    Sprintf(buf, "used %ld wish%s",
1753
		    u.uconduct.wishes, (u.uconduct.wishes > 1L) ? "es" : "");
1754
	    dump("  You ", buf);
1755
1756
	    if (!u.uconduct.wisharti)
1757
		dump("", "  You did not wish for any artifacts");
1758
	}
1759
1760
	dump("", "");
1761
}
1762
#endif /* DUMP_LOG */
1763
1344
#endif /* OVLB */
1764
#endif /* OVLB */
1345
#ifdef OVL1
1765
#ifdef OVL1
1346
1766
Lines 1474-1479 Link Here
1474
	{0,0,0,0}
1894
	{0,0,0,0}
1475
};
1895
};
1476
1896
1897
#ifdef DYNKEY
1898
1899
/* let's not get too dynamic */
1900
#define DYNKEY_SZ (sizeof(struct dkb_tab) * (26*4+40))
1901
1902
struct dkb_tab *dkblist = (struct dkb_tab *) 0;
1903
1904
static int dkblist_sz=-1;
1905
1906
int
1907
map_dkb(b, c)
1908
char b, c;
1909
{
1910
        if(dkblist_sz<0) {
1911
                dkblist=(struct dkb_tab *) alloc(DYNKEY_SZ+1); /* 0-term */
1912
                memset(dkblist, 0, DYNKEY_SZ+1);
1913
                dkblist_sz=0;
1914
        }
1915
        dkblist_sz++;
1916
        if(sizeof(struct dkb_tab) * dkblist_sz>DYNKEY_SZ)
1917
                return 0;
1918
        dkblist[dkblist_sz-1].bound_char=b;
1919
        dkblist[dkblist_sz-1].cmd_char=c;
1920
        return 1;
1921
}
1922
1923
char
1924
keydesc2char(desc)
1925
char *desc;
1926
{
1927
        char key;
1928
        int l=strlen(desc);
1929
1930
        if(l)
1931
                key=desc[l-1];
1932
        switch(l) {
1933
                case 1:
1934
                        return key;
1935
                case 3:
1936
                        if(desc[1]=='-')
1937
                                if(desc[0]=='M')
1938
                                        return M(key);
1939
                                else if(desc[0]=='C')
1940
                                        return C(key);
1941
                        /*fall through*/
1942
                default:
1943
                        return 0;
1944
        }
1945
}
1946
#undef DYNKEY_SZ
1947
#endif /* DYNKEY */
1948
1477
struct ext_func_tab extcmdlist[] = {
1949
struct ext_func_tab extcmdlist[] = {
1478
	{"adjust", "adjust inventory letters", doorganize, TRUE},
1950
	{"adjust", "adjust inventory letters", doorganize, TRUE},
1479
	{"chat", "talk to someone", dotalk, TRUE},	/* converse? */
1951
	{"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
2557
2084
#ifdef REDO
2558
#ifdef REDO
2085
	if(in_doagain || *readchar_queue)
2559
	if(in_doagain || *readchar_queue)
2086
	    dirsym = readchar();
2560
	    dirsym =
2087
	else
2561
#ifdef DYNKEY
2562
                    greadchar(TRUE);
2563
#else
2564
                    readchar();
2088
#endif
2565
#endif
2566
	else
2567
#endif /* REDO */
2089
	    dirsym = yn_function ((s && *s != '^') ? s : "In what direction?",
2568
	    dirsym = yn_function ((s && *s != '^') ? s : "In what direction?",
2090
					(char *)0, '\0');
2569
					(char *)0, '\0');
2091
#ifdef REDO
2570
#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
2812
2334
	if (!iflags.num_pad || (foo = readchar()) == 'n')
2813
	if (!iflags.num_pad || (foo =
2814
#ifdef DYNKEY
2815
                                greadchar(TRUE)
2816
#else
2817
                                readchar()
2818
#endif
2819
                               ) == 'n')
2335
	    for (;;) {
2820
	    for (;;) {
2336
		foo = readchar();
2821
		foo =
2822
#ifdef DYNKEY
2823
                        greadchar(TRUE);
2824
#else
2825
                        readchar();
2826
#endif
2337
		if (foo >= '0' && foo <= '9') {
2827
		if (foo >= '0' && foo <= '9') {
2338
		    multi = 10 * multi + foo - '0';
2828
		    multi = 10 * multi + foo - '0';
2339
		    if (multi < 0 || multi >= LARGEST_INT) multi = LARGEST_INT;
2829
		    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
2902
2407
char
2903
char
2904
#ifdef DYNKEY
2905
greadchar(dynkey)
2906
boolean dynkey;
2907
#else
2408
readchar()
2908
readchar()
2909
#endif
2409
{
2910
{
2410
	register int sym;
2911
	register int sym;
2411
	int x = u.ux, y = u.uy, mod = 0;
2912
	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
}
2448
2960
(-)nethack-3.4.3/src/decl.c (+13 lines)
Lines 209-214 Link Here
209
209
210
NEARDATA struct mvitals mvitals[NUMMONS];
210
NEARDATA struct mvitals mvitals[NUMMONS];
211
211
212
/* originally from end.c */
213
#ifdef DUMP_LOG
214
#ifdef DUMP_FN
215
char dump_fn[] = DUMP_FN;
216
#else
217
char dump_fn[PL_PSIZ] = DUMMY;
218
#endif
219
#endif /* DUMP_LOG */
220
212
NEARDATA struct c_color_names c_color_names = {
221
NEARDATA struct c_color_names c_color_names = {
213
	"black", "amber", "golden",
222
	"black", "amber", "golden",
214
	"light blue", "red", "green",
223
	"light blue", "red", "green",
Lines 235-240 Link Here
235
	"white",		/* CLR_WHITE */
244
	"white",		/* CLR_WHITE */
236
};
245
};
237
246
247
#ifdef MENU_COLOR
248
struct menucoloring *menu_colorings = 0;
249
#endif
250
238
struct c_common_strings c_common_strings = {
251
struct c_common_strings c_common_strings = {
239
	"Nothing happens.",		"That's enough tries!",
252
	"Nothing happens.",		"That's enough tries!",
240
	"That is a silly thing to %s.",	"shudder for a moment.",
253
	"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
/* ========================================================================= */
1371
/* ========================================================================= */
1372
1372
1373
#ifdef DUMP_LOG
1374
/* D: Added to dump screen to output file */
1375
STATIC_PTR uchar get_glyph_char(glyph)
1376
int glyph;
1377
{
1378
    uchar   ch;
1379
    register int offset;
1380
1381
    if (glyph >= NO_GLYPH)
1382
        return ' ';
1383
1384
    /*
1385
     *  Map the glyph back to a character.
1386
     *
1387
     *  Warning:  For speed, this makes an assumption on the order of
1388
     *		  offsets.  The order is set in display.h.
1389
     */
1390
    if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) {	/* a warning flash */
1391
	ch = def_warnsyms[offset].sym;
1392
    } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) {	/* swallow */
1393
	/* see swallow_to_glyph() in display.c */
1394
	ch = (uchar) defsyms[S_sw_tl + (offset & 0x7)].sym;
1395
    } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) {	/* zap beam */
1396
	/* see zapdir_to_glyph() in display.c */
1397
	ch = defsyms[S_vbeam + (offset & 0x3)].sym;
1398
    } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) {	/* cmap */
1399
	ch = defsyms[offset].sym;
1400
    } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) {	/* object */
1401
	ch = def_oc_syms[(int)objects[offset].oc_class];
1402
    } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */
1403
	ch = def_monsyms[(int)mons[offset].mlet];
1404
    } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) {	/* a corpse */
1405
	ch = def_oc_syms[(int)objects[CORPSE].oc_class];
1406
    } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */
1407
	ch = def_monsyms[(int)mons[offset].mlet];
1408
    } else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) {  /* invisible */
1409
	ch = DEF_INVISIBLE;
1410
    } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) {	/* a pet */
1411
	ch = def_monsyms[(int)mons[offset].mlet];
1412
    } else {						    /* a monster */
1413
	ch = monsyms[(int)mons[glyph].mlet];
1414
    }
1415
    return ch;
1416
}
1417
1418
#ifdef TTY_GRAPHICS
1419
extern const char * FDECL(compress_str, (const char *));
1420
#else
1421
const char*
1422
compress_str(str) /* copied from win/tty/wintty.c */
1423
const char *str;
1424
{
1425
	static char cbuf[BUFSZ];
1426
	/* compress in case line too long */
1427
	if((int)strlen(str) >= 80) {
1428
		register const char *bp0 = str;
1429
		register char *bp1 = cbuf;
1430
1431
		do {
1432
			if(*bp0 != ' ' || bp0[1] != ' ')
1433
				*bp1++ = *bp0;
1434
		} while(*bp0++);
1435
	} else
1436
	    return str;
1437
	return cbuf;
1438
}
1439
#endif /* TTY_GRAPHICS */
1440
1441
/* Take a screen dump */
1442
void dump_screen()
1443
{
1444
    register int x,y;
1445
    int lastc;
1446
    /* D: botl.c has a closer approximation to the size, but we'll go with
1447
     *    this */
1448
    char buf[300], *ptr;
1449
    
1450
    for (y = 0; y < ROWNO; y++) {
1451
	lastc = 0;
1452
	ptr = buf;
1453
	for (x = 1; x < COLNO; x++) {
1454
	    uchar c = get_glyph_char(gbuf[y][x].glyph);
1455
	    *ptr++ = c;
1456
	    if (c != ' ')
1457
		lastc = x;
1458
	}
1459
	buf[lastc] = '\0';
1460
	dump("", buf);
1461
    }
1462
    dump("", "");
1463
    bot1str(buf);
1464
    ptr = (char *) compress_str((const char *) buf);
1465
    dump("", ptr);
1466
    bot2str(buf);
1467
    dump("", buf);
1468
    dump("", "");
1469
    dump("", "");
1470
}
1471
#endif /* DUMP_LOG */
1472
1373
/*
1473
/*
1374
 * back_to_glyph()
1474
 * back_to_glyph()
1375
 *
1475
 *
(-)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
795
795
			if (flags.autodig && !flags.nopick &&
796
			if (flags.autodig && !flags.nopick &&
Lines 821-826 Link Here
821
		return(0);
822
		return(0);
822
	}
823
	}
823
824
825
	/* Move into the pit */
826
	if (trap && (trap->ttyp == PIT || trap->ttyp == SPIKED_PIT)) {
827
		You("carefully slide down into the %spit", 
828
			trap->ttyp == SPIKED_PIT ? "spiked " : "");
829
		u.utraptype = TT_PIT;
830
		u.utrap = rn1(6,2);
831
		return(0);
832
	} else {
824
	if (trap)
833
	if (trap)
825
	    You("%s %s.", locomotion(youmonst.data, "jump"),
834
	    You("%s %s.", locomotion(youmonst.data, "jump"),
826
		trap->ttyp == HOLE ? "down the hole" : "through the trap door");
835
		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
}
837
847
(-)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
812
814
# ifdef ASCIIGRAPH
813
# ifdef ASCIIGRAPH
815
	if (!iflags.IBMgraphics
814
	if (!(iflags.chargfx == IBM_GRAPHICS)
816
#  if defined(USE_TILES) && defined(MSDOS)
815
#  if defined(USE_TILES) && defined(MSDOS)
817
		|| iflags.grmode
816
		|| iflags.grmode
818
#  endif
817
#  endif
Lines 871-877 Link Here
871
870
872
	for (i = 0; i < MAXOCLASSES; i++) {
871
	for (i = 0; i < MAXOCLASSES; i++) {
873
#ifdef ASCIIGRAPH
872
#ifdef ASCIIGRAPH
874
	    if (iflags.IBMgraphics
873
	    if (iflags.chargfx == IBM_GRAPHICS
875
# if defined(USE_TILES) && defined(MSDOS)
874
# if defined(USE_TILES) && defined(MSDOS)
876
		&& !iflags.grmode
875
		&& !iflags.grmode
877
# endif
876
# endif
(-)nethack-3.4.3/src/eat.c (+22 lines)
Lines 1888-1893 Link Here
1888
		}
1888
		}
1889
	}
1889
	}
1890
1890
1891
	/* Can't eat trapped food - Chris Becker (topher@csh.rit.edu) */
1892
	{
1893
		struct trap* ttmp = t_at(u.ux,u.uy);
1894
		if (ttmp) {
1895
			switch(ttmp->ttyp) {
1896
			case PIT:
1897
			case SPIKED_PIT:
1898
				if (!(u.utraptype == TT_PIT && u.utrap)) {
1899
					You("can't reach %s, it's at the bottom of the %s!", the(xname(otmp)), 
1900
						ttmp->ttyp == PIT ? "pit" :	"spiked pit" );
1901
					return 0;
1902
				}
1903
				break;
1904
			case WEB:
1905
				You("can't eat %s, it's caught in the spider web%s!", the(xname(otmp)),
1906
					u.utraptype == TT_WEB && u.utrap ? " with you" : "" );
1907
				return 0;
1908
			default:
1909
				break;
1910
			}
1911
		}
1912
	}
1891
	/* We have to make non-foods take 1 move to eat, unless we want to
1913
	/* We have to make non-foods take 1 move to eat, unless we want to
1892
	 * do ridiculous amounts of coding to deal with partly eaten plate
1914
	 * do ridiculous amounts of coding to deal with partly eaten plate
1893
	 * mails, players who polymorph back to human in the middle of their
1915
	 * 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
51
46
#if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2)
52
#if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2)
Lines 86-91 Link Here
86
92
87
extern const char * const killed_by_prefix[];	/* from topten.c */
93
extern const char * const killed_by_prefix[];	/* from topten.c */
88
94
95
#ifdef DUMP_LOG
96
FILE *dump_fp = (FILE *)0;  /* file pointer for dumps */
97
/* functions dump_init, dump_exit and dump are from the dump patch */
98
99
void
100
dump_init ()
101
{
102
  if (dump_fn[0]) {
103
    char *p = (char *) strstr(dump_fn, "%n");
104
    if (p) {
105
      int new_dump_fn_len = strlen(dump_fn)+strlen(plname)-2; /* %n */
106
      char *new_dump_fn = (char *) alloc((unsigned)(new_dump_fn_len+1));
107
      char *q = new_dump_fn;
108
      strncpy(q, dump_fn, p-dump_fn);
109
      q += p-dump_fn;
110
      strncpy(q, plname, strlen(plname) + 1);
111
      regularize(q);
112
      q[strlen(plname)] = '\0';
113
      q += strlen(q);
114
      p += 2;	/* skip "%n" */
115
      strncpy(q, p, strlen(p));
116
      new_dump_fn[new_dump_fn_len] = '\0';
117
118
      dump_fp = fopen(new_dump_fn, "w");
119
      if (!dump_fp) {
120
	pline("Can't open %s for output.", new_dump_fn);
121
	pline("Dump file not created.");
122
      }
123
      free(new_dump_fn);
124
      
125
    } else {
126
      dump_fp = fopen (dump_fn, "w");
127
128
      if (!dump_fp) {
129
	pline("Can't open %s for output.", dump_fn);
130
	pline("Dump file not created.");
131
      }
132
    }
133
  }
134
}
135
136
void
137
dump_exit ()
138
{
139
  if (dump_fp)
140
    fclose (dump_fp);
141
}
142
143
void dump (pre, str)
144
     char *pre, *str;
145
{
146
  if (dump_fp)
147
    fprintf (dump_fp, "%s%s\n", pre, str);
148
}
149
#endif  /* DUMP_LOG */
150
89
/*ARGSUSED*/
151
/*ARGSUSED*/
90
void
152
void
91
done1(sig_unused)   /* called as signal() handler, so sent at least one arg */
153
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
453
372
			for (obj = invent; obj; obj = obj->nobj) {
454
			for (obj = invent; obj; obj = obj->nobj) {
373
			    makeknown(obj->otyp);
455
			    makeknown(obj->otyp);
374
			    obj->known = obj->bknown = obj->dknown = obj->rknown = 1;
456
			    obj->known = obj->bknown = obj->dknown = obj->rknown = 1;
375
			}
457
			}
458
#ifdef DUMP_LOG
459
			(void) dump_inventory((char *)0, TRUE, want_disp);
460
			do_containerconts(invent, TRUE, TRUE, TRUE, want_disp);
461
#else
462
			if (c == 'y') {
376
			(void) display_inventory((char *)0, TRUE);
463
			(void) display_inventory((char *)0, TRUE);
377
			container_contents(invent, TRUE, TRUE);
464
			container_contents(invent, TRUE, TRUE);
465
			}
466
#endif /* DUMP_LOG */
378
		}
467
		}
379
		if (c == 'q')  done_stopprint++;
468
		if (c == 'q')  done_stopprint++;
380
	    }
381
	}
469
	}
382
470
383
	ask = should_query_disclose_option('a', &defquery);
471
	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
485
392
	ask = should_query_disclose_option('v', &defquery);
486
	ask = should_query_disclose_option('v', &defquery);
487
#ifdef DUMP_LOG
488
	do_vanquished(defquery, ask, TRUE);
489
#else
393
	if (!done_stopprint)
490
	if (!done_stopprint)
394
	    list_vanquished(defquery, ask);
491
	    list_vanquished(defquery, ask);
492
#endif
395
493
396
	ask = should_query_disclose_option('g', &defquery);
494
	ask = should_query_disclose_option('g', &defquery);
397
	if (!done_stopprint)
495
	if (!done_stopprint)
496
#ifdef DUMP_LOG
497
	    list_genocided(defquery, ask,TRUE);
498
#else
398
	    list_genocided(defquery, ask);
499
	    list_genocided(defquery, ask);
500
#endif
399
501
400
	ask = should_query_disclose_option('c', &defquery);
502
	ask = should_query_disclose_option('c', &defquery);
401
	if (!done_stopprint) {
503
	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
517
410
/* try to get the player back in a viable state after being killed */
518
/* 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
858
726
	if (bones_ok) {
859
	if (bones_ok) {
727
#ifdef WIZARD
860
#ifdef WIZARD
861
# ifdef PARANOID
862
	    if(wizard) {
863
		getlin("Save WIZARD MODE bones? [no/yes]", paranoid_buf);
864
		(void) lcase (paranoid_buf);
865
		if (strcmp (paranoid_buf, "yes"))
866
		  really_bon = FALSE;
867
	    }
868
	    if(really_bon)
869
# else
728
	    if (!wizard || yn("Save bones?") == 'y')
870
	    if (!wizard || yn("Save bones?") == 'y')
729
#endif
871
# endif /* PARANOID */
872
#endif /* WIZARD */
730
		savebones(corpse);
873
		savebones(corpse);
731
	    /* corpse may be invalid pointer now so
874
	    /* corpse may be invalid pointer now so
732
		ensure that it isn't used again */
875
		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
	}
772
915
916
	Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname,
917
		how != ASCENDED ?
918
		   (const char *) ((flags.female && urole.name.f) ?
919
		      urole.name.f : urole.name.m) :
920
		   (const char *) (flags.female ? "Demigoddess" : "Demigod"));
773
	if (!done_stopprint) {
921
	if (!done_stopprint) {
774
	    Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname,
775
		   how != ASCENDED ?
776
		      (const char *) ((flags.female && urole.name.f) ?
777
		         urole.name.f : urole.name.m) :
778
		      (const char *) (flags.female ? "Demigoddess" : "Demigod"));
779
	    putstr(endwin, 0, pbuf);
922
	    putstr(endwin, 0, pbuf);
780
	    putstr(endwin, 0, "");
923
	    putstr(endwin, 0, "");
781
	}
924
	}
925
#ifdef DUMP_LOG
926
	if (dump_fp) dump("", pbuf);
927
#endif
782
928
783
	if (how == ESCAPED || how == ASCENDED) {
929
	if (how == ESCAPED || how == ASCENDED) {
784
	    register struct monst *mtmp;
930
	    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
980
830
	    if (!done_stopprint)
981
	    if (!done_stopprint)
831
		artifact_score(invent, FALSE, endwin);	/* list artifacts */
982
		artifact_score(invent, FALSE, endwin);	/* list artifacts */
832
983
#ifdef DUMP_LOG
984
	    else
985
		artifact_score(invent, FALSE, WIN_ERR);
986
#endif
833
	    /* list valuables here */
987
	    /* list valuables here */
834
	    for (val = valuables; val->list; val++) {
988
	    for (val = valuables; val->list; val++) {
835
		sort_valuables(val->list, val->size);
989
		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
1017
861
	} else if (!done_stopprint) {
1018
	} else {
862
	    /* did not escape or ascend */
1019
	    /* did not escape or ascend */
863
	    if (u.uz.dnum == 0 && u.uz.dlevel <= 0) {
1020
	    if (u.uz.dnum == 0 && u.uz.dlevel <= 0) {
864
		/* level teleported out of the dungeon; `how' is DIED,
1021
		/* level teleported out of the dungeon; `how' is DIED,
Lines 878-898 Link Here
878
1035
879
	    Sprintf(eos(pbuf), " with %ld point%s,",
1036
	    Sprintf(eos(pbuf), " with %ld point%s,",
880
		    u.urexp, plur(u.urexp));
1037
		    u.urexp, plur(u.urexp));
881
	    putstr(endwin, 0, pbuf);
1038
	    if (!done_stopprint) putstr(endwin, 0, pbuf);
1039
#ifdef DUMP_LOG
1040
	    if (dump_fp) dump("", pbuf);
1041
#endif
882
	}
1042
	}
883
1043
884
	if (!done_stopprint) {
1044
	Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.",
885
	    Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.",
1045
	    umoney, plur(umoney), moves, plur(moves));
886
		    umoney, plur(umoney), moves, plur(moves));
1046
	if (!done_stopprint)  putstr(endwin, 0, pbuf);
887
	    putstr(endwin, 0, pbuf);
1047
#ifdef DUMP_LOG
1048
	if (dump_fp) {
1049
	  dump("", pbuf);
1050
	  Sprintf(pbuf, "Killer: %s", killer);
1051
	  dump("", pbuf);
888
	}
1052
	}
889
	if (!done_stopprint) {
1053
#endif
890
	    Sprintf(pbuf,
1054
	Sprintf(pbuf,
891
	     "You were level %d with a maximum of %d hit point%s when you %s.",
1055
	     "You were level %d with a maximum of %d hit point%s when you %s.",
892
		    u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]);
1056
		u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]);
1057
	if (!done_stopprint) {
893
	    putstr(endwin, 0, pbuf);
1058
	    putstr(endwin, 0, pbuf);
894
	    putstr(endwin, 0, "");
1059
	    putstr(endwin, 0, "");
895
	}
1060
	}
1061
#ifdef DUMP_LOG
1062
	    if (dump_fp) dump("", pbuf);
1063
#endif
896
	if (!done_stopprint)
1064
	if (!done_stopprint)
897
	    display_nhwindow(endwin, TRUE);
1065
	    display_nhwindow(endwin, TRUE);
898
	if (endwin != WIN_ERR)
1066
	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
1083
913
	if(done_stopprint) { raw_print(""); raw_print(""); }
1084
	if(done_stopprint) { raw_print(""); raw_print(""); }
914
	terminate(EXIT_SUCCESS);
1085
	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
1111
926
	for (box = list; box; box = box->nobj) {
1112
	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
1237
976
STATIC_OVL void
1238
void		/* showborn patch */
977
list_vanquished(defquery, ask)
1239
list_vanquished(defquery, ask)
978
char defquery;
1240
char defquery;
979
boolean ask;
1241
boolean ask;
1242
#ifdef DUMP_LOG
1243
{
1244
  do_vanquished(defquery, ask, FALSE);
1245
}
1246
1247
void
1248
do_vanquished(defquery, ask, want_dump)
1249
int defquery;
1250
boolean ask;
1251
boolean want_dump;
1252
#endif
980
{
1253
{
981
    register int i, lev;
1254
    register int i, lev;
982
    int ntypes = 0, max_lev = 0, nkilled;
1255
    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
1288
1007
	    /* countdown by monster "toughness" */
1289
	    /* countdown by monster "toughness" */
1008
	    for (lev = max_lev; lev >= 0; lev--)
1290
	    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
}
1049
1348
Lines 1059-1101 Link Here
1059
    return n;
1358
    return n;
1060
}
1359
}
1061
1360
1361
#ifdef DUMP_LOG
1362
STATIC_OVL void
1363
list_genocided(defquery, ask, want_dump)
1364
int defquery;
1365
boolean ask;
1366
boolean want_dump;
1367
#else
1062
STATIC_OVL void
1368
STATIC_OVL void
1063
list_genocided(defquery, ask)
1369
list_genocided(defquery, ask)
1064
char defquery;
1370
char defquery;
1065
boolean ask;
1371
boolean ask;
1372
#endif
1066
{
1373
{
1067
    register int i;
1374
    register int i;
1068
    int ngenocided;
1375
    int ngenocided=0;
1376
#ifdef SHOW_EXTINCT
1377
    int nextincted=0;
1378
#endif
1069
    char c;
1379
    char c;
1070
    winid klwin;
1380
    winid klwin;
1071
    char buf[BUFSZ];
1381
    char buf[BUFSZ];
1072
1382
1383
    /* get totals first */
1384
#ifdef SHOW_EXTINCT
1385
    for (i = LOW_PM; i < NUMMONS; i++) {
1386
	if (mvitals[i].mvflags & G_GENOD)
1387
	    ngenocided++;
1388
	else if ( (mvitals[i].mvflags & G_GONE) && !(mons[i].geno & G_UNIQ) )
1389
	    nextincted++;
1390
    }
1073
    ngenocided = num_genocides();
1391
    ngenocided = num_genocides();
1392
#endif
1074
1393
1075
    /* genocided species list */
1394
    /* genocided species list */
1076
    if (ngenocided != 0) {
1395
    if (ngenocided != 0
1396
#ifdef SHOW_EXTINCT
1397
      || nextincted != 0
1398
#endif
1399
    ) {
1400
#ifdef SHOW_EXTINCT
1401
	if (nextincted != 0)
1402
	  c = ask ?
1403
	  yn_function("Do you want a list of species genocided or extinct?",
1404
		      ynqchars, defquery) : defquery;
1405
       else
1406
#endif
1077
	c = ask ? yn_function("Do you want a list of species genocided?",
1407
	c = ask ? yn_function("Do you want a list of species genocided?",
1078
			      ynqchars, defquery) : defquery;
1408
			      ynqchars, defquery) : defquery;
1079
	if (c == 'q') done_stopprint++;
1409
	if (c == 'q') done_stopprint++;
1080
	if (c == 'y') {
1410
	if (c == 'y') {
1081
	    klwin = create_nhwindow(NHW_MENU);
1411
	    klwin = create_nhwindow(NHW_MENU);
1082
	    putstr(klwin, 0, "Genocided species:");
1412
#ifdef SHOW_EXTINCT
1413
	    Sprintf(buf, "Genocided or extinct species:");
1414
#else
1415
	    Sprintf(buf, "Genocided species:");
1416
#endif
1417
	    putstr(klwin, 0, buf);
1083
	    putstr(klwin, 0, "");
1418
	    putstr(klwin, 0, "");
1419
#ifdef DUMP_LOG
1420
	    if (want_dump)  dump("", buf);
1421
#endif
1084
1422
1085
	    for (i = LOW_PM; i < NUMMONS; i++)
1423
	    for (i = LOW_PM; i < NUMMONS; i++)
1424
#ifdef SHOW_EXTINCT
1425
	      if (mvitals[i].mvflags & G_GONE && !(mons[i].geno & G_UNIQ) ){
1426
#else
1086
		if (mvitals[i].mvflags & G_GENOD) {
1427
		if (mvitals[i].mvflags & G_GENOD) {
1428
#endif
1087
		    if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST)
1429
		    if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST)
1088
			Sprintf(buf, "%s%s",
1430
			Sprintf(buf, "%s%s",
1089
				!type_is_pname(&mons[i]) ? "" : "the ",
1431
				!type_is_pname(&mons[i]) ? "" : "the ",
1090
				mons[i].mname);
1432
				mons[i].mname);
1091
		    else
1433
		    else
1092
			Strcpy(buf, makeplural(mons[i].mname));
1434
			Strcpy(buf, makeplural(mons[i].mname));
1435
#ifdef SHOW_EXTINCT
1436
		    if( !(mvitals[i].mvflags & G_GENOD) )
1437
			Strcat(buf, " (extinct)");
1438
#endif
1093
		    putstr(klwin, 0, buf);
1439
		    putstr(klwin, 0, buf);
1440
#ifdef DUMP_LOG
1441
		    if (want_dump)  dump("  ", buf);
1442
#endif
1094
		}
1443
		}
1095
1444
1096
	    putstr(klwin, 0, "");
1445
	    putstr(klwin, 0, "");
1446
#ifdef SHOW_EXTINCT
1447
	    if (ngenocided>0)  {
1448
#endif
1097
	    Sprintf(buf, "%d species genocided.", ngenocided);
1449
	    Sprintf(buf, "%d species genocided.", ngenocided);
1098
	    putstr(klwin, 0, buf);
1450
	    putstr(klwin, 0, buf);
1451
#ifdef DUMP_LOG
1452
	    if (want_dump)  dump("  ", buf);
1453
#endif
1454
#ifdef SHOW_EXTINCT
1455
	    }
1456
	    if (nextincted>0) {
1457
		Sprintf(buf, "%d species extinct.", nextincted);
1458
		putstr(klwin, 0, buf);
1459
#ifdef DUMP_LOG
1460
		if (want_dump) dump("  ", buf);
1461
#endif
1462
	    }
1463
#endif /* SHOW_EXTINCT */
1464
#ifdef DUMP_LOG
1465
	    if (want_dump)  dump("", "");
1466
#endif
1099
1467
1100
	    display_nhwindow(klwin, TRUE);
1468
	    display_nhwindow(klwin, TRUE);
1101
	    destroy_nhwindow(klwin);
1469
	    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",SAVE_PREFIX,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;
1706
1729
1730
#ifdef DUMP_LOG
1731
	if (want_disp) {
1732
#endif
1707
	/* overriden by global flag */
1733
	/* overriden by global flag */
1708
	if (flags.perm_invent) {
1734
	if (flags.perm_invent) {
1709
	    win = (lets && *lets) ? local_win : WIN_INVEN;
1735
	    win = (lets && *lets) ? local_win : WIN_INVEN;
Lines 1713-1718 Link Here
1713
	} else
1739
	} else
1714
	    win = WIN_INVEN;
1740
	    win = WIN_INVEN;
1715
1741
1742
#ifdef DUMP_LOG
1743
	}
1744
	if (want_dump)   dump("", "Your inventory");
1745
#endif
1746
1716
	/*
1747
	/*
1717
	Exit early if no inventory -- but keep going if we are doing
1748
	Exit early if no inventory -- but keep going if we are doing
1718
	a permanent inventory update.  We need to keep going so the
1749
	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
	}
1735
1779
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
	}
1755
1811
1812
#ifdef SORTLOOT
1813
	/* count the number of items */
1814
	for (n = 0, otmp = invent; otmp; otmp = otmp->nobj)
1815
	  if(!lets || !*lets || index(lets, otmp->invlet)) n++;
1816
1817
	/* Make a temporary array to store the objects sorted */
1818
	oarray = (struct obj **)alloc(n*sizeof(struct obj*));
1819
1820
	/* Add objects to the array */
1821
	i = 0;
1822
	for(otmp = invent; otmp; otmp = otmp->nobj)
1823
	  if(!lets || !*lets || index(lets, otmp->invlet)) {
1824
	    if (iflags.sortloot == 'f') {
1825
	      /* Insert object at correct index */
1826
	      for (j = i; j; j--) {
1827
		if (strcmpi(cxname2(otmp), cxname2(oarray[j-1]))>0) break;
1828
		oarray[j] = oarray[j-1];
1829
	      }
1830
	      oarray[j] = otmp;
1831
	      i++;
1832
	    } else {
1833
	      /* Just add it to the array */
1834
	      oarray[i++] = otmp;
1835
	    }
1836
	  }
1837
#endif /* SORTLOOT */
1838
1839
#ifdef DUMP_LOG
1840
	if (want_disp)
1841
#endif
1756
	start_menu(win);
1842
	start_menu(win);
1757
nextclass:
1843
nextclass:
1758
	classcount = 0;
1844
	classcount = 0;
1759
	any.a_void = 0;		/* set all bits to zero */
1845
	any.a_void = 0;		/* set all bits to zero */
1846
#ifdef SORTLOOT
1847
	for(i = 0; i < n; i++) {
1848
	  otmp = oarray[i];
1849
	  ilet = otmp->invlet;
1850
	  if (!flags.sortpack || otmp->oclass == *invlet) {
1851
	    if (flags.sortpack && !classcount) {
1852
	      any.a_void = 0;             /* zero */
1853
#ifdef DUMP_LOG
1854
	      if (want_dump)
1855
		dump("  ", let_to_name(*invlet, FALSE));
1856
	      if (want_disp)
1857
#endif
1858
	      add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
1859
		       let_to_name(*invlet, FALSE), MENU_UNSELECTED);
1860
	      classcount++;
1861
	    }
1862
	    any.a_char = ilet;
1863
#ifdef DUMP_LOG
1864
	    if (want_dump) {
1865
	      char letbuf[7];
1866
	      sprintf(letbuf, "  %c - ", ilet);
1867
	      dump(letbuf, doname(otmp));
1868
	    }
1869
	    if (want_disp)
1870
#endif
1871
	    add_menu(win, obj_to_glyph(otmp),
1872
		     &any, ilet, 0, ATR_NONE, doname(otmp),
1873
		     MENU_UNSELECTED);
1874
	  }
1875
	}
1876
#else /* SORTLOOT */
1760
	for(otmp = invent; otmp; otmp = otmp->nobj) {
1877
	for(otmp = invent; otmp; otmp = otmp->nobj) {
1761
		ilet = otmp->invlet;
1878
		ilet = otmp->invlet;
1762
		if(!lets || !*lets || index(lets, ilet)) {
1879
		if(!lets || !*lets || index(lets, ilet)) {
1763
			if (!flags.sortpack || otmp->oclass == *invlet) {
1880
			if (!flags.sortpack || otmp->oclass == *invlet) {
1764
			    if (flags.sortpack && !classcount) {
1881
			    if (flags.sortpack && !classcount) {
1765
				any.a_void = 0;		/* zero */
1882
				any.a_void = 0;		/* zero */
1883
#ifdef DUMP_LOG
1884
				if (want_dump)
1885
				    dump("  ", let_to_name(*invlet, FALSE));
1886
				if (want_disp)
1887
#endif
1766
				add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
1888
				add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
1767
				    let_to_name(*invlet, FALSE), MENU_UNSELECTED);
1889
				    let_to_name(*invlet, FALSE), MENU_UNSELECTED);
1768
				classcount++;
1890
				classcount++;
1769
			    }
1891
			    }
1770
			    any.a_char = ilet;
1892
			    any.a_char = ilet;
1893
#ifdef DUMP_LOG
1894
			    if (want_dump) {
1895
			      char letbuf[7];
1896
			      sprintf(letbuf, "  %c - ", ilet);
1897
			      dump(letbuf, doname(otmp));
1898
			    }
1899
			    if (want_disp)
1900
#endif
1771
			    add_menu(win, obj_to_glyph(otmp),
1901
			    add_menu(win, obj_to_glyph(otmp),
1772
					&any, ilet, 0, ATR_NONE, doname(otmp),
1902
					&any, ilet, 0, ATR_NONE, doname(otmp),
1773
					MENU_UNSELECTED);
1903
					MENU_UNSELECTED);
1774
			}
1904
			}
1775
		}
1905
		}
1776
	}
1906
	}
1907
#endif /* SORTLOOT */
1777
	if (flags.sortpack) {
1908
	if (flags.sortpack) {
1778
		if (*++invlet) goto nextclass;
1909
		if (*++invlet) goto nextclass;
1779
#ifdef WIZARD
1910
#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
1924
1788
	n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected);
1925
	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
1936
1796
	return ret;
1937
	return ret;
1797
}
1938
}
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
/*
1970
/*
1815
 * Returns the number of unpaid items within the given list.  This includes
1971
 * 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
50
51
#ifdef ROGUE_COLOR
51
#ifdef ROGUE_COLOR
52
# if defined(USE_TILES) && defined(MSDOS)
52
# if defined(USE_TILES) && defined(MSDOS)
53
#define HAS_ROGUE_IBM_GRAPHICS (iflags.IBMgraphics && !iflags.grmode && \
53
#define HAS_ROGUE_IBM_GRAPHICS (iflags.chargfx == IBM_GRAPHICS && !iflags.grmode && \
54
	Is_rogue_level(&u.uz))
54
	Is_rogue_level(&u.uz))
55
# else
55
# else
56
#define HAS_ROGUE_IBM_GRAPHICS (iflags.IBMgraphics && Is_rogue_level(&u.uz))
56
#define HAS_ROGUE_IBM_GRAPHICS (iflags.chargfx == IBM_GRAPHICS && Is_rogue_level(&u.uz))
57
# endif
57
# endif
58
#endif
58
#endif
59
59
(-)nethack-3.4.3/src/mcastu.c (+8 lines)
Lines 515-520 Link Here
515
515
516
	pline("A bolt of lightning strikes down at you from above!");
516
	pline("A bolt of lightning strikes down at you from above!");
517
	reflects = ureflects("It bounces off your %s%s.", "");
517
	reflects = ureflects("It bounces off your %s%s.", "");
518
	   
519
	/* copied from zap.c
520
	 * Chris Becker (topher@csh.rit.edu)
521
	 */
522
    You("are blinded by the flash!");
523
    make_blinded((long)rnd(100),FALSE);
524
    if (!Blind) Your(vision_clears);
525
518
	if (reflects || Shock_resistance) {
526
	if (reflects || Shock_resistance) {
519
	    shieldeff(u.ux, u.uy);
527
	    shieldeff(u.ux, u.uy);
520
	    dmg = 0;
528
	    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
21
19
struct Jitem {
22
struct Jitem {
20
	int item;
23
	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
488
474
	if (obj->onamelth && obj->dknown) {
489
	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
881
857
/* treat an object as fully ID'd when it might be used as reason for death */
882
/* treat an object as fully ID'd when it might be used as reason for death */
858
char *
883
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
25
26
static struct Char_Gfx {
27
  int gfx;
28
  char *txt;
29
  char let;
30
} const chargfx[] = {
31
  {ASCII_GRAPHICS,	"ASCII", 'a'},
32
  {DEC_GRAPHICS,	"DEC",	 'd'},
33
  {IBM_GRAPHICS,	"IBM",	 'i'},
34
#ifdef MAC_GRAPHICS_ENV
35
  {MAC_GRAPHICS,	"Mac",	 'm'},
36
#endif
37
};
38
39
26
/*
40
/*
27
 *  NOTE:  If you add (or delete) an option, please update the short
41
 *  NOTE:  If you add (or delete) an option, please update the short
28
 *  options help (option_help()), the long options help (dat/opthelp),
42
 *  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;
534
584
585
#ifdef SORTLOOT
586
	iflags.sortloot = 'n';
587
#endif
588
535
     /* assert( sizeof flags.inv_order == sizeof def_inv_order ); */
589
     /* assert( sizeof flags.inv_order == sizeof def_inv_order ); */
536
	(void)memcpy((genericptr_t)flags.inv_order,
590
	(void)memcpy((genericptr_t)flags.inv_order,
537
		     (genericptr_t)def_inv_order, sizeof flags.inv_order);
591
		     (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
626
571
#ifdef MAC_GRAPHICS_ENV
627
#ifdef MAC_GRAPHICS_ENV
628
	iflags.chargfx = MAC_GRAPHICS;
572
	switch_graphics(MAC_GRAPHICS);
629
	switch_graphics(MAC_GRAPHICS);
573
#endif /* MAC_GRAPHICS_ENV */
630
#endif /* MAC_GRAPHICS_ENV */
574
	flags.menu_style = MENU_FULL;
631
	flags.menu_style = MENU_FULL;
Lines 891-896 Link Here
891
	return 1;
948
	return 1;
892
}
949
}
893
950
951
#ifdef MENU_COLOR
952
extern struct menucoloring *menu_colorings;
953
954
static const struct {
955
   const char *name;
956
   const int color;
957
} colornames[] = {
958
   {"black", CLR_BLACK},
959
   {"red", CLR_RED},
960
   {"green", CLR_GREEN},
961
   {"brown", CLR_BROWN},
962
   {"blue", CLR_BLUE},
963
   {"magenta", CLR_MAGENTA},
964
   {"cyan", CLR_CYAN},
965
   {"gray", CLR_GRAY},
966
   {"orange", CLR_ORANGE},
967
   {"lightgreen", CLR_BRIGHT_GREEN},
968
   {"yellow", CLR_YELLOW},
969
   {"lightblue", CLR_BRIGHT_BLUE},
970
   {"lightmagenta", CLR_BRIGHT_MAGENTA},
971
   {"lightcyan", CLR_BRIGHT_CYAN},
972
   {"white", CLR_WHITE}
973
};
974
975
static const struct {
976
   const char *name;
977
   const int attr;
978
} attrnames[] = {
979
     {"none", ATR_NONE},
980
     {"bold", ATR_BOLD},
981
     {"dim", ATR_DIM},
982
     {"underline", ATR_ULINE},
983
     {"blink", ATR_BLINK},
984
     {"inverse", ATR_INVERSE}
985
986
};
987
988
/* parse '"regex_string"=color&attr' and add it to menucoloring */
989
boolean
990
add_menu_coloring(str)
991
char *str;
992
{
993
    int i, c = NO_COLOR, a = ATR_NONE;
994
    struct menucoloring *tmp;
995
    char *tmps, *cs = strchr(str, '=');
996
#ifdef MENU_COLOR_REGEX_POSIX
997
    int errnum;
998
    char errbuf[80];
999
#endif
1000
    const char *err = (char *)0;
1001
1002
    if (!cs || !str) return FALSE;
1003
1004
    tmps = cs;
1005
    tmps++;
1006
    while (*tmps && isspace(*tmps)) tmps++;
1007
1008
    for (i = 0; i < SIZE(colornames); i++)
1009
	if (strstri(tmps, colornames[i].name) == tmps) {
1010
	    c = colornames[i].color;
1011
	    break;
1012
	}
1013
    if ((i == SIZE(colornames)) && (*tmps >= '0' && *tmps <='9'))
1014
	c = atoi(tmps);
1015
1016
    if (c > 15) return FALSE;
1017
1018
    tmps = strchr(str, '&');
1019
    if (tmps) {
1020
	tmps++;
1021
	while (*tmps && isspace(*tmps)) tmps++;
1022
	for (i = 0; i < SIZE(attrnames); i++)
1023
	    if (strstri(tmps, attrnames[i].name) == tmps) {
1024
		a = attrnames[i].attr;
1025
		break;
1026
	    }
1027
	if ((i == SIZE(attrnames)) && (*tmps >= '0' && *tmps <='9'))
1028
	    a = atoi(tmps);
1029
    }
1030
1031
    *cs = '\0';
1032
    tmps = str;
1033
    if ((*tmps == '"') || (*tmps == '\'')) {
1034
	cs--;
1035
	while (isspace(*cs)) cs--;
1036
	if (*cs == *tmps) {
1037
	    *cs = '\0';
1038
	    tmps++;
1039
	}
1040
    }
1041
1042
    tmp = (struct menucoloring *)alloc(sizeof(struct menucoloring));
1043
#ifdef MENU_COLOR_REGEX
1044
#ifdef MENU_COLOR_REGEX_POSIX
1045
    errnum = regcomp(&tmp->match, tmps, REG_EXTENDED | REG_NOSUB);
1046
    if (errnum != 0)
1047
    {
1048
	regerror(errnum, &tmp->match, errbuf, sizeof(errbuf));
1049
	err = errbuf;
1050
    }
1051
#else
1052
    tmp->match.translate = 0;
1053
    tmp->match.fastmap = 0;
1054
    tmp->match.buffer = 0;
1055
    tmp->match.allocated = 0;
1056
    tmp->match.regs_allocated = REGS_FIXED;
1057
    err = re_compile_pattern(tmps, strlen(tmps), &tmp->match);
1058
#endif
1059
#else
1060
    tmp->match = (char *)alloc(strlen(tmps)+1);
1061
    (void) memcpy((genericptr_t)tmp->match, (genericptr_t)tmps, strlen(tmps)+1);
1062
#endif
1063
    if (err) {
1064
	raw_printf("\nMenucolor regex error: %s\n", err);
1065
	wait_synch();
1066
	free(tmp);
1067
	return FALSE;
1068
    } else {
1069
	tmp->next = menu_colorings;
1070
	tmp->color = c;
1071
	tmp->attr = a;
1072
	menu_colorings = tmp;
1073
	return TRUE;
1074
    }
1075
}
1076
#endif /* MENU_COLOR */
1077
894
void
1078
void
895
set_duplicate_opt_detection(on_or_off)
1079
set_duplicate_opt_detection(on_or_off)
896
int on_or_off;
1080
int on_or_off;
Lines 964-969 Link Here
964
	}
1148
	}
965
}
1149
}
966
1150
1151
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
1152
1153
struct name_value {
1154
	char *name;
1155
	int value;
1156
};
1157
1158
const struct name_value status_colornames[] = {
1159
	{ "black",	CLR_BLACK },
1160
	{ "red",	CLR_RED },
1161
	{ "green",	CLR_GREEN },
1162
	{ "brown",	CLR_BROWN },
1163
	{ "blue",	CLR_BLUE },
1164
	{ "magenta",	CLR_MAGENTA },
1165
	{ "cyan",	CLR_CYAN },
1166
	{ "gray",	CLR_GRAY },
1167
	{ "orange",	CLR_ORANGE },
1168
	{ "lightgreen",	CLR_BRIGHT_GREEN },
1169
	{ "yellow",	CLR_YELLOW },
1170
	{ "lightblue",	CLR_BRIGHT_BLUE },
1171
	{ "lightmagenta", CLR_BRIGHT_MAGENTA },
1172
	{ "lightcyan",	CLR_BRIGHT_CYAN },
1173
	{ "white",	CLR_WHITE },
1174
	{ NULL,		-1 }
1175
};
1176
1177
const struct name_value status_attrnames[] = {
1178
	 { "none",	ATR_NONE },
1179
	 { "bold",	ATR_BOLD },
1180
	 { "dim",	ATR_DIM },
1181
	 { "underline",	ATR_ULINE },
1182
	 { "blink",	ATR_BLINK },
1183
	 { "inverse",	ATR_INVERSE },
1184
	 { NULL,	-1 }
1185
};
1186
1187
int
1188
value_of_name(name, name_values)
1189
const char *name;
1190
const struct name_value *name_values;
1191
{
1192
	while (name_values->name && !strstri(name_values->name, name))
1193
		++name_values;
1194
	return name_values->value;
1195
}
1196
1197
struct color_option
1198
parse_color_option(start)
1199
char *start;
1200
{
1201
	struct color_option result = {NO_COLOR, 0};
1202
	char last;
1203
	char *end;
1204
	int attr;
1205
1206
	for (end = start; *end != '&' && *end != '\0'; ++end);
1207
	last = *end;
1208
	*end = '\0';
1209
	result.color = value_of_name(start, status_colornames);
1210
1211
	while (last == '&') {
1212
		for (start = ++end; *end != '&' && *end != '\0'; ++end);
1213
		last = *end;
1214
		*end = '\0';
1215
		attr = value_of_name(start, status_attrnames);
1216
		if (attr >= 0)
1217
			result.attr_bits |= 1 << attr;
1218
	}
1219
1220
	return result;
1221
}
1222
1223
const struct percent_color_option *hp_colors = NULL;
1224
const struct percent_color_option *pw_colors = NULL;
1225
const struct text_color_option *text_colors = NULL;
1226
1227
struct percent_color_option *
1228
add_percent_option(new_option, list_head)
1229
struct percent_color_option *new_option;
1230
struct percent_color_option *list_head;
1231
{
1232
	if (list_head == NULL)
1233
		return new_option;
1234
	if (new_option->percentage <= list_head->percentage) {
1235
		new_option->next = list_head;
1236
		return new_option;
1237
	}
1238
	list_head->next = add_percent_option(new_option, list_head->next);
1239
	return list_head;
1240
}
1241
1242
boolean
1243
parse_status_color_option(start)
1244
char *start;
1245
{
1246
	char *middle;
1247
1248
	while (*start && isspace(*start)) start++;
1249
	for (middle = start; *middle != ':' && *middle != '=' && *middle != '\0'; ++middle);
1250
	*middle++ = '\0';
1251
	if (middle - start > 2 && start[2] == '%') {
1252
		struct percent_color_option *percent_color_option =
1253
			(struct percent_color_option *)alloc(sizeof(*percent_color_option));
1254
		percent_color_option->next = NULL;
1255
		percent_color_option->percentage = atoi(start + 3);
1256
		percent_color_option->color_option = parse_color_option(middle);
1257
		start[2] = '\0';
1258
		if (percent_color_option->color_option.color >= 0
1259
		 && percent_color_option->color_option.attr_bits >= 0) {
1260
			if (!strcmpi(start, "hp")) {
1261
				hp_colors = add_percent_option(percent_color_option, hp_colors);
1262
				return TRUE;
1263
			}
1264
			if (!strcmpi(start, "pw")) {
1265
				pw_colors = add_percent_option(percent_color_option, pw_colors);
1266
				return TRUE;
1267
			}
1268
		}
1269
		free(percent_color_option);
1270
		return FALSE;
1271
	} else {
1272
		int length = strlen(start) + 1;
1273
		struct text_color_option *text_color_option =
1274
			(struct text_color_option *)alloc(sizeof(*text_color_option));
1275
		text_color_option->next = NULL;
1276
		text_color_option->text = (char *)alloc(length);
1277
		memcpy((char *)text_color_option->text, start, length);
1278
		text_color_option->color_option = parse_color_option(middle);
1279
		if (text_color_option->color_option.color >= 0
1280
		 && text_color_option->color_option.attr_bits >= 0) {
1281
			text_color_option->next = text_colors;
1282
			text_colors = text_color_option;
1283
			return TRUE;
1284
		}
1285
		free(text_color_option->text);
1286
		free(text_color_option);
1287
		return FALSE;
1288
	}
1289
}
1290
1291
boolean
1292
parse_status_color_options(start)
1293
char *start;
1294
{
1295
	char last = ',';
1296
	char *end = start - 1;
1297
	boolean ok = TRUE;
1298
	while (last == ',') {
1299
		for (start = ++end; *end != ',' && *end != '\0'; ++end);
1300
		last = *end;
1301
		*end = '\0';
1302
		ok = parse_status_color_option(start) && ok;
1303
	}
1304
	return ok;
1305
}
1306
1307
1308
#endif /* STATUS_COLORS */
1309
967
void
1310
void
968
parseoptions(opts, tinitial, tfrom_file)
1311
parseoptions(opts, tinitial, tfrom_file)
969
register char *opts;
1312
register char *opts;
Lines 1077-1082 Link Here
1077
		return;
1420
		return;
1078
	}
1421
	}
1079
1422
1423
#ifdef DUMP_LOG
1424
	fullname = "dumpfile";
1425
	if (match_optname(opts, fullname, 3, TRUE)) {
1426
#ifndef DUMP_FN
1427
		if (negated) bad_negation(fullname, FALSE);
1428
		else if ((op = string_for_opt(opts, !tfrom_file)) != 0
1429
			&& strlen(op) > 1)
1430
			nmcpy(dump_fn, op, PL_PSIZ);
1431
#endif
1432
		return;
1433
       }
1434
#endif
1435
1080
	fullname = "horsename";
1436
	fullname = "horsename";
1081
	if (match_optname(opts, fullname, 5, TRUE)) {
1437
	if (match_optname(opts, fullname, 5, TRUE)) {
1082
		if (negated) bad_negation(fullname, FALSE);
1438
		if (negated) bad_negation(fullname, FALSE);
Lines 1114-1119 Link Here
1114
		return;
1470
		return;
1115
	}
1471
	}
1116
1472
1473
	fullname = "chargfx";
1474
	if (match_optname(opts, fullname, 5, TRUE)) {
1475
		if (negated) {
1476
			iflags.chargfx = ASCII_GRAPHICS;
1477
		} else if ((op = string_for_opt(opts, FALSE)) != 0) {
1478
		  int i;
1479
		  for (i = 0; i < SIZE(chargfx); i++)
1480
		    if (!strncmpi(op, chargfx[i].txt, strlen(op))) {
1481
		      iflags.chargfx = chargfx[i].gfx;
1482
		      need_redraw = TRUE;
1483
# ifdef REINCARNATION
1484
		      if (!initial && Is_rogue_level(&u.uz))
1485
			assign_rogue_graphics(FALSE);
1486
# endif
1487
		      switch_graphics(iflags.chargfx);
1488
# ifdef REINCARNATION
1489
		      if (!initial && Is_rogue_level(&u.uz))
1490
			assign_rogue_graphics(TRUE);
1491
# endif
1492
		      return;
1493
		    }
1494
		  badoption(opts);
1495
		}
1496
		return;
1497
	}
1498
1117
	fullname = "runmode";
1499
	fullname = "runmode";
1118
	if (match_optname(opts, fullname, 4, TRUE)) {
1500
	if (match_optname(opts, fullname, 4, TRUE)) {
1119
		if (negated) {
1501
		if (negated) {
Lines 1133-1138 Link Here
1133
		return;
1515
		return;
1134
	}
1516
	}
1135
1517
1518
	/* menucolor:"regex_string"=color */
1519
	fullname = "menucolor";
1520
	if (match_optname(opts, fullname, 9, TRUE)) {
1521
#ifdef MENU_COLOR
1522
	    if (negated) bad_negation(fullname, FALSE);
1523
	    else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
1524
		if (!add_menu_coloring(op))
1525
		    badoption(opts);
1526
#endif
1527
	    return;
1528
	}
1529
1530
	fullname = "statuscolor";
1531
	if (match_optname(opts, fullname, 11, TRUE)) {
1532
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
1533
		if (negated) bad_negation(fullname, FALSE);
1534
		else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
1535
			if (!parse_status_color_options(op))
1536
				badoption(opts);
1537
#endif
1538
	    return;
1539
	}
1540
	
1136
	fullname = "msghistory";
1541
	fullname = "msghistory";
1137
	if (match_optname(opts, fullname, 3, TRUE)) {
1542
	if (match_optname(opts, fullname, 3, TRUE)) {
1138
		op = string_for_env_opt(fullname, opts, negated);
1543
		op = string_for_env_opt(fullname, opts, negated);
Lines 1839-1844 Link Here
1839
	    return;
2244
	    return;
1840
	}
2245
	}
1841
2246
2247
#ifdef SORTLOOT
2248
	fullname = "sortloot";
2249
	if (match_optname(opts, fullname, 4, TRUE)) {
2250
		op = string_for_env_opt(fullname, opts, FALSE);
2251
		if (op) {
2252
			switch (tolower(*op)) {
2253
                        case 'n':
2254
                        case 'l':
2255
                        case 'f': iflags.sortloot = tolower(*op);
2256
				break;
2257
                        default:  badoption(opts);
2258
				return;
2259
			}
2260
		}
2261
		return;
2262
	}
2263
#endif /* SORTLOOT */
2264
1842
	fullname = "suppress_alert";
2265
	fullname = "suppress_alert";
1843
	if (match_optname(opts, fullname, 4, TRUE)) {
2266
	if (match_optname(opts, fullname, 4, TRUE)) {
1844
		op = string_for_opt(opts, negated);
2267
		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
};
2265
2689
2690
#ifdef SORTLOOT
2691
static NEARDATA const char *sortltype[] = {
2692
	"none", "loot", "full"
2693
};
2694
#endif
2695
2266
/*
2696
/*
2267
 * Convert the given string of object classes to a string of default object
2697
 * Convert the given string of object classes to a string of default object
2268
 * symbols.
2698
 * symbols.
Lines 2540-2546 Link Here
2540
    boolean retval = FALSE;
2970
    boolean retval = FALSE;
2541
    
2971
    
2542
    /* Special handling of menustyle, pickup_burden, pickup_types,
2972
    /* Special handling of menustyle, pickup_burden, pickup_types,
2543
     * disclose, runmode, msg_window, menu_headings, and number_pad options.
2973
     * disclose, runmode, msg_window, menu_headings, number_pad and sortloot
2544
#ifdef AUTOPICKUP_EXCEPTIONS
2974
#ifdef AUTOPICKUP_EXCEPTIONS
2545
     * Also takes care of interactive autopickup_exception_handling changes.
2975
     * Also takes care of interactive autopickup_exception_handling changes.
2546
#endif
2976
#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
}
2880
3358
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 */
3264
3764
3765
#ifdef DYNKEY
3766
void
3767
add_dkb(bufp, swap)
3768
char *bufp;
3769
boolean swap;
3770
{
3771
        char *p;
3772
        char b, c;
3773
3774
        if(!(p=index(bufp,' '))) {
3775
                raw_printf("DYNKEY MAP: bad mapping: %s.", bufp);
3776
                return;
3777
        }
3778
        *p++='\0';
3779
3780
        b=keydesc2char(bufp);
3781
        c=keydesc2char(p);
3782
        if(b && c) {
3783
                if(!map_dkb(b, c) || (swap && !map_dkb(c, b)))
3784
                        raw_printf("DYNKEY MAP: map_dkb error");
3785
        } else
3786
                raw_printf("DYNKEY MAP: invalid key: %s.", b==0?bufp:p);
3787
}
3788
#endif /* DYNKEY */
3789
3265
/* data for option_help() */
3790
/* data for option_help() */
3266
static const char *opt_intro[] = {
3791
static const char *opt_intro[] = {
3267
	"",
3792
	"",
(-)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
	}
719
725
726
#ifdef SORTLOOT
727
	/* Make a temporary array to store the objects sorted */
728
	oarray = (struct obj **)alloc(n*sizeof(struct obj*));
729
730
	/* Add objects to the array */
731
	i = 0;
732
	for (curr = olist; curr; curr = FOLLOW(curr, qflags)) {
733
	  if ((*allow)(curr)) {
734
	    if (iflags.sortloot == 'f' ||
735
		(iflags.sortloot == 'l' && !(qflags & USE_INVLET)))
736
	      {
737
		/* Insert object at correct index */
738
		for (j = i; j; j--)
739
		  {
740
		    if (strcmpi(cxname2(curr), cxname2(oarray[j-1]))>0) break;
741
		    oarray[j] = oarray[j-1];
742
		  }
743
		oarray[j] = curr;
744
		i++;
745
	      } else {
746
		/* Just add it to the array */
747
		oarray[i++] = curr;
748
	      }
749
	  }
750
	}
751
#endif /* SORTLOOT */
752
720
	win = create_nhwindow(NHW_MENU);
753
	win = create_nhwindow(NHW_MENU);
721
	start_menu(win);
754
	start_menu(win);
722
	any.a_obj = (struct obj *) 0;
755
	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);
760
798
799
#ifdef SORTLOOT
800
	free(oarray);
801
#endif
761
	end_menu(win, qstr);
802
	end_menu(win, qstr);
762
	n = select_menu(win, how, pick_list);
803
	n = select_menu(win, how, pick_list);
763
	destroy_nhwindow(win);
804
	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
50
51
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
52
extern const struct percent_color_option *hp_colors;
53
extern const struct percent_color_option *pw_colors;
54
extern const struct text_color_option *text_colors;
55
#endif
56
57
#ifdef MENU_COLOR
58
extern struct menucoloring *menu_colorings;
59
#endif
60
51
/* need to preserve these during save to avoid accessing freed memory */
61
/* need to preserve these during save to avoid accessing freed memory */
52
static unsigned ustuck_id = 0, usteed_id = 0;
62
static unsigned ustuck_id = 0, usteed_id = 0;
53
63
Lines 953-964 Link Here
953
	return;
963
	return;
954
}
964
}
955
965
966
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
967
968
void
969
free_percent_color_options(list_head)
970
const struct percent_color_option *list_head;
971
{
972
	if (list_head == NULL) return;
973
	free_percent_color_options(list_head->next);
974
	free(list_head);
975
}
976
977
void
978
free_text_color_options(list_head)
979
const struct text_color_option *list_head;
980
{
981
	if (list_head == NULL) return;
982
	free_text_color_options(list_head->next);
983
	free(list_head->text);
984
	free(list_head);
985
}
986
987
void
988
free_status_colors()
989
{
990
	free_percent_color_options(hp_colors); hp_colors = NULL;
991
	free_percent_color_options(pw_colors); pw_colors = NULL;
992
	free_text_color_options(text_colors); text_colors = NULL;
993
}
994
#endif
995
996
#ifdef MENU_COLOR
997
void
998
free_menu_coloring()
999
{
1000
    struct menucoloring *tmp = menu_colorings;
1001
1002
    while (tmp) {
1003
	struct menucoloring *tmp2 = tmp->next;
1004
# ifdef MENU_COLOR_REGEX
1005
	(void) regfree(&tmp->match);
1006
# else
1007
	free(tmp->match);
1008
# endif
1009
	free(tmp);
1010
	tmp = tmp2;
1011
    }
1012
}
1013
#endif /* MENU_COLOR */
1014
956
void
1015
void
957
freedynamicdata()
1016
freedynamicdata()
958
{
1017
{
959
	unload_qtlist();
1018
	unload_qtlist();
960
	free_invbuf();	/* let_to_name (invent.c) */
1019
	free_invbuf();	/* let_to_name (invent.c) */
961
	free_youbuf();	/* You_buf,&c (pline.c) */
1020
	free_youbuf();	/* You_buf,&c (pline.c) */
1021
#ifdef MENU_COLOR
1022
	free_menu_coloring();
1023
#endif
1024
#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
1025
	free_status_colors();
1026
#endif
962
	tmp_at(DISP_FREEMEM, 0);	/* temporary display effects */
1027
	tmp_at(DISP_FREEMEM, 0);	/* temporary display effects */
963
#ifdef FREE_ALL_MEMORY
1028
#ifdef FREE_ALL_MEMORY
964
# define freeobjchn(X)	(saveobjchn(0, X, FREE_SAVE),  X = 0)
1029
# 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
65
66
	    obj = level.objects[u.ux][u.uy];
66
	    obj = level.objects[u.ux][u.uy];
67
	    You("sit on %s.", the(xname(obj)));
67
	    
68
	    if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH))
68
	    /* Corpse effects when sitting - Chris Becker (topher@csh.rit.edu)
69
		pline("It's not very comfortable...");
69
	     */
70
	    if (obj->otyp == CORPSE ) {
71
	    	/* so we get the monster's name */
72
	    	You("sit on %s.", singular(obj, doname));
73
	    	if (touch_petrifies(&mons[obj->corpsenm]) && !uarm 
74
	    		&& !Stone_resistance ) {
75
		    	char kbuf[BUFSZ];
76
		    		pline("Sitting on %s corpse without armor is a fatal mistake...",
77
				an(mons[obj->corpsenm].mname));
78
				Sprintf(kbuf, "sitting on %s corpse without armor",
79
					an(mons[obj->corpsenm].mname));
80
				instapetrify(kbuf);	
81
	    	} else if (acidic(&mons[obj->corpsenm])) {
82
	    		if (!Acid_resistance) {
83
		    		pline( "Ouch! That burns!" );
84
		    		losehp(d(1,6), "sitting on an acidic corpse", KILLED_BY);
85
	    		}
86
	    		if (uarm && !rn2(3)) /* corrode armor */
87
		    			(void)rust_dmg(uarm, xname(uarm), 3, TRUE, &youmonst);
88
	    		if (obj->corpsenm == PM_GREEN_SLIME) {
89
	    		if (!uarm && !rn2(4)) { /* you touched it */
90
	    			if (flaming(youmonst.data) || Unchanging ||
91
							youmonst.data == &mons[PM_GREEN_SLIME]) {
92
					    pline_The("Yuck!");
93
					} else if (!Slimed) {
94
					    You("don't feel very well.");
95
					    Slimed = 10L;
96
					    flags.botl = 1;
97
					    killer_format = KILLED_BY_AN;
98
					    delayed_killer = (&mons[obj->corpsenm])->mname;
99
					}
100
	    		}
101
	    	} else {
102
	    			pline("It's not very comfortable...");
103
	    		}
104
	    	}
105
	    } else {
106
	    	You("sit on %s.", the(xname(obj)));
107
		    if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH))
108
			pline("It's not very comfortable...");
109
	    }
70
110
71
	} else if ((trap = t_at(u.ux, u.uy)) != 0 ||
111
	} else if ((trap = t_at(u.ux, u.uy)) != 0 ||
72
		   (u.utrap && (u.utraptype >= TT_LAVA))) {
112
		   (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
1116
1117
#ifdef DUMP_LOG
1118
void 
1119
dump_spells()
1120
{
1121
	int i;
1122
	char buf[BUFSZ];
1123
1124
	if (spellid(0) == NO_SPELL) {
1125
	    dump("", "You didn't know any spells.");
1126
	    dump("", "");
1127
	    return;
1128
	}
1129
	dump("", "Spells known in the end");
1130
1131
	Sprintf(buf, "%-20s   Level    %-12s Fail", "    Name", "Category");
1132
	dump("  ",buf);
1133
	for (i = 0; i < MAXSPELL && spellid(i) != NO_SPELL; i++) {
1134
		Sprintf(buf, "%c - %-20s  %2d%s   %-12s %3d%%",
1135
			spellet(i), spellname(i), spellev(i),
1136
			spellknow(i) ? " " : "*",
1137
			spelltypemnemonic(spell_skilltype(spellid(i))),
1138
			100 - percent_success(i));
1139
		dump("  ", buf);
1140
	}
1141
	dump("","");
1142
1143
} /* dump_spells */
1144
#endif
1145
1117
/* Integer square root function without using floating point. */
1146
/* Integer square root function without using floating point. */
1118
STATIC_OVL int
1147
STATIC_OVL int
1119
isqrt(val)
1148
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
385
380
	HUP topten_print("");
386
	HUP topten_print("");
387
#ifdef DUMP_LOG
388
	dump("", "");
389
#endif
381
390
382
	/* assure minimum number of points */
391
	/* assure minimum number of points */
383
	if(t0->points < POINTSMIN) t0->points = 0;
392
	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
581
552
/* so>0: standout line; so=0: ordinary line */
582
/* 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
735
696
STATIC_OVL int
736
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
105
103
	/* if you're close enough to attack, alert any waiting monster */
106
	/* if you're close enough to attack, alert any waiting monster */
104
	mtmp->mstrategy &= ~STRAT_WAITMASK;
107
	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
	}
209
227
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
16
17
/* #define BETA_INFO "" */	/* "[ beta n]" */
17
/* #define BETA_INFO "" */	/* "[ beta n]" */
18
18
19
/* Don't store SCORE_ON_BOTL option in save file or bones */
20
#define HIDDEN_FEATURES (1L << 21)
21
19
/* fill buffer with short version (so caller can avoid including date.h) */
22
/* fill buffer with short version (so caller can avoid including date.h) */
20
char *
23
char *
21
version_string(buf)
24
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
111
101
/* this used to be based on file date and somewhat OS-dependant,
112
/* 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
	};
136
151
(-)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
11
12
#ifdef DUMP_LOG
13
STATIC_DCL int FDECL(enhance_skill, (boolean));
14
#endif
15
12
/* Categories whose names don't come from OBJ_NAME(objects[type])
16
/* Categories whose names don't come from OBJ_NAME(objects[type])
13
 */
17
 */
14
#define PN_BARE_HANDED			(-1)	/* includes martial arts */
18
#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
888
864
#ifdef WIZARD
889
#ifdef WIZARD
890
#ifdef DUMP_LOG
891
	if (!want_dump)
892
#endif
865
	if (wizard && yn("Advance skills without practice?") == 'y')
893
	if (wizard && yn("Advance skills without practice?") == 'y')
866
	    speedy = TRUE;
894
	    speedy = TRUE;
867
#endif
895
#endif
Lines 878-883 Link Here
878
		else if (peaked_skill(i)) maxxed_cnt++;
906
		else if (peaked_skill(i)) maxxed_cnt++;
879
	    }
907
	    }
880
908
909
#ifdef DUMP_LOG
910
	    if (want_dump)
911
		dump("","Your skills at the end");
912
	    else {
913
#endif
881
	    win = create_nhwindow(NHW_MENU);
914
	    win = create_nhwindow(NHW_MENU);
882
	    start_menu(win);
915
	    start_menu(win);
883
916
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
944
909
	    /* List the skills, making ones that could be advanced
945
	    /* List the skills, making ones that could be advanced
910
	       selectable.  List the miscellaneous skills first.
946
	       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
975
922
		if (P_RESTRICTED(i)) continue;
976
		if (P_RESTRICTED(i)) continue;
923
		/*
977
		/*
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
1023
967
	    Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" :
1024
	    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
101
102
# yacc/lex programs to use to generate *_comp.h, *_lex.c, and *_yacc.c.
102
# yacc/lex programs to use to generate *_comp.h, *_lex.c, and *_yacc.c.
103
# if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
103
# if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
104
YACC     = yacc
104
#YACC     = yacc
105
LEX      = lex
105
#LEX      = lex
106
# YACC     = bison -y
106
 YACC     = bison -y
107
# YACC     = byacc
107
# YACC     = byacc
108
# LEX      = flex
108
 LEX      = flex
109
 
109
 
110
# these are the names of the output files from YACC/LEX. Under MS-DOS
110
# these are the names of the output files from YACC/LEX. Under MS-DOS
111
# and similar systems, they may differ
111
# 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
				)
422
425
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
	};
780
857
(-)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
473
474
#ifdef TERMLIB
474
#ifdef TERMLIB
475
	if (iflags.DECgraphics) tty_decgraphics_termcap_fixup();
475
	if (iflags.chargfx == DEC_GRAPHICS) tty_decgraphics_termcap_fixup();
476
	/* set up callback in case option is not set yet but toggled later */
476
	/* set up callback in case option is not set yet but toggled later */
477
	decgraphics_mode_callback = tty_decgraphics_termcap_fixup;
477
	decgraphics_mode_callback = tty_decgraphics_termcap_fixup;
478
#endif
478
#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
127
128
#ifdef MENU_COLOR
129
extern struct menucoloring *menu_colorings;
130
#endif
131
128
#ifdef CLIPPING
132
#ifdef CLIPPING
129
# if defined(USE_TILES) && defined(MSDOS)
133
# if defined(USE_TILES) && defined(MSDOS)
130
boolean clipping = FALSE;	/* clipping on? */
134
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
}
1130
1134
1135
#ifdef MENU_COLOR
1136
STATIC_OVL boolean
1137
get_menu_coloring(str, color, attr)
1138
char *str;
1139
int *color, *attr;
1140
{
1141
    struct menucoloring *tmpmc;
1142
    if (iflags.use_menu_color)
1143
	for (tmpmc = menu_colorings; tmpmc; tmpmc = tmpmc->next)
1144
# ifdef MENU_COLOR_REGEX
1145
#  ifdef MENU_COLOR_REGEX_POSIX
1146
	    if (regexec(&tmpmc->match, str, 0, NULL, 0) == 0) {
1147
#  else
1148
	    if (re_search(&tmpmc->match, str, strlen(str), 0, 9999, 0) >= 0) {
1149
#  endif
1150
# else
1151
	    if (pmatch(tmpmc->match, str)) {
1152
# endif
1153
		*color = tmpmc->color;
1154
		*attr = tmpmc->attr;
1155
		return TRUE;
1156
	    }
1157
    return FALSE;
1158
}
1159
#endif /* MENU_COLOR */
1160
1131
STATIC_OVL void
1161
STATIC_OVL void
1132
process_menu_window(window, cw)
1162
process_menu_window(window, cw)
1133
winid window;
1163
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;
1209
1243
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
1770
1724
1771
1725
STATIC_OVL const char*
1772
const char*
1726
compress_str(str)
1773
compress_str(str)
1727
const char *str;
1774
const char *str;
1728
{
1775
{
Lines 2328-2334 Link Here
2328
    register char ch = (char)in_ch;
2375
    register char ch = (char)in_ch;
2329
2376
2330
# if defined(ASCIIGRAPH) && !defined(NO_TERMS)
2377
# if defined(ASCIIGRAPH) && !defined(NO_TERMS)
2331
    if (iflags.IBMgraphics || iflags.eight_bit_tty) {
2378
    if (iflags.chargfx == IBM_GRAPHICS || iflags.eight_bit_tty) {
2332
	/* IBM-compatible displays don't need other stuff */
2379
	/* IBM-compatible displays don't need other stuff */
2333
	(void) putchar(ch);
2380
	(void) putchar(ch);
2334
    } else if (ch & 0x80) {
2381
    } 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