From dfe967732d181df07a26814848ed4bb285d6781f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 24 Mar 2015 21:14:49 +0200 Subject: [PATCH 01/73] Add more hallu sounds monsters make when hit --- src/sounds.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sounds.c b/src/sounds.c index 6204847e8..d8d78b4cc 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -304,7 +304,11 @@ dosounds() static const char * const h_sounds[] = { "beep", "boing", "sing", "belche", "creak", "cough", "rattle", - "ululate", "pop", "jingle", "sniffle", "tinkle", "eep" + "ululate", "pop", "jingle", "sniffle", "tinkle", "eep", + "clatter", "hum", "sizzle", "twitter", "wheeze", "rustle", + "honk", "lisp", "yodel", "coo", "burp", "moo", "boom", + "murmur", "oink", "quack", "rumble", "twang", "bellow", + "toot", "gargle", "hoot", "warble" }; const char * From d787f45dcbec5b1ab3bd8bec062107c22511b625 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 24 Mar 2015 22:01:29 +0200 Subject: [PATCH 02/73] Add an option to give feedback when bumping walls Boolean option "mention_walls", defaults to off. Useful for blind players. --- doc/Guidebook.mn | 2 ++ doc/fixes35.0 | 2 +- include/flag.h | 1 + src/hack.c | 9 +++++++-- src/options.c | 1 + 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 0b2e5cf3b..04cb9ea5f 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2053,6 +2053,8 @@ Enable mail delivery during the game (default on). .lp "male " An obsolete synonym for ``gender:male''. Cannot be set with the `O' command. +.lp mention_walls +Give feedback when walking against a wall (default off). .lp menustyle Controls the interface used when you need to choose various objects (in response to the Drop command, for instance). The value specified should diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5d9f4707a..d1cd02932 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -879,7 +879,7 @@ abuse wisdom in keeping with Rider eating message message inconsistency: death message "swallowed whole" was preceded by "You bite into" improve the messaging when a monster you can't see is causing an obstruction - +add option mention_walls, which gives feedback when bumping against a wall Platform- and/or Interface-Specific Fixes ----------------------------------------- diff --git a/include/flag.h b/include/flag.h index aaff7431c..add59340e 100644 --- a/include/flag.h +++ b/include/flag.h @@ -189,6 +189,7 @@ struct instance_flags { boolean deferred_X; /* deferred entry into explore mode */ boolean num_pad; /* use numbers for movement commands */ boolean news; /* print news */ + boolean mention_walls; /* give feedback when bumping walls */ boolean menu_tab_sep; /* Use tabs to separate option menu fields */ boolean menu_requested; /* Flag for overloaded use of 'm' prefix * on some non-move commands */ diff --git a/src/hack.c b/src/hack.c index 1edfb9f4e..7f15af6ee 100644 --- a/src/hack.c +++ b/src/hack.c @@ -630,8 +630,11 @@ int mode; if (Passes_walls && may_passwall(x,y)) { ; /* do nothing */ } else if (tmpr->typ == IRONBARS) { - if (!(Passes_walls || passes_bars(youmonst.data))) + if (!(Passes_walls || passes_bars(youmonst.data))) { + if (iflags.mention_walls) + You("cannot pass through the bars."); return FALSE; + } } else if (tunnels(youmonst.data) && !needspick(youmonst.data)) { /* Eat the rock. */ if (mode == DO_MOVE && still_chewing(x,y)) return FALSE; @@ -646,8 +649,10 @@ int mode; if (Is_stronghold(&u.uz) && is_db_wall(x,y)) pline_The("drawbridge is up!"); /* sokoban restriction stays even after puzzle is solved */ - if (Passes_walls && !may_passwall(x,y) && In_sokoban(&u.uz)) + else if (Passes_walls && !may_passwall(x,y) && In_sokoban(&u.uz)) pline_The("Sokoban walls resist your ability."); + else if (iflags.mention_walls) + pline("It's a wall."); } return FALSE; } diff --git a/src/options.c b/src/options.c index 147e0a701..d1f5b26de 100644 --- a/src/options.c +++ b/src/options.c @@ -139,6 +139,7 @@ static struct Bool_Opt #else {"mail", (boolean *)0, TRUE, SET_IN_FILE}, #endif + {"mention_walls", &iflags.mention_walls, FALSE, SET_IN_GAME}, /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, {"mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME}, /*WC*/ From 2ae33fa514490047598db89e9a02be9afe236e25 Mon Sep 17 00:00:00 2001 From: keni Date: Tue, 24 Mar 2015 18:29:02 -0400 Subject: [PATCH 03/73] NHsubst bugfixes and hack for whitespace errors. --- DEVEL/hooksdir/NHsubst | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/DEVEL/hooksdir/NHsubst b/DEVEL/hooksdir/NHsubst index 2c0c3c774..1039c21e6 100755 --- a/DEVEL/hooksdir/NHsubst +++ b/DEVEL/hooksdir/NHsubst @@ -13,7 +13,8 @@ my $rawin = 0; # feed diff to stdin for testing (do NOT set $debug=1) # this first block because it's expensive and dumpfile() hangs with $rawin. my $sink = ($^O eq "MSWin32") ? "NUL" : "/dev/null"; my $dbgfile = ($^O eq "MSWin32") ? "$ENV{TEMP}.$$" : "/tmp/trace.$$"; -open TRACE, ">>", ($debug==0)? $sink : $dbgfile; +open TRACE, ">>", $rawin?"/dev/tty":(($debug==0)? $sink : $dbgfile); +print TRACE "TEST TRACE\n"; if($debug){ print TRACE "START CLIENT ARGV:\n"; print TRACE "[0] $0\n"; @@ -233,7 +234,7 @@ sub merge_one_line_maybe { $theirval = $1; } } - +print TRACE "MID: $ourstype/$oursval $theirtype/$theirval\n"; # are we done? if(pos($ours)==length $ours && pos($theirs) == length $theirs){ $more = 0; @@ -245,6 +246,12 @@ sub merge_one_line_maybe { # now see if ours and their match or can be resolved # text if($ourstype == 3 && $theirtype == 3){ +#mismatch is \s vs \s\s - where is this coming from? + # HACK - hopefully temporary + if($oursval =~ m/^\s+$/ && $theirval =~ m/^\s+$/){ + $out .= $oursval; + next; + } if($oursval eq $theirval){ $out .= $oursval; next; @@ -273,6 +280,7 @@ sub merge_one_line_maybe { # return undef if we can't merge the values; $NAME: VALUE $ or $NAME$ (as appropriate) if we can. sub merge_one_var_maybe { my($varname, $oursval, $theirval) = @_; +print TRACE "MVM: -$varname-$oursval-$theirval-\n"; my $resolvedas; { no strict; @@ -309,12 +317,28 @@ sub Date { sub Branch { my($PREFIX, $varname, $mine, $theirs) = @_; - return "\$$PREFIX-$varname: $mine \$"; + $mine =~ s/^\s+//; $mine =~ s/\s+$//; + $theirs =~ s/^\s+//; $theirs =~ s/\s+$//; + return "\$$PREFIX-$varname: $mine \$" if(length $mine); + return "\$$PREFIX-$varname: $theirs \$" if(length $theirs); + return "\$$PREFIX-$varname\$" if(length $theirs); } sub Revision { my($PREFIX, $varname, $mine, $theirs) = @_; - return "\$$PREFIX-$varname: $mine \$"; + my($m) = ($mine =~ m/1.(\d+)/); + my($t) = ($theirs =~ m/1.(\d+)/); + if($m > 0 && $t > 0){ + my $q = ($m > $t) ? $m : $t; + return "\$$PREFIX-$varname: 1.$q \$"; + } + if($m > 0){ + return "\$$PREFIX-$varname: 1.$m \$"; + } + if($t > 0){ + return "\$$PREFIX-$varname: 1.$t \$"; + } + return "\$$PREFIX-$varname\$"; } __END__ @@ -364,3 +388,10 @@ $TEST-Branch: mine $ === $TEST-Branch: theirs $ >>> d3 + +TEST 8: +<<< d1 +/* NetHack 3.5 objnam.c $TEST-Date$ $TEST-Branch$:$TEST-Revision$ */ +=== +/* NetHack 3.5 objnam.c $TEST-Date: 1426977394 2015/03/21 22:36:34 $ $TEST-Branch: master $:$TEST-Revision: 1.108 $ */ +>>> d3 From a1cc33d6aed8cec411339736375fc231c2da9699 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 24 Mar 2015 19:20:14 -0400 Subject: [PATCH 04/73] fix invalid pointer dereference in morguemon On 3/23/2015 6:41 PM, a bug reporter wrote: > If the game generates a graveyard, the graveyard places a normal > demon, but all normal demons are extinct at the time, then morguemon (at > mkroom.c line 423) indexes mons with NON_PM (the return value of > ndemon() if it can't find a reference), which is an invalid pointer > dereference. According to the testbench, this mostly seems to happen on > dlvl 12. This fixes the code violation, but the logic will now drop down to the ghost/wraith/zombie code when that happens. Is that desireable, or should something else happen (for variety)? --- doc/fixes35.0 | 2 ++ src/mkroom.c | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index d1cd02932..34a6ac9b4 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -880,6 +880,8 @@ message inconsistency: death message "swallowed whole" was preceded by "You bite into" improve the messaging when a monster you can't see is causing an obstruction add option mention_walls, which gives feedback when bumping against a wall +fix invalid pointer dereference in morguemon if ndemon returns NON_PM + Platform- and/or Interface-Specific Fixes ----------------------------------------- diff --git a/src/mkroom.c b/src/mkroom.c index 7f94076e7..2581ce996 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mkroom.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkroom.c $NHDT-Date: 1427239202 2015/03/24 23:20:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.16 $ */ /* NetHack 3.5 mkroom.c $Date: 2012/01/10 17:47:19 $ $Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -408,9 +408,17 @@ morguemon() { register int i = rn2(100), hd = rn2(level_difficulty()); - if(hd > 10 && i < 10) - return((Inhell || In_endgame(&u.uz)) ? mkclass(S_DEMON,0) : - &mons[ndemon(A_NONE)]); + if(hd > 10 && i < 10) { + if (Inhell || In_endgame(&u.uz)) { + return(mkclass(S_DEMON,0)); + } else { + int ndemon_res = ndemon(A_NONE); + if (ndemon_res != NON_PM) + return(&mons[ndemon_res]); + /* else do what? As is, it will drop to ghost/wraith/zombie */ + } + } + if(hd > 8 && i > 85) return(mkclass(S_VAMPIRE,0)); From a355911c2c98c5dba8428046b4033c820b46998c Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 24 Mar 2015 22:07:16 -0400 Subject: [PATCH 05/73] no hiding under nothing On 3/23/2015 6:41 PM, a bug reporter wrote: > When you're hiding under an item (e.g. via garter snake polyform), and > that item gets polyshuddered into nonexistence, you continue hiding > (under nothing). This addresses the "hiding under nothing" bug, but does not address this flavor comment also included in the report: > (Incidentally, it's a bit weird that you use > to aim at items that are > flavorwise above you at the time.) --- doc/fixes35.0 | 2 ++ src/zap.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 34a6ac9b4..f22cdc80d 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -881,6 +881,8 @@ message inconsistency: death message "swallowed whole" was preceded improve the messaging when a monster you can't see is causing an obstruction add option mention_walls, which gives feedback when bumping against a wall fix invalid pointer dereference in morguemon if ndemon returns NON_PM +after object loss through polyshudder don't get left hiding under nothing + if you're polymorphed into a hider Platform- and/or Interface-Specific Fixes diff --git a/src/zap.c b/src/zap.c index 3134c8b88..fcf0047bf 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 zap.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.195 $ */ +/* NetHack 3.5 zap.c $NHDT-Date: 1427249230 2015/03/25 02:07:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.197 $ */ /* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1750,8 +1750,14 @@ struct obj *obj, *otmp; if (Is_box(obj)) (void) boxlock(obj, otmp); if (obj_shudders(obj)) { + boolean cover = ((obj->ox == u.ux && obj->oy == u.uy) && + u.uundetected && + hides_under(youmonst.data)); + if (cansee(obj->ox, obj->oy)) learn_it = TRUE; do_osshock(obj); + /* eek - your cover might have been blown */ + if (cover) (void) hideunder(&youmonst); break; } obj = poly_obj(obj, STRANGE_OBJECT); From 907a2dfee0f81a9f9d5f7eaa764a21d776117de5 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Wed, 25 Mar 2015 14:34:03 -0400 Subject: [PATCH 06/73] Fix a memory leak on termination. Found by Alex Smith. --- src/save.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/save.c b/src/save.c index 807ecd7dc..f94b1857c 100644 --- a/src/save.c +++ b/src/save.c @@ -1316,6 +1316,7 @@ freedynamicdata() /* level-specific data */ free_timers(RANGE_LEVEL); free_light_sources(RANGE_LEVEL); + clear_regions(); freemonchn(fmon); free_worm(); /* release worm segment information */ freetrapchn(ftrap); From f41c51aef064b9399684da428c540bcb26a57b8e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 25 Mar 2015 22:13:28 +0200 Subject: [PATCH 07/73] Show object symbols in menu headings ... in menus where those object symbols act as menu accelerators. Toggleable via "menu_objsyms" boolean option, defaults to off. --- doc/Guidebook.mn | 3 +++ doc/fixes35.0 | 2 ++ include/extern.h | 2 +- include/flag.h | 1 + src/invent.c | 26 +++++++++++++++++++------- src/o_init.c | 8 ++++---- src/options.c | 1 + src/pickup.c | 10 +++++++--- 8 files changed, 38 insertions(+), 15 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 04cb9ea5f..14aa20239 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2100,6 +2100,9 @@ Default '|'. Menu character accelerator to goto the next menu page. Implemented by the Amiga, Gem and tty ports. Default '>'. +.lp menu_objsyms +Show object symbols in menu headings in menus where +the object symbols act as menu accelerators (default off). .lp menu_previous_page Menu character accelerator to goto the previous menu page. Implemented by the Amiga, Gem and tty ports. diff --git a/doc/fixes35.0 b/doc/fixes35.0 index f22cdc80d..a639b1ff6 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -883,6 +883,8 @@ add option mention_walls, which gives feedback when bumping against a wall fix invalid pointer dereference in morguemon if ndemon returns NON_PM after object loss through polyshudder don't get left hiding under nothing if you're polymorphed into a hider +show object symbols in menu headings in menus where those object symbols + act as menu accelerators, toggleable via "menu_objsyms" option Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index da9bf7eff..30e6c6d43 100644 --- a/include/extern.h +++ b/include/extern.h @@ -911,7 +911,7 @@ E int NDECL(dopramulet); E int NDECL(doprtool); E int NDECL(doprinuse); E void FDECL(useupf, (struct obj *,long)); -E char *FDECL(let_to_name, (CHAR_P,BOOLEAN_P)); +E char *FDECL(let_to_name, (CHAR_P,BOOLEAN_P,BOOLEAN_P)); E void NDECL(free_invbuf); E void NDECL(reassign); E int NDECL(doorganize); diff --git a/include/flag.h b/include/flag.h index add59340e..e7ebafa26 100644 --- a/include/flag.h +++ b/include/flag.h @@ -191,6 +191,7 @@ struct instance_flags { boolean news; /* print news */ boolean mention_walls; /* give feedback when bumping walls */ boolean menu_tab_sep; /* Use tabs to separate option menu fields */ + boolean menu_head_objsym; /* Show obj symbol in menu headings */ boolean menu_requested; /* Flag for overloaded use of 'm' prefix * on some non-move commands */ boolean renameallowed; /* can change hero name during role selection */ diff --git a/src/invent.c b/src/invent.c index 12f0ef1b3..e5100ee5e 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1789,7 +1789,7 @@ nextclass: if (!flags.sortpack || otmp->oclass == *invlet) { if (flags.sortpack && !classcount) { add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, - let_to_name(*invlet, FALSE), MENU_UNSELECTED); + let_to_name(*invlet, FALSE, (want_reply && iflags.menu_head_objsym)), MENU_UNSELECTED); classcount++; } any.a_char = ilet; @@ -1863,7 +1863,7 @@ char avoidlet; if (flags.sortpack && !classcount) { any = zeroany; /* zero */ add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, - let_to_name(*invlet, FALSE), MENU_UNSELECTED); + let_to_name(*invlet, FALSE, FALSE), MENU_UNSELECTED); classcount++; } any.a_char = ilet; @@ -1991,7 +1991,7 @@ dounpaid() if (otmp->unpaid) { if (!flags.sortpack || otmp->oclass == *invlet) { if (flags.sortpack && !classcount) { - putstr(win, 0, let_to_name(*invlet, TRUE)); + putstr(win, 0, let_to_name(*invlet, TRUE, FALSE)); classcount++; } @@ -2009,7 +2009,7 @@ dounpaid() if (count > num_so_far) { /* something unpaid is contained */ if (flags.sortpack) - putstr(win, 0, let_to_name(CONTAINED_SYM, TRUE)); + putstr(win, 0, let_to_name(CONTAINED_SYM, TRUE, FALSE)); /* * Search through the container objects in the inventory for * unpaid items. The top level inventory items have already @@ -2701,10 +2701,12 @@ static NEARDATA char *invbuf = (char *)0; static NEARDATA unsigned invbufsiz = 0; char * -let_to_name(let,unpaid) +let_to_name(let,unpaid,showsym) char let; -boolean unpaid; +boolean unpaid,showsym; { + const char *ocsymfmt = " ('%c')"; + const int invbuf_sympadding = 8; /* arbitrary */ const char *class_name; const char *pos; int oclass = (let >= 1 && let < MAXOCLASSES) ? let : 0; @@ -2717,7 +2719,8 @@ boolean unpaid; else class_name = names[0]; - len = strlen(class_name) + (unpaid ? sizeof "unpaid_" : sizeof ""); + len = strlen(class_name) + (unpaid ? sizeof "unpaid_" : sizeof "") + + (oclass ? (strlen(ocsymfmt)+invbuf_sympadding) : 0); if (len > invbufsiz) { if (invbuf) free((genericptr_t)invbuf); invbufsiz = len + 10; /* add slop to reduce incremental realloc */ @@ -2727,6 +2730,15 @@ boolean unpaid; Strcat(strcpy(invbuf, "Unpaid "), class_name); else Strcpy(invbuf, class_name); + if ((oclass != 0) && showsym) { + char *bp = eos(invbuf); + int mlen = invbuf_sympadding - strlen(class_name); + while (--mlen > 0) { + *bp = ' '; bp++; + } + *bp = '\0'; + Sprintf(eos(invbuf), ocsymfmt, def_oc_syms[oclass].sym); + } return invbuf; } diff --git a/src/o_init.c b/src/o_init.c index 4ae8892e9..3d95a0d6f 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -446,7 +446,7 @@ dodiscovered() /* free after Robert Viduya */ if ((dis = disco[i]) != 0 && interesting_to_discover(dis)) { ct++; if (oclass != prev_class) { - putstr(tmpwin, iflags.menu_headings, let_to_name(oclass, FALSE)); + putstr(tmpwin, iflags.menu_headings, let_to_name(oclass, FALSE, FALSE)); prev_class = oclass; } Sprintf(buf, "%s %s",(objects[dis].oc_pre_discovered ? "*" : " "), @@ -472,7 +472,7 @@ char *buf; { char *s; - Strcpy(buf, let_to_name(oclass, FALSE)); + Strcpy(buf, let_to_name(oclass, FALSE, FALSE)); for (s = buf; *s; ++s) *s = lowc(*s); return buf; } @@ -615,7 +615,7 @@ doclassdisco() break; default: oclass = def_char_to_objclass(c); - Sprintf(buf, "Discovered %s", let_to_name(oclass, FALSE)); + Sprintf(buf, "Discovered %s", let_to_name(oclass, FALSE, FALSE)); putstr(tmpwin, iflags.menu_headings, buf); for (i = bases[(int)oclass]; i < NUM_OBJECTS && objects[i].oc_class == oclass; ++i) { @@ -672,7 +672,7 @@ rename_disco() if (oclass != prev_class) { any.a_int = 0; add_menu(tmpwin, NO_GLYPH, &any, ' ', iflags.menu_headings, - ATR_NONE, let_to_name(oclass, FALSE), MENU_UNSELECTED); + ATR_NONE, let_to_name(oclass, FALSE, FALSE), MENU_UNSELECTED); prev_class = oclass; } any.a_int = dis; diff --git a/src/options.c b/src/options.c index d1f5b26de..285603351 100644 --- a/src/options.c +++ b/src/options.c @@ -142,6 +142,7 @@ static struct Bool_Opt {"mention_walls", &iflags.mention_walls, FALSE, SET_IN_GAME}, /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, + {"menu_objsyms", &iflags.menu_head_objsym, FALSE, SET_IN_GAME}, {"mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME}, /*WC*/ #ifdef NEWS {"news", &iflags.news, TRUE, DISP_IN_GAME}, diff --git a/src/pickup.c b/src/pickup.c index 1d78dea76..476d85798 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -769,7 +769,9 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */ if (sorted && !printed_type_name) { any = zeroany; add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, - let_to_name(*pack, FALSE), MENU_UNSELECTED); + let_to_name(*pack, FALSE, + (how != PICK_NONE) && iflags.menu_head_objsym), + MENU_UNSELECTED); printed_type_name = TRUE; } @@ -928,8 +930,10 @@ int how; /* type of query */ any.a_int = curr->oclass; add_menu(win, NO_GLYPH, &any, invlet++, def_oc_syms[(int)objects[curr->otyp].oc_class].sym, - ATR_NONE, let_to_name(*pack, FALSE), - MENU_UNSELECTED); + ATR_NONE, + let_to_name(*pack, FALSE, + (how != PICK_NONE) && iflags.menu_head_objsym), + MENU_UNSELECTED); collected_type_name = TRUE; } } From 12ca92aa4236133e776411ddab81cbde05a9adaa Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Wed, 25 Mar 2015 17:07:10 -0400 Subject: [PATCH 08/73] Fix 'fetch' syntax, include sparkly 'git log' trick And bolt a couple more Win32-folders onto .gitignore. --- .gitignore | 2 ++ DEVEL/git_recipes.txt | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 302497de0..db40c9ab4 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ core Makefile # Win32-specific ignores +Debug/ +Release/ binary/ build/ Nethack.sln diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt index 88af7f927..5e8d872f9 100644 --- a/DEVEL/git_recipes.txt +++ b/DEVEL/git_recipes.txt @@ -32,6 +32,10 @@ you specify: -pretty=one: format output as a single line for each entry (branch): show the commits from (branch) instead of the current one +[*] git log --pretty=one --decorate --graph --all + +(This is best explained by executing and looking at the output.) + [*] git add (filename) [*] git nhadd (filename) @@ -101,10 +105,10 @@ the prior commit. [/end area-of-concern] -[*] git fetch [-a] +[*] git fetch [--all] Retrieve commits from the remote repository to your machine. -Including -a will get commits for all branches. +Including --all will get commits for all branches. Does NOT merge them into your local repository. From b1df164a3befaaec7d1bc902200cd8f9ef1867b1 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 25 Mar 2015 18:04:50 -0700 Subject: [PATCH 09/73] fix acid_damage() crash My dog bit an acid blob and triggered a crash, caught by SYSCF panictrace but yielding confusing information. The backtrace included a call from 'rustm()+N' that turned out to be passivemm(), which was deferencing a null pointer since no weapon was involved. --- src/trap.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/trap.c b/src/trap.c index a0c6fa1b1..47d8d99b2 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 trap.c $NHDT-Date: 1426805491 2015/03/19 22:51:31 $ $NHDT-Branch: water_damage $:$NHDT-Revision: 1.198 $ */ +/* NetHack 3.5 trap.c $NHDT-Date: 1427331767 2015/03/26 01:02:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.199 $ */ /* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3118,13 +3118,17 @@ acid_damage(obj) struct obj *obj; { /* Scrolls but not spellbooks can be erased by acid. */ - struct monst *victim = - carried(obj) ? &youmonst : mcarried(obj) ? obj->ocarry : NULL; - boolean vismon = victim && (victim != &youmonst) && canseemon(victim); + struct monst *victim; + boolean vismon; - if (obj->greased) + if (!obj) return; + + victim = carried(obj) ? &youmonst : mcarried(obj) ? obj->ocarry : NULL; + vismon = victim && (victim != &youmonst) && canseemon(victim); + + if (obj->greased) { grease_protect(obj, NULL, victim); - else if (obj->oclass == SCROLL_CLASS && obj->otyp != SCR_BLANK_PAPER) { + } else if (obj->oclass == SCROLL_CLASS && obj->otyp != SCR_BLANK_PAPER) { if (obj->otyp != SCR_BLANK_PAPER #ifdef MAIL && obj->otyp != SCR_MAIL From f4776d515d6ce22cb5c83fc01b5297005c9d9706 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 26 Mar 2015 08:44:24 +0200 Subject: [PATCH 10/73] Fix typos in fixes35.0 --- doc/fixes35.0 | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index a639b1ff6..6c43632a4 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -63,7 +63,7 @@ wizard mode: avoid division by 0 crash for level teleport in the endgame if don't #sit on an object in a pit if you're only on the precipice fix message when pushing a boulder into a pool while riding plural of "Nazgul" is "Nazgul" not "Nazguls" -trap messages referring to named steed were ackwardly worded when hallucination +trap messages referring to named steed were awkwardly worded when hallucination overrode use of the name some actions such as eating corpses off the floor didn't check whether hero could reach the bottom of a pit @@ -117,7 +117,7 @@ shopkeeper removal of trap from shop doorway yields an open door instead of a closed one if an intact open door is present guarantee that hostile djinn released from bottles really are hostile handle lava when removing or losing water walking boots -fix incomplete sentence occuring when unique monster's corpse fell down stairs +fix incomplete sentence occurring when unique monster's corpse fell down stairs fractured boulders or statues produced inconsistent object settings on the resulting rocks really fix rolling boulder bug C340-18, the previous "fix" reversed the test @@ -165,7 +165,7 @@ clean up messages when you stop levitation while riding a flying steed monsters evading a kick on noteleport levels would cause a "teleports" message interrupt current activity during certain stages of petrification or vomiting warning about bad food didn't recognize tin of Medusa meat -eating tainted Medusa corpse caused food poisioning instead of petrification +eating tainted Medusa corpse caused food poisoning instead of petrification avoid potential stale pointer use after magic bag explosion nymphs and monkeys can't steal rings worn under gloves monkeys can't steal rings worn under cursed weapon @@ -237,7 +237,7 @@ when there were multiple boulders at a location, moving one of them sometimes resulted in line-of-sight anomalies unicorn can't catch gems if it is asleep or paralyzed fix grammar when choking on gold -prevent lose-level+regain-level cycle from arbritrarily boosting HP and Pw +prevent lose-level+regain-level cycle from arbitrarily boosting HP and Pw prevent polymorphing into "new man" at low level from magnifying HP and Pw some messages which referred to "mirror" ought to have used "looking glass" incubi react to mirrors @@ -360,8 +360,8 @@ code handling a monster's use of potion or food to cure stoning or confusion properly handle destruction of equipment carried by monsters hit by disintegration breath; life-saving retained conferred properties of formerly worn items (loss of steed's saddle caused much confusion) -don't exercize or abuse wisdom when rumors get used for random graffiti -don't exercize wisdom twice for each minor oracle consultation +don't exercise or abuse wisdom when rumors get used for random graffiti +don't exercise wisdom twice for each minor oracle consultation don't welcome the hero to Delphi if the Oracle was angered before first entry create_object() created lizard corpses without timers and troll corpses with their revive timers, then changed the corpsenm field @@ -383,7 +383,7 @@ specifying role and/or race along with an invalid alignment for it/them in temple donation can recover protection previously stolen by attrcurse attack even when protection amount is so big that no increment would be given meditating monsters stop meditating when affected by something which wakes - sleeping mosnters + sleeping monsters monsters capable of hiding can't do so when trapped or while holding you limit recursive calls to spoteffects (poly'd hero fell into water, reverted to human because of it, fell into same water, then crawled out twice) @@ -474,7 +474,7 @@ suppress corpse from bones data if death is due to being dissolved in lava suppress "you rise from the dead" if game ends due to be turned into slime hero poly'd into stone golem and wielding cockatrice corpse casts stone-to- flesh at self to become flesh golem will revert to stone if no gloves -don't give erroneous " disppears" message for hero poly'd into quantum +don't give erroneous " disappears" message for hero poly'd into quantum mechanic who hits engulfer while swallowed and blinded demon lords/princes can't be summoned to the elemental or Astral planes feedback from casting spell of protection was wrong in some situations @@ -496,7 +496,7 @@ can't eat an artifact you're unable to touch attempting to kick beyond map edge performed an out of array bounds memory access; symptom seen was "show_glyph: bad pos" warning when blind attempting to engrave with an empty wand should always use a turn -don't access freed memory after engraving "wrests one last charnge" from wand +don't access freed memory after engraving "wrests one last charge" from wand a magic portal could be rendered inactive for the hero if a successful hangup save took place during level change; leaving the level by any means other than triggering the portal would reactivate it @@ -645,7 +645,7 @@ secret door detection's trap finding is no longer blocked by water or clouds potion thrown by monster which hit a long worm's tail gave feedback about hitting its head implement energy vortex's previously unused energy drain attack -changing alignment type resets alignment record to 0 (nomimally aligned) +changing alignment type resets alignment record to 0 (nominally aligned) jellyfish do not technically have a head while polymorphed, suppress attribute gain/lose earned by pre-poly exercise wizard mode #monpolycontrol prompting asked about "it" when monster was unseen @@ -670,7 +670,7 @@ if polymorph causes a monster to drop items, they won't be used up via monsters who ate green slime corpses weren't turned into green slime "hand slip" while naming an object would never pick 'z' as a substitute letter hero would "gladly take off " for nymph or succubus even while asleep -concealed mimic wasn't revealed if kicking attmpt yielded a clumsy miss +concealed mimic wasn't revealed if kicking attempt yielded a clumsy miss too accurate feedback given to a blinded hero when a monster summons insects if life-saved steed became untame, repeated "placing steed onto map?" warnings would be given as long as the hero remained mounted @@ -730,7 +730,7 @@ shouldn't have been able write scrolls by guessing type name when they're scrolls given names can be written by assigned name as well as by description fix writing feedback "the spellbook warps strangely, then turns parchment" make stone artifacts usually resist stone-to-flesh -when reading an unknown scroll and learning it, discovery of teleporation was +when reading an unknown scroll and learning it, discovery of teleportation was too late if hero happened to land on another scroll of teleportation using an unlocking tool on a closed door which was actually a mimic reported that there was no door to unlock instead of exposing the mimic @@ -760,7 +760,7 @@ for number_pad:2 (MSDOS compatibility), M-5 (Alt+5, or Shift+keypad5 using MSDOS/Windows keystroke hackery) didn't function as G movement prefix if an angry shopkeeper chased the hero to a different level and then got paid off, he'd dismiss kops on that other level but not on his shop level -objects inside the Wizard's Tower can't be teleport to outside and vica versa +objects inside the Wizard's Tower can't be teleport to outside and vice versa dying in lava and being life-saved or leaving bones would destroy ring of fire resistance if it happened to be made of wood, and also burn up scrolls of fire and spellbook of fireball @@ -786,7 +786,7 @@ when shop prices are adjusted, handle roundoff (integer truncation) better for hero poly'd into a monster form that lacks a weapon attack but has a claw attack, use wielded weapon even when claw attack isn't the very first rename the SLEEPING property and Sleeping attribute to SLEEPY and Sleepy, resp. -character escape sequence handling during options processing was vulernable +character escape sequence handling during options processing was vulnerable to malformed escapes and could potentially be abused to clobber the stack and launch a buffer overrun attack give alternate message for " turns to flee" when mon can't move @@ -815,7 +815,7 @@ hangup save made during magic mapping or detection performed while underwater could put hero on top of the water after restore fix bug preventing stone-resistant monsters w/o gloves from wielding cockatrices items conferring life drain resistance were affected by drain life spell -'a'pply command could be used to recogniize undiscovered potions of oil +'a'pply command could be used to recognize undiscovered potions of oil fix replacing an existing bones file in wizard mode [load?y, unlink?n, die?y, save?y, replace?y] for configurations using external file compression theft of worn armor with wear/unwear delay would interfere with completion of @@ -872,7 +872,7 @@ data.base "gelatinous cube" and "jack boot" have their own entries data.base "vampire bat" matched twice; use the bat entry data.base dagger attribution started with spaces instead of tabs remove 'if (Deaf)' guards preceding You_hear which already checks deafness -tse a menu to loot multiple containers +use a menu to loot multiple containers do_look() in post-3.4.3 used glyph prior to setting it in pager.c charge for a boulder that fills a pit in shop abuse wisdom in keeping with Rider eating message @@ -985,7 +985,7 @@ burying a punishment ball no longer ends your punishment add clicklook option to allow looking at things on the display by clicking right mouse button when floating mouse pointer over them Izchak's lighting store is now able to stock oil for your lamp -provide core support for saving of messsage history in save file +provide core support for saving of message history in save file the following actions can now be continued after save/restore: digging, eating, studying, removing armor hero-created and monster-created ice will eventually melt away From 4f0dc123c6accaa3b8be80fbc7a9328de41ea1c9 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 26 Mar 2015 11:41:05 +0200 Subject: [PATCH 11/73] Fix Guidebook typos --- doc/Guidebook.mn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 14aa20239..32b894faa 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -714,7 +714,7 @@ via the ``#twoweapon'' extended command Since using this command by accident would be troublesome, you are asked to confirm your intent before switching to explore mode. By default the response 'y' acknowledges that intent. You can set the -.op paraniod_confirmation +.op paranoid_confirmation option to require a response of "yes" instead. .lp ^X Display basic information about your character. @@ -848,7 +848,7 @@ You probably shouldn't start off a new game by praying right away.) Since using this command by accident can cause trouble, there is an option to make you confirm your intent before praying. It is enabled by default, and you can reset the -.op paraniod_confirmation +.op paranoid_confirmation option to disable it. .lp #quit Quit the program without saving your game. @@ -856,7 +856,7 @@ Quit the program without saving your game. Since using this command by accident would throw away the current game, you are asked to confirm your intent before quitting. By default a response of 'y' acknowledges that intent. You can set the -.op paraniod_confirmation +.op paranoid_confirmation option to require a response of "yes" instead. .lp #ride Ride (or stop riding) a monster. @@ -1138,7 +1138,7 @@ In most circumstances, if you attempt to attack a peaceful monster by moving into its location, you'll be asked to confirm your intent. By default an answer of 'y' acknowledges that intent, which can be error prone if you're using 'y' to move. You can set the -.op paraniod_confirmation +.op paranoid_confirmation option to require a response of "yes" instead. .pg If you can't see a monster (if it is invisible, or if you are blinded), @@ -2175,7 +2175,7 @@ is the same as specifying 0. (Settings 2 and 4 are for compatibility with MSDOS or old PC Hack; in addition to the different behavior for `5', `Alt-5' acts as `G' and `Alt-0' acts as `I'. -Setting -1 is to accomodate some German keyboards which have the +Setting -1 is to accommodate some German keyboards which have the location of the `y' and `z' keys swapped.) When moving by numbers, to enter a count prefix for those commands which accept one (such as ``12s'' to search twelve times), precede it From 7d4298655d745d5d44bee098acbf59b2515b7e88 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 26 Mar 2015 08:05:23 -0400 Subject: [PATCH 12/73] names of public servers and tournament contrib Changes to be committed: modified: dat/history --- dat/history | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dat/history b/dat/history index 0e15a079c..0a4a8471f 100644 --- a/dat/history +++ b/dat/history @@ -211,7 +211,8 @@ people primarily responsible for the public NetHack servers available for playing the game at nethack.alt.org and devnull.net. In addition to providing a way for the public to play a game of NetHack from almost anywhere, they have hosted annual NetHack tournaments for many, many years. - write up something for Robin, M. Drew Streib, Pasi Kallinen + On behalf of the NetHack community, thank you very much to +M. Drew Streib, Pasi Kallinen and Robin Bandy. - - - - - - - - - - From 9c29d74fedd98320762dbf79da460b8d822efa3d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 26 Mar 2015 16:14:33 +0200 Subject: [PATCH 13/73] Fix typo in Guidebook.tex --- doc/Guidebook.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index c1cf2015e..e2d74df3a 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2600,7 +2600,7 @@ is the same as specifying {\tt 0}. (Settings {\tt 2} and {\tt 4} are for compatibility with MSDOS or old PC Hack; in addition to the different behavior for `{\tt 5}', `{\tt Alt-5}' acts as `{\tt G}' and `{\tt Alt-0}' acts as `{\tt I}'. -Setting {\tt -1} is to accomodate some German keyboards which have the +Setting {\tt -1} is to accommodate some German keyboards which have the location of the `{\tt y}' and `{\tt z}' keys swapped.) When moving by numbers, to enter a count prefix for those commands which accept one (such as ``{\tt 12s}'' to search twelve times), precede it From 8c94f9337081b55c9a37df29ce01b4a1cf9f1abc Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 26 Mar 2015 16:46:41 +0200 Subject: [PATCH 14/73] Catch up and sync Guidebooks --- doc/Guidebook.mn | 8 +------- doc/Guidebook.tex | 41 ++++++++++++++++++++--------------------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 32b894faa..4a0243fea 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -710,12 +710,6 @@ the exchange still takes place. .lp X Toggle two-weapon combat, if your character can do it. Also available via the ``#twoweapon'' extended command -.lp "" -Since using this command by accident would be troublesome, you are asked -to confirm your intent before switching to explore mode. By default -the response 'y' acknowledges that intent. You can set the -.op paranoid_confirmation -option to require a response of "yes" instead. .lp ^X Display basic information about your character. .lp "" @@ -2994,7 +2988,7 @@ command-line switch or with the .op playmode:explore option. The other is to issue the ``#exploremode'' extended command while already playing the game. Starting a new game in explore mode provides your -character with a wand of wishing in initial inventory; switching via `X' +character with a wand of wishing in initial inventory; switching during play does not. The other benefits of explore mode are left for the trepid reader to discover. .pg diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index e2d74df3a..6d3774946 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -862,13 +862,8 @@ two-weapon combat. Note that if one of these slots is empty, the exchange still takes place. %.lp \item[\tb{X}] -Enter explore (discovery) mode, explained in its own section later.\\ -%.lp "" -Since using this command by accident would be troublesome, you are asked -to confirm your intent before switching to explore mode. By default -the response `{\tt y}' acknowledges that intent. You can set the -{\it paranoid\_confirmation\/} -option to require a response of ``yes'' instead. +Toggle two-weapon combat, if your character can do it. Also available +via the ``#twoweapon'' extended command %.lp \item[\tb{\^{}X}] Display basic information about your character.\\ @@ -2275,8 +2270,7 @@ each entry. Such a sequence can be continued to multiple lines by putting a `{\tt \verb+\+}' at the end of each line to be continued. %.pg -If your copy of the game included the compile time AUTOPICKUP\_EXCEPTIONS -option, then any line starting with ``{\tt AUTOPICKUP\_EXCEPTION=}'' +Any line starting with ``{\tt AUTOPICKUP\_EXCEPTION=}'' is taken as defining an exception to the ``{\tt pickup\_types}'' option. There is a section of this Guidebook that discusses that. @@ -2327,6 +2321,9 @@ or make ready with the `Q' command instead. If no weapon is found or the option is false, the `t' (throw) command is executed instead. (default false) %.lp +\item[\ib{bones}] +Allow saving and loading bones files. (default true) +%.lp \item[\ib{boulder}] Set the character used to display boulders (default is rock class symbol). %.lp @@ -2475,6 +2472,9 @@ Enable mail delivery during the game (default on). An obsolete synonym for ``{\tt gender:male}''. Cannot be set with the `{\tt O}' command. %.lp +\item[\ib{mention\_walls}] +Give feedback when walking against a wall (default off). +%.lp \item[\ib{menustyle}] Controls the interface used when you need to choose various objects (in response to the Drop command, for instance). The value specified should @@ -2520,13 +2520,16 @@ Default `\verb+|+'. Menu character accelerator to goto the next menu page. Implemented by the Amiga, Gem and tty ports. Default `\verb+>+'. +\item[\ib{menu\_objsyms}] +Show object symbols in menu headings in menus where +the object symbols act as menu accelerators (default off). \item[\ib{menu\_previous\_page}] Menu character accelerator to goto the previous menu page. Implemented by the Amiga, Gem and tty ports. Default `\verb+<+'. \item[\ib{menu\_search}] Menu character accelerator to search for a menu item. -Implemented by the Amiga, Gem and X11 ports. +Implemented by the Amiga, Gem, X11 and tty ports. Default `:'. \item[\ib{menu\_select\_all}] Menu character accelerator to select all items in a menu. @@ -2678,10 +2681,8 @@ match an autopickup exception. Default is on. %.lp \item[\ib{pickup\_types}] Specify the object types to be picked up when ``{\it autopickup\/}'' -is on. Default is all types. If your copy of the game has the -compile time option AUTOPICKUP\_EXCEPTIONS included, -you may be able to use ``{\it autopickup\_exception\/}'' configuration -file lines to further refine ``{\it autopickup\/}'' behavior. +is on. Default is all types. You can use ``{\it autopickup\_exception\/}'' +configuration file lines to further refine ``{\it autopickup\/}'' behavior. %.lp \item[\ib{pile\_limit}] When walking across a pile of objects on the floor, threshold at which @@ -3074,10 +3075,8 @@ Cannot be set with the `{\tt O}' command. \subsection*{Configuring autopickup exceptions} %.pg -There is a compile time option called AUTOPICKUP_EXCEPTIONS. -If your copy of the game was built with that option defined, you can -further refine the behavior of the ``{\tt autopickup}'' option beyond -what is available through the ``{\tt pickup\_types}'' option. +You can further refine the behavior of the ``{\tt autopickup}'' option +beyond what is available through the ``{\tt pickup\_types}'' option. %.pg By placing ``{\tt autopickup\_exception}'' lines in your configuration @@ -3505,9 +3504,9 @@ There are two ways of enabling explore mode. One is to start the game with the {\tt -X} command-line switch or with the {\it playmode:explore\/} -option. The other is to issue the `{\tt X}' command while already -playing the game. Starting a new game in explore mode provides your -character with a wand of wishing in initial inventory; switching via `X' +option. The other is to issue the `{\tt #exploremode}' extended command while +already playing the game. Starting a new game in explore mode provides your +character with a wand of wishing in initial inventory; switching during play does not. The other benefits of explore mode are left for the trepid reader to discover. From 896fb1524900b4aada80b1a2727cf2189db6591f Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 26 Mar 2015 12:40:22 -0400 Subject: [PATCH 15/73] sync docs Pasi pointed it out that the SYSCF stuff was only added to Guidebook.mn not Guidebook.tex --- doc/Guidebook.tex | 64 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index c1cf2015e..6a7524bcc 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2224,7 +2224,8 @@ command allows you to view all options and change most of them. You can also set options automatically by placing them in the ``NETHACKOPTIONS'' environment variable or in a configuration file. Some versions of {\it NetHack\/} also have front-end programs that allow -you to set options before starting the game. +you to set options before starting the game or a global configuration +for system administrators. %.hn 2 \subsection*{Using the NETHACKOPTIONS environment variable} @@ -3459,6 +3460,65 @@ If this is the case, disable the number\_pad option and use the traditional Rogue-like commands. \elist +%.hn2 +\subsection*{Global Configuration for System Administrators} + +%.pg +If NetHack is compiled with teh SYSCF option, a system administrator +should set up a global configuration; this is a file in the +same format as the traditional per-user configuration file (see above). + +This file should be named sysconf and placed in the same directory as +the other NetHack support files. +The options recognized in this file are listed below. Any option not +set uses a compiled-in default (which may not be appropriate for your +system). + +%.pg +\blist{} +%.lp +\item[\ib{WIZARDS}] +A space-separated list of user name who are allowed to play in wizard +mode (the debugging mode, not the magic-useing role). A value of a single +asterisk (*) allows anyone to start a game in wizard mode. +%.lp +\item[\ib{SHELLERS}] +A list of users who are allowed to use the shell escape command (!). +The syntax is the same as WIZARDS. +%.lp +\item[\ib{MAXPLAYERS}] +Limit the maximum number of games taht can be running at the same time. +%.lp +\item[\ib{SUPPORT}] +A string explainign how to get local support (no default value). +%.lp +\item[\ib{RECOVER}] +A string explaining how to recover a game on this system (no default value). +%.lp +\item[\ib{SEDUCE}] +0 or 1 to disable or enable, respectively, the SEDUCE option (see the source) +for details on this function. +\elist + +%.pg +The following options affect the score file: +\blist {} +%.pg +%.lp +\item[\ib{PERSMAX}] +Maximum number of entries for one person +%.lp +\item[\ib{ENTRYMAX}] +Maximum number of entries in the score file +%.lp +\item[\ib{POINTSMIN}] +Minimum number of points to get an entry in the score file. +%.lp +\item[\ib{PERS_IS_UID}] +0 or 1 to use user names or numeric userids, respectively, to identify +unique people for the score file +\elist + %.hn 1 \section{Scoring} @@ -3782,7 +3842,7 @@ resurrected it for 3.3.1. %.pg \medskip -\nd There is a NetHack web site maintained by {\it Ken Lorber} at +\nd The official NetHack web site is maintained by {\it Ken Lorber} at {\catcode`\#=11 \special{html:}} http:{\tt /}{\tt /}www.nethack.org{\tt /}. From ed85d3f1586910c1ef2a049047db0212eaf72a6d Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 27 Mar 2015 00:21:40 -0700 Subject: [PATCH 16/73] objnam formatting for bag of tricks Bag of tricks that had been used at least once was being described as "empty" regardless of charge count, because it always fails the Has_contents() test. After half this patch fixed that, it started being flagged as "empty" as soon as the last charge was used rather than after attempting to use it again after that, since 'cknown' was being set whenever it was used. Only set that flag when applying the bag has been observed to fail. --- src/makemon.c | 6 +----- src/objnam.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/makemon.c b/src/makemon.c index 6ce548ea0..799438c2e 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 makemon.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.74 $ */ +/* NetHack 3.5 makemon.c $NHDT-Date: 1427440865 2015/03/27 07:21:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.75 $ */ /* NetHack 3.5 makemon.c $Date: 2012/01/29 00:34:33 $ $Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1884,10 +1884,6 @@ int *seencount; /* secondary output */ } while (--creatcnt > 0); if (seecount) { if (seencount) *seencount += seecount; - /* don't set contents-known flag if we just used last charge - (such suppression doesn't actually gain us much since - player can now deduce that the bag has become empty) */ - if (bag->spe > 0) bag->cknown = 1; if (bag->dknown) makeknown(BAG_OF_TRICKS); } else if (!tipping) { pline1(!moncount ? nothing_happens : "Nothing seems to happen."); diff --git a/src/objnam.c b/src/objnam.c index 898dfb60a..54923ce1e 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 objnam.c $NHDT-Date: 1426977394 2015/03/21 22:36:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.108 $ */ +/* NetHack 3.5 objnam.c $NHDT-Date: 1427440866 2015/03/27 07:21:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.109 $ */ /* NetHack 3.5 objnam.c $Date: 2011/10/27 02:24:54 $ $Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -651,8 +651,9 @@ register struct obj *obj; */ register char *bp = xname(obj); - if (iflags.override_ID) known = cknown = bknown = lknown = TRUE; - else { + if (iflags.override_ID) { + known = cknown = bknown = lknown = TRUE; + } else { known = obj->known; cknown = obj->cknown; bknown = obj->bknown; @@ -685,7 +686,15 @@ register struct obj *obj; /* "empty" goes at the beginning, but item count goes at the end */ if (cknown && - (Is_container(obj) || obj->otyp == STATUE) && !Has_contents(obj)) + /* bag of tricks: include "empty" prefix if it's known to + be empty but its precise number of charges isn't known + (when that is known, suffix of "(n:0)" will be appended, + making the prefix be redundant; note that 'known' flag + isn't set when emptiness gets discovered because then + charging magic would yield known number of new charges) */ + (obj->otyp == BAG_OF_TRICKS ? (obj->spe == 0 && !obj->known) : + /* not bag of tricks: empty if container which has no contents */ + (Is_container(obj) || obj->otyp == STATUE) && !Has_contents(obj))) Strcat(prefix, "empty "); if (bknown && From 08654c213cc810f283669dcb6c72ae9805d06711 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 15:12:04 +0200 Subject: [PATCH 17/73] Fix passing non-static buffer out of scope --- src/pager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pager.c b/src/pager.c index bb1c82e72..f2f5b9968 100644 --- a/src/pager.c +++ b/src/pager.c @@ -447,7 +447,8 @@ const char **firstmatch; { boolean need_to_look = FALSE; int glyph; - char look_buf[BUFSZ], prefix[BUFSZ]; + static char look_buf[BUFSZ]; + char prefix[BUFSZ]; int found = 0; /* count of matching syms found */ int i; int skipped_venom = 0; From 911a3756c6dba95d7b6039f1a740ff278b269943 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 15:29:54 +0200 Subject: [PATCH 18/73] TTY: Guard against impossible x coord If a menu item was longer than terminal width, the menu wasn't cleared away after it was finished with. This easily happened when an inventory item was named. --- win/tty/wintty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 553553744..f3cc97eb5 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1809,6 +1809,7 @@ tty_display_nhwindow(window, blocking) cw->offx = (uchar) (int) max((int) 10, (int) (ttyDisplay->cols - cw->maxcol - 1)); #endif + if(cw->offx < 0) cw->offx = 0; if(cw->type == NHW_MENU) cw->offy = 0; if(ttyDisplay->toplin == 1) From 2e2d020a591a9a831827f0eb44fae56d29a1a220 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 16:08:06 +0200 Subject: [PATCH 19/73] Show t-shirt text at end of game inventory disclose Restricting the text display only to the end of game disclose, so it doesn't clutter the inventory during gameplay and so that the readability of t-shirts is not given away. --- include/extern.h | 1 + src/objnam.c | 5 ++++ src/read.c | 61 +++++++++++++++++++++++++++--------------------- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/include/extern.h b/include/extern.h index 30e6c6d43..d6347207c 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1824,6 +1824,7 @@ E long NDECL(random); /* ### read.c ### */ E void FDECL(learnscroll, (struct obj *)); +E char *FDECL(tshirt_text, (struct obj *, char *)); E int NDECL(doread); E boolean FDECL(is_chargeable, (struct obj *)); E void FDECL(recharge, (struct obj *,int)); diff --git a/src/objnam.c b/src/objnam.c index 54923ce1e..f40222c3b 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -489,6 +489,11 @@ register struct obj *obj; } if (pluralize) Strcpy(buf, makeplural(buf)); + if (obj->otyp == T_SHIRT && program_state.gameover) { + char tmpbuf[BUFSZ]; + Sprintf(eos(buf), " with text \"%s\"", tshirt_text(obj, tmpbuf)); + } + if (has_oname(obj) && dknown) { Strcat(buf, " named "); nameit: diff --git a/src/read.c b/src/read.c index 9be9f9390..26e9f2f62 100644 --- a/src/read.c +++ b/src/read.c @@ -53,6 +53,39 @@ struct obj *sobj; (void) learnscrolltyp(sobj->otyp); } +char * +tshirt_text(tshirt, buf) +struct obj *tshirt; +char *buf; +{ + static const char *shirt_msgs[] = { /* Scott Bigham */ + "I explored the Dungeons of Doom and all I got was this lousy T-shirt!", + "Is that Mjollnir in your pocket or are you just happy to see me?", + "It's not the size of your sword, it's how #enhance'd you are with it.", + "Madame Elvira's House O' Succubi Lifetime Customer", + "Madame Elvira's House O' Succubi Employee of the Month", + "Ludios Vault Guards Do It In Small, Dark Rooms", + "Yendor Military Soldiers Do It In Large Groups", + "I survived Yendor Military Boot Camp", + "Ludios Accounting School Intra-Mural Lacrosse Team", + "Oracle(TM) Fountains 10th Annual Wet T-Shirt Contest", + "Hey, black dragon! Disintegrate THIS!", + "I'm With Stupid -->", + "Don't blame me, I voted for Izchak!", + "Don't Panic", /* HHGTTG */ + "Furinkan High School Athletic Dept.", /* Ranma 1/2 */ + "Hel-LOOO, Nurse!", /* Animaniacs */ + }; + int erosion; + Strcpy(buf, shirt_msgs[tshirt->o_id % SIZE(shirt_msgs)]); + erosion = greatest_erosion(tshirt); + if (erosion) + wipeout_text(buf, + (int)(strlen(buf) * erosion / (2*MAX_ERODE)), + tshirt->o_id ^ (unsigned)ubirthday); + return buf; +} + int doread() { @@ -73,27 +106,7 @@ doread() useup(scroll); return(1); } else if (scroll->otyp == T_SHIRT) { - static const char *shirt_msgs[] = { /* Scott Bigham */ - "I explored the Dungeons of Doom and all I got was this lousy T-shirt!", - "Is that Mjollnir in your pocket or are you just happy to see me?", - "It's not the size of your sword, it's how #enhance'd you are with it.", - "Madame Elvira's House O' Succubi Lifetime Customer", - "Madame Elvira's House O' Succubi Employee of the Month", - "Ludios Vault Guards Do It In Small, Dark Rooms", - "Yendor Military Soldiers Do It In Large Groups", - "I survived Yendor Military Boot Camp", - "Ludios Accounting School Intra-Mural Lacrosse Team", - "Oracle(TM) Fountains 10th Annual Wet T-Shirt Contest", - "Hey, black dragon! Disintegrate THIS!", - "I'm With Stupid -->", - "Don't blame me, I voted for Izchak!", - "Don't Panic", /* HHGTTG */ - "Furinkan High School Athletic Dept.", /* Ranma 1/2 */ - "Hel-LOOO, Nurse!", /* Animaniacs */ - }; char buf[BUFSZ]; - int erosion; - if (Blind) { You_cant("feel any Braille writing."); return 0; @@ -108,13 +121,7 @@ doread() u.uconduct.literate++; if(flags.verbose) pline("It reads:"); - Strcpy(buf, shirt_msgs[scroll->o_id % SIZE(shirt_msgs)]); - erosion = greatest_erosion(scroll); - if (erosion) - wipeout_text(buf, - (int)(strlen(buf) * erosion / (2*MAX_ERODE)), - scroll->o_id ^ (unsigned)ubirthday); - pline("\"%s\"", buf); + pline("\"%s\"", tshirt_text(scroll, buf)); return 1; } else if (scroll->oclass != SCROLL_CLASS && scroll->oclass != SPBOOK_CLASS) { From 870b124f14194f50bf4cb4383d646b0874b688d7 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 21:04:01 +0200 Subject: [PATCH 20/73] Allow reading many more items You can now also read alchemy smocks, credit cards, cans of grease, magic markers, gold, the Orb of Fate, and candy bars. --- include/obj.h | 11 +++++ src/invent.c | 4 +- src/read.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 134 insertions(+), 12 deletions(-) diff --git a/include/obj.h b/include/obj.h index 7af927919..44876bcb4 100644 --- a/include/obj.h +++ b/include/obj.h @@ -303,6 +303,17 @@ struct obj { || (otmp)->otyp == WAX_CANDLE\ || (otmp)->otyp == POT_OIL) +/* things that can be read */ +#define is_readable(otmp) ((otmp)->otyp == FORTUNE_COOKIE\ + || (otmp)->otyp == T_SHIRT\ + || (otmp)->otyp == ALCHEMY_SMOCK\ + || (otmp)->otyp == CREDIT_CARD\ + || (otmp)->otyp == CAN_OF_GREASE\ + || (otmp)->otyp == MAGIC_MARKER\ + || (otmp)->oclass == COIN_CLASS\ + || (otmp)->oartifact == ART_ORB_OF_FATE\ + || (otmp)->otyp == CANDY_BAR) + /* special stones */ #define is_graystone(obj) ((obj)->otyp == LUCKSTONE || \ (obj)->otyp == LOADSTONE || \ diff --git a/src/invent.c b/src/invent.c index e5100ee5e..2cc9e9004 100644 --- a/src/invent.c +++ b/src/invent.c @@ -915,8 +915,8 @@ register const char *let,*word; /* "ugly check" for reading fortune cookies, part 2 */ if ((!strcmp(word, "read") - && (otmp->otyp == FORTUNE_COOKIE || otmp->otyp == T_SHIRT))) - allowall = TRUE; + && is_readable(otmp))) + allowall = usegold = TRUE; } } bp[foo] = 0; diff --git a/src/read.c b/src/read.c index 26e9f2f62..51a5b5295 100644 --- a/src/read.c +++ b/src/read.c @@ -53,6 +53,19 @@ struct obj *sobj; (void) learnscrolltyp(sobj->otyp); } +char * +erode_obj_text(otmp, buf) +struct obj *otmp; +char *buf; +{ + int erosion = greatest_erosion(otmp); + if (erosion) + wipeout_text(buf, + (int)(strlen(buf) * erosion / (2*MAX_ERODE)), + otmp->o_id ^ (unsigned)ubirthday); + return buf; +} + char * tshirt_text(tshirt, buf) struct obj *tshirt; @@ -76,14 +89,28 @@ char *buf; "Furinkan High School Athletic Dept.", /* Ranma 1/2 */ "Hel-LOOO, Nurse!", /* Animaniacs */ }; - int erosion; Strcpy(buf, shirt_msgs[tshirt->o_id % SIZE(shirt_msgs)]); - erosion = greatest_erosion(tshirt); - if (erosion) - wipeout_text(buf, - (int)(strlen(buf) * erosion / (2*MAX_ERODE)), - tshirt->o_id ^ (unsigned)ubirthday); - return buf; + return erode_obj_text(tshirt, buf); +} + +char * +apron_text(apron, buf) +struct obj *apron; +char *buf; +{ + static const char *apron_msgs[] = { + "Kiss the cook", + "I'm making SCIENCE!", + "Don't mess with the chef", + "Don't make me poison you", + "Gehennom's Kitchen", + "Rat: The other white meat", + "If you can't stand the heat, get out of Gehennom!", + "If we weren't meant to eat animals, why are they made out of meat?", + "If you don't like the food, I'll stab you", + }; + Strcpy(buf, apron_msgs[apron->o_id % SIZE(apron_msgs)]); + return erode_obj_text(apron, buf); } int @@ -105,14 +132,15 @@ doread() if (!Blind) u.uconduct.literate++; useup(scroll); return(1); - } else if (scroll->otyp == T_SHIRT) { + } else if (scroll->otyp == T_SHIRT || + scroll->otyp == ALCHEMY_SMOCK) { char buf[BUFSZ]; if (Blind) { You_cant("feel any Braille writing."); return 0; } /* can't read shirt worn under suit (under cloak is ok though) */ - if (uarm && scroll == uarmu) { + if (scroll->otyp == T_SHIRT && uarm && scroll == uarmu) { pline("%s shirt is obscured by %s%s.", scroll->unpaid ? "That" : "Your", shk_your(buf, uarm), suit_simple_name(uarm)); @@ -121,7 +149,90 @@ doread() u.uconduct.literate++; if(flags.verbose) pline("It reads:"); - pline("\"%s\"", tshirt_text(scroll, buf)); + pline("\"%s\"", (scroll->otyp == T_SHIRT) + ? tshirt_text(scroll, buf) + : apron_text(scroll, buf)); + return 1; + } else if (scroll->otyp == CREDIT_CARD) { + static const char *card_msgs[] = { + "Leprechaun Gold Tru$t - Shamrock Card", + "Magic Memory Vault Charge Card", + "Larn National Bank", /* Larn */ + "First Bank of Omega", /* Omega */ + "Bank of Zork - Frobozz Magic Card", /* Zork */ + "Ankh-Morpork Merchant's Guild Barter Card", + "Ankh-Morpork Thieves' Guild Unlimited Transaction Card", + "Ransmannsby Moneylenders Association", + "Bank of Gehennom - 99% Interest Card", + "Yendorian Express - Copper Card", + "Yendorian Express - Silver Card", + "Yendorian Express - Gold Card", + "Yendorian Express - Mithril Card", + "Yendorian Express - Platinum Card", /* must be last */ + }; + if (Blind) { + You("feel the embossed numbers:"); + } else { + if(flags.verbose) + pline("It reads:"); + pline("\"%s\"", scroll->oartifact ? card_msgs[SIZE(card_msgs)-1] + : card_msgs[scroll->o_id % (SIZE(card_msgs)-1)]); + } + /* Make a credit card number */ + pline("\"%d0%d %d%d1 0%d%d0\"", ((scroll->o_id % 89)+10), (scroll->o_id % 4), + (((scroll->o_id * 499) % 899999) + 100000), (scroll->o_id % 10), + (!(scroll->o_id % 3)), ((scroll->o_id * 7) % 10)); + u.uconduct.literate++; + return 1; + } else if (scroll->otyp == CAN_OF_GREASE) { + pline("This %s has no label.", singular(scroll, xname)); + return 0; + } else if (scroll->otyp == MAGIC_MARKER) { + if (Blind) { + You_cant("feel any Braille writing."); + return 0; + } + if (flags.verbose) + pline("It reads:"); + pline("\"Magic Marker(TM) Red Ink Marker Pen. Water Soluble.\""); + u.uconduct.literate++; + return 1; + } else if (scroll->oclass == COIN_CLASS) { + if (Blind) + You("feel the embossed words:"); + else if (flags.verbose) + You("read:"); + pline("\"1 Zorkmid. 857 GUE. In Frobs We Trust.\""); + u.uconduct.literate++; + return 1; + } else if (scroll->oartifact == ART_ORB_OF_FATE) { + if (Blind) + You("feel the engraved signature:"); + else pline("It is signed:"); + pline("\"Odin.\""); + u.uconduct.literate++; + return 1; + } else if (scroll->otyp == CANDY_BAR) { + static const char *wrapper_msgs[] = { + "Apollo", /* Lost */ + "Moon Crunchy", /* South Park */ + "Snacky Cake", + "Chocolate Nuggie", + "The Small Bar", + "Crispy Yum Yum", + "Nilla Crunchie", + "Berry Bar", + "Choco Nummer", + "Om-nom", /* Cat Macro */ + "Fruity Oaty", /* Serenity */ + "Wonka" /* Charlie and the Chocolate Factory */ + }; + if (Blind) { + You_cant("feel any Braille writing."); + return 0; + } + pline("The wrapper reads: \"%s\"", wrapper_msgs[scroll->o_id % SIZE(wrapper_msgs)]); + u.uconduct.literate++; return 1; } else if (scroll->oclass != SCROLL_CLASS && scroll->oclass != SPBOOK_CLASS) { From c5ea07356918d59dd5627f3a3ef4e199df40f433 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 22:11:41 +0200 Subject: [PATCH 21/73] Update fixes35.0 with reading items --- doc/fixes35.0 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 6c43632a4..1e4bdbe16 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1096,6 +1096,7 @@ pressing @ when cursor positioning moves cursor on top of hero pressing # when cursor positioning toggles automatic description of features under the cursor cursor positioning ignores uninteresting dungeon features +allow reading many more items Platform- and/or Interface-Specific New Features From 5c876419854eac8f219a888b9bcf66e57a2ede77 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 22:13:35 +0200 Subject: [PATCH 22/73] Update fixes35.0 with t-shirt text disclose --- doc/fixes35.0 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 1e4bdbe16..6b59f340f 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -885,6 +885,7 @@ after object loss through polyshudder don't get left hiding under nothing if you're polymorphed into a hider show object symbols in menu headings in menus where those object symbols act as menu accelerators, toggleable via "menu_objsyms" option +show t-shirt text at end of game inventory disclose Platform- and/or Interface-Specific Fixes From 5bb4a02ffe0502a4e5f850f51457c6c281400172 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 23:29:30 +0200 Subject: [PATCH 23/73] Remember position of monster you hit with polearm If you hit a monster with a polearm, following polearm applications will try to automatically suggest the monster's position --- doc/fixes35.0 | 1 + include/context.h | 6 ++++++ include/patchlevel.h | 2 +- src/apply.c | 12 ++++++++++-- src/do.c | 1 + src/mon.c | 2 ++ src/restore.c | 4 ++++ src/save.c | 7 ++++++- 8 files changed, 31 insertions(+), 4 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 6b59f340f..601be2ee0 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -886,6 +886,7 @@ after object loss through polyshudder don't get left hiding under nothing show object symbols in menu headings in menus where those object symbols act as menu accelerators, toggleable via "menu_objsyms" option show t-shirt text at end of game inventory disclose +hitting with a polearm remembers the position of the last monster you hit Platform- and/or Interface-Specific Fixes diff --git a/include/context.h b/include/context.h index ebfe1ada7..7a73344af 100644 --- a/include/context.h +++ b/include/context.h @@ -73,6 +73,11 @@ struct warntype_info { short speciesidx; /* index of above in mons[] (for save/restore) */ }; +struct polearm_info { + struct monst *hitmon; /* the monster we tried to hit last */ + unsigned m_id; /* monster id of hitmon, in save file */ +}; + struct context_info { unsigned ident; /* social security number for each monster */ unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */ @@ -103,6 +108,7 @@ struct context_info { struct book_info spbook; struct takeoff_info takeoff; struct warntype_info warntype; + struct polearm_info polearm; }; extern NEARDATA struct context_info context; diff --git a/include/patchlevel.h b/include/patchlevel.h index eab90e89f..1b0ebf241 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -14,7 +14,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 58 +#define EDITLEVEL 59 #define COPYRIGHT_BANNER_A \ "NetHack, Copyright 1985-2015" diff --git a/src/apply.c b/src/apply.c index fd3193fb3..185ca80ad 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2539,6 +2539,7 @@ use_pole(obj) int res = 0, typ, max_range, min_range, glyph; coord cc; struct monst *mtmp; + struct monst *hitm = context.polearm.hitmon; /* Are you allowed to use the pole? */ if (u.uswallow) { @@ -2553,8 +2554,13 @@ use_pole(obj) /* Prompt for a location */ pline(where_to_hit); - cc.x = u.ux; - cc.y = u.uy; + if (hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)) { + cc.x = hitm->mx; + cc.y = hitm->my; + } else { + cc.x = u.ux; + cc.y = u.uy; + } if (getpos(&cc, TRUE, "the spot to hit") < 0) return res; /* ESC; uses turn iff polearm became wielded */ @@ -2596,11 +2602,13 @@ use_pole(obj) return res; } + context.polearm.hitmon = NULL; /* Attack the monster there */ bhitpos = cc; if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != (struct monst *)0) { if (attack_checks(mtmp, uwep)) return res; if (overexertion()) return 1; /* burn nutrition; maybe pass out */ + context.polearm.hitmon = mtmp; check_caitiff(mtmp); notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my); (void) thitmonst(mtmp, uwep); diff --git a/src/do.c b/src/do.c index b387752d6..c690ad4fa 100644 --- a/src/do.c +++ b/src/do.c @@ -1402,6 +1402,7 @@ boolean at_stairs, falling, portal; /* assume this will always return TRUE when changing level */ (void) in_out_region(u.ux, u.uy); (void) pickup(1); + context.polearm.hitmon = NULL; } STATIC_OVL void diff --git a/src/mon.c b/src/mon.c index d9bc63d6d..607845e7a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1237,6 +1237,8 @@ dmonsfree() for (mtmp = &fmon; *mtmp;) { freetmp = *mtmp; if (freetmp->mhp <= 0 && !freetmp->isgd) { + if (freetmp == context.polearm.hitmon) + context.polearm.hitmon = NULL; *mtmp = freetmp->nmon; dealloc_monst(freetmp); count++; diff --git a/src/restore.c b/src/restore.c index 4e4502b53..be1126be8 100644 --- a/src/restore.c +++ b/src/restore.c @@ -446,6 +446,10 @@ boolean ghostly; if (mtmp->isshk) restshk(mtmp, ghostly); if (mtmp->ispriest) restpriest(mtmp, ghostly); + if (!ghostly) { + if (mtmp->m_id == context.polearm.m_id) + context.polearm.hitmon = mtmp; + } mtmp2 = mtmp; } if(first && mtmp2->nmon){ diff --git a/src/save.c b/src/save.c index f94b1857c..4a4363e9e 100644 --- a/src/save.c +++ b/src/save.c @@ -1124,8 +1124,13 @@ register struct monst *mtmp; } if (mtmp->minvent) saveobjchn(fd,mtmp->minvent,mode); - if (release_data(mode)) + if (release_data(mode)) { + if (mtmp == context.polearm.hitmon) { + context.polearm.m_id = mtmp->m_id; + context.polearm.hitmon = NULL; + } dealloc_monst(mtmp); + } mtmp = mtmp2; } if (perform_bwrite(mode)) From 13645dcd2a2efa96403898fbeb361f296e55b271 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 00:32:54 +0200 Subject: [PATCH 24/73] Automatically find monster to target with polearm If there's only one suitable monster within range, automatically suggest it for targeting with the polearm --- src/apply.c | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/src/apply.c b/src/apply.c index 185ca80ad..4d6899710 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2531,6 +2531,28 @@ static const char cant_see_spot[] = "won't hit anything if you can't see that spot.", cant_reach[] = "can't reach that spot from here."; +/* find pos of monster in range, if only one monster */ +boolean +find_poleable_mon(pos, min_range, max_range) +coord *pos; +int min_range, max_range; +{ + struct monst *mtmp; + struct monst *selmon = NULL; + for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) + if (mtmp && !DEADMONSTER(mtmp) && !mtmp->mtame && + cansee(mtmp->mx, mtmp->my) && + distu(mtmp->mx, mtmp->my) <= max_range && + distu(mtmp->mx, mtmp->my) >= min_range) { + if (selmon) return FALSE; + selmon = mtmp; + } + if (!selmon) return FALSE; + pos->x = selmon->mx; + pos->y = selmon->my; + return TRUE; +} + /* Distance attacks by pole-weapons */ STATIC_OVL int use_pole(obj) @@ -2552,20 +2574,7 @@ use_pole(obj) } /* assert(obj == uwep); */ - /* Prompt for a location */ - pline(where_to_hit); - if (hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)) { - cc.x = hitm->mx; - cc.y = hitm->my; - } else { - cc.x = u.ux; - cc.y = u.uy; - } - if (getpos(&cc, TRUE, "the spot to hit") < 0) - return res; /* ESC; uses turn iff polearm became wielded */ - - glyph = glyph_at(cc.x, cc.y); - /* + /* * Calculate allowable range (pole's reach is always 2 steps): * unskilled and basic: orthogonal direction, 4..4; * skilled: as basic, plus knight's jump position, 4..5; @@ -2585,6 +2594,20 @@ use_pole(obj) if (typ == P_NONE || P_SKILL(typ) <= P_BASIC) max_range = 4; else if (P_SKILL(typ) == P_SKILLED) max_range = 5; else max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */ + + /* Prompt for a location */ + pline(where_to_hit); + if (hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)) { + cc.x = hitm->mx; + cc.y = hitm->my; + } else if (!find_poleable_mon(&cc, min_range, max_range)) { + cc.x = u.ux; + cc.y = u.uy; + } + if (getpos(&cc, TRUE, "the spot to hit") < 0) + return res; /* ESC; uses turn iff polearm became wielded */ + + glyph = glyph_at(cc.x, cc.y); if (distu(cc.x, cc.y) > max_range) { pline("Too far!"); return (res); From 76ee82b7d3061e60a8c121024bcc2b5fcc4c6517 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 27 Mar 2015 19:47:17 -0400 Subject: [PATCH 25/73] more doc updates Changes to be committed: modified: dat/history modified: doc/Guidebook.mn modified: doc/Guidebook.tex --- dat/history | 73 ++++++++++----------- doc/Guidebook.mn | 143 ++++++++++++++++++++++++++++++----------- doc/Guidebook.tex | 160 +++++++++++++++++++++++++++++++++++----------- 3 files changed, 265 insertions(+), 111 deletions(-) diff --git a/dat/history b/dat/history index 0a4a8471f..060982446 100644 --- a/dat/history +++ b/dat/history @@ -128,20 +128,20 @@ just before the release of NetHack 3.4.0 in March 2002. As with version 3.3, various people contributed to the game as a whole as well as supporting ports on the different platforms that NetHack runs on: -Pat Rankin maintained 3.5 for VMS. +Pat Rankin maintained 3.4 for VMS. -Michael Allison maintained NetHack 3.5 for the MS-DOS platform. +Michael Allison maintained NetHack 3.4 for the MS-DOS platform. Paul Winner and Yitzhak Sapir provided encouragement. Dean Luick, Mark Modrall, and Kevin Hugo maintained and enhanced the Macintosh port of 3.4. Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, and Yitzhak Sapir -maintained and enhanced 3.5 for the Microsoft Windows platform. Alex Kompel +maintained and enhanced 3.4 for the Microsoft Windows platform. Alex Kompel contributed a new graphical interface for the Windows port. Alex Kompel also contributed a Windows CE port for 3.4.1. -Ron Van Iwaarden maintained 3.5 for OS/2. +Ron Van Iwaarden maintained 3.4 for OS/2. Janne Salmijarvi and Teemu Suikki maintained and enhanced the Amiga port of 3.5 after Janne Salmijarvi resurrected it for 3.3.1. @@ -174,7 +174,6 @@ At the beginning of development for what would eventually get released as 3.6.0, the development team consisted of Michael Allison, Warwick Allison, Ken Arromdee, David Cohrs, Jessie Collet, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and Paul Winner. - Leading up to the release of 3.6.0 in early 2015, new members Sean Hunt, Pasi Kallinen, and Derek S. Ray joined the NetHack development team. @@ -211,7 +210,8 @@ people primarily responsible for the public NetHack servers available for playing the game at nethack.alt.org and devnull.net. In addition to providing a way for the public to play a game of NetHack from almost anywhere, they have hosted annual NetHack tournaments for many, many years. - On behalf of the NetHack community, thank you very much to + +On behalf of the NetHack community, thank you very much to M. Drew Streib, Pasi Kallinen and Robin Bandy. - - - - - - - - - - @@ -221,11 +221,11 @@ particularly intriguing modification to help out with the game. The Gods of the Dungeon sometimes make note of the names of the worst of these miscreants in this, the list of Dungeoneers: - Adam Aronow Izchak Miller Mike Stephenson - Alex Kompel J. Ali Harlow Norm Meluch - Andreas Dorn Janet Walz Olaf Seibert - Andy Church Janne Salmijarvi Pasi Kallinen - Andy Swanson Jean-Christophe Collet Pat Rankin + Adam Aronow J. Ali Harlow Mike Stephenson + Alex Kompel Janet Walz Norm Meluch + Andreas Dorn Janne Salmijarvi Olaf Seibert + Andy Church Jean-Christophe Collet Pasi Kallinen + Andy Swanson Jeff Bailey Pat Rankin Ari Huttunen Jochen Erwied Paul Winner Barton House John Kallen Pierre Martineau Benson I. Margulies John Rupley Ralf Brown @@ -234,29 +234,30 @@ in this, the list of Dungeoneers: Bruce Cox Jon W{tte Richard Beigel Bruce Holloway Jonathan Handler Richard P. Hughey Bruce Mewborne Joshua Delahunty Rob Menke - Carl Schelin Keizo Yamamoto Robin Johnson - Chris Russo Ken Arnold Roderick Schertler - David Cohrs Ken Arromdee Roland McGrath - David Damerell Ken Lorber Ron Van Iwaarden - David Gentzel Ken Washikita Ronnen Miller - David Hairston Kevin Darcy Ross Brown - Dean Luick Kevin Hugo Sascha Wostmann - Del Lamb Kevin Sitze Scott Bigham - Derek S. Ray Kevin Smolkowski Scott R. Turner - Deron Meranda Kevin Sweet Sean Hunt - Dion Nicolaas Lars Huttar Stephen Spackman - Dylan O'Donnell Leon Arnott Stephen White - Eric Backus Malcolm Ryan Steve Creps - Eric Hendrickson Mark Gooderum Steve Linhart - Eric R. Smith Mark Modrall Steve VanDevender - Eric S. Raymond Marvin Bressler Teemu Suikki - Erik Andersen Matthew Day Tim Lennan - Frederick Roeber Merlyn LeRoy Timo Hakulinen - Gil Neiger Michael Allison Tom Almy - Greg Laskin Michael Feir Tom West - Greg Olson Michael Hamel Warren Cheung - Gregg Wonderly Michael Sokolov Warwick Allison - Hao-yang Wang Mike Engber Yitzhak Sapir - Helge Hafting Mike Gallop - Irina Rempt-Drijfhout Mike Passaretti + Carl Schelin Keizo Yamamoto Robin Bandy + Chris Russo Ken Arnold Robin Johnson + David Cohrs Ken Arromdee Roderick Schertler + David Damerell Ken Lorber Roland McGrath + David Gentzel Ken Washikita Ron Van Iwaarden + David Hairston Kevin Darcy Ronnen Miller + Dean Luick Kevin Hugo Ross Brown + Del Lamb Kevin Sitze Sascha Wostmann + Derek S. Ray Kevin Smolkowski Scott Bigham + Deron Meranda Kevin Sweet Scott R. Turner + Dion Nicolaas Lars Huttar Sean Hunt + Dylan O'Donnell Leon Arnott Stephen Spackman + Eric Backus M. Drew Streib Stephen White + Eric Hendrickson Malcolm Ryan Steve Creps + Eric R. Smith Mark Gooderum Steve Linhart + Eric S. Raymond Mark Modrall Steve VanDevender + Erik Andersen Marvin Bressler Teemu Suikki + Frederick Roeber Matthew Day Tim Lennan + Gil Neiger Merlyn LeRoy Timo Hakulinen + Greg Laskin Michael Allison Tom Almy + Greg Olson Michael Feir Tom West + Gregg Wonderly Michael Hamel Warren Cheung + Hao-yang Wang Michael Sokolov Warwick Allison + Helge Hafting Mike Engber Yitzhak Sapir + Irina Rempt-Drijfhout Mike Gallop + Izchak Miller Mike Passaretti diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 4a0243fea..e5faa97d2 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,12 +1,12 @@ -.\" $NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ -.\" $Revision: 1.130 $ $Date: 2012/05/02 00:38:30 $ +.\" $NHDT-Branch: master $:$NHDT-Revision: 1.140 $ $NHDT-Date: 1427500010 2015/03/27 23:46:50 $ +.\" $Revision: 1.130 $ $Date: 2015/03/27 00:38:30 $ .ds h0 "NetHack Guidebook .ds h1 .ds h2 % .ds vr "NetHack 3.6 .ds f0 "\*(vr .ds f1 -.ds f2 "March 16, 2015 +.ds f2 "March 27, 2015 .\" labeled paragraph start (should be part of tmac.n, but I don't want to .\" make changes to that file) .\" .PS word @@ -3156,7 +3156,7 @@ available web-site listing all the bugs that had been discovered. Despite that constantly growing bug list, 3.3 proved stable enough to last for more than a year and a half. .pg -The 3.5 development team initially consisted of +The 3.4 development team initially consisted of \fBMichael Allison\fP, \fBKen Arromdee\fP, \fBDavid Cohrs\fP, \fBJessie Collet\fP, \fBKevin Hugo\fP, \fBKen Lorber\fP, \fBDean Luick\fP, \fBPat Rankin\fP, \fBMike Stephenson\fP, @@ -3166,16 +3166,16 @@ just before the release of NetHack 3.4.0 in March 2002. As with version 3.3, various people contributed to the game as a whole as well as supporting ports on the different platforms that NetHack runs on: .pg -\fBPat Rankin\fP maintained 3.5 for VMS. +\fBPat Rankin\fP maintained 3.4 for VMS. .pg -\fBMichael Allison\fP maintained NetHack 3.5 for the MS-DOS platform. \fBPaul Winner\fP +\fBMichael Allison\fP maintained NetHack 3.4 for the MS-DOS platform. \fBPaul Winner\fP and \fBYitzhak Sapir\fP provided encouragement. .pg \fBDean Luick\fP, \fBMark Modrall\fP, and \fBKevin Hugo\fP maintained and enhanced the Macintosh port of 3.4. .pg \fBMichael Allison\fP, \fBDavid Cohrs\fP, \fBAlex Kompel\fP, \fBDion Nicolaas\fP, and -\fBYitzhak Sapir\fP maintained and enhanced 3.5 for the Microsoft Windows platform. +\fBYitzhak Sapir\fP maintained and enhanced 3.4 for the Microsoft Windows platform. \fBAlex Kompel\fP contributed a new graphical interface for the Windows port. \fBAlex Kompel\fP also contributed a Windows CE port for 3.4.1. .pg @@ -3185,13 +3185,77 @@ early 2006. A great many thanks to Ron for keeping NetHack alive on OS/2 all these years. .pg \fBJanne Salmijarvi\fP and \fBTeemu Suikki\fP maintained and -enhanced the Amiga port of 3.5 after \fBJanne Salmijarvi\fP resurrected +enhanced the Amiga port of 3.4 after \fBJanne Salmijarvi\fP resurrected it for 3.3.1. .pg -\fBChristian ``Marvin'' Bressler\fP maintained 3.5 for the Atari after he +\fBChristian ``Marvin'' Bressler\fP maintained 3.4 for the Atari after he resurrected it for 3.3.1. .pg +The release of NetHack 3.4.3 in December 2003 marked the beginning of a +long release hiatus. 3.4.3 proved to be a remarkably stable version that +provided continued enjoyment by the community for more than a decade. The +devteam slowly and quietly continued to work on the game behind the scenes +during the tenure of 3.4.3. It was during that same period that several new +variants emerged within the NetHack community. Notably sporkhack by +\fBDerek S. Ray\fP, unnethack by \fBPatric Mueller\fP, nitrohack and its +successors originally by \fBDaniel Thaler\fP and then by \fBAlex Smith\fP, +and Dynahack by \fBTung Nguyen\fP. Some of those variants continue to be +developed, maintained, and enjoyed by the community to this day. +.pg +In September 2014, an interim snapshot of the code under development was +released publicly by other parties. Since that code was a work-in-progress +and had not gone through a period of debugging, it was decided that the +version numbers present on that code snapshot would be retired and never +used in an official NetHack release. An announcement was posted on the +devteam's official nethack.org website to that effect, stating that there +would never be a 3.4.4, 3.5, or 3.5.0 official release version. +.pg +In January 2015, preparation began for the release of NetHack 3.6 +.pg +At the beginning of development for what would eventually get released +as 3.6.0, the development team consisted of \fBWarwick Allison\fP, +\fBMichael Allison\fP, \fBKen Arromdee\fP, +\fBDavid Cohrs\fP, \fBJessie Collet\fP, +\fBKen Lorber\fP, \fBDean Luick\fP, \fBPat Rankin\fP, +\fBMike Stephenson\fP, \fBJanet Walz\fP, and \fBPaul Winner\fP. +Leading up to the release of 3.6.0 in early 2015, new members +\fBSean Hunt\fP, \fBPasi Kallinen\fP, and \fBDerek S. Ray\fP +joined the NetHack development team, +.pg +\fB3.6.0 TODO insert apprpriate description of 3.6.0 here +.pg +\fBThe development team, as well as \fBSteve VanDevender\fP and +\fBKevin Smolkowski\fP ensured that NetHack 3.6.0 continued to operate on +various Unix flavors as well as maintaining the X11 interface. +.pg +\fB\fBKen Lorber\fP, \fBHaoyang Wang\fP, \fBPat Rankin\fP, and \fBDean Luick\fP +maintained the port of NetHack 3.6.0 for Mac. +.pg +\fB\fBMichael Allison\fP, \fBDerek S. Ray\fP, \fBYitzhak Sapir\fP, +\fBAlex Kompel\fP, and \fBDavid Cohrs\fP maintained the port of +NetHack 3.6.0 for Microsoft Windows. +.pg +\fB\fBJeff Bailey\fP created and maintained a port of NetHack 3.6.0 for Chrome. +.pg +\fBTODO\fBAlex Kompel\fP maintained a port of NetHack 3.6.0 to Windows Phone. +.pg +\fBThis version of the game is special in a particular way. Near the end of +the development of 3.6, one of the significant inspirations for many of the +humorous and fun features found in the game, author \fBTerry Pratchett\fP, +passed away. This version of the game is dedicated to him. +.pg The official NetHack web site is maintained by \fBKen Lorber\fP at http://www.nethack.org/. +.pg +SHOUT-OUTS +.pg +The devteam would like to give a special "shout-out" to thank the generous +people primarily responsible for the public NetHack servers available for +playing the game at nethack.alt.org and devnull.net. In addition to providing +a way for the public to play a game of NetHack from almost anywhere, they +have hosted annual NetHack tournaments for many, many years. +.pg +On behalf of the NetHack community, thank you very much to +\fBM. Drew Streib\fP, \fBPasi Kallinen\fP and \fBRobin Bandy\fP. .pg - - - - - - - - - - .pg @@ -3204,11 +3268,11 @@ in this, the list of Dungeoneers: center; c c c. .\"TABLE_START -Adam Aronow Izchak Miller Mike Stephenson -Alex Kompel J. Ali Harlow Norm Meluch -Andreas Dorn Janet Walz Olaf Seibert -Andy Church Janne Salmijarvi Pasi Kallinen -Andy Swanson Jean-Christophe Collet Pat Rankin +Adam Aronow J. Ali Harlow Mike Stephenson +Alex Kompel Janet Walz Norm Meluch +Andreas Dorn Janne Salmijarvi Olaf Seibert +Andy Church Jean-Christophe Collet Pasi Kallinen +Andy Swanson Jeff Bailey Pat Rankin Ari Huttunen Jochen Erwied Paul Winner Barton House John Kallen Pierre Martineau Benson I. Margulies John Rupley Ralf Brown @@ -3217,31 +3281,32 @@ Boudewijn Waijers Johnny Lee Richard Addison Bruce Cox Jon W{tte Richard Beigel Bruce Holloway Jonathan Handler Richard P. Hughey Bruce Mewborne Joshua Delahunty Rob Menke -Carl Schelin Keizo Yamamoto Robin Johnson -Chris Russo Ken Arnold Roderick Schertler -David Cohrs Ken Arromdee Roland McGrath -David Damerell Ken Lorber Ron Van Iwaarden -David Gentzel Ken Washikita Ronnen Miller -David Hairston Kevin Darcy Ross Brown -Dean Luick Kevin Hugo Sascha Wostmann -Del Lamb Kevin Sitze Scott Bigham -Derek S. Ray Kevin Smolkowski Scott R. Turner -Deron Meranda Kevin Sweet Sean Hunt -Dion Nicolaas Lars Huttar Stephen Spackman -Dylan O'Donnell Leon Arnott Stephen White -Eric Backus Malcolm Ryan Steve Creps -Eric Hendrickson Mark Gooderum Steve Linhart -Eric R. Smith Mark Modrall Steve VanDevender -Eric S. Raymond Marvin Bressler Teemu Suikki -Erik Andersen Matthew Day Tim Lennan -Frederick Roeber Merlyn LeRoy Timo Hakulinen -Gil Neiger Michael Allison Tom Almy -Greg Laskin Michael Feir Tom West -Greg Olson Michael Hamel Warren Cheung -Gregg Wonderly Michael Sokolov Warwick Allison -Hao-yang Wang Mike Engber Yitzhak Sapir -Helge Hafting Mike Gallop -Irina Rempt-Drijfhout Mike Passaretti +Carl Schelin Keizo Yamamoto Robin Bandy +Chris Russo Ken Arnold Robin Johnson +David Cohrs Ken Arromdee Roderick Schertler +David Damerell Ken Lorber Roland McGrath +David Gentzel Ken Washikita Ron Van Iwaarden +David Hairston Kevin Darcy Ronnen Miller +Dean Luick Kevin Hugo Ross Brown +Del Lamb Kevin Sitze Sascha Wostmann +Derek S. Ray Kevin Smolkowski Scott Bigham +Deron Meranda Kevin Sweet Scott R. Turner +Dion Nicolaas Lars Huttar Sean Hunt +Dylan O'Donnell Leon Arnott Stephen Spackman +Eric Backus M. Drew Streib Stephen White +Eric Hendrickson Malcolm Ryan Steve Creps +Eric R. Smith Mark Gooderum Steve Linhart +Eric S. Raymond Mark Modrall Steve VanDevender +Erik Andersen Marvin Bressler Teemu Suikki +Frederick Roeber Matthew Day Tim Lennan +Gil Neiger Merlyn LeRoy Timo Hakulinen +Greg Laskin Michael Allison Tom Almy +Greg Olson Michael Feir Tom West +Gregg Wonderly Michael Hamel Warren Cheung +Hao-yang Wang Michael Sokolov Warwick Allison +Helge Hafting Mike Engber Yitzhak Sapir +Irina Rempt-Drijfhout Mike Gallop +Izchak Miller Mike Passaretti .\"TABLE_END Do not delete this line. .TE diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index d7b295519..0310aaeb1 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -33,7 +33,7 @@ \begin{document} % % input file: guidebook.mn -% $Revision: 1.122 $ $Date: 2015/03/16 06:00:00 $ +% $Revision: 1.122 $ $Date: 2015/03/27 06:00:00 $ % %.ds h0 " %.ds h1 %.ds h2 \% @@ -46,7 +46,7 @@ %.au \author{Eric S. Raymond\\ (Edited and expanded for 3.6)} -\date{March 16, 2015} +\date{March 27, 2015} \maketitle @@ -3787,7 +3787,7 @@ more than a year and a half. %.pg \medskip -The 3.5 development team initially consisted of +The 3.4 development team initially consisted of {\it Michael Allison}, {\it Ken Arromdee}, {\it David Cohrs}, {\it Jessie Collet}, {\it Kevin Hugo}, {\it Ken Lorber}, {\it Dean Luick}, {\it Pat Rankin}, {\it Mike Stephenson}, @@ -3802,11 +3802,11 @@ runs on: %.pg \medskip -\nd{\it Pat Rankin} maintained 3.5 for VMS. +\nd{\it Pat Rankin} maintained 3.4 for VMS. %.pg \medskip -\nd {\it Michael Allison} maintained NetHack 3.5 for the MS-DOS platform. +\nd {\it Michael Allison} maintained NetHack 3.4 for the MS-DOS platform. {\it Paul Winner} and {\it Yitzhak Sapir} provided encouragement. %.pg @@ -3836,9 +3836,82 @@ it for 3.3.1. %.pg \medskip -\nd {\it Christian ``Marvin'' Bressler} maintained 3.5 for the Atari after he +\nd {\it Christian ``Marvin'' Bressler} maintained 3.4 for the Atari after he resurrected it for 3.3.1. +%.pg +\medskip +The release of NetHack 3.4.3 in December 2003 marked the beginning of a +long release hiatus. 3.4.3 proved to be a remarkably stable version that +provided continued enjoyment by the community for more than a decade. The +devteam slowly and quietly continued to work on the game behind the scenes +during the tenure of 3.4.3. It was during that same period that several new +variants emerged within the NetHack community. Notably sporkhack by +Derek S. Ray, unnethack by Patric Mueller, nitrohack and its successors +originally by Daniel Thaler and then by Alex Smith, and +Dynahack by Tung Nguyen. Some of those variants continue to be developed, +maintained, and enjoyed by the community to this day. + +%.pg +\medskip +In September 2014, an interim snapshot of the code under development was +released publicly by other parties. Since that code was a work-in-progress +and had not gone through a period of debugging, it was decided that the +version numbers present on that code snapshot would be retired and never +used in an official NetHack release. An announcement was posted on the +devteam's official nethack.org website to that effect, stating that there +would never be a 3.4.4, 3.5, or 3.5.0 official release version. + +%.pg +\medskip +In January 2015, preparation began for the release of NetHack 3.6 + +%.pg +\medskip +At the beginning of development for what would eventually get released +as 3.6.0, the development team consisted of {\it Warwick Allison}, +{\it Michael Allison}, {\it Ken Arromdee}, +{\it David Cohrs}, {\it Jessie Collet}, +{\it Ken Lorber}, {\it Dean Luick}, {\it Pat Rankin}, +{\it Mike Stephenson}, {\it Janet Walz}, and {\it Paul Winner}. +Leading up to the release of 3.6.0 in early 2015, new members +{\it Sean Hunt}, {\it Pasi Kallinen}, and {\it Derek S. Ray} +joined the NetHack development team, + +%.pg +\medskip +3.6.0 TODO insert apprpriate description of 3.6.0 here + +%.pg +\medskip +The development team, as well as {\it Steve VanDevender} and +{\it Kevin Smolkowski} ensured that NetHack 3.6.0 continued to operate on +various Unix flavors as well as maintaining the X11 interface. + +{\it Ken Lorber}, {\it Haoyang Wang}, {\it Pat Rankin}, and {\it Dean Luick} +maintained the port of NetHack 3.6.0 for Mac. + +%.pg +\medskip +{\it Michael Allison}, {\it Derek S. Ray}, {\it Yitzhak Sapir}, +{\it Alex Kompel}, and {\it David Cohrs} maintained the port of +NetHack 3.6.0 for Microsoft Windows. + +%.pg +\medskip +{\it Jeff Bailey} created and maintained a port of NetHack 3.6.0 for Chrome. + +%.pg +\medskip +{\it Alex Kompel} maintained a port of NetHack 3.6.0 to Windows Phone. ? + +%.pg +\medskip +This version of the game is special in a particular way. Near the end of +the development of 3.6, one of the significant inspirations for many of the +humorous and fun features found in the game, author {\it Terry Pratchett}, +passed away. This version of the game is dedicated to him. + %.pg \medskip \nd The official NetHack web site is maintained by {\it Ken Lorber} at @@ -3848,6 +3921,20 @@ http:{\tt /}{\tt /}www.nethack.org{\tt /}. {\catcode`\#=11 \special{html:}} +%.pg +%.hn 2 +\subsection*{Shout Outs} +\nd The devteam would like to give a special "shout-out" to thank the generous +people primarily responsible for the public NetHack servers available for +playing the game at nethack.alt.org and devnull.net. In addition to providing +a way for the public to play a game of NetHack from almost anywhere, they +have hosted annual NetHack tournaments for many, many years. +%pg +\medskip +\nd On behalf of the NetHack community, thank you very much to +{\it M. Drew Streib}, {\it Pasi Kallinen} and {\it Robin Bandy}. + +.pg %.hn 3 \subsection*{Dungeoneers} \bigskip @@ -3860,11 +3947,11 @@ in this, the list of Dungeoneers: \begin{center} \begin{tabular}{lll} %TABLE_START -Adam Aronow & Izchak Miller & Mike Stephenson\\ -Alex Kompel & J. Ali Harlow & Norm Meluch\\ -Andreas Dorn & Janet Walz & Olaf Seibert\\ -Andy Church & Janne Salmij\"{a}rvi & Pasi Kallinen\\ -Andy Swanson & Jean-Christophe Collet & Pat Rankin\\ +Adam Aronow & J. Ali Harlow & Mike Stephenson\\ +Alex Kompel & Janet Walz & Norm Meluch\\ +Andreas Dorn & Janne Salmij\"{a}rvi & Olaf Seibert\\ +Andy Church & Jean-Christophe Collet & Pasi Kallinen\\ +Andy Swanson & Jeff Bailey & Pat Rankin\\ Ari Huttunen & Jochen Erwied & Paul Winner\\ Barton House & John Kallen & Pierre Martineau\\ Benson I. Margulies & John Rupley & Ralf Brown\\ @@ -3873,31 +3960,32 @@ Boudewijn Waijers & Johnny Lee & Richard Addison\\ Bruce Cox & Jon W\{tte & Richard Beigel\\ Bruce Holloway & Jonathan Handler & Richard P. Hughey\\ Bruce Mewborne & Joshua Delahunty & Rob Menke\\ -Carl Schelin & Keizo Yamamoto & Robin Johnson\\ -Chris Russo & Ken Arnold & Roderick Schertler\\ -David Cohrs & Ken Arromdee & Roland McGrath\\ -David Damerell & Ken Lorber & Ron Van Iwaarden\\ -David Gentzel & Ken Washikita & Ronnen Miller\\ -David Hairston & Kevin Darcy & Ross Brown\\ -Dean Luick & Kevin Hugo & Sascha Wostmann\\ -Del Lamb & Kevin Sitze & Scott Bigham\\ -Derek S. Ray & Kevin Smolkowski & Scott R. Turner\\ -Deron Meranda & Kevin Sweet & Sean Hunt\\ -Dion Nicolaas & Lars Huttar & Stephen Spackman\\ -Dylan O'Donnell & Leon Arnott & Stephen White\\ -Eric Backus & Malcolm Ryan & Steve Creps\\ -Eric Hendrickson & Mark Gooderum & Steve Linhart\\ -Eric R. Smith & Mark Modrall & Steve VanDevender\\ -Eric S. Raymond & Marvin Bressler & Teemu Suikki\\ -Erik Andersen & Matthew Day & Tim Lennan\\ -Frederick Roeber & Merlyn LeRoy & Timo Hakulinen\\ -Gil Neiger & Michael Allison & Tom Almy\\ -Greg Laskin & Michael Feir & Tom West\\ -Greg Olson & Michael Hamel & Warren Cheung\\ -Gregg Wonderly & Michael Sokolov & Warwick Allison\\ -Hao-yang Wang & Mike Engber & Yitzhak Sapir\\ -Helge Hafting & Mike Gallop\\ -Irina Rempt-Drijfhout & Mike Passaretti +Carl Schelin & Keizo Yamamoto & Robin Bandy\\ +Chris Russo & Ken Arnold & Robin Johnson\\ +David Cohrs & Ken Arromdee & Roderick Schertler\\ +David Damerell & Ken Lorber & Roland McGrath\\ +David Gentzel & Ken Washikita & Ron Van Iwaarden\\ +David Hairston & Kevin Darcy & Ronnen Miller\\ +Dean Luick & Kevin Hugo & Ross Brown\\ +Del Lamb & Kevin Sitze & Sascha Wostmann\\ +Derek S. Ray & Kevin Smolkowski & Scott Bigham\\ +Deron Meranda & Kevin Sweet & Scott R. Turner\\ +Dion Nicolaas & Lars Huttar & Sean Hunt\\ +Dylan O'Donnell & Leon Arnott & Stephen Spackman\\ +Eric Backus & M. Drew Streib & Stephen White\\ +Eric Hendrickson & Malcolm Ryan & Steve Creps\\ +Eric R. Smith & Mark Gooderum & Steve Linhart\\ +Eric S. Raymond & Mark Modrall & Steve VanDevender\\ +Erik Andersen & Marvin Bressler & Teemu Suikki\\ +Frederick Roeber & Matthew Day & Tim Lennan\\ +Gil Neiger & Merlyn LeRoy & Timo Hakulinen\\ +Greg Laskin & Michael Allison & Tom Almy\\ +Greg Olson & Michael Feir & Tom West\\ +Gregg Wonderly & Michael Hamel & Warren Cheung\\ +Hao-yang Wang & Michael Sokolov & Warwick Allison\\ +Helge Hafting & Mike Engber & Yitzhak Sapir\\ +Irina Rempt-Drijfhout & Mike Gallop\\ +Izchak Miller & Mike Passaretti %TABLE_END Do not delete this line. \end{tabular} \end{center} From 4a3a130795f786a3bb7406edf32c98a8e301bf9e Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 27 Mar 2015 19:56:04 -0400 Subject: [PATCH 26/73] subsitution gone amuck Changes to be committed: modified: doc/Guidebook.mn --- doc/Guidebook.mn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index e5faa97d2..eb340dff5 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,4 +1,4 @@ -.\" $NHDT-Branch: master $:$NHDT-Revision: 1.140 $ $NHDT-Date: 1427500010 2015/03/27 23:46:50 $ +.\" $NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ .\" $Revision: 1.130 $ $Date: 2015/03/27 00:38:30 $ .ds h0 "NetHack Guidebook .ds h1 @@ -3228,16 +3228,16 @@ joined the NetHack development team, \fBKevin Smolkowski\fP ensured that NetHack 3.6.0 continued to operate on various Unix flavors as well as maintaining the X11 interface. .pg -\fB\fBKen Lorber\fP, \fBHaoyang Wang\fP, \fBPat Rankin\fP, and \fBDean Luick\fP +\fBKen Lorber\fP, \fBHaoyang Wang\fP, \fBPat Rankin\fP, and \fBDean Luick\fP maintained the port of NetHack 3.6.0 for Mac. .pg -\fB\fBMichael Allison\fP, \fBDerek S. Ray\fP, \fBYitzhak Sapir\fP, +\fBMichael Allison\fP, \fBDerek S. Ray\fP, \fBYitzhak Sapir\fP, \fBAlex Kompel\fP, and \fBDavid Cohrs\fP maintained the port of NetHack 3.6.0 for Microsoft Windows. .pg -\fB\fBJeff Bailey\fP created and maintained a port of NetHack 3.6.0 for Chrome. +\fBJeff Bailey\fP created and maintained a port of NetHack 3.6.0 for Chrome. .pg -\fBTODO\fBAlex Kompel\fP maintained a port of NetHack 3.6.0 to Windows Phone. +TODO \fBAlex Kompel\fP maintained a port of NetHack 3.6.0 to Windows Phone. .pg \fBThis version of the game is special in a particular way. Near the end of the development of 3.6, one of the significant inspirations for many of the From 45c5a796818fc064473146548a002f3292b73956 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 27 Mar 2015 18:24:53 -0700 Subject: [PATCH 27/73] tty menu hack for ':' Looting a container generates a menu which contains ': - look inside' but the recent change to make ':' be a menu command for selecting items which match a search string made it impossible to pick that item. (Well, I suppose you could enter a search string which matched it, but that's a nuisance compared to just directly picking a choice.) This makes menu selection for tty give precedence to menu choice characters over mapped menu commands when some character happens to be both. I'm not sure whether it ought to be expended to group accelerators too, so didn't do that. There's bound to be a better way to do this, but it works. --- win/tty/wintty.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index f3cc97eb5..afe0e204e 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 wintty.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.71 $ */ +/* NetHack 3.5 wintty.c $NHDT-Date: 1427505884 2015/03/28 01:24:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */ /* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1391,10 +1391,11 @@ struct WinDesc *cw; { tty_menu_item *page_start, *page_end, *curr; long count; - int n, curr_page, page_lines; + int n, curr_page, page_lines, resp_len; boolean finished, counting, reset_count; char *cp, *rp, resp[QBUFSZ], gacc[QBUFSZ], - *msave, *morestr; + *msave, *morestr, really_morc; +#define MENU_EXPLICIT_CHOICE 0x7f /* pseudo menu manipulation char */ curr_page = page_lines = 0; page_start = page_end = 0; @@ -1501,6 +1502,8 @@ struct WinDesc *cw; page_lines = 0; } *rp = 0; + /* remember how many explicit menu choices there are */ + resp_len = (int)strlen(resp); /* corner window - clear extra lines from last page */ if (cw->offx) { @@ -1533,7 +1536,15 @@ struct WinDesc *cw; xwaitforspace(resp); } - morc = map_menu_cmd(morc); + really_morc = morc; /* (only used with MENU_EXPLICIT_CHOICE */ + if ((rp = index(resp, morc)) != 0 && rp < resp + resp_len) + /* explicit menu selection; don't override it if it also + happens to match a mapped menu command (such as ':' to + look inside a container vs ':' to search) */ + morc = MENU_EXPLICIT_CHOICE; + else + morc = map_menu_cmd(morc); + switch (morc) { case '0': /* special case: '0' is also the default ball class */ @@ -1664,6 +1675,9 @@ struct WinDesc *cw; } } break; + case MENU_EXPLICIT_CHOICE: + morc = really_morc; + /*FALLTHRU*/ default: if (cw->how == PICK_NONE || !index(resp, morc)) { /* unacceptable input received */ From 78452809bc28089847ddc0bcc18ab3b42ec88145 Mon Sep 17 00:00:00 2001 From: keni Date: Fri, 27 Mar 2015 21:31:25 -0400 Subject: [PATCH 28/73] regenerate Guidebook.txt --- doc/Guidebook.txt | 4164 +++++++++++++++++++++++++-------------------- 1 file changed, 2313 insertions(+), 1851 deletions(-) diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt index 4318b8a5f..84a5395a6 100644 --- a/doc/Guidebook.txt +++ b/doc/Guidebook.txt @@ -13,25 +13,25 @@ Eric S. Raymond - (Extensively edited and expanded for 3.5) + (Edited and expanded for 3.6) 1. Introduction Recently, you have begun to find yourself unfulfilled and distant - in your daily occupation. Strange dreams of prospecting, steal- + in your daily occupation. Strange dreams of prospecting, steal‐ ing, crusading, and combat have haunted you in your sleep for - many months, but you aren't sure of the reason. You wonder + many months, but you aren’t sure of the reason. You wonder whether you have in fact been having those dreams all your life, and somehow managed to forget about them until now. Some nights - you awaken suddenly and cry out, terrified at the vivid recollec- - tion of the strange and powerful creatures that seem to be lurk- + you awaken suddenly and cry out, terrified at the vivid recollec‐ + tion of the strange and powerful creatures that seem to be lurk‐ ing behind every corner of the dungeon in your dream. Could - these details haunting your dreams be real? As each night pass- + these details haunting your dreams be real? As each night pass‐ es, you feel the desire to enter the mysterious caverns near the ruins grow stronger. Each morning, however, you quickly put the - idea out of your head as you recall the tales of those who en- + idea out of your head as you recall the tales of those who en‐ tered the caverns before you and did not return. Eventually you can resist the yearning to seek out the fantastic place in your dreams no longer. After all, when other adventurers came back @@ -49,14 +49,14 @@ deep within the Mazes of Menace. Upon hearing the legends, you immediately realize that there is some profound and undiscovered reason that you are to descend into the caverns and seek out that - amulet of which they spoke. Even if the rumors of the amulet's + amulet of which they spoke. Even if the rumors of the amulet’s powers are untrue, you decide that you should at least be able to sell the tales of your adventures to the local minstrels for a tidy sum, especially if you encounter any of the terrifying and magical creatures of your dreams along the way. You spend one last night fortifying yourself at the local inn, becoming more and more depressed as you watch the odds of your success being - posted on the inn's walls getting lower and lower. + posted on the inn’s walls getting lower and lower. @@ -74,8 +74,8 @@ off for the dungeon. After several days of uneventful travel, you see the ancient ruins that mark the entrance to the Mazes of Menace. It is late at night, so you make camp at the entrance - and spend the night sleeping under the open skies. In the morn- - ing, you gather your gear, eat what may be your last meal out- + and spend the night sleeping under the open skies. In the morn‐ + ing, you gather your gear, eat what may be your last meal out‐ side, and enter the dungeon... @@ -94,15 +94,15 @@ Barbarians are warriors out of the hinterland, hardened to battle. They begin their quests with naught but uncommon - strength, a trusty hauberk, and a great two-handed sword. + strength, a trusty hauberk, and a great two‐handed sword. Cavemen and Cavewomen start with exceptional strength but, unfortunately, with neolithic weapons. Healers are wise in medicine and apothecary. They know the - herbs and simples that can restore vitality, ease pain, anes- + herbs and simples that can restore vitality, ease pain, anes‐ thetize, and neutralize poisons; and with their instruments, they - can divine a being's state of health or sickness. Their medical + can divine a being’s state of health or sickness. Their medical practice earns them quite reasonable amounts of money, with which they enter the dungeon. @@ -115,7 +115,7 @@ without weapons as with. They wear no armor but make up for it with increased mobility. - Priests and Priestesses are clerics militant, crusaders ad- + Priests and Priestesses are clerics militant, crusaders ad‐ vancing the cause of righteousness with arms, armor, and arts thaumaturgic. Their ability to commune with deities via prayer occasionally extricates them from peril, but can also put them in @@ -126,7 +126,7 @@ as well as tracking and stealthy movement. - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -141,26 +141,26 @@ which they employ to great advantage. Samurai are the elite warriors of feudal Nippon. They are - lightly armored and quick, and wear the dai-sho, two swords of + lightly armored and quick, and wear the dai‐sho, two swords of the deadliest keenness. Tourists start out with lots of gold (suitable for shopping with), a credit card, lots of food, some maps, and an expensive - camera. Most monsters don't like being photographed. + camera. Most monsters don’t like being photographed. Valkyries are hardy warrior women. Their upbringing in the harsh Northlands makes them strong, inures them to extremes of cold, and instills in them stealth and cunning. Wizards start out with a knowledge of magic, a selection of - magical items, and a particular affinity for dweomercraft. Al- - though seemingly weak and easy to overcome at first sight, an ex- + magical items, and a particular affinity for dweomercraft. Al‐ + though seemingly weak and easy to overcome at first sight, an ex‐ perienced Wizard is a deadly foe. You may also choose the race of your character: Dwarves are smaller than humans or elves, but are stocky and - solid individuals. Dwarves' most notable trait is their great + solid individuals. Dwarves’ most notable trait is their great expertise in mining and metalwork. Dwarvish armor is said to be second in quality not even to the mithril armor of the Elves. @@ -169,7 +169,7 @@ often gives them an advantage in arms and armor. Gnomes are smaller than but generally similar to dwarves. - Gnomes are known to be expert miners, and it is known that a se- + Gnomes are known to be expert miners, and it is known that a se‐ cret underground mine complex built by this race exists within the Mazes of Menace, filled with both riches and danger. @@ -192,7 +192,7 @@ - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -202,63 +202,63 @@ - When NetHack's ancestor rogue first appeared, its screen + When NetHack’s ancestor rogue first appeared, its screen orientation was almost unique among computer fantasy games. Since then, screen orientation has become the norm rather than the exception; NetHack continues this fine tradition. Unlike - text adventure games that accept commands in pseudo-English sen- + text adventure games that accept commands in pseudo‐English sen‐ tences and explain the results in words, NetHack commands are all one or two keystrokes and the results are displayed graphically on the screen. A minimum screen size of 24 lines by 80 columns is recommended; if the screen is larger, only a 21x80 section will be used for the map. - NetHack can even be played by blind players, with the assis- + NetHack can even be played by blind players, with the assis‐ tance of Braille readers or speech synthesisers. Instructions for configuring NetHack for the blind are included later in this document. NetHack generates a new dungeon every time you play it; even - the authors still find it an entertaining and exciting game de- + the authors still find it an entertaining and exciting game de‐ spite having won several times. NetHack offers a variety of display options. The options available to you will vary from port to port, depending on the capabilities of your hardware and software, and whether various - compile-time options were enabled when your executable was creat- - ed. The three possible display options are: a monochrome charac- - ter interface, a color character interface, and a graphical in- - terface using small pictures called tiles. The two character in- + compile‐time options were enabled when your executable was creat‐ + ed. The three possible display options are: a monochrome charac‐ + ter interface, a color character interface, and a graphical in‐ + terface using small pictures called tiles. The two character in‐ terfaces allow fonts with other characters to be substituted, but - the default assignments use standard ASCII characters to repre- - sent everything. There is no difference between the various dis- - play options with respect to game play. Because we cannot repro- - duce the tiles or colors in the Guidebook, and because it is com- + the default assignments use standard ASCII characters to repre‐ + sent everything. There is no difference between the various dis‐ + play options with respect to game play. Because we cannot repro‐ + duce the tiles or colors in the Guidebook, and because it is com‐ mon to all ports, we will use the default ASCII characters from the monochrome character display when referring to things you might see on the screen during your game. In order to understand what is going on in NetHack, first you must understand what NetHack is doing with the screen. The - NetHack screen replaces the ``You see ...'' descriptions of text + NetHack screen replaces the ‘‘You see ...’’ descriptions of text adventure games. Figure 1 is a sample of what a NetHack screen might look like. The way the screen looks for you depends on your platform. - -------------------------------------------------------------------- + ──────────────────────────────────────────────────────────────────── The bat bites! - ------ - |....| ---------- + ‐‐‐‐‐‐ + |....| ‐‐‐‐‐‐‐‐‐‐ |.<..|####...@...$.| - |....-# |...B....+ + |....‐# |...B....+ |....| |.d......| - ------ -------|-- + ‐‐‐‐‐‐ ‐‐‐‐‐‐‐|‐‐ - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -273,7 +273,7 @@ Player the Rambler St:12 Dx:7 Co:18 In:11 Wi:9 Ch:15 Neutral Dlvl:1 $:0 HP:9(12) Pw:3(3) AC:10 Exp:1/19 T:257 Weak - -------------------------------------------------------------------- + ──────────────────────────────────────────────────────────────────── Figure 1 @@ -282,19 +282,19 @@ The bottom two lines of the screen contain several cryptic pieces of information describing your current status. If either status line becomes longer than the width of the screen, you - might not see all of it. Here are explanations of what the vari- + might not see all of it. Here are explanations of what the vari‐ ous status items mean (though your configuration may not have all the status items listed below): Rank - Your character's name and professional ranking (based on the + Your character’s name and professional ranking (based on the experience level, see below). Strength - A measure of your character's strength; one of your six ba- - sic attributes. A human character's attributes can range - from 3 to 18 inclusive; non-humans may exceed these limits - (occasionally you may get super-strengths of the form 18/xx, + A measure of your character’s strength; one of your six ba‐ + sic attributes. A human character’s attributes can range + from 3 to 18 inclusive; non‐humans may exceed these limits + (occasionally you may get super‐strengths of the form 18/xx, and magic can also cause attributes to exceed the normal limits). The higher your strength, the stronger you are. Strength affects how successfully you perform physical @@ -324,7 +324,7 @@ - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -336,17 +336,17 @@ Alignment Lawful, Neutral, or Chaotic. Often, Lawful is taken as good - and Chaotic as evil, but legal and ethical do not always co- + and Chaotic as evil, but legal and ethical do not always co‐ incide. Your alignment influences how other monsters react toward you. Monsters of a like alignment are more likely to - be non-aggressive, while those of an opposing alignment are + be non‐aggressive, while those of an opposing alignment are more likely to be seriously offended at your presence. Dungeon Level How deep you are in the dungeon. You start at level one and the number increases as you go deeper into the dungeon. Some levels are special, and are identified by a name and - not a number. The Amulet of Yendor is reputed to be some- + not a number. The Amulet of Yendor is reputed to be some‐ where beneath the twentieth level. Gold @@ -367,16 +367,16 @@ regenerate the amount available. Armor Class - A measure of how effectively your armor stops blows from un- - friendly creatures. The lower this number is, the more ef- - fective the armor; it is quite possible to have negative ar- + A measure of how effectively your armor stops blows from un‐ + friendly creatures. The lower this number is, the more ef‐ + fective the armor; it is quite possible to have negative ar‐ mor class. Experience Your current experience level and experience points. As you - adventure, you gain experience points. At certain experi- + adventure, you gain experience points. At certain experi‐ ence point totals, you gain an experience level. The more - experienced you are, the better you fight and withstand mag- + experienced you are, the better you fight and withstand mag‐ ical attacks. Many dungeons show only your experience level here. @@ -386,11 +386,11 @@ Hunger status Your current hunger status, ranging from Satiated down to - Fainting. If your hunger status is normal, it is not dis- + Fainting. If your hunger status is normal, it is not dis‐ played. - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -401,27 +401,27 @@ Additional status flags may appear after the hunger status: - Conf when you're confused, FoodPois or Ill when sick, Blind when - you can't see, Stun when stunned, and Hallu when hallucinating. + Conf when you’re confused, FoodPois or Ill when sick, Blind when + you can’t see, Stun when stunned, and Hallu when hallucinating. 3.2. The message line (top) - The top line of the screen is reserved for messages that de- + The top line of the screen is reserved for messages that de‐ scribe things that are impossible to represent visually. If you - see a ``--More--'' on the top line, this means that NetHack has + see a ‘‘‐‐More‐‐’’ on the top line, this means that NetHack has another message to display on the screen, but it wants to make - certain that you've read the one that is there first. To read + certain that you’ve read the one that is there first. To read the next message, just press the space bar. 3.3. The map (rest of the screen) The rest of the screen is the map of the level as you have - explored it so far. Each symbol on the screen represents some- + explored it so far. Each symbol on the screen represents some‐ thing. You can set various graphics options to change some of the symbols the game uses; otherwise, the game will use default symbols. Here is a list of what the default symbols mean: - - and | + ‐ and | The walls of a room, or an open door. Or a grave (|). . The floor of a room, ice, or a doorless doorway. @@ -456,7 +456,7 @@ - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -468,13 +468,13 @@ ! A potion. - ( A useful item (pick-axe, key, lamp...). + ( A useful item (pick‐axe, key, lamp...). " An amulet or a spider web. * A gem or rock (possibly valuable, possibly worthless). - ` A boulder or statue. + ‘ A boulder or statue. 0 An iron ball. @@ -486,43 +486,43 @@ \ An opulent throne. - a-zA-Z and other symbols - Letters and certain other symbols represent the various in- + a‐zA‐Z and other symbols + Letters and certain other symbols represent the various in‐ habitants of the Mazes of Menace. Watch out, they can be nasty and vicious. Sometimes, however, they can be helpful. - I This marks the last known location of an invisible or other- + I This marks the last known location of an invisible or other‐ wise unseen monster. Note that the monster could have - moved. The 'F' and 'm' commands may be useful here. + moved. The ’F’ and ’m’ commands may be useful here. You need not memorize all these symbols; you can ask the - game what any symbol represents with the `/' command (see the + game what any symbol represents with the ‘/’ command (see the next section for more info). 4. Commands Commands are initiated by typing one or two characters. - Some commands, like ``search'', do not require that any more in- + Some commands, like ‘‘search’’, do not require that any more in‐ formation be collected by NetHack. Other commands might require additional information, for example a direction, or an object to be used. For those commands that require additional information, NetHack will present you with either a menu of choices or with a - command line prompt requesting information. Which you are pre- + command line prompt requesting information. Which you are pre‐ sented with will depend chiefly on how you have set the menustyle option. - For example, a common question, in the form ``What do you - want to use? [a-zA-Z ?*]'', asks you to choose an object you are - carrying. Here, ``a-zA-Z'' are the inventory letters of your - possible choices. Typing `?' gives you an inventory list of + For example, a common question, in the form ‘‘What do you + want to use? [a‐zA‐Z ?*]’’, asks you to choose an object you are + carrying. Here, ‘‘a‐zA‐Z’’ are the inventory letters of your + possible choices. Typing ‘?’ gives you an inventory list of these items, so you can see what each letter refers to. In this - example, there is also a `*' indicating that you may choose an - object not on the list, if you wanted to use something unexpect- - ed. Typing a `*' lists your entire inventory, so you can see the + example, there is also a ‘*’ indicating that you may choose an + object not on the list, if you wanted to use something unexpect‐ + ed. Typing a ‘*’ lists your entire inventory, so you can see the - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -532,39 +532,39 @@ - inventory letters of every object you're carrying. Finally, if - you change your mind and decide you don't want to do this command + inventory letters of every object you’re carrying. Finally, if + you change your mind and decide you don’t want to do this command after all, you can press the ESC key to abort the command. You can put a number before some commands to repeat them - that many times; for example, ``10s'' will search ten times. If - you have the number_pad option set, you must type `n' to prefix a - count, so the example above would be typed ``n10s'' instead. - Commands for which counts make no sense ignore them. In addi- + that many times; for example, ‘‘10s’’ will search ten times. If + you have the number_pad option set, you must type ‘n’ to prefix a + count, so the example above would be typed ‘‘n10s’’ instead. + Commands for which counts make no sense ignore them. In addi‐ tion, movement commands can be prefixed for greater control (see below). To cancel a count or a prefix, press the ESC key. The list of commands is rather long, but it can be read at - any time during the game through the `?' command, which accesses - a menu of helpful texts. Here are the commands for your refer- + any time during the game through the ‘?’ command, which accesses + a menu of helpful texts. Here are the commands for your refer‐ ence: ? Help menu: display one of several help texts available. / Tell what a symbol represents. You may choose to specify a location or type a symbol (or even a whole word) to explain. - Specifying a location is done by moving the cursor to a par- - ticular spot on the map and then pressing one of `.', `,', - `;', or `:'. `.' will explain the symbol at the chosen lo- - cation, conditionally check for ``More info?'' depending up- + Specifying a location is done by moving the cursor to a par‐ + ticular spot on the map and then pressing one of ‘.’, ‘,’, + ‘;’, or ‘:’. ‘.’ will explain the symbol at the chosen lo‐ + cation, conditionally check for ‘‘More info?’’ depending up‐ on whether the help option is on, and then you will be asked - to pick another location; `,' will explain the symbol but - skip any additional information; `;' will skip additional - info and also not bother asking you to choose another loca- - tion to examine; `:' will show additional info, if any, + to pick another location; ‘,’ will explain the symbol but + skip any additional information; ‘;’ will skip additional + info and also not bother asking you to choose another loca‐ + tion to examine; ‘:’ will show additional info, if any, without asking for confirmation. When picking a location, - pressing the ESC key will terminate this command, or press- - ing `?' will give a brief reminder about how it works. + pressing the ESC key will terminate this command, or press‐ + ing ‘?’ will give a brief reminder about how it works. Specifying a name rather than a location always gives any additional information available about that name. @@ -574,21 +574,21 @@ < Go up to the previous level (if you are on a staircase or ladder). - > Go down to the next level (if you are on a staircase or lad- + > Go down to the next level (if you are on a staircase or lad‐ der). [yuhjklbn] Go one step in the direction indicated (see Figure 2). If you sense or remember a monster there, you will fight the - monster instead. Only these one-step movement commands + monster instead. Only these one‐step movement commands cause you to fight monsters; the others (below) are - ``safe.'' + ‘‘safe.’’ - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -600,7 +600,7 @@ y k u 7 8 9 \ | / \ | / - h- . -l 4- . -6 + h‐ . ‐l 4‐ . ‐6 / | \ / | \ b j n 1 2 3 (if number_pad is set) @@ -609,7 +609,7 @@ [YUHJKLBN] - Go in that direction until you hit a wall or run into some- + Go in that direction until you hit a wall or run into some‐ thing. m[yuhjklbn] @@ -626,35 +626,35 @@ g[yuhjklbn] Prefix: move until something interesting is found. - G[yuhjklbn] or [yuhjklbn] - Prefix: same as `g', but forking of corridors is not con- + G[yuhjklbn] or [yuhjklbn] + Prefix: same as ‘g’, but forking of corridors is not con‐ sidered interesting. - _ Travel to a map location via a shortest-path algorithm. The - shortest path is computed over map locations the hero knows - about (e.g. seen or previously traversed). If there is no - known path, a guess is made instead. Stops on most of the - same conditions as the `G' command, but without picking up - objects, similar to the `M' command. For ports with mouse - support, the command is also invoked when a mouse-click - takes place on a location other than the current position. + _ Travel to a map location via a shortest‐path algorithm. + + The shortest path is computed over map locations the hero + knows about (e.g. seen or previously traversed). If there + is no known path, a guess is made instead. Stops on most of + the same conditions as the ‘G’ command, but without picking + up objects, similar to the ‘M’ command. For ports with + mouse support, the command is also invoked when a mouse‐ + click takes place on a location other than the current posi‐ + tion. . Rest, do nothing for one turn. - a Apply (use) a tool (pick-axe, key, lamp...). + a Apply (use) a tool (pick‐axe, key, lamp...). - A Remove one or more worn items, such as armor. Use `T' (take - off) to take off only one piece of armor or `R' (remove) to - take off only one accessory. + A Remove one or more worn items, such as armor. + + Use ‘T’ (take off) to take off only one piece of armor or + ‘R’ (remove) to take off only one accessory. ^A Redo the previous command. - c Close a door. - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -664,63 +664,63 @@ - C Call (name) an individual monster. + c Close a door. + + C Call (name) a monster, an individual object, or a type of + object. + + Same as extended command ‘‘#name’’. ^C Panic button. Quit the game. - d Drop something. Ex. ``d7a'' means drop seven items of ob- - ject a. + d Drop something. - D Drop several things. In answer to the question ``What kinds - of things do you want to drop? [!%= BUCXaium]'' you should - type zero or more object symbols possibly followed by `a' - and/or `i' and/or `u' and/or `m'. In addition, one or more - of the blessed/uncursed/cursed groups may be typed. + Ex. ‘‘d7a’’ means drop seven items of object a. - DB - drop all objects known to be blessed. - DU - drop all objects known to be uncursed. - DC - drop all objects known to be cursed. - DX - drop all objects of unknown B/U/C status. - Da - drop all objects, without asking for confirmation. - Di - examine your inventory before dropping anything. - Du - drop only unpaid objects (when in a shop). - Dm - use a menu to pick which object(s) to drop. - D%u - drop only unpaid food. + D Drop several things. + + In answer to the question + + ‘‘What kinds of things do you want to drop? [!%= BUCXaium]’’ + + you should type zero or more object symbols possibly fol‐ + lowed by ‘a’ and/or ‘i’ and/or ‘u’ and/or ‘m’. In addition, + one or more of the blessed/uncursed/cursed groups may be + typed. + + DB ‐ drop all objects known to be blessed. + DU ‐ drop all objects known to be uncursed. + DC ‐ drop all objects known to be cursed. + DX ‐ drop all objects of unknown B/U/C status. + Da ‐ drop all objects, without asking for confirmation. + Di ‐ examine your inventory before dropping anything. + Du ‐ drop only unpaid objects (when in a shop). + Dm ‐ use a menu to pick which object(s) to drop. + D%u ‐ drop only unpaid food. ^D Kick something (usually a door). e Eat food. - E Engrave a message on the floor. Engraving the word - ``Elbereth'' will cause most monsters to not attack you - hand-to-hand (but if you attack, you will rub it out); this - is often useful to give yourself a breather. (This feature - may be compiled out of the game, so your version might not - have it.) + E Engrave a message on the floor. - E- - write in the dust with your fingers. + E‐ ‐ write in the dust with your fingers. - f Fire one of the objects placed in your quiver. You may se- - lect ammunition with a previous `Q' command, or let the com- - puter pick something appropriate if autoquiver is true. + Engraving the word ‘‘Elbereth’’ will cause most monsters to + not attack you hand‐to‐hand (but if you attack, you will rub + it out); this is often useful to give yourself a breather. + (This feature may be compiled out of the game, so your ver‐ + sion might not have it.) - i List your inventory (everything you're carrying). - - I List selected parts of your inventory. - - I* - list all gems in inventory; - Iu - list all unpaid items; - Ix - list all used up items that are on your shopping bill; - I$ - count your money. - - o Open a door. - - O Set options. A menu showing the current option values will - be displayed. You can change most values simply by select- - ing the menu entry for the given option (ie, by typing its + f Fire one of the objects placed in your quiver (or quiver + sack, or that you have at the ready). You may select ammu‐ + nition with a previous ‘Q’ command, or let the computer pick + something appropriate if autoquiver is true. - NetHack 3.5 September 20, 2006 + + + NetHack 3.6 March 27, 2015 @@ -730,63 +730,63 @@ - letter or clicking upon it, depending on your user inter- - face). For the non-boolean choices, a further menu or - prompt will appear once you've closed this menu. The avail- - able options are listed later in this Guidebook. Options - are usually set before the game rather than with the `O' - command; see the section on options below. + i List your inventory (everything you’re carrying). + + I List selected parts of your inventory. + + I* ‐ list all gems in inventory; + Iu ‐ list all unpaid items; + Ix ‐ list all used up items that are on your shopping bill; + I$ ‐ count your money. + + o Open a door. + + O Set options. + + A menu showing the current option values will be displayed. + You can change most values simply by selecting the menu en‐ + try for the given option (ie, by typing its letter or click‐ + ing upon it, depending on your user interface). For the + non‐boolean choices, a further menu or prompt will appear + once you’ve closed this menu. The available options are + listed later in this Guidebook. Options are usually set be‐ + fore the game rather than with the ‘O’ command; see the sec‐ + tion on options below. p Pay your shopping bill. P Put on a ring or other accessory (amulet, blindfold). - ^P Repeat previous message. Subsequent ^P's repeat earlier - messages. The behavior can be varied via the msg_window op- - tion. + Use the ’W’ command to wear armor. + + ^P Repeat previous message. + + Subsequent ^P’s repeat earlier messages. The behavior can + be varied via the msg_window option. q Quaff (drink) something (potion, water, etc). - Q Select an object for your quiver. You can then throw this - using the `f' command. (In versions prior to 3.3 this was - the command to quit the game, which has now been moved to - `#quit'.) + Q Select an object for your quiver, quiver sack, or just gen‐ + erally at the ready (only one of these is available at a + time). You can then throw this (or one of these) using the + ‘f’ command. (In versions prior to 3.3 this was the command + to quit the game, which has now been moved to ‘#quit’.) r Read a scroll or spellbook. R Remove an accessory (ring, amulet, etc). - ^R Redraw the screen. + If you’re wearing more than one, you’ll be prompted for + which one to remove. If you’re only wearing one, then by + default it will be removed without asking, but you can set + the paranoid_confirmation option to require a prompt. - s Search for secret doors and traps around you. It usually - takes several tries to find something. - - S Save (and suspend) the game. The game will be restored au- - tomatically the next time you play. - - t Throw an object or shoot a projectile. - - T Take off armor. - - ^T Teleport, if you have the ability. - - v Display version number. - - V Display the game history. - - w Wield weapon. - - w- - wield nothing, use your bare hands. - - W Wear armor. - - x Exchange your wielded weapon with the item in your alternate - weapon slot. The latter is used as your secondary weapon - when engaging in two-weapon combat. Note that if one of - these slots is empty, the exchange still takes place. + Use the ’T’ command to take off armor. - NetHack 3.5 September 20, 2006 + + + NetHack 3.6 March 27, 2015 @@ -796,16 +796,81 @@ - X Enter explore (discovery) mode, explained in its own section - later. + ^R Redraw the screen. - ^X Display your name, role, race, gender, and alignment as well - as the various deities in your game. + s Search for secret doors and traps around you. It usually + takes several tries to find something. - z Zap a wand. To aim at yourself, use `.' for the direction. + S Save (and suspend) the game. The game will be restored au‐ + tomatically the next time you play. - Z Zap (cast) a spell. To cast at yourself, use `.' for the - direction. + t Throw an object or shoot a projectile. + + T Take off armor. + + If you’re wearing more than one piece, you’ll be prompted + for which one to take off. If you’re only wearing one, then + by default it will be taken off without asking, but you can + set the paranoid_confirmation option to require a prompt. + + Use the ’R’ command to remove accessories. + + ^T Teleport, if you have the ability. + + v Display version number. + + V Display the game history. + + w Wield weapon. + + w‐ ‐ wield nothing, use your bare hands. + + Some characters can wield two weapons and once; use the + ‘‘#twoweapon’’ extended command to do so. + + W Wear armor. + + Use the ’P’ command to put on accessories. + + x Exchange your wielded weapon with the item in your alternate + weapon slot. + + The latter is used as your secondary weapon when engaging in + two‐weapon combat. Note that if one of these slots is emp‐ + ty, the exchange still takes place. + + X Toggle two‐weapon combat, if your character can do it. Also + available via the ‘‘#twoweapon’’ extended command + + ^X Display basic information about your character. + + Displays name, role, race, gender (unless role name makes + that redundant, such as Caveman or Priestess), and align‐ + ment, along with your patron deity and his or her opposi‐ + tion. It also shows most of the various items of informa‐ + tion from the status line(s) in a less terse form, including + several additional things which don’t appear in the normal + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 14 + + + + status display due to space considerations. + + z Zap a wand. + + z. ‐ to aim at yourself, use ‘.’ for the direction. + + Z Zap (cast) a spell. + + Z. ‐ to cast at yourself, use ‘.’ for the direction. ^Z Suspend the game (UNIX(R) versions with job control only). @@ -813,8 +878,9 @@ ; Show what type of thing a visible symbol corresponds to. - , Pick up some things. May be preceded by `m' to force a se- - lection menu. + , Pick up some things from the floor beneath you. + + May be preceded by ‘m’ to force a selection menu. @ Toggle the autopickup option on and off. @@ -830,95 +896,29 @@ ( Tell what tools you are using. - * Tell what equipment you are using; combines the preceding - five type-specific commands into one. + * Tell what equipment you are using. + + Combines the preceding five type‐specific commands into one. $ Count your gold pieces. - + List the spells you know. Using this command, you can also - rearrange the order in which your spells are listed, either - by sorting the entire list or by picking one spell from the - menu then picking another to swap places with it. Swapping - pairs of spells changes their casting letters, so the change - lasts after the current `+' command finishes. Sorting the - whole list is temporary. To make the most recent sort order - persist beyond the current `+' command, choose the sort op- - tion again and then pick "reassign casting letters". (Any - spells learned after that will be added to the end of the - list rather than be inserted into the sorted ordering.) + + List the spells you know. + Using this command, you can also rearrange the order in + which your spells are listed, either by sorting the entire + list or by picking one spell from the menu then picking an‐ + other to swap places with it. Swapping pairs of spells + changes their casting letters, so the change lasts after the + current ‘+’ command finishes. Sorting the whole list is + temporary. To make the most recent sort order persist be‐ + yond the current ‘+’ command, choose the sort option again + and then pick "reassign casting letters". (Any spells __________ (R)UNIX is a registered trademark of AT&T. - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 14 - - - - \ Show what types of objects have been discovered. - - ! Escape to a shell. - - # Perform an extended command. As you can see, the authors of - NetHack used up all the letters, so this is a way to intro- - duce the less frequently used commands. What extended com- - mands are available depends on what features the game was - compiled with. - - #adjust - Adjust inventory letters (most useful when the fixinv option - is ``on''). This command allows you to move an item from - one particular inventory slot to another so that it has a - letter which is more meaningful for you or that it will ap- - pear in a particular location when inventory listings are - displayed. ``#adjust'' can also be used to split a stack of - objects; when choosing the item to adjust, enter a count - prior to its letter. - - #chat - Talk to someone. - - #conduct - List voluntary challenges you have maintained. See the sec- - tion below entitled ``Conduct'' for details. - - #dip Dip an object into something. - - #enhance - Advance or check weapon and spell skills. - - #force - Force a lock. - - #invoke - Invoke an object's special powers. - - #jump - Jump to another location. - - #loot - Loot a box or bag on the floor beneath you, or the saddle - from a horse standing next to you. - - #monster - Use a monster's special ability (when polymorphed into mon- - ster form). - - #name - Name an item or type of object. - - #offer - Offer a sacrifice to the gods. - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -928,63 +928,63 @@ - #pray - Pray to the gods for help. + learned after that will be added to the end of the list + rather than be inserted into the sorted ordering.) - #quit - Quit the program without saving your game. + \ Show what types of objects have been discovered. - #ride - Ride (or stop riding) a monster. + ‘ Show discovered types for one class of objects. - #rub Rub a lamp or a stone. + ! Escape to a shell. - #sit Sit down. + # Perform an extended command. - #tip Tip over a container to pour out its contents. + As you can see, the authors of NetHack used up all the let‐ + ters, so this is a way to introduce the less frequently used + commands. What extended commands are available depends on + what features the game was compiled with. - #turn - Turn undead. + #adjust + Adjust inventory letters (most useful when the fixinv option + is ‘‘on’’). - #twoweapon - Toggle two-weapon combat on or off. Note that you must use - suitable weapons for this type of combat, or it will be au- - tomatically turned off. + This command allows you to move an item from one particular + inventory slot to another so that it has a letter which is + more meaningful for you or that it will appear in a particu‐ + lar location when inventory listings are displayed. ‘‘#ad‐ + just’’ can also be used to split a stack of objects; when + choosing the item to adjust, enter a count prior to its let‐ + ter. - #untrap - Untrap something (trap, door, or chest). + #chat + Talk to someone. - #version - Print compile time options for this version of NetHack. + #conduct + List voluntary challenges you have maintained. - #wipe - Wipe off your face. + See the section below entitled ‘‘Conduct’’ for details. - #? Help menu: get the list of available extended commands. + #dip + Dip an object into something. - If your keyboard has a meta key (which, when pressed in com- - bination with another key, modifies it by setting the `meta' - [8th, or `high'] bit), you can invoke many extended commands by - meta-ing the first letter of the command. In NT, OS/2, and PC - NetHack, the `Alt' key can be used in this fashion. + #enhance + Advance or check weapon and spell skills. - M-? #? (not supported by all platforms) + #force + Force a lock. - M-2 #twoweapon (unless the number_pad option is enabled) + #invoke + Invoke an object’s special powers. - M-a #adjust + #jump + Jump to another location. - M-c #chat - - M-d #dip - - M-e #enhance - - M-f #force + #loot + Loot a box or bag on the floor beneath you, or the saddle + from a steed standing next to you. - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -994,63 +994,63 @@ - M-i #invoke + #monster + Use a monster’s special ability (when polymorphed into mon‐ + ster form). - M-j #jump + #name + Name a monster, an individual object, or a type of object. + Same as ‘C’. - M-l #loot + #offer + Offer a sacrifice to the gods. - M-m #monster + You’ll need to find an altar to have any chance at success. + Corpses of recently killed monsters are the fodder of + choice. - M-n #name + #pray + Pray to the gods for help. - M-o #offer + Praying too soon after receiving prior help is a bad idea. + (Hint: entering the dungeon alive is treated as having re‐ + ceived help. You probably shouldn’t start off a new game by + praying right away.) Since using this command by accident + can cause trouble, there is an option to make you confirm + your intent before praying. It is enabled by default, and + you can reset the paranoid_confirmation option to disable + it. - M-p #pray + #quit + Quit the program without saving your game. - M-q #quit + Since using this command by accident would throw away the + current game, you are asked to confirm your intent before + quitting. By default a response of ’y’ acknowledges that + intent. You can set the paranoid_confirmation option to re‐ + quire a response of "yes" instead. - M-r #rub + #ride + Ride (or stop riding) a monster. - M-s #sit + #rub + Rub a lamp or a stone. - M-t #turn + #sit + Sit down. - M-u #untrap + #terrain + Show bare map without displaying monsters, objects, or + traps. - M-v #version + #tip + Tip over a container (bag or box) to pour out its contents. - M-w #wipe - - If the number_pad option is on, some additional letter com- - mands are available: - - h Help menu: display one of several help texts available, - like ``?''. - - j Jump to another location. Same as ``#jump'' or ``M-j''. - - k Kick something (usually a door). Same as `^D'. - - l Loot a box or bag on the floor beneath you, or the saddle - from a horse standing next to you. Same as ``#loot'' or - ``M-l''. - - N Name an item or type of object. Same as ``#name'' or ``M- - n''. - - u Untrap a trap, door, or chest. Same as ``#untrap'' or ``M- - u''. + #turn + Turn undead. - 5. Rooms and corridors - - Rooms and corridors in the dungeon are either lit or dark. - Any lit areas within your line of sight will be displayed; dark - areas are only displayed if they are within one space of you. - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -1060,63 +1060,63 @@ - Walls and corridors remain on the map as you explore them. + #twoweapon + Toggle two‐weapon combat on or off. - Secret corridors are hidden. You can find them with the `s' - (search) command. + Note that you must use suitable weapons for this type of + combat, or it will be automatically turned off. - 5.1. Doorways + #untrap + Untrap something (trap, door, or chest). - Doorways connect rooms and corridors. Some doorways have no - doors; you can walk right through. Others have doors in them, - which may be open, closed, or locked. To open a closed door, use - the `o' (open) command; to close it again, use the `c' (close) - command. + In some circumstances it can also be used to rescue trapped + monsters. - You can get through a locked door by using a tool to pick - the lock with the `a' (apply) command, or by kicking it open with - the `^D' (kick) command. + #version + Print compile time options for this version of NetHack. - Open doors cannot be entered diagonally; you must approach - them straight on, horizontally or vertically. Doorways without - doors are not restricted in this fashion. + #wipe + Wipe off your face. - Doors can be useful for shutting out monsters. Most mon- - sters cannot open doors, although a few don't need to (ex. ghosts - can walk through doors). + #? + Help menu: get the list of available extended commands. - Secret doors are hidden. You can find them with the `s' - (search) command. Once found they are in all ways equivalent to - normal doors. + If your keyboard has a meta key (which, when pressed in com‐ + bination with another key, modifies it by setting the ‘meta’ + [8th, or ‘high’] bit), you can invoke many extended commands by + meta‐ing the first letter of the command. In NT, OS/2, PC and ST + NetHack, the ‘Alt’ key can be used in this fashion; on the Amiga, + set the altmeta option to get this behavior. On other systems, + if typing ‘Alt’ plus another key transmits a two character se‐ + quence consisting of an Escape followed by the other key, you may + set the altmeta option to have nethack combine them into + meta+key. - 5.2. Traps (`^') + M‐? #? (not supported by all platforms) - There are traps throughout the dungeon to snare the unwary - delver. For example, you may suddenly fall into a pit and be - stuck for a few turns trying to climb out. Traps don't appear on - your map until you see one triggered by moving onto it, see some- - thing fall into it, or you discover it with the `s' (search) com- - mand. Monsters can fall prey to traps, too, which can be a very - useful defensive strategy. + M‐2 #twoweapon (unless the number_pad option is enabled) - There is a special pre-mapped branch of the dungeon based on - the classic computer game ``Sokoban.'' The goal is to push the - boulders into the pits or holes. With careful foresight, it is - possible to complete all of the levels according to the tradi- - tional rules of Sokoban. Some allowances are permitted in case - the player gets stuck; however, they will lower your luck. + M‐a #adjust - 5.3. Stairs (`<', `>') + M‐A #annotate (if supported) - In general, each level in the dungeon will have a staircase - going up (`<') to the previous level and another going down (`>') - to the next level. There are some exceptions though. For in- - stance, fairly early in the dungeon you will find a level with - two down staircases, one continuing into the dungeon and the oth- - er branching into an area known as the Gnomish Mines. Those + M‐c #chat + + M‐C #conduct + + M‐d #dip + + M‐e #enhance + + M‐f #force + + M‐i #invoke + + M‐j #jump - NetHack 3.5 September 20, 2006 + + NetHack 3.6 March 27, 2015 @@ -1126,63 +1126,63 @@ - mines eventually hit a dead end, so after exploring them (if you - choose to do so), you'll need to climb back up to the main dun- - geon. + M‐l #loot - When you traverse a set of stairs, or trigger a trap which - sends you to another level, the level you're leaving will be de- - activated and stored in a file on disk. If you're moving to a - previously visited level, it will be loaded from its file on disk - and reactivated. If you're moving to a level which has not yet - been visited, it will be created (from scratch for most random - levels, from a template for some ``special'' levels, or loaded - from the remains of an earlier game for a ``bones'' level as - briefly described below). Monsters are only active on the cur- - rent level; those on other levels are essentially placed into - stasis. + M‐m #monster - Ordinarily when you climb a set of stairs, you will arrive - on the corresponding staircase at your destination. However, - pets (see below) and some other monsters will follow along if - they're close enough when you travel up or down stairs, and occa- - sionally one of these creatures will displace you during the - climb. When that occurs, the pet or other monster will arrive on - the staircase and you will end up nearby. + M‐n #name - 5.4. Ladders (`<', `>') + M‐o #offer - Ladders serve the same purpose as staircases, and the two - types of inter-level connections are nearly indistinguishable - during game play. + M‐O #overview (if supported) - 5.5. Shops and shopping + M‐p #pray - Occasionally you will run across a room with a shopkeeper - near the door and many items lying on the floor. You can buy - items by picking them up and then using the `p' command. You can - inquire about the price of an item prior to picking it up by us- - ing the ``#chat'' command while standing on it. Using an item - prior to paying for it will incur a charge, and the shopkeeper - won't allow you to leave the shop until you have paid any debt - you owe. + M‐q #quit - You can sell items to a shopkeeper by dropping them to the - floor while inside a shop. You will either be offered an amount - of gold and asked whether you're willing to sell, or you'll be - told that the shopkeeper isn't interested (generally, your item - needs to be compatible with the type of merchandise carried by - the shop). + M‐r #rub - If you drop something in a shop by accident, the shopkeeper - will usually claim ownership without offering any compensation. - You'll have to buy it back if you want to reclaim it. + M‐R #ride (if supported) - Shopkeepers sometimes run out of money. When that happens, - you'll be offered credit instead of gold when you try to sell + M‐s #sit + + M‐t #turn + + M‐T #tip + + M‐u #untrap + + M‐v #version + + M‐w #wipe + + If the number_pad option is on, some additional letter com‐ + mands are available: + + h Help menu: display one of several help texts available, + like ‘‘?’’. + + j Jump to another location. Same as ‘‘#jump’’ or ‘‘M‐j’’. + + k Kick something (usually a door). Same as ‘^D’. + + l Loot a box or bag on the floor beneath you, or the saddle + from a steed standing next to you. Same as ‘‘#loot’’ or + ‘‘M‐l’’. + + N Name a monster, an individual object, or a type of object. + Same as ‘‘#name’’ (or ‘‘M‐n’’) which is the same as the ‘C’ + command. + + u Untrap a trap, door, or chest. Same as ‘‘#untrap’’ or ‘‘M‐ + u’’. - NetHack 3.5 September 20, 2006 + + + + + NetHack 3.6 March 27, 2015 @@ -1192,17 +1192,157 @@ + 5. Rooms and corridors + + Rooms and corridors in the dungeon are either lit or dark. + Any lit areas within your line of sight will be displayed; dark + areas are only displayed if they are within one space of you. + Walls and corridors remain on the map as you explore them. + + Secret corridors are hidden. You can find them with the ‘s’ + (search) command. + + 5.1. Doorways + + Doorways connect rooms and corridors. Some doorways have no + doors; you can walk right through. Others have doors in them, + which may be open, closed, or locked. To open a closed door, use + the ‘o’ (open) command; to close it again, use the ‘c’ (close) + command. + + You can get through a locked door by using a tool to pick + the lock with the ‘a’ (apply) command, or by kicking it open with + the ‘^D’ (kick) command. + + Open doors cannot be entered diagonally; you must approach + them straight on, horizontally or vertically. Doorways without + doors are not restricted in this fashion. + + Doors can be useful for shutting out monsters. Most mon‐ + sters cannot open doors, although a few don’t need to (ex. ghosts + can walk through doors). + + Secret doors are hidden. You can find them with the ‘s’ + (search) command. Once found they are in all ways equivalent to + normal doors. + + 5.2. Traps (‘^’) + + There are traps throughout the dungeon to snare the unwary + delver. For example, you may suddenly fall into a pit and be + stuck for a few turns trying to climb out. Traps don’t appear on + your map until you see one triggered by moving onto it, see some‐ + thing fall into it, or you discover it with the ‘s’ (search) com‐ + mand. Monsters can fall prey to traps, too, which can be a very + useful defensive strategy. + + There is a special pre‐mapped branch of the dungeon based on + the classic computer game ‘‘Sokoban.’’ The goal is to push the + boulders into the pits or holes. With careful foresight, it is + possible to complete all of the levels according to the tradi‐ + tional rules of Sokoban. Some allowances are permitted in case + the player gets stuck; however, they will lower your luck. + + + + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 20 + + + + 5.3. Stairs (‘<’, ‘>’) + + In general, each level in the dungeon will have a staircase + going up (‘<’) to the previous level and another going down (‘>’) + to the next level. There are some exceptions though. For in‐ + stance, fairly early in the dungeon you will find a level with + two down staircases, one continuing into the dungeon and the oth‐ + er branching into an area known as the Gnomish Mines. Those + mines eventually hit a dead end, so after exploring them (if you + choose to do so), you’ll need to climb back up to the main dun‐ + geon. + + When you traverse a set of stairs, or trigger a trap which + sends you to another level, the level you’re leaving will be de‐ + activated and stored in a file on disk. If you’re moving to a + previously visited level, it will be loaded from its file on disk + and reactivated. If you’re moving to a level which has not yet + been visited, it will be created (from scratch for most random + levels, from a template for some ‘‘special’’ levels, or loaded + from the remains of an earlier game for a ‘‘bones’’ level as + briefly described below). Monsters are only active on the cur‐ + rent level; those on other levels are essentially placed into + stasis. + + Ordinarily when you climb a set of stairs, you will arrive + on the corresponding staircase at your destination. However, + pets (see below) and some other monsters will follow along if + they’re close enough when you travel up or down stairs, and occa‐ + sionally one of these creatures will displace you during the + climb. When that occurs, the pet or other monster will arrive on + the staircase and you will end up nearby. + + 5.4. Ladders (‘<’, ‘>’) + + Ladders serve the same purpose as staircases, and the two + types of inter‐level connections are nearly indistinguishable + during game play. + + 5.5. Shops and shopping + + Occasionally you will run across a room with a shopkeeper + near the door and many items lying on the floor. You can buy + items by picking them up and then using the ‘p’ command. You can + inquire about the price of an item prior to picking it up by us‐ + ing the ‘‘#chat’’ command while standing on it. Using an item + prior to paying for it will incur a charge, and the shopkeeper + won’t allow you to leave the shop until you have paid any debt + you owe. + + You can sell items to a shopkeeper by dropping them to the + floor while inside a shop. You will either be offered an amount + of gold and asked whether you’re willing to sell, or you’ll be + told that the shopkeeper isn’t interested (generally, your item + needs to be compatible with the type of merchandise carried by + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 21 + + + + the shop). + + If you drop something in a shop by accident, the shopkeeper + will usually claim ownership without offering any compensation. + You’ll have to buy it back if you want to reclaim it. + + Shopkeepers sometimes run out of money. When that happens, + you’ll be offered credit instead of gold when you try to sell something. Credit can be used to pay for purchases, but it is only good in the shop where it was obtained; other shopkeepers - won't honor it. (If you happen to find a "credit card" in the - dungeon, don't bother trying to use it in shops; shopkeepers will + won’t honor it. (If you happen to find a "credit card" in the + dungeon, don’t bother trying to use it in shops; shopkeepers will not accept it.) - The `$' command, which reports the amount of gold you are + The ‘$’ command, which reports the amount of gold you are carrying (in inventory, not inside bags or boxes), will also show - current shop debt or credit, if any. The `Iu' command lists un- - paid items (those which still belong to the shop) if you are car- - rying any. The `Ix' command shows an inventory-like display of + current shop debt or credit, if any. The ‘Iu’ command lists un‐ + paid items (those which still belong to the shop) if you are car‐ + rying any. The ‘Ix’ command shows an inventory‐like display of any unpaid items which have been used up, along with other shop fees, if any. @@ -1221,7 +1361,7 @@ * If a shop is "closed for inventory", it will not open of its own accord. - * Shops do not get restocked with new items, regardless of inven- + * Shops do not get restocked with new items, regardless of inven‐ tory depletion. @@ -1232,155 +1372,15 @@ magic items can help you locate them before they locate you (which some monsters can do very well). - The commands `/' and `;' may be used to obtain information - about those monsters who are displayed on the screen. The com- - mand `C' allows you to assign a name to a monster, which may be - useful to help distinguish one from another when multiple mon- - sters are present. Assigning a name which is just a space will - remove any prior name. - - The extended command ``#chat'' can be used to interact with - an adjacent monster. There is no actual dialog (in other words, - you don't get to choose what you'll say), but chatting with some - monsters such as a shopkeeper or the Oracle of Delphi can produce - useful results. + The commands ‘/’ and ‘;’ may be used to obtain information + about those monsters who are displayed on the screen. The com‐ + mand ‘‘#name’’, or its synonym ‘C’, allows you to assign a name + to a monster, which may be useful to help distinguish one from + another when multiple monsters are present. Assigning a name + which is just a space will remove any prior name. - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 20 - - - - 6.1. Fighting - - If you see a monster and you wish to fight it, just attempt - to walk into it. Many monsters you find will mind their own - business unless you attack them. Some of them are very dangerous - when angered. Remember: discretion is the better part of valor. - - If you can't see a monster (if it is invisible, or if you - are blinded), the symbol `I' will be shown when you learn of its - presence. If you attempt to walk into it, you will try to fight - it just like a monster that you can see; of course, if the mon- - ster has moved, you will attack empty air. If you guess that the - monster has moved and you don't wish to fight, you can use the - `m' command to move without fighting; likewise, if you don't re- - member a monster but want to try fighting anyway, you can use the - `F' command. - - 6.2. Your pet - - You start the game with a little dog (`d'), cat (`f'), or - pony (`u'), which follows you about the dungeon and fights mon- - sters with you. Like you, your pet needs food to survive. It - usually feeds itself on fresh carrion and other meats. If you're - worried about it or want to train it, you can feed it, too, by - throwing it food. A properly trained pet can be very useful un- - der certain circumstances. - - Your pet also gains experience from killing monsters, and - can grow over time, gaining hit points and doing more damage. - Initially, your pet may even be better at killing things than - you, which makes pets useful for low-level characters. - - Your pet will follow you up and down staircases if it is - next to you when you move. Otherwise your pet will be stranded - and may become wild. Similarly, when you trigger certain types - of traps which alter your location (for instance, a trap door - which drops you to a lower dungeon level), any adjacent pet will - accompany you and any non-adjacent pet will be left behind. Your - pet may trigger such traps itself; you will not be carried along - with it even if adjacent at the time. - - 6.3. Steeds - - Some types of creatures in the dungeon can actually be rid- - den if you have the right equipment and skill. Convincing a wild - beast to let you saddle it up is difficult to say the least. - Many a dungeoneer has had to resort to magic and wizardry in or- - der to forge the alliance. Once you do have the beast under your - control however, you can easily climb in and out of the saddle - with the `#ride' command. Lead the beast around the dungeon when - riding, in the same manner as you would move yourself. It is the - beast that you will see displayed on the map. - - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 21 - - - - Riding skill is managed by the `#enhance' command. See the - section on Weapon proficiency for more information about that. - - 6.4. Bones levels - - You may encounter the shades and corpses of other adventur- - ers (or even former incarnations of yourself!) and their personal - effects. Ghosts are hard to kill, but easy to avoid, since - they're slow and do little damage. You can plunder the deceased - adventurer's possessions; however, they are likely to be cursed. - Beware of whatever killed the former player; it is probably still - lurking around, gloating over its last victory. - - - 7. Objects - - When you find something in the dungeon, it is common to want - to pick it up. In NetHack, this is accomplished automatically by - walking over the object (unless you turn off the autopickup op- - tion (see below), or move with the `m' prefix (see above)), or - manually by using the `,' command. - - If you're carrying too many items, NetHack will tell you so - and you won't be able to pick up anything more. Otherwise, it - will add the object(s) to your pack and tell you what you just - picked up. - - As you add items to your inventory, you also add the weight - of that object to your load. The amount that you can carry de- - pends on your strength and your constitution. The stronger you - are, the less the additional load will affect you. There comes a - point, though, when the weight of all of that stuff you are car- - rying around with you through the dungeon will encumber you. - Your reactions will get slower and you'll burn calories faster, - requiring food more frequently to cope with it. Eventually, - you'll be so overloaded that you'll either have to discard some - of what you're carrying or collapse under its weight. - - NetHack will tell you how badly you have loaded yourself. - The symbols `Burdened', `Stressed', `Strained', `Overtaxed' and - `Overloaded' are displayed on the bottom line display to indicate - your condition. - - When you pick up an object, it is assigned an inventory let- - ter. Many commands that operate on objects must ask you to find - out which object you want to use. When NetHack asks you to - choose a particular object you are carrying, you are usually pre- - sented with a list of inventory letters to choose from (see Com- - mands, above). - - Some objects, such as weapons, are easily differentiated. - Others, like scrolls and potions, are given descriptions which - vary according to type. During a game, any two objects with the - same description are the same type. However, the descriptions - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -1390,63 +1390,63 @@ - will vary from game to game. + The extended command ‘‘#chat’’ can be used to interact with + an adjacent monster. There is no actual dialog (in other words, + you don’t get to choose what you’ll say), but chatting with some + monsters such as a shopkeeper or the Oracle of Delphi can produce + useful results. - When you use one of these objects, if its effect is obvious, - NetHack will remember what it is for you. If its effect isn't - extremely obvious, you will be asked what you want to call this - type of object so you will recognize it later. You can also use - the ``#name'' command for the same purpose at any time, to name - all objects of a particular type or just an individual object. - When you use ``#name'' on an object which has already been named, - specifying a space as the value will remove the prior name in- - stead of assigning a new one. + 6.1. Fighting - 7.1. Curses and Blessings + If you see a monster and you wish to fight it, just attempt + to walk into it. Many monsters you find will mind their own + business unless you attack them. Some of them are very dangerous + when angered. Remember: discretion is the better part of valor. - Any object that you find may be cursed, even if the object - is otherwise helpful. The most common effect of a curse is being - stuck with (and to) the item. Cursed weapons weld themselves to - your hand when wielded, so you cannot unwield them. Any cursed - item you wear is not removable by ordinary means. In addition, - cursed arms and armor usually, but not always, bear negative en- - chantments that make them less effective in combat. Other cursed - objects may act poorly or detrimentally in other ways. + In most circumstances, if you attempt to attack a peaceful + monster by moving into its location, you’ll be asked to confirm + your intent. By default an answer of ’y’ acknowledges that in‐ + tent, which can be error prone if you’re using ’y’ to move. You + can set the paranoid_confirmation option to require a response of + "yes" instead. - Objects can also be blessed. Blessed items usually work - better or more beneficially than normal uncursed items. For ex- - ample, a blessed weapon will do more damage against demons. + If you can’t see a monster (if it is invisible, or if you + are blinded), the symbol ‘I’ will be shown when you learn of its + presence. If you attempt to walk into it, you will try to fight + it just like a monster that you can see; of course, if the mon‐ + ster has moved, you will attack empty air. If you guess that the + monster has moved and you don’t wish to fight, you can use the + ‘m’ command to move without fighting; likewise, if you don’t re‐ + member a monster but want to try fighting anyway, you can use the + ‘F’ command. - There are magical means of bestowing or removing curses upon - objects, so even if you are stuck with one, you can still have - the curse lifted and the item removed. Priests and Priestesses - have an innate sensitivity to this property in any object, so - they can more easily avoid cursed objects than other character - roles. + 6.2. Your pet - An item with unknown status will be reported in your inven- - tory with no prefix. An item which you know the state of will be - distinguished in your inventory by the presence of the word - ``cursed'', ``uncursed'' or ``blessed'' in the description of the - item. + You start the game with a little dog (‘d’), cat (‘f’), or + pony (‘u’), which follows you about the dungeon and fights mon‐ + sters with you. Like you, your pet needs food to survive. It + usually feeds itself on fresh carrion and other meats. If you’re + worried about it or want to train it, you can feed it, too, by + throwing it food. A properly trained pet can be very useful un‐ + der certain circumstances. - 7.2. Weapons (`)') + Your pet also gains experience from killing monsters, and + can grow over time, gaining hit points and doing more damage. + Initially, your pet may even be better at killing things than + you, which makes pets useful for low‐level characters. - Given a chance, most monsters in the Mazes of Menace will - gratuitously try to kill you. You need weapons for self-defense - (killing them first). Without a weapon, you do only 1-2 hit - points of damage (plus bonuses, if any). Monk characters are an - exception; they normally do much more damage with bare hands than - they do with weapons. - - There are wielded weapons, like maces and swords, and thrown - weapons, like arrows and spears. To hit monsters with a weapon, - you must wield it and attack them, or throw it at them. You can - simply elect to throw a spear. To shoot an arrow, you should - first wield a bow, then throw the arrow. Crossbows shoot + Your pet will follow you up and down staircases if it is + next to you when you move. Otherwise your pet will be stranded + and may become wild. Similarly, when you trigger certain types + of traps which alter your location (for instance, a trap door + which drops you to a lower dungeon level), any adjacent pet will + accompany you and any non‐adjacent pet will be left behind. Your + pet may trigger such traps itself; you will not be carried along + with it even if adjacent at the time. - NetHack 3.5 September 20, 2006 + + NetHack 3.6 March 27, 2015 @@ -1456,63 +1456,63 @@ - crossbow bolts. Slings hurl rocks and (other) stones (like - gems). + 6.3. Steeds - Enchanted weapons have a ``plus'' (or ``to hit enhancement'' - which can be either positive or negative) that adds to your - chance to hit and the damage you do to a monster. The only way - to determine a weapon's enchantment is to have it magically iden- - tified somehow. Most weapons are subject to some type of damage - like rust. Such ``erosion'' damage can be repaired. + Some types of creatures in the dungeon can actually be rid‐ + den if you have the right equipment and skill. Convincing a wild + beast to let you saddle it up is difficult to say the least. + Many a dungeoneer has had to resort to magic and wizardry in or‐ + der to forge the alliance. Once you do have the beast under your + control however, you can easily climb in and out of the saddle + with the ‘#ride’ command. Lead the beast around the dungeon when + riding, in the same manner as you would move yourself. It is the + beast that you will see displayed on the map. - The chance that an attack will successfully hit a monster, - and the amount of damage such a hit will do, depends upon many - factors. Among them are: type of weapon, quality of weapon (en- - chantment and/or erosion), experience level, strength, dexterity, - encumbrance, and proficiency (see below). The monster's armor - class - a general defense rating, not necessarily due to wearing - of armor - is a factor too; also, some monsters are particularly - vulnerable to certain types of weapons. + Riding skill is managed by the ‘#enhance’ command. See the + section on Weapon proficiency for more information about that. - Many weapons can be wielded in one hand; some require both - hands. When wielding a two-handed weapon, you can not wear a - shield, and vice versa. When wielding a one-handed weapon, you - can have another weapon ready to use by setting things up with - the `x' command, which exchanges your primary (the one being - wielded) and alternate weapons. And if you have proficiency in - the ``two weapon combat'' skill, you may wield both weapons si- - multaneously as primary and secondary; use the `#twoweapon' ex- - tended command to engage or disengage that. Only some types of - characters (barbarians, for instance) have the necessary skill - available. Even with that skill, using two weapons at once in- - curs a penalty in the chance to hit your target compared to using - just one weapon at a time. + 6.4. Bones levels - There might be times when you'd rather not wield any weapon - at all. To accomplish that, wield `-', or else use the `A' com- - mand which allows you to unwield the current weapon in addition - to taking off other worn items. - - Those of you in the audience who are AD&D players, be aware - that each weapon which existed in AD&D does roughly the same dam- - age to monsters in NetHack. Some of the more obscure weapons - (such as the aklys, lucern hammer, and bec-de-corbin) are defined - in an appendix to Unearthed Arcana, an AD&D supplement. - - The commands to use weapons are `w' (wield), `t' (throw), - `f' (fire, an alternative way of throwing), `Q' (quiver), `x' - (exchange), `#twoweapon', and `#enhance' (see below). - - 7.2.1. Throwing and shooting - - You can throw just about anything via the `t' command. It - will prompt for the item to throw; picking `?' will list things - in your inventory which are considered likely to be thrown, or - picking `*' will list your entire inventory. After you've chosen + You may encounter the shades and corpses of other adventur‐ + ers (or even former incarnations of yourself!) and their personal + effects. Ghosts are hard to kill, but easy to avoid, since + they’re slow and do little damage. You can plunder the deceased + adventurer’s possessions; however, they are likely to be cursed. + Beware of whatever killed the former player; it is probably still + lurking around, gloating over its last victory. - NetHack 3.5 September 20, 2006 + 7. Objects + + When you find something in the dungeon, it is common to want + to pick it up. In NetHack, this is accomplished automatically by + walking over the object (unless you turn off the autopickup op‐ + tion (see below), or move with the ‘m’ prefix (see above)), or + manually by using the ‘,’ command. + + If you’re carrying too many items, NetHack will tell you so + and you won’t be able to pick up anything more. Otherwise, it + will add the object(s) to your pack and tell you what you just + picked up. + + As you add items to your inventory, you also add the weight + of that object to your load. The amount that you can carry de‐ + pends on your strength and your constitution. The stronger you + are, the less the additional load will affect you. There comes a + point, though, when the weight of all of that stuff you are car‐ + rying around with you through the dungeon will encumber you. + Your reactions will get slower and you’ll burn calories faster, + requiring food more frequently to cope with it. Eventually, + you’ll be so overloaded that you’ll either have to discard some + of what you’re carrying or collapse under its weight. + + NetHack will tell you how badly you have loaded yourself. + The symbols ‘Burdened’, ‘Stressed’, ‘Strained’, ‘Overtaxed’ and + ‘Overloaded’ are displayed on the bottom line display to indicate + your condition. + + + NetHack 3.6 March 27, 2015 @@ -1522,63 +1522,63 @@ - what to throw, you will be prompted for a direction rather than - for a specific target. The distance something can be thrown de- - pends mainly on the type of object and your strength. Arrows can - be thrown by hand, but can be thrown much farther and will be - more likely to hit when thrown while you are wielding a bow. + When you pick up an object, it is assigned an inventory let‐ + ter. Many commands that operate on objects must ask you to find + out which object you want to use. When NetHack asks you to + choose a particular object you are carrying, you are usually pre‐ + sented with a list of inventory letters to choose from (see Com‐ + mands, above). - You can simplify the throwing operation by using the `Q' - command to select your preferred ``missile'', then using the `f' - command to throw it. You'll be prompted for a direction as - above, but you don't have to specify which item to throw each - time you use `f'. There is also an option, autoquiver, which has - NetHack choose another item to automatically fill your quiver - when the inventory slot used for `Q' runs out. + Some objects, such as weapons, are easily differentiated. + Others, like scrolls and potions, are given descriptions which + vary according to type. During a game, any two objects with the + same description are the same type. However, the descriptions + will vary from game to game. - Some characters have the ability to fire a volley of multi- - ple items in a single turn. Knowing how to load several rounds - of ammunition at once -- or hold several missiles in your hand -- - and still hit a target is not an easy task. Rangers are among - those who are adept at this task, as are those with a high level - of proficiency in the relevant weapon skill (in bow skill if - you're wielding one to shoot arrows, in crossbow skill if you're - wielding one to shoot bolts, or in sling skill if you're wielding - one to shoot stones). The number of items that the character has - a chance to fire varies from turn to turn. You can explicitly - limit the number of shots by using a numeric prefix before the - `t' or `f' command. For example, ``2f'' (or ``n2f'' if using - number_pad mode) would ensure that at most 2 arrows are shot even - if you could have fired 3. If you specify a larger number than - would have been shot (``4f'' in this example), you'll just end up - shooting the same number (3, here) as if no limit had been speci- - fied. Once the volley is in motion, all of the items will travel - in the same direction; if the first ones kill a monster, the oth- - ers can still continue beyond that spot. + When you use one of these objects, if its effect is obvious, + NetHack will remember what it is for you. If its effect isn’t + extremely obvious, you will be asked what you want to call this + type of object so you will recognize it later. You can also use + the ‘‘#name’’ command, or its synonym ‘C’, for the same purpose + at any time, to name all objects of a particular type or just an + individual object. When you use ‘‘#name’’ on an object which has + already been named, specifying a space as the value will remove + the prior name instead of assigning a new one. - 7.2.2. Weapon proficiency + 7.1. Curses and Blessings - You will have varying degrees of skill in the weapons avail- - able. Weapon proficiency, or weapon skills, affect how well you - can use particular types of weapons, and you'll be able to im- - prove your skills as you progress through a game, depending on - your role, your experience level, and use of the weapons. + Any object that you find may be cursed, even if the object + is otherwise helpful. The most common effect of a curse is being + stuck with (and to) the item. Cursed weapons weld themselves to + your hand when wielded, so you cannot unwield them. Any cursed + item you wear is not removable by ordinary means. In addition, + cursed arms and armor usually, but not always, bear negative en‐ + chantments that make them less effective in combat. Other cursed + objects may act poorly or detrimentally in other ways. - For the purposes of proficiency, weapons have been divided - up into various groups such as daggers, broadswords, and - polearms. Each role has a limit on what level of proficiency a - character can achieve for each group. For instance, wizards can - become highly skilled in daggers or staves but not in swords or - bows. + Objects can also be blessed. Blessed items usually work + better or more beneficially than normal uncursed items. For ex‐ + ample, a blessed weapon will do more damage against demons. - The `#enhance' extended command is used to review current - weapons proficiency (also spell proficiency) and to choose which - skill(s) to improve when you've used one or more skills enough to - become eligible to do so. The skill rankings are ``none'' (some- - times also referred to as ``restricted'', because you won't be + There are magical means of bestowing or removing curses upon + objects, so even if you are stuck with one, you can still have + the curse lifted and the item removed. Priests and Priestesses + have an innate sensitivity to this property in any object, so + they can more easily avoid cursed objects than other character + roles. + + An item with unknown status will be reported in your inven‐ + tory with no prefix. An item which you know the state of will be + distinguished in your inventory by the presence of the word + ‘‘cursed’’, ‘‘uncursed’’ or ‘‘blessed’’ in the description of the + item. - NetHack 3.5 September 20, 2006 + + + + + NetHack 3.6 March 27, 2015 @@ -1588,35 +1588,230 @@ - able to advance), ``unskilled'', ``basic'', ``skilled'', and - ``expert''. Restricted skills simply will not appear in the list - shown by `#enhance'. (Divine intervention might unrestrict a - particular skill, in which case it will start at unskilled and be - limited to basic.) Some characters can enhance their barehanded - combat or martial arts skill beyond expert to ``master'' or - ``grand master''. + 7.2. Weapons (‘)’) - Use of a weapon in which you're restricted or unskilled will + Given a chance, most monsters in the Mazes of Menace will + gratuitously try to kill you. You need weapons for self‐defense + (killing them first). Without a weapon, you do only 1‐2 hit + points of damage (plus bonuses, if any). Monk characters are an + exception; they normally do much more damage with bare hands than + they do with weapons. + + There are wielded weapons, like maces and swords, and thrown + weapons, like arrows and spears. To hit monsters with a weapon, + you must wield it and attack them, or throw it at them. You can + simply elect to throw a spear. To shoot an arrow, you should + first wield a bow, then throw the arrow. Crossbows shoot cross‐ + bow bolts. Slings hurl rocks and (other) stones (like gems). + + Enchanted weapons have a ‘‘plus’’ (or ‘‘to hit enhancement’’ + which can be either positive or negative) that adds to your + chance to hit and the damage you do to a monster. The only way + to determine a weapon’s enchantment is to have it magically iden‐ + tified somehow. Most weapons are subject to some type of damage + like rust. Such ‘‘erosion’’ damage can be repaired. + + The chance that an attack will successfully hit a monster, + and the amount of damage such a hit will do, depends upon many + factors. Among them are: type of weapon, quality of weapon (en‐ + chantment and/or erosion), experience level, strength, dexterity, + encumbrance, and proficiency (see below). The monster’s armor + class ‐ a general defense rating, not necessarily due to wearing + of armor ‐ is a factor too; also, some monsters are particularly + vulnerable to certain types of weapons. + + Many weapons can be wielded in one hand; some require both + hands. When wielding a two‐handed weapon, you can not wear a + shield, and vice versa. When wielding a one‐handed weapon, you + can have another weapon ready to use by setting things up with + the ‘x’ command, which exchanges your primary (the one being + wielded) and alternate weapons. And if you have proficiency in + the ‘‘two weapon combat’’ skill, you may wield both weapons si‐ + multaneously as primary and secondary; use the ‘#twoweapon’ ex‐ + tended command to engage or disengage that. Only some types of + characters (barbarians, for instance) have the necessary skill + available. Even with that skill, using two weapons at once in‐ + curs a penalty in the chance to hit your target compared to using + just one weapon at a time. + + There might be times when you’d rather not wield any weapon + at all. To accomplish that, wield ‘‐’, or else use the ‘A’ com‐ + mand which allows you to unwield the current weapon in addition + to taking off other worn items. + + Those of you in the audience who are AD&D players, be aware + that each weapon which existed in AD&D does roughly the same dam‐ + age to monsters in NetHack. Some of the more obscure weapons + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 26 + + + + (such as the aklys, lucern hammer, and bec‐de‐corbin) are defined + in an appendix to Unearthed Arcana, an AD&D supplement. + + The commands to use weapons are ‘w’ (wield), ‘t’ (throw), + ‘f’ (fire, an alternative way of throwing), ‘Q’ (quiver), ‘x’ + (exchange), ‘#twoweapon’, and ‘#enhance’ (see below). + + 7.2.1. Throwing and shooting + + You can throw just about anything via the ‘t’ command. It + will prompt for the item to throw; picking ‘?’ will list things + in your inventory which are considered likely to be thrown, or + picking ‘*’ will list your entire inventory. After you’ve chosen + what to throw, you will be prompted for a direction rather than + for a specific target. The distance something can be thrown de‐ + pends mainly on the type of object and your strength. Arrows can + be thrown by hand, but can be thrown much farther and will be + more likely to hit when thrown while you are wielding a bow. + + You can simplify the throwing operation by using the ‘Q’ + command to select your preferred ‘‘missile’’, then using the ‘f’ + command to throw it. You’ll be prompted for a direction as + above, but you don’t have to specify which item to throw each + time you use ‘f’. There is also an option, autoquiver, which has + NetHack choose another item to automatically fill your quiver (or + quiver sack, or have at the ready) when the inventory slot used + for ‘Q’ runs out. + + Some characters have the ability to fire a volley of multi‐ + ple items in a single turn. Knowing how to load several rounds + of ammunition at once ‐‐ or hold several missiles in your hand ‐‐ + and still hit a target is not an easy task. Rangers are among + those who are adept at this task, as are those with a high level + of proficiency in the relevant weapon skill (in bow skill if + you’re wielding one to shoot arrows, in crossbow skill if you’re + wielding one to shoot bolts, or in sling skill if you’re wielding + one to shoot stones). The number of items that the character has + a chance to fire varies from turn to turn. You can explicitly + limit the number of shots by using a numeric prefix before the + ‘t’ or ‘f’ command. For example, ‘‘2f’’ (or ‘‘n2f’’ if using + number_pad mode) would ensure that at most 2 arrows are shot even + if you could have fired 3. If you specify a larger number than + would have been shot (‘‘4f’’ in this example), you’ll just end up + shooting the same number (3, here) as if no limit had been speci‐ + fied. Once the volley is in motion, all of the items will travel + in the same direction; if the first ones kill a monster, the oth‐ + ers can still continue beyond that spot. + + 7.2.2. Weapon proficiency + + You will have varying degrees of skill in the weapons avail‐ + able. Weapon proficiency, or weapon skills, affect how well you + can use particular types of weapons, and you’ll be able to im‐ + prove your skills as you progress through a game, depending on + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 27 + + + + your role, your experience level, and use of the weapons. + + For the purposes of proficiency, weapons have been divided + up into various groups such as daggers, broadswords, and + polearms. Each role has a limit on what level of proficiency a + character can achieve for each group. For instance, wizards can + become highly skilled in daggers or staves but not in swords or + bows. + + The ‘#enhance’ extended command is used to review current + weapons proficiency (also spell proficiency) and to choose which + skill(s) to improve when you’ve used one or more skills enough to + become eligible to do so. The skill rankings are ‘‘none’’ (some‐ + times also referred to as ‘‘restricted’’, because you won’t be + able to advance), ‘‘unskilled’’, ‘‘basic’’, ‘‘skilled’’, and + ‘‘expert’’. Restricted skills simply will not appear in the list + shown by ‘#enhance’. (Divine intervention might unrestrict a + particular skill, in which case it will start at unskilled and be + limited to basic.) Some characters can enhance their barehanded + combat or martial arts skill beyond expert to ‘‘master’’ or + ‘‘grand master’’. + + Use of a weapon in which you’re restricted or unskilled will incur a modest penalty in the chance to hit a monster and also in - the amount of damage done when you do hit; at basic level, there - is no penalty or bonus; at skilled level, you receive a modest - bonus in the chance to hit and amount of damage done; at expert - level, the bonus is higher. A successful hit has a chance to - boost your training towards the next skill level (unless you've - already reached the limit for this skill). Once such training - reaches the threshold for that next level, you'll be told that - you feel more confident in your skills. At that point you can - use `#enhance' to increase one or more skills. Such skills are - not increased automatically because there is a limit to your to- - tal overall skills, so you need to actively choose which skills + the amount of damage done when you do hit; at basic level, there + is no penalty or bonus; at skilled level, you receive a modest + bonus in the chance to hit and amount of damage done; at expert + level, the bonus is higher. A successful hit has a chance to + boost your training towards the next skill level (unless you’ve + already reached the limit for this skill). Once such training + reaches the threshold for that next level, you’ll be told that + you feel more confident in your skills. At that point you can + use ‘#enhance’ to increase one or more skills. Such skills are + not increased automatically because there is a limit to your to‐ + tal overall skills, so you need to actively choose which skills to enhance and which to ignore. - 7.3. Armor (`[') + 7.2.3. Two‐Weapon combat - Lots of unfriendly things lurk about; you need armor to pro- + Some characters can use two weapons at once. Setting things + up to do so can seem cumbersome but becomes second nature with + use. To wield two weapons, you need to use the ‘‘#twoweapon’’ + command. But first you need to have a weapon in each hand. + (Note that your two weapons are not fully equal; the one in the + hand you normally wield with is considered primary and the other + one is considered secondary. The most noticeable difference is + after you stop‐‐or before you begin, for that matter‐‐wielding + two weapons at once. The primary is your wielded weapon and the + secondary is just an item in your inventory that’s been designat‐ + ed as alternate weapon.) + + If your primary weapon is wielded but your off hand is empty + or has the wrong weapon, use the sequence ’x’, ’w’, ’x’ to first + swap your primary into your off hand, wield whatever you want as + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 28 + + + + secondary weapon, then swap them both back into the intended + hands. If your secondary or alternate weapon is correct but your + primary one is not, simply use ’w’ to wield the primary. Lastly, + if neither hand holds the correct weapon, use ’w’, ’x’, ’w’ to + first wield the intended secondary, swap it to off hand, and then + wield the primary. + + The whole process can be simplified via use of the push‐ + weapon option. When it is enabled, then using ’w’ to wield some‐ + thing causes the currently wielded weapon to become your alter‐ + nate weapon. So the sequence ’w’, ’w’ can be used to first wield + the weapon you intend to be secondary, and then wield the one you + want as primary which will push the first into secondary posi‐ + tion. + + When in two‐weapon combat mode, using the ‘‘#twoweapon’’ + command toggles back to single‐weapon mode. Throwing or dropping + either of the weapons or having one of them be stolen or de‐ + stroyed will also make you revert to single‐weapon combat. + + 7.3. Armor (‘[’) + + Lots of unfriendly things lurk about; you need armor to pro‐ tect yourself from their blows. Some types of armor offer better protection than others. Your armor class is a measure of this - protection. Armor class (AC) is measured as in AD&D, with 10 be- + protection. Armor class (AC) is measured as in AD&D, with 10 be‐ ing the equivalent of no armor, and lower numbers meaning better armor. Each suit of armor which exists in AD&D gives the same protection in NetHack. Here is an (incomplete) list of the armor @@ -1628,8 +1823,8 @@ bronze plate mail 4 splint mail 4 banded mail 4 - dwarvish mithril-coat 4 - elven mithril-coat 5 + dwarvish mithril‐coat 4 + elven mithril‐coat 5 chain mail 5 orcish chain mail 6 scale mail 6 @@ -1642,103 +1837,103 @@ You can also wear other pieces of armor (ex. helmets, boots, shields, cloaks) to lower your armor class even further, but you - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 26 - - - can only wear one item of each category (one suit of armor, one cloak, one helmet, one shield, and so on) at a time. + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 29 + + + If a piece of armor is enchanted, its armor protection will - be better (or worse) than normal, and its ``plus'' (or minus) + be better (or worse) than normal, and its ‘‘plus’’ (or minus) will subtract from your armor class. For example, a +1 chain mail would give you better protection than normal chain mail, lowering your armor class one unit further to 4. When you put on a piece of armor, you immediately find out the armor class and - any ``plusses'' it provides. Cursed pieces of armor usually have + any ‘‘plusses’’ it provides. Cursed pieces of armor usually have negative enchantments (minuses) in addition to being unremovable. Many types of armor are subject to some kind of damage like - rust. Such damage can be repaired. Some types of armor may in- + rust. Such damage can be repaired. Some types of armor may in‐ hibit spell casting. - The commands to use armor are `W' (wear) and `T' (take off). - The `A' command can also be used to take off armor as well as + The commands to use armor are ‘W’ (wear) and ‘T’ (take off). + The ‘A’ command can also be used to take off armor as well as other worn items. - 7.4. Food (`%') + 7.4. Food (‘%’) Food is necessary to survive. If you go too long without eating you will faint, and eventually die of starvation. Some types of food will spoil, and become unhealthy to eat, if not - protected. Food stored in ice boxes or tins (``cans'') will usu- + protected. Food stored in ice boxes or tins (‘‘cans’’) will usu‐ ally stay fresh, but ice boxes are heavy, and tins take a while to open. When you kill monsters, they usually leave corpses which are - also ``food.'' Many, but not all, of these are edible; some also + also ‘‘food.’’ Many, but not all, of these are edible; some also give you special powers when you eat them. A good rule of thumb - is ``you are what you eat.'' + is ‘‘you are what you eat.’’ - Some character roles and some monsters are vegetarian. Veg- + Some character roles and some monsters are vegetarian. Veg‐ etarian monsters will typically never eat animal corpses, while - vegetarian players can, but with some rather unpleasant side-ef- + vegetarian players can, but with some rather unpleasant side‐ef‐ fects. You can name one food item after something you like to eat with the fruit option. - The command to eat food is `e'. + The command to eat food is ‘e’. - 7.5. Scrolls (`?') + 7.5. Scrolls (‘?’) Scrolls are labeled with various titles, probably chosen by - ancient wizards for their amusement value (ex. ``READ ME,'' or - ``THANX MAUD'' backwards). Scrolls disappear after you read them + ancient wizards for their amusement value (ex. ‘‘READ ME,’’ or + ‘‘THANX MAUD’’ backwards). Scrolls disappear after you read them (except for blank ones, without magic spells on them). One of the most useful of these is the scroll of identify, which can be used to determine what another object is, whether it - is cursed or blessed, and how many uses it has left. Some - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 27 - - - - objects of subtle enchantment are difficult to identify without + is cursed or blessed, and how many uses it has left. Some ob‐ + jects of subtle enchantment are difficult to identify without these. + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 30 + + + A mail daemon may run up and deliver mail to you as a scroll of mail (on versions compiled with this feature). To use this feature on versions where NetHack mail delivery is triggered by electronic mail appearing in your system mailbox, you must let - NetHack know where to look for new mail by setting the ``MAIL'' + NetHack know where to look for new mail by setting the ‘‘MAIL’’ environment variable to the file name of your mailbox. You may - also want to set the ``MAILREADER'' environment variable to the + also want to set the ‘‘MAILREADER’’ environment variable to the file name of your favorite reader, so NetHack can shell to it when you read the scroll. On versions of NetHack where mail is - randomly generated internal to the game, these environment vari- + randomly generated internal to the game, these environment vari‐ ables are ignored. You can disable the mail daemon by turning off the mail option. - The command to read a scroll is `r'. + The command to read a scroll is ‘r’. - 7.6. Potions (`!') + 7.6. Potions (‘!’) Potions are distinguished by the color of the liquid inside the flask. They disappear after you quaff them. @@ -1746,22 +1941,22 @@ Clear potions are potions of water. Sometimes these are blessed or cursed, resulting in holy or unholy water. Holy water is the bane of the undead, so potions of holy water are good - things to throw (`t') at them. It is also sometimes very useful - to dip (``#dip'') an object into a potion. + things to throw (‘t’) at them. It is also sometimes very useful + to dip (‘‘#dip’’) an object into a potion. - The command to drink a potion is `q' (quaff). + The command to drink a potion is ‘q’ (quaff). - 7.7. Wands (`/') + 7.7. Wands (‘/’) Magic wands usually have multiple magical charges. Some - wands are directional--you must give a direction in which to zap - them. You can also zap them at yourself (just give a `.' or `s' + wands are directional—you must give a direction in which to zap + them. You can also zap them at yourself (just give a ‘.’ or ‘s’ for the direction). Be warned, however, for this is often unwise. - Other wands are nondirectional--they don't require a direction. + Other wands are nondirectional—they don’t require a direction. The number of charges in a wand is random and decreases by one whenever you use it. - When the number of charges left in a wand becomes zero, at- + When the number of charges left in a wand becomes zero, at‐ tempts to use the wand will usually result in nothing happening. Occasionally, however, it may be possible to squeeze the last few mana points from an otherwise spent wand, destroying it in the @@ -1772,32 +1967,33 @@ In a truly desperate situation, when your back is up against the wall, you might decide to go for broke and break your wand. - This is not for the faint of heart. Doing so will almost cer- + This is not for the faint of heart. Doing so will almost cer‐ tainly cause a catastrophic release of magical energies. - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 28 - - - When you have fully identified a particular wand, inventory display will include additional information in parentheses: the + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 31 + + + number of times it has been recharged followed by a colon and then by its current number of charges. A current charge count of - -1 is a special case indicating that the wand has been cancelled. + ‐1 is a special case indicating that the wand has been cancelled. - The command to use a wand is `z' (zap). To break one, use - the `a' (apply) command. + The command to use a wand is ‘z’ (zap). To break one, use + the ‘a’ (apply) command. - 7.8. Rings (`=') + 7.8. Rings (‘=’) - Rings are very useful items, since they are relatively per- + Rings are very useful items, since they are relatively per‐ manent magic, unlike the usually fleeting effects of potions, scrolls, and wands. @@ -1807,15 +2003,15 @@ Most rings also cause you to grow hungry more rapidly, the rate varying with the type of ring. - The commands to use rings are `P' (put on) and `R' (remove). + The commands to use rings are ‘P’ (put on) and ‘R’ (remove). - 7.9. Spellbooks (`+') + 7.9. Spellbooks (‘+’) Spellbooks are tomes of mighty magic. When studied with the - `r' (read) command, they transfer to the reader the knowledge of - a spell (and therefore eventually become unreadable) -- unless - the attempt backfires. Reading a cursed spellbook or one with - mystic runes beyond your ken can be harmful to your health! + ‘r’ (read) command, they transfer to the reader the knowledge of + a spell (and therefore eventually become unreadable) — unless the + attempt backfires. Reading a cursed spellbook or one with mystic + runes beyond your ken can be harmful to your health! A spell (even when learned) can also backfire when you cast it. If you attempt to cast a spell well above your experience @@ -1827,98 +2023,100 @@ Casting a spell calls forth magical energies and focuses them with your naked mind. Some of the magical energy released comes from within you, and casting several spells in a row may - tire you. Casting of spells also requires practice. With prac- + tire you. Casting of spells also requires practice. With prac‐ tice, your skill in each category of spell casting will improve. Over time, however, your memory of each spell will dim, and you will need to relearn it. - Some spells are directional--you must give a direction in + Some spells are directional—you must give a direction in which to cast them. You can also cast them at yourself (just - give a `.' or `s' for the direction). Be warned, however, for - this is often unwise. Other spells are nondirectional--they - don't require a direction. + give a ‘.’ or ‘s’ for the direction). Be warned, however, for + this is often unwise. Other spells are nondirectional—they don’t + require a direction. Just as weapons are divided into groups in which a character can become proficient (to varying degrees), spells are similarly - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 29 - - - grouped. Successfully casting a spell exercises its skill group; - using the `#enhance' command to advance a sufficiently exercised + using the ‘#enhance’ command to advance a sufficiently exercised + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 32 + + + skill will affect all spells within the group. Advanced skill may increase the potency of spells, reduce their risk of failure during casting attempts, and improve the accuracy of the estimate for how much longer they will be retained in your memory. Skill slots are shared with weapons skills. (See also the section on - ``Weapon proficiency''.) + ‘‘Weapon proficiency’’.) Casting a spell also requires flexible movement, and wearing various types of armor may interfere with that. The command to read a spellbook is the same as for scrolls, - `r' (read). The `+' command lists each spell you know along with + ‘r’ (read). The ‘+’ command lists each spell you know along with its level, skill category, chance of failure when casting, and an - estimate of how strongly it is remembered. The `Z' (cast) com- + estimate of how strongly it is remembered. The ‘Z’ (cast) com‐ mand casts a spell. - 7.10. Tools (`(') + 7.10. Tools (‘(’) Tools are miscellaneous objects with various purposes. Some tools have a limited number of uses, akin to wand charges. For - example, lamps burn out after a while. Other tools are contain- + example, lamps burn out after a while. Other tools are contain‐ ers, which objects can be placed into or taken out of. - The command to use tools is `a' (apply). + The command to use tools is ‘a’ (apply). 7.10.1. Containers You may encounter bags, boxes, and chests in your travels. - A tool of this sort can be opened with the ``#loot'' extended + A tool of this sort can be opened with the ‘‘#loot’’ extended command when you are standing on top of it (that is, on the same - floor spot), or with the `a' (apply) command when you are carry- + floor spot), or with the ‘a’ (apply) command when you are carry‐ ing it. However, chests are often locked, and are in any case unwieldy objects. You must set one down before unlocking it by - using a key or lock-picking tool with the `a' (apply) command, by - kicking it with the `^D' command, or by using a weapon to force - the lock with the ``#force'' extended command. + using a key or lock‐picking tool with the ‘a’ (apply) command, by + kicking it with the ‘^D’ command, or by using a weapon to force + the lock with the ‘‘#force’’ extended command. Some chests are trapped, causing nasty things to happen when you unlock or open them. You can check for and try to deactivate - traps with the ``#untrap'' extended command. + traps with the ‘‘#untrap’’ extended command. - 7.11. Amulets (`"') + 7.11. Amulets (‘"’) Amulets are very similar to rings, and often more powerful. - Like rings, amulets have various magical properties, some benefi- + Like rings, amulets have various magical properties, some benefi‐ cial, some harmful, which are activated by putting them on. Only one amulet may be worn at a time, around your neck. - The commands to use amulets are the same as for rings, `P' - (put on) and `R' (remove). - - - - NetHack 3.5 September 20, 2006 + The commands to use amulets are the same as for rings, ‘P’ + (put on) and ‘R’ (remove). - NetHack Guidebook 30 + NetHack 3.6 March 27, 2015 - 7.12. Gems (`*') + + + NetHack Guidebook 33 + + + + 7.12. Gems (‘*’) Some gems are valuable, and can be sold for a lot of gold. They are also a far more efficient way of carrying your riches. @@ -1926,11 +2124,11 @@ you exit. Other small rocks are also categorized as gems, but they are - much less valuable. All rocks, however, can be used as projec- + much less valuable. All rocks, however, can be used as projec‐ tile weapons (if you have a sling). In the most desperate of cases, you can still throw them by hand. - 7.13. Large rocks (``') + 7.13. Large rocks (‘`’) Statues and boulders are not particularly useful, and are generally heavy. It is rumored that some statues are not what @@ -1939,7 +2137,7 @@ Very large humanoids (giants and their ilk) have been known to use boulders as weapons. - 7.14. Gold (`$') + 7.14. Gold (‘$’) Gold adds to your score, and you can buy things in shops with it. There are a number of monsters in the dungeon that may @@ -1955,7 +2153,7 @@ of these challenges, which can be checked at any time with the #conduct command or at the end of the game. When you perform an action which breaks a challenge, it will no longer be listed. - This gives players extra ``bragging rights'' for winning the game + This gives players extra ‘‘bragging rights’’ for winning the game with these challenges. Note that it is perfectly acceptable to win the game without resorting to these restrictions and that it is unusual for players to adhere to challenges the first time @@ -1965,37 +2163,37 @@ The most difficult of these is the foodless challenge. Although creatures can survive long periods of time without food, there is a physiological need for water; thus there is no restriction on - drinking beverages, even if they provide some minor food bene- + drinking beverages, even if they provide some minor food bene‐ fits. Calling upon your god for help with starvation does not violate any food challenges either. A strict vegan diet is one which avoids any food derived - from animals. The primary source of nutrition is fruits and veg- - etables. The corpses and tins of blobs (`b'), jellies (`j'), and + from animals. The primary source of nutrition is fruits and veg‐ + etables. The corpses and tins of blobs (‘b’), jellies (‘j’), and - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 - NetHack Guidebook 31 + NetHack Guidebook 34 - fungi (`F') are also considered to be vegetable matter. Certain + fungi (‘F’) are also considered to be vegetable matter. Certain human food is prepared without animal products; namely, lembas - wafers, cram rations, food rations (gunyoki), K-rations, and C- + wafers, cram rations, food rations (gunyoki), K‐rations, and C‐ rations. Metal or another normally indigestible material eaten - while polymorphed into a creature that can digest it is also con- + while polymorphed into a creature that can digest it is also con‐ sidered vegan food. Note however that eating such items still counts against foodless conduct. - Vegetarians do not eat animals; however, they are less se- + Vegetarians do not eat animals; however, they are less se‐ lective about eating animal byproducts than vegans. In addition to the vegan items listed above, they may eat any kind of pudding - (`P') other than the black puddings, eggs and food made from eggs + (‘P’) other than the black puddings, eggs and food made from eggs (fortune cookies and pancakes), food made with milk (cream pies and candy bars), and lumps of royal jelly. Monks are expected to observe a vegetarian diet. @@ -2004,32 +2202,32 @@ foodless conducts. This includes tripe rations, the corpses or tins of any monsters not mentioned above, and the various other chunks of meat found in the dungeon. Swallowing and digesting a - monster while polymorphed is treated as if you ate the creature's - corpse. Eating leather, dragon hide, or bone items while poly- + monster while polymorphed is treated as if you ate the creature’s + corpse. Eating leather, dragon hide, or bone items while poly‐ morphed into a creature that can digest it, or eating monster brains while polymorphed into a mind flayer, is considered eating an animal, although wax is only an animal byproduct. Regardless of conduct, there will be some items which are indigestible, and others which are hazardous to eat. Using a - swallow-and-digest attack against a monster is equivalent to eat- - ing the monster's corpse. Please note that the term ``vegan'' is + swallow‐and‐digest attack against a monster is equivalent to eat‐ + ing the monster’s corpse. Please note that the term ‘‘vegan’’ is used here only in the context of diet. You are still free to choose not to use or wear items derived from animals (e.g. leather, dragon hide, bone, horns, coral), but the game will not - keep track of this for you. Also note that ``milky'' potions may + keep track of this for you. Also note that ‘‘milky’’ potions may be a translucent white, but they do not contain milk, so they are - compatible with a vegan diet. Slime molds or player-defined - ``fruits'', although they could be anything from ``cherries'' to - ``pork chops'', are also assumed to be vegan. + compatible with a vegan diet. Slime molds or player‐defined + ‘‘fruits’’, although they could be anything from ‘‘cherries’’ to + ‘‘pork chops’’, are also assumed to be vegan. An atheist is one who rejects religion. This means that you cannot #pray, #offer sacrifices to any god, #turn undead, or #chat with a priest. Particularly selective readers may argue - that playing Monk or Priest characters should violate this con- + that playing Monk or Priest characters should violate this con‐ duct; that is a choice left to the player. Offering the Amulet of Yendor to your god is necessary to win the game and is not - counted against this conduct. You are also not penalized for be- + counted against this conduct. You are also not penalized for be‐ ing spoken to by an angry god, priest(ess), or other religious figure; a true atheist would hear the words but attach no special meaning to them. @@ -2040,13 +2238,13 @@ throw, fire, and kick weapons; use a wand, spell, or other type - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 - NetHack Guidebook 32 + NetHack Guidebook 35 @@ -2058,30 +2256,30 @@ possible to gain experience by other means. An illiterate character cannot read or write. This includes - reading a scroll, spellbook, fortune cookie message, or t-shirt; + reading a scroll, spellbook, fortune cookie message, or t‐shirt; writing a scroll; or making an engraving of anything other than a - single ``x'' (the traditional signature of an illiterate person). + single ‘‘x’’ (the traditional signature of an illiterate person). Reading an engraving, or any item that is absolutely necessary to win the game, is not counted against this conduct. The identity of scrolls and spellbooks (and knowledge of spells) in your starting inventory is assumed to be learned from your teachers - prior to the start of the game and isn't counted. + prior to the start of the game and isn’t counted. There are several other challenges tracked by the game. It - is possible to eliminate one or more species of monsters by geno- + is possible to eliminate one or more species of monsters by geno‐ cide; playing without this feature is considered a challenge. When the game offers you an opportunity to genocide monsters, you - may respond with the monster type ``none'' if you want to de- + may respond with the monster type ‘‘none’’ if you want to de‐ cline. You can change the form of an item into another item of - the same type (``polypiling'') or the form of your own body into - another creature (``polyself'') by wand, spell, or potion of + the same type (‘‘polypiling’’) or the form of your own body into + another creature (‘‘polyself’’) by wand, spell, or potion of polymorph; avoiding these effects are each considered challenges. Polymorphing monsters, including pets, does not break either of these challenges. Finally, you may sometimes receive wishes; a game without an attempt to wish for any items is a challenge, as is a game without wishing for an artifact (even if the artifact immediately disappears). When the game offers you an opportunity - to make a wish for an item, you may choose ``nothing'' if you + to make a wish for an item, you may choose ‘‘nothing’’ if you want to decline. @@ -2094,217 +2292,19 @@ 9.1. Setting the options Options may be set in a number of ways. Within the game, - the `O' command allows you to view all options and change most of + the ‘O’ command allows you to view all options and change most of them. You can also set options automatically by placing them in the NETHACKOPTIONS environment variable or in a configuration - file. Some versions of NetHack also have front-end programs that - allow you to set options before starting the game. + file. Some versions of NetHack also have front‐end programs that + allow you to set options before starting the game or a global + configuration for system administrators. - 9.2. Using the NETHACKOPTIONS environment variable - The NETHACKOPTIONS variable is a comma-separated list of - initial values for the various options. Some can only be turned - NetHack 3.5 September 20, 2006 - - - - NetHack Guidebook 33 - - - - on or off. You turn one of these on by adding the name of the - option to the list, and turn it off by typing a `!' or ``no'' be- - fore the name. Others take a character string as a value. You - can set string options by typing the option name, a colon or - equals sign, and then the value of the string. The value is ter- - minated by the next comma or the end of string. - - For example, to set up an environment variable so that ``au- - toquiver'' is on, ``autopickup'' is off, the name is set to - ``Blue Meanie'', and the fruit is set to ``papaya'', you would - enter the command - - % setenv NETHACKOPTIONS "autoquiver,\!autopickup,name:Blue Meanie,fruit:papaya" - - in csh (note the need to escape the ! since it's special to the - shell), or - - $ NETHACKOPTIONS="autoquiver,!autopickup,name:Blue Meanie,fruit:papaya" - $ export NETHACKOPTIONS - - in sh or ksh. - - 9.3. Using a configuration file - - Any line in the configuration file starting with `#' is - treated as a comment. Any line in the configuration file start- - ing with ``OPTIONS='' may be filled out with options in the same - syntax as in NETHACKOPTIONS. Any line starting with ``SYMBOLS='' - is taken as defining the corresponding symbol in a different syn- - tax, a sequence of decimal numbers giving the character position - in the current font to be used in displaying each entry. Such a - sequence can be continued to multiple lines by putting a `\' at - the end of each line to be continued. - - If your copy of the game included the compile time AUTOPICK- - UP_EXCEPTIONS option, then any line starting with ``AUTOPICK- - UP_EXCEPTION='' is taken as defining an exception to the pick- - up_types option. There is a section of this Guidebook that dis- - cusses that. - - The default name of the configuration file varies on differ- - ent operating systems, but NETHACKOPTIONS can also be set to the - full name of a file you want to use (possibly preceded by an - `@'). - - 9.4. Customization options - - Here are explanations of what the various options do. Char- - acter strings that are too long may be truncated. Some of the - options listed may be inactive in your dungeon. - - acoustics - Enable messages about what your character hears (default on). - Note that this has nothing to do with your computer's audio - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 34 - - - - capabilities. - - align - Your starting alignment (align:lawful, align:neutral, or - align:chaotic). You may specify just the first letter. The - default is to randomly pick an appropriate alignment. If you - prefix a `!' or ``no'' to the value, you can exclude that - alignment from being picked randomly. Cannot be set with the - `O' command. - - autodig - Automatically dig if you are wielding a digging tool and moving - into a place that can be dug (default false). - - autopickup - Automatically pick up things onto which you move (default on). - See pickup_types to refine the behavior. - - autoquiver - This option controls what happens when you attempt the `f' - (fire) command with an empty quiver. When true, the computer - will fill your quiver with some suitable weapon. Note that it - will not take into account the blessed/cursed status, enchant- - ment, damage, or quality of the weapon; you are free to manual- - ly fill your quiver with the `Q' command instead. If no weapon - is found or the option is false, the `t' (throw) command is ex- - ecuted instead. (default false) - - boulder - Set the character used to display boulders (default is rock - class symbol). - - catname - Name your starting cat (ex. ``catname:Morris''). Cannot be set - with the `O' command. - - character - Pick your type of character (ex. ``character:Monk''); synonym - for ``role''. See ``name'' for an alternate method of specify- - ing your role. Normally only the first letter of the value is - examined; the string ``random'' is an exception. - - checkpoint - Save game state after each level change, for possible recovery - after program crash (default on). - - checkspace - Check free disk space before writing files to disk (default - on). You may have to turn this off if you have more than 2 GB - free space on the partition used for your save and level files. - Only applies when MFLOPPY was defined during compilation. - - clicklook - Allows looking at things on the screen by navigating the mouse - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 35 - - - - over them and clicking the right mouse button (default off). - - cmdassist - Have the game provide some additional command assistance for - new players if it detects some anticipated mistakes (default - on). - - confirm - Have user confirm attacks on pets, shopkeepers, and other - peaceable creatures (default on). - - disclose - Controls options for disclosing various information when the - game ends (defaults to all possibilities being disclosed). The - possibilities are: - - i - disclose your inventory. - a - disclose your attributes. - v - summarize monsters that have been vanquished. - g - list monster species that have been genocided. - c - display your conduct. - - Each disclosure possibility can optionally be preceded by a - prefix which let you refine how it behaves. Here are the valid - prefixes: - - y - prompt you and default to yes on the prompt. - n - prompt you and default to no on the prompt. - + - disclose it without prompting. - - - do not disclose it and do not prompt. - - (ex. ``disclose:yi na +v -g -c'') The example sets inventory to - prompt and default to yes, attributes to prompt and default to - no, vanquished to disclose without prompting, genocided to not - disclose and not to prompt, conduct to not disclose and not to - prompt. Note that the vanquished monsters list includes all - monsters killed by traps and each other as well as by you. - - dogname - Name your starting dog (ex. ``dogname:Fang''). Cannot be set - with the `O' command. - - extmenu - Changes the extended commands interface to pop-up a menu of - available commands. It is keystroke compatible with the tradi- - tional interface except that it does not require that you hit - Enter. It is implemented only by the tty port (default off), - when the game has been compiled to support tty graphics. - - female - An obsolete synonym for ``gender:female''. Cannot be set with - the `O' command. - - - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -2314,63 +2314,63 @@ - fixinv - An object's inventory letter sticks to it when it's dropped - (default on). If this is off, dropping an object shifts all - the remaining inventory letters. + 9.2. Using the NETHACKOPTIONS environment variable - fruit - Name a fruit after something you enjoy eating (ex. ``fruit:man- - go'') (default ``slime mold''). Basically a nostalgic whimsy - that NetHack uses from time to time. You should set this to - something you find more appetizing than slime mold. Apples, - oranges, pears, bananas, and melons already exist in NetHack, - so don't use those. + The NETHACKOPTIONS variable is a comma‐separated list of + initial values for the various options. Some can only be turned + on or off. You turn one of these on by adding the name of the + option to the list, and turn it off by typing a ‘!’ or ‘‘no’’ be‐ + fore the name. Others take a character string as a value. You + can set string options by typing the option name, a colon or + equals sign, and then the value of the string. The value is ter‐ + minated by the next comma or the end of string. - gender - Your starting gender (gender:male or gender:female). You may - specify just the first letter. Although you can still denote - your gender using the ``male'' and ``female'' options, the - ``gender'' option will take precedence. The default is to ran- - domly pick an appropriate gender. If you prefix a `!' or - ``no'' to the value, you can exclude that gender from being - picked randomly. Cannot be set with the `O' command. + For example, to set up an environment variable so that ‘‘au‐ + toquiver’’ is on, ‘‘autopickup’’ is off, the name is set to + ‘‘Blue Meanie’’, and the fruit is set to ‘‘papaya’’, you would + enter the command - help - If more information is available for an object looked at with - the `/' command, ask if you want to see it (default on). Turn- - ing help off makes just looking at things faster, since you - aren't interrupted with the ``More info?'' prompt, but it also - means that you might miss some interesting and/or important in- - formation. + % setenv NETHACKOPTIONS "autoquiver,\!autopickup,name:Blue Meanie,fruit:papaya" - horsename - Name your starting horse (ex. ``horsename:Trigger''). Cannot - be set with the `O' command. + in csh (note the need to escape the ! since it’s special to the + shell), or - ignintr - Ignore interrupt signals, including breaks (default off). + $ NETHACKOPTIONS="autoquiver,!autopickup,name:Blue Meanie,fruit:papaya" + $ export NETHACKOPTIONS - legacy - Display an introductory message when starting the game (default - on). + in sh or ksh. - lit_corridor - Show corridor squares seen by night vision or a light source - held by your character as lit (default off). + 9.3. Using a configuration file - lootabc - Use the old `a', `b', and `c' keyboard shortcuts when looting, - rather than the mnemonics `o', `i', and `b' (default off). + Any line in the configuration file starting with ‘#’ is + treated as a comment. Any line in the configuration file start‐ + ing with ‘‘OPTIONS=’’ may be filled out with options in the same + syntax as in NETHACKOPTIONS. Any line starting with ‘‘SYMBOLS=’’ + is taken as defining the corresponding symbol in a different syn‐ + tax, a sequence of decimal numbers giving the character position + in the current font to be used in displaying each entry. Such a + sequence can be continued to multiple lines by putting a ‘\’ at + the end of each line to be continued. - mail - Enable mail delivery during the game (default on). + Any line starting with ‘‘AUTOPICKUP_EXCEPTION=’’ is taken as + defining an exception to the pickup_types option. There is a + section of this Guidebook that discusses that. - male - An obsolete synonym for ``gender:male''. Cannot be set with + The default name of the configuration file varies on differ‐ + ent operating systems, but NETHACKOPTIONS can also be set to the + full name of a file you want to use (possibly preceded by an + ‘@’). + + 9.4. Customization options + + Here are explanations of what the various options do. Char‐ + acter strings that are too long may be truncated. Some of the + options listed may be inactive in your dungeon. - NetHack 3.5 September 20, 2006 + + + NetHack 3.6 March 27, 2015 @@ -2380,63 +2380,63 @@ - the `O' command. + acoustics + Enable messages about what your character hears (default on). + Note that this has nothing to do with your computer’s audio ca‐ + pabilities. - menustyle - Controls the interface used when you need to choose various ob- - jects (in response to the Drop command, for instance). The - value specified should be the first letter of one of the fol- - lowing: traditional, combination, partial, or full. Tradi- - tional was the only interface available for earlier versions; - it consists of a prompt for object class characters, followed - by an object-by-object prompt for all items matching the se- - lected object class(es). Combination starts with a prompt for - object class(es) of interest, but then displays a menu of - matching objects rather than prompting one-by-one. Partial - skips the object class filtering and immediately displays a - menu of all objects. Full displays a menu of object classes - rather than a character prompt, and then a menu of matching ob- - jects for selection. + align + Your starting alignment (align:lawful, align:neutral, or + align:chaotic). You may specify just the first letter. The + default is to randomly pick an appropriate alignment. If you + prefix a ‘!’ or ‘‘no’’ to the value, you can exclude that + alignment from being picked randomly. Cannot be set with the + ‘O’ command. - menu_deselect_all - Menu character accelerator to deselect all items in a menu. - Implemented by the Amiga, Gem, X11 and tty ports. Default '-'. + autodig + Automatically dig if you are wielding a digging tool and moving + into a place that can be dug (default false). - menu_deselect_page - Menu character accelerator to deselect all items on this page - of a menu. Implemented by the Amiga, Gem and tty ports. De- - fault '\'. + autopickup + Automatically pick up things onto which you move (default on). + See pickup_types to refine the behavior. - menu_first_page - Menu character accelerator to jump to the first page in a menu. - Implemented by the Amiga, Gem and tty ports. Default '^'. + autoquiver + This option controls what happens when you attempt the ‘f’ + (fire) command with an empty quiver (or quiver sack or have + nothing at the ready). When true, the computer will fill your + quiver or quiver sack or make ready some suitable weapon. Note + that it will not take into account the blessed/cursed status, + enchantment, damage, or quality of the weapon; you are free to + manually fill your quiver or quiver sack or make ready with the + ‘Q’ command instead. If no weapon is found or the option is + false, the ‘t’ (throw) command is executed instead. (default + false) - menu_headings - Controls how the headings in a menu are highlighted. Values - are 'bold', 'inverse', or 'underline'. Not all ports can actu- - ally display all three types. + bones + Allow saving and loading bones files. (default true) - menu_invert_all - Menu character accelerator to invert all items in a menu. Im- - plemented by the Amiga, Gem, X11 and tty ports. Default '@'. + boulder + Set the character used to display boulders (default is rock + class symbol). - menu_invert_page - Menu character accelerator to invert all items on this page of - a menu. Implemented by the Amiga, Gem and tty ports. Default - '~'. + catname + Name your starting cat (ex. ‘‘catname:Morris’’). Cannot be set + with the ‘O’ command. - menu_last_page - Menu character accelerator to jump to the last page in a menu. - Implemented by the Amiga, Gem and tty ports. Default '|'. + character + Pick your type of character (ex. ‘‘character:Monk’’); synonym + for ‘‘role’’. See ‘‘name’’ for an alternate method of specify‐ + ing your role. Normally only the first letter of the value is + examined; the string ‘‘random’’ is an exception. - menu_next_page - Menu character accelerator to goto the next menu page. Imple- - mented by the Amiga, Gem and tty ports. Default '>'. + checkpoint + Save game state after each level change, for possible recovery + after program crash (default on). - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -2446,63 +2446,63 @@ - menu_previous_page - Menu character accelerator to goto the previous menu page. Im- - plemented by the Amiga, Gem and tty ports. Default '<'. + checkspace + Check free disk space before writing files to disk (default + on). You may have to turn this off if you have more than 2 GB + free space on the partition used for your save and level files. + Only applies when MFLOPPY was defined during compilation. - menu_search - Menu character accelerator to search for a menu item. Imple- - mented by the Amiga, Gem and X11 ports. Default ':'. + clicklook + Allows looking at things on the screen by navigating the mouse + over them and clicking the right mouse button (default off). - menu_select_all - Menu character accelerator to select all items in a menu. Im- - plemented by the Amiga, Gem, X11 and tty ports. Default '.'. + cmdassist + Have the game provide some additional command assistance for + new players if it detects some anticipated mistakes (default + on). - menu_select_page - Menu character accelerator to select all items on this page of - a menu. Implemented by the Amiga, Gem and tty ports. Default - ','. + confirm + Have user confirm attacks on pets, shopkeepers, and other + peaceable creatures (default on). - msghistory - The number of top line messages to save (and recall with ^P) - (default 20). Cannot be set with the `O' command. + disclose + Controls what information the program reveals when the game + ends. Value is a space separated list of prompting/category + pairs (default is ‘ni na nv ng nc no’, prompt with default re‐ + sponse of ‘n’ for each candidate). The possibilities are: - msg_window - Allows you to change the way recalled messages are displayed. - (It is currently implemented for tty only.) The possible val- - ues are: + i ‐ disclose your inventory; + a ‐ disclose your attributes; + v ‐ summarize monsters that have been vanquished; + g ‐ list monster species that have been genocided; + c ‐ display your conduct; + o ‐ display dungeon overview. - s - single message (default, this was the behavior before 3.4.0). - c - combination, two messages as `single', then as `full'. - f - full window, oldest message first. - r - full window, newest message first. + Each disclosure possibility can optionally be preceded by a + prefix which lets you refine how it behaves. Here are the + valid prefixes: - For backward compatibility, no value needs to be specified - (which defaults to `full'), or it can be negated (which de- - faults to `single'). + y ‐ prompt you and default to yes on the prompt; + n ‐ prompt you and default to no on the prompt; + + ‐ disclose it without prompting; + ‐ ‐ do not disclose it and do not prompt. - name - Set your character's name (defaults to your user name). You - can also set your character's role by appending a dash and one - or more letters of the role (that is, by suffixing one of -A -B - -C -H -K -M -P -Ra -Ro -S -T -V -W). If -@ is used for the - role, then a random one will be automatically chosen. Cannot - be set with the `O' command. + Omitted categories are implicitly added with ‘n’ prefix. Spec‐ + ified categories with omitted prefix implicitly use ‘+’ prefix. + Order of the disclosure categories does not matter, program + display for end‐of‐game disclosure follows a set sequence. - news - Read the NetHack news file, if present (default on). Since the - news is shown at the beginning of the game, there's no point in - setting this with the `O' command. + (ex. ‘‘disclose:yi na +v ‐g o’’) The example sets inventory to + prompt and default to yes, attributes to prompt and default to + no, vanquished to disclose without prompting, genocided to not + disclose and not prompt, conduct to implicitly prompt and de‐ + fault to no, and overview to disclose without prompting. - null - Send padding nulls to the terminal (default on). - - number_pad - Use digit keys instead of letters to move (default 0 or off). - Valid settings are: + Note that the vanquished monsters list includes all monsters + killed by traps and each other as well as by you. And the - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -2512,63 +2512,63 @@ - 0 - move by letters; `yuhjklbn'. - 1 - move by numbers; digit `5' acts as `G' movement prefix. - 2 - like 1 but `5' works as `g' prefix instead of as `G'. - 3 - move by numbers using phone keypad layout; 123 above, 789 below. - 4 - combines 3 with 2; phone layout plus MSDOS compatibility. - -1 - move by letters but use `z' to go northwest and `y' to zap wands. + dungeon overview shows all levels you had visited but does not + reveal things about them that you hadn’t discovered. - For backward compatibility, omitting a value is the same as - specifying 1 and negating number_pad is the same as specifying - 0. (Settings 2 and 4 are for compatibility with MSDOS or old - PC Hack; in addition to the different behavior for `5', `Alt-5' - acts as `G' and `Alt-0' acts as `I'. Setting -1 is to accomo- - date some German keyboards which have the location of the `y' - and `z' keys swapped.) When moving by numbers, to enter a - count prefix for those commands which accept one (such as - ``12s'' to search twelve times), precede it with the letter `n' - (``n12s''). + dogname + Name your starting dog (ex. ‘‘dogname:Fang’’). Cannot be set + with the ‘O’ command. - packorder - Specify the order to list object types in (default - ``")[%?+!=/(*`0_''). The value of this option should be a - string containing the symbols for the various object types. - Any omitted types are filled in at the end from the previous - order. + extmenu + Changes the extended commands interface to pop‐up a menu of + available commands. It is keystroke compatible with the tradi‐ + tional interface except that it does not require that you hit + Enter. It is implemented only by the tty port (default off), + when the game has been compiled to support tty graphics. - perm_invent - If true, always display your current inventory in a window. - This only makes sense for windowing system interfaces that im- - plement this feature. + female + An obsolete synonym for ‘‘gender:female’’. Cannot be set with + the ‘O’ command. - pettype - Specify the type of your initial pet, if you are playing a - character class that uses multiple types of pets; or choose to - have no initial pet at all. Possible values are ``cat'', - ``dog'', ``horse'', and ``none''. If the choice is not allowed - for the role you are currently playing, it will be silently ig- - nored. For example, ``horse'' will only be honored when play- - ing a knight. Cannot be set with the `O' command. + fixinv + An object’s inventory letter sticks to it when it’s dropped + (default on). If this is off, dropping an object shifts all + the remaining inventory letters. - pickup_burden - When you pick up an item that would exceed this encumbrance - level (Unburdened, Burdened, streSsed, straiNed, overTaxed, or - overLoaded), you will be asked if you want to continue. (De- - fault `S'). + fruit + Name a fruit after something you enjoy eating (ex. ‘‘fruit:man‐ + go’’) (default ‘‘slime mold’’). Basically a nostalgic whimsy + that NetHack uses from time to time. You should set this to + something you find more appetizing than slime mold. Apples, + oranges, pears, bananas, and melons already exist in NetHack, + so don’t use those. - pickup_thrown - If this option is on and autopickup is also on, try to pick up - things that you threw, even if they aren't in pickup_types or - match an autopickup exception. Default is on. + gender + Your starting gender (gender:male or gender:female). You may + specify just the first letter. Although you can still denote + your gender using the ‘‘male’’ and ‘‘female’’ options, the + ‘‘gender’’ option will take precedence. The default is to ran‐ + domly pick an appropriate gender. If you prefix a ‘!’ or + ‘‘no’’ to the value, you can exclude that gender from being + picked randomly. Cannot be set with the ‘O’ command. - pickup_types - Specify the object types to be picked up when autopickup is on. - Default is all types. If your copy of the game has the compile - time option AUTOPICKUP_EXCEPTIONS included, you may be able to + help + If more information is available for an object looked at with + the ‘/’ command, ask if you want to see it (default on). Turn‐ + ing help off makes just looking at things faster, since you + aren’t interrupted with the ‘‘More info?’’ prompt, but it also + means that you might miss some interesting and/or important in‐ + formation. + + horsename + Name your starting horse (ex. ‘‘horsename:Trigger’’). Cannot + be set with the ‘O’ command. + + ignintr + Ignore interrupt signals, including breaks (default off). - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -2578,63 +2578,63 @@ - use autopickup_exception configuration file lines to further - refine autopickup behavior. + legacy + Display an introductory message when starting the game (default + on). - prayconfirm - Prompt for confirmation before praying (default on). + lit_corridor + Show corridor squares seen by night vision or a light source + held by your character as lit (default off). - pushweapon - Using the `w' (wield) command when already wielding something - pushes the old item into your alternate weapon slot (default - off). Likewise for the `a' (apply) command if it causes the - applied item to become wielded. + lootabc + Use the old ‘a’, ‘b’, and ‘c’ keyboard shortcuts when looting, + rather than the mnemonics ‘o’, ‘i’, and ‘b’ (default off). - race - Selects your race (for example, ``race:human''). Default is - random. If you prefix a `!' or ``no'' to the value, you can - exclude that race from being picked randomly. Cannot be set - with the `O' command. + mail + Enable mail delivery during the game (default on). - rest_on_space - Make the space bar a synonym for the `.' (rest) command (de- - fault off). + male + An obsolete synonym for ‘‘gender:male’’. Cannot be set with + the ‘O’ command. - role - Pick your type of character (ex. ``role:Samurai''); synonym for - ``character''. See ``name'' for an alternate method of speci- - fying your role. Normally only the first letter of the value - is examined; `r' is an exception with ``Rogue'', ``Ranger'', - and ``random'' values. If you prefix a `!' or ``no'' to the - value, you can exclude that role from being picked randomly. + mention_walls + Give feedback when walking against a wall (default off). - roguesymset - This option may be used to select one of the named symbol sets - found within ``symbols'' to alter the symbols displayed on the - screen on the rogue level. + menustyle + Controls the interface used when you need to choose various ob‐ + jects (in response to the Drop command, for instance). The + value specified should be the first letter of one of the fol‐ + lowing: traditional, combination, partial, or full. Tradi‐ + tional was the only interface available for earlier versions; + it consists of a prompt for object class characters, followed + by an object‐by‐object prompt for all items matching the se‐ + lected object class(es). Combination starts with a prompt for + object class(es) of interest, but then displays a menu of + matching objects rather than prompting one‐by‐one. Partial + skips the object class filtering and immediately displays a + menu of all objects. Full displays a menu of object classes + rather than a character prompt, and then a menu of matching ob‐ + jects for selection. - rlecomp - When writing out a save file, perform run length compression of - the map. Not all ports support run length compression. It has - no effect on reading an existing save file. + menu_deselect_all + Menu character accelerator to deselect all items in a menu. + Implemented by the Amiga, Gem, X11 and tty ports. Default ’‐’. - runmode - Controls the amount of screen updating for the map window when - engaged in multi-turn movement (running via shift+direction or - control+direction and so forth, or via the travel command or - mouse click). The possible values are: + menu_deselect_page + Menu character accelerator to deselect all items on this page + of a menu. Implemented by the Amiga, Gem and tty ports. De‐ + fault ’\’. - teleport - update the map after movement has finished; - run - update the map after every seven or so steps; - walk - update the map after each step; - crawl - like walk, but pause briefly after each step. + menu_first_page + Menu character accelerator to jump to the first page in a menu. + Implemented by the Amiga, Gem and tty ports. Default ’^’. - This option only affects the game's screen display, not the ac- - tual results of moving. The default is `run'; versions prior - to 3.4.1 used `teleport' only. Whether or not the effect is + menu_headings + Controls how the headings in a menu are highlighted. Values + are ’bold’, ’inverse’, or ’underline’. Not all ports can - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -2644,6 +2644,280 @@ + actually display all three types. + + menu_invert_all + Menu character accelerator to invert all items in a menu. Im‐ + plemented by the Amiga, Gem, X11 and tty ports. Default ’@’. + + menu_invert_page + Menu character accelerator to invert all items on this page of + a menu. Implemented by the Amiga, Gem and tty ports. Default + ’~’. + + menu_last_page + Menu character accelerator to jump to the last page in a menu. + Implemented by the Amiga, Gem and tty ports. Default ’|’. + + menu_next_page + Menu character accelerator to goto the next menu page. Imple‐ + mented by the Amiga, Gem and tty ports. Default ’>’. + + menu_objsyms + Show object symbols in menu headings in menus where the object + symbols act as menu accelerators (default off). + + menu_previous_page + Menu character accelerator to goto the previous menu page. Im‐ + plemented by the Amiga, Gem and tty ports. Default ’<’. + + menu_search + Menu character accelerator to search for a menu item. Imple‐ + mented by the Amiga, Gem, X11 and tty ports. Default ’:’. + + menu_select_all + Menu character accelerator to select all items in a menu. Im‐ + plemented by the Amiga, Gem, X11 and tty ports. Default ’.’. + + menu_select_page + Menu character accelerator to select all items on this page of + a menu. Implemented by the Amiga, Gem and tty ports. Default + ’,’. + + msghistory + The number of top line messages to save (and recall with ^P) + (default 20). Cannot be set with the ‘O’ command. + + msg_window + Allows you to change the way recalled messages are displayed. + (It is currently implemented for tty only.) The possible val‐ + ues are: + + s ‐ single message (default; only choice prior to 3.4.0); + c ‐ combination, two messages as ‘single’, then as ‘full’; + f ‐ full window, oldest message first; + r ‐ full window reversed, newest message first. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 42 + + + + For backward compatibility, no value needs to be specified + (which defaults to ‘full’), or it can be negated (which de‐ + faults to ‘single’). + + name + Set your character’s name (defaults to your user name). You + can also set your character’s role by appending a dash and one + or more letters of the role (that is, by suffixing one of ‐A ‐B + ‐C ‐H ‐K ‐M ‐P ‐Ra ‐Ro ‐S ‐T ‐V ‐W). If ‐@ is used for the + role, then a random one will be automatically chosen. Cannot + be set with the ‘O’ command. + + news + Read the NetHack news file, if present (default on). Since the + news is shown at the beginning of the game, there’s no point in + setting this with the ‘O’ command. + + null + Send padding nulls to the terminal (default on). + + number_pad + Use digit keys instead of letters to move (default 0 or off). + Valid settings are: + + 0 ‐ move by letters; ‘yuhjklbn’ + 1 ‐ move by numbers; digit ‘5’ acts as ‘G’ movement prefix + 2 ‐ like 1 but ‘5’ works as ‘g’ prefix instead of as ‘G’ + 3 ‐ by numbers using phone key layout; 123 above, 789 below + 4 ‐ combines 3 with 2; phone layout plus MSDOS compatibility + ‐1 ‐ by letters but use ‘z’ to go northwest, ‘y’ to zap wands + + For backward compatibility, omitting a value is the same as + specifying 1 and negating number_pad is the same as specifying + 0. (Settings 2 and 4 are for compatibility with MSDOS or old + PC Hack; in addition to the different behavior for ‘5’, ‘Alt‐5’ + acts as ‘G’ and ‘Alt‐0’ acts as ‘I’. Setting ‐1 is to accommo‐ + date some German keyboards which have the location of the ‘y’ + and ‘z’ keys swapped.) When moving by numbers, to enter a + count prefix for those commands which accept one (such as + ‘‘12s’’ to search twelve times), precede it with the letter ‘n’ + (‘‘n12s’’). + + packorder + Specify the order to list object types in (default + ‘‘")[%?+!=/(*‘0_’’). The value of this option should be a + string containing the symbols for the various object types. + Any omitted types are filled in at the end from the previous + order. + + paranoid_confirmation + A space separated list of specific situations where alternate + prompting is desired. The default is paranoid_confirma‐ + tion:pray. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 43 + + + + Confirm ‐ for any prompts which are set to require "yes" rather + than ’y’, also require "no" to reject instead of ac‐ + cepting any non‐yes response as no + quit ‐ require "yes" rather than ’y’ to confirm quitting the + game or switching into non‐scoring explore mode; + die ‐ require "yes" rather than ’y’ to confirm dying (not + useful in normal play; applies to explore mode); + bones ‐ require "yes" rather than ’y’ to confirm saving bones + data when dying in debug mode; + attack ‐ require "yes" rather than ’y’ to confirm attacking a + peaceful monster; + pray ‐ require ’y’ to confirm an attempt to pray rather than + immediately praying; on by default; + Remove ‐ require selection from inventory for ’R’ and ’T’ com‐ + mands even when wearing just one applicable item. + + By default, the pray choice is enabled, the others disabled. + To disable it without setting any of the other choices, use + ‘‘paranoid_confirmation:none’’. To keep it enabled while set‐ + ting any of the others, include it in the list, such as ‘‘para‐ + noid_confirmation:attack pray Remove’’. + + perm_invent + If true, always display your current inventory in a window. + This only makes sense for windowing system interfaces that im‐ + plement this feature. + + pettype + Specify the type of your initial pet, if you are playing a + character class that uses multiple types of pets; or choose to + have no initial pet at all. Possible values are ‘‘cat’’, + ‘‘dog’’, ‘‘horse’’, and ‘‘none’’. If the choice is not allowed + for the role you are currently playing, it will be silently ig‐ + nored. For example, ‘‘horse’’ will only be honored when play‐ + ing a knight. Cannot be set with the ‘O’ command. + + pickup_burden + When you pick up an item that would exceed this encumbrance + level (Unencumbered, Burdened, streSsed, straiNed, overTaxed, + or overLoaded), you will be asked if you want to continue. + (Default ‘S’). + + pickup_thrown + If this option is on and autopickup is also on, try to pick up + things that you threw, even if they aren’t in pickup_types or + match an autopickup exception. Default is on. + + pickup_types + Specify the object types to be picked up when autopickup is on. + Default is all types. You can use autopickup_exception config‐ + uration file lines to further refine autopickup behavior. + + pile_limit + When walking across a pile of objects on the floor, threshold + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 44 + + + + at which the message "there are few/several/many objects here" + is given instead of showing a popup list of those objects. A + value of 0 means "no limit" (always list the objects); a value + of 1 effectively means "never show the objects" since the pile + size will always be at least that big; default value is 5. + + playmode + Values are ‘normal’, ‘explore’, or ‘debug’. Allows selection + of explore mode (also known as discovery mode) or debug mode + (also known as wizard mode) instead of normal play. Debug mode + might only be allowed for someone logged in under a particular + user name (on multi‐user systems) or specifying a particular + character name (on single‐user systems) or it might be disabled + entirely. Requesting it when not allowed or not possible re‐ + sults in explore mode instead. Default is normal play. + + pushweapon + Using the ‘w’ (wield) command when already wielding something + pushes the old item into your alternate weapon slot (default + off). Likewise for the ‘a’ (apply) command if it causes the + applied item to become wielded. + + race + Selects your race (for example, ‘‘race:human’’). Default is + random. If you prefix a ‘!’ or ‘‘no’’ to the value, you can + exclude that race from being picked randomly. Cannot be set + with the ‘O’ command. + + rest_on_space + Make the space bar a synonym for the ‘.’ (rest) command (de‐ + fault off). + + role + Pick your type of character (ex. ‘‘role:Samurai’’); synonym for + ‘‘character’’. See ‘‘name’’ for an alternate method of speci‐ + fying your role. Normally only the first letter of the value + is examined; ‘r’ is an exception with ‘‘Rogue’’, ‘‘Ranger’’, + and ‘‘random’’ values. If you prefix a ‘!’ or ‘‘no’’ to the + value, you can exclude that role from being picked randomly. + + roguesymset + This option may be used to select one of the named symbol sets + found within ‘‘symbols’’ to alter the symbols displayed on the + screen on the rogue level. + + rlecomp + When writing out a save file, perform run length compression of + the map. Not all ports support run length compression. It has + no effect on reading an existing save file. + + runmode + Controls the amount of screen updating for the map window when + engaged in multi‐turn movement (running via shift+direction or + control+direction and so forth, or via the travel command or + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 45 + + + + mouse click). The possible values are: + + teleport ‐ update the map after movement has finished; + run ‐ update the map after every seven or so steps; + walk ‐ update the map after each step; + crawl ‐ like walk, but pause briefly after each step. + + This option only affects the game’s screen display, not the ac‐ + tual results of moving. The default is ‘run’; versions prior + to 3.4.1 used ‘teleport’ only. Whether or not the effect is noticeable will depend upon the window port used or on the type of terminal. @@ -2652,8 +2926,8 @@ scores Control what parts of the score list you are shown at the end - (ex. ``scores:5 top scores/4 around my score/own scores''). - Only the first letter of each category (`t', `a', or `o') is + (ex. ‘‘scores:5 top scores/4 around my score/own scores’’). + Only the first letter of each category (‘t’, ‘a’, or ‘o’) is necessary. showexp @@ -2662,7 +2936,7 @@ showrace Display yourself as the glyph for your race, rather than the - glyph for your role (default off). Note that this setting af- + glyph for your role (default off). Note that this setting af‐ fects only the appearance of the display, not the way the game treats you. @@ -2674,7 +2948,7 @@ Suppress terminal beeps (default on). sortpack - Sort the pack contents by type when displaying inventory (de- + Sort the pack contents by type when displaying inventory (de‐ fault on). sparkle @@ -2682,39 +2956,38 @@ hit by an attack to which it is resistant (default on). standout - Boldface monsters and ``--More--'' (default off). + Boldface monsters and ‘‘‐‐More‐‐’’ (default off). suppress_alert This option may be set to a NetHack version level to suppress alert notification messages about feature changes for that and - prior versions (ex. ``suppress_alert:3.3.1''). + prior versions (ex. ‘‘suppress_alert:3.3.1’’). + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 46 + + symset This option may be used to select one of the named symbol sets - found within ``symbols'' to alter the symbols displayed on the + found within ‘‘symbols’’ to alter the symbols displayed on the screen. time Show the elapsed game time in turns on bottom line (default off). - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 42 - - - timed_delay - When pausing momentarily for display effect, such as with ex- + When pausing momentarily for display effect, such as with ex‐ plosions and moving objects, use a timer rather than sending - extra characters to the screen. (Applies to ``tty'' interface - only; ``X11'' interface always uses a timer based delay. The + extra characters to the screen. (Applies to ‘‘tty’’ interface + only; ‘‘X11’’ interface always uses a timer based delay. The default is on if configured into the program.) tombstone @@ -2722,7 +2995,7 @@ toptenwin Put the ending display in a NetHack window instead of on stdout - (default off). Setting this option makes the score list visi- + (default off). Setting this option makes the score list visi‐ ble when a windowing version of NetHack is started without a parent window, but it no longer leaves the score list around after game end on a terminal or emulating window. @@ -2736,13 +3009,13 @@ Provide more commentary during the game (default on). windowtype - Select which windowing system to use, such as ``tty'' or - ``X11'' (default depends on version). Cannot be set with the - `O' command. + Select which windowing system to use, such as ‘‘tty’’ or + ‘‘X11’’ (default depends on version). Cannot be set with the + ‘O’ command. zerocomp - When writing out a save file, perform zero-comp compression of - the contents. Not all ports support zero-comp compression. It + When writing out a save file, perform zero‐comp compression of + the contents. Not all ports support zero‐comp compression. It has no effect on reading an existing save file. 9.5. Window Port Customization options @@ -2753,29 +3026,29 @@ truncated. Not all window ports will adjust for all settings listed here. You can safely add any of these options to your config file, and if the window port is capable of adjusting to - suit your preferences, it will attempt to do so. If it can't it - will silently ignore it. You can find out if an option is sup- - ported by the window port that you are currently using by check- - ing to see if it shows up in the Options list. Some options are - dynamic and can be specified during the game with the `O' com- - mand. + suit your preferences, it will attempt to do so. If it can’t it + will silently ignore it. You can find out if an option is + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 47 + + + + supported by the window port that you are currently using by + checking to see if it shows up in the Options list. Some options + are dynamic and can be specified during the game with the ‘O’ + command. align_message Where to align or place the message window (top, bottom, left, or right) - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 43 - - - align_status Where to align or place the status window (top, bottom, left, or right). @@ -2788,12 +3061,12 @@ objects, and dungeon features eight_bit_tty - NetHack should pass eight-bit character values (for example, - specified with the traps option) straight through to your ter- + NetHack should pass eight‐bit character values (for example, + specified with the traps option) straight through to your ter‐ minal (default off). font_map - NetHack should use a font by the chosen name for the map win- + NetHack should use a font by the chosen name for the map win‐ dow. font_menu @@ -2822,6 +3095,17 @@ font_size_status NetHack should use this size font for the status window. + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 48 + + + font_size_text NetHack should use this size font for text windows. @@ -2829,19 +3113,6 @@ NetHack should try and display on the entire screen rather than in a window. - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 44 - - - hilite_pet Visually distinguish pets from similar animals (default off). The behavior of this option depends on the type of windowing @@ -2859,7 +3130,7 @@ Allow use of the mouse for input and travel. player_selection - NetHack should pop up dialog boxes, or use prompts for charac- + NetHack should pop up dialog boxes, or use prompts for charac‐ ter selection. popup_dialog @@ -2867,10 +3138,10 @@ preload_tiles NetHack should preload tiles into memory. For example, in the - protected mode MSDOS version, control whether tiles get pre- + protected mode MSDOS version, control whether tiles get pre‐ loaded into RAM at the start of the game. Doing so enhances - performance of the tile graphics, but uses more memory. (de- - fault on). Cannot be set with the `O' command. + performance of the tile graphics, but uses more memory. (de‐ + fault on). Cannot be set with the ‘O’ command. scroll_amount NetHack should scroll the display by this number of cells when @@ -2889,6 +3160,18 @@ Display an onscreen keyboard. Handhelds are most likely to support this option. + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 49 + + + splash_screen NetHack should display an opening splash screen when it starts up (default yes). @@ -2896,18 +3179,6 @@ tiled_map NetHack should display a tiled map if it can. - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 45 - - - tile_file Specify the name of an alternative tile file to override the default. @@ -2927,14 +3198,14 @@ message window. windowcolors - NetHack should display windows with the specified fore- + NetHack should display windows with the specified fore‐ ground/background colors if it can. wraptext - NetHack port should wrap long lines of text if they don't fit + NetHack port should wrap long lines of text if they don’t fit in the visible area of the window. - 9.6. Platform-specific Customization options + 9.6. Platform‐specific Customization options Here are explanations of options that are used by specific platforms or ports to customize and change the port behavior. @@ -2943,15 +3214,43 @@ Select an alternate keystroke handler dll to load (Win32 tty NetHack only). The name of the handler is specified without the .dll extension and without any path information. Cannot be - set with the `O' command. + set with the ‘O’ command. altmeta - (default on, AMIGA NetHack only). + On Amiga, this option controls whether typing ‘Alt’ plus anoth‐ + er key functions as a meta‐shift for that key (default on). + + altmeta + On other (non‐Amiga) systems where this option is available, it + can be set to tell nethack to convert a two character sequence + beginning with ESC into a meta‐shifted version of the second + character (default off). + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 50 + + + + This conversion is only done for commands, not for other input + prompts. Note that typing one or more digits as a count prefix + prior to a command‐‐preceded by n if the number_pad option is + set‐‐is also subject to this conversion, so attempting to abort + the count by typing ESC will leave nethack waiting for another + character to complete the two character sequence. Type a sec‐ + ond ESC to finish cancelling such a count. At other prompts a + single ESC suffices. BIOS Use BIOS calls to update the screen display quickly and to read - the keyboard (allowing the use of arrow keys to move) on ma- - chines with an IBM PC compatible BIOS ROM (default off, OS/2, + the keyboard (allowing the use of arrow keys to move) on ma‐ + chines with an IBM PC compatible BIOS ROM (default off, OS/2, PC, and ST NetHack only). flush @@ -2963,177 +3262,180 @@ page_wait (default on, Mac NetHack only). - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 46 - - - rawio - Force raw (non-cbreak) mode for faster output and more bullet- - proof input (MS-DOS sometimes treats `^P' as a printer toggle - without it) (default off, OS/2, PC, and ST NetHack only). - Note: DEC Rainbows hang if this is turned on. Cannot be set - with the `O' command. + Force raw (non‐cbreak) mode for faster output and more bullet‐ + proof input (MS‐DOS sometimes treats ‘^P’ as a printer toggle + without it) (default off, OS/2, PC, and ST NetHack only). + Note: DEC Rainbows hang if this is turned on. Cannot be set + with the ‘O’ command. soundcard - (default on, PC NetHack only). Cannot be set with the `O' com- + (default on, PC NetHack only). Cannot be set with the ‘O’ com‐ mand. subkeyvalue - (Win32 tty NetHack only). May be used to alter the value of + (Win32 tty NetHack only). May be used to alter the value of keystrokes that the operating system returns to NetHack to help - compensate for international keyboard issues. OPTIONS=subkey- - value:171/92 will return 92 to NetHack, if 171 was originally - going to be returned. You can use multiple subkeyvalue state- - ments in the config file if needed. Cannot be set with the `O' + compensate for international keyboard issues. OPTIONS=subkey‐ + value:171/92 will return 92 to NetHack, if 171 was originally + going to be returned. You can use multiple subkeyvalue state‐ + ments in the config file if needed. Cannot be set with the ‘O’ command. video - Set the video mode used (PC NetHack only). Values are `autode- - tect', `default', or `vga'. Setting `vga' (or `autodetect' - with vga hardware present) will cause the game to display - tiles. Cannot be set with the `O' command. + Set the video mode used (PC NetHack only). Values are ‘autode‐ + tect’, ‘default’, or ‘vga’. Setting ‘vga’ (or ‘autodetect’ + with vga hardware present) will cause the game to display + tiles. Cannot be set with the ‘O’ command. videocolors - Set the color palette for PC systems using NO_TERMS (default - 4-2-6-1-5-3-15-12-10-14-9-13-11, (PC NetHack only). The order - of colors is red, green, brown, blue, magenta, cyan, - bright.white, bright.red, bright.green, yellow, bright.blue, - bright.magenta, and bright.cyan. Cannot be set with the `O' + Set the color palette for PC systems using NO_TERMS (default + 4‐2‐6‐1‐5‐3‐15‐12‐10‐14‐9‐13‐11, (PC NetHack only). The order + of colors is red, green, brown, blue, magenta, cyan, + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 51 + + + + bright.white, bright.red, bright.green, yellow, bright.blue, + bright.magenta, and bright.cyan. Cannot be set with the ‘O’ command. videoshades - Set the intensity level of the three gray scales available (de- + Set the intensity level of the three gray scales available (de‐ fault dark normal light, PC NetHack only). If the game display - is difficult to read, try adjusting these scales; if this does - not correct the problem, try !color. Cannot be set with the - `O' command. + is difficult to read, try adjusting these scales; if this does + not correct the problem, try !color. Cannot be set with the + ‘O’ command. 9.7. Configuring autopickup exceptions - There is an experimental compile time option called AU- - TOPICKUP_EXCEPTIONS. If your copy of the game was built with - that option defined, you can further refine the behavior of the - autopickup option beyond what is available through the pick- - up_types option. + You can further refine the behavior of the autopickup option + beyond what is available through the pickup_types option. By placing autopickup_exception lines in your configuration file, you can define patterns to be checked when the game is about to autopickup something. - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 47 - - - autopickup_exception - Sets an exception to the pickup_types option. The autopick- - up_exception option should be followed by a string of 1-80 - characters to be used as a pattern to match against the singu- + Sets an exception to the pickup_types option. The autopick‐ + up_exception option should be followed by a string of 1‐80 + characters to be used as a pattern to match against the singu‐ lar form of the description of an object at your location. - You may use the following special characters in a pattern: + You may use the following special characters in a pattern: - *--- matches 0 or more characters. - ?--- matches any single character. + * ‐ matches zero or more characters; + ? ‐ matches any single character. - In addition, some characters are treated specially if they - occur as the first character in the string pattern, specifically: + In addition, some characters are treated specially if they oc‐ + cur as the first character in the pattern, specifically: - < - always pickup an object that matches the pattern that follows. - > - never pickup an object that matches the pattern that follows. + < ‐ always pickup an object that matches rest of pattern; + > ‐ never pickup an object that matches rest of pattern. - Can be set with the `O' command, but the setting is not pre- - served across saves and restores. + A ‘never pickup’ rule takes precedence over an ‘always pickup’ + rule if both match. - Here's a couple of examples of autopickup_exceptions: + Exceptions can be set with the ‘O’ command, but ones set that + way will not be preserved across saves and restores. + + Here are some examples: + + autopickup_exception="<*arrow" + autopickup_exception=">*corpse" + autopickup_exception=">* cursed*" + + The first example above will result in autopickup of any + type of arrow. The second example results in the exclusion of + any corpse from autopickup. The last example results in the ex‐ + clusion of items known to be cursed from autopickup. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 52 - autopickup_exception="<*arrow" - autopickup_exception=">*corpse" - autopickup_exception=">* cursed*" - The first example above will result in autopickup of any type of - arrow. The second example results in the exclusion of any corpse - from autopickup. The last example results in the exclusion of - items known to be cursed from autopickup. A `never pickup' rule - takes precedence over an `always pickup' rule if both match. 9.8. Configuring User Sounds - Some platforms allow you to define sound files to be played - when a message that matches a user-defined pattern is delivered + Some platforms allow you to define sound files to be played + when a message that matches a user‐defined pattern is delivered to the message window. At this time the Qt port and the win32tty and win32gui ports support the use of user sounds. - The following config file entries are relevant to mapping + The following config file entries are relevant to mapping user sounds to messages: SOUNDDIR The directory that houses the sound files to be played. SOUND - An entry that maps a sound file to a user-specified message - pattern. Each SOUND entry is broken down into the following + An entry that maps a sound file to a user‐specified message + pattern. Each SOUND entry is broken down into the following parts: - MESG - message window mapping (the only one supported in 3.5). - pattern - the pattern to match. - sound file - the sound file to play. - volume - the volume to be set while playing the sound file. + MESG ‐ message window mapping (the only one supported in + 3.5); + pattern ‐ the pattern to match; + sound file ‐ the sound file to play; + volume ‐ the volume to be set while playing the sound file. + The exact format for the pattern depends on whether the plat‐ + form is built to use ‘‘regular expressions’’ or NetHack’s own + internal pattern matching facility. The ‘‘regular expressions’’ + matching can be much more sophisticated than the internal + NetHack pattern matching, but requires 3rd party libraries on + some platforms. There are plenty of references available else‐ + where for explaining ‘‘regular expressions’’. You can verify + which pattern matching is used by your port with the #version + command. - NetHack 3.5 September 20, 2006 + NetHack’s internal pattern matching routine uses the following + special characters in its pattern matching: + * ‐ matches 0 or more characters; + ? ‐ matches any single character. + Here’s an example of a sound mapping using NetHack’s internal + pattern matching facility: + SOUND=MESG "*chime of a cash register*" "gong.wav" 50 - - NetHack Guidebook 48 - - - - The exact format for the pattern depends on whether the - platform is built to use ``regular expressions'' or NetHack's own - internal pattern matching facility. The ``regular expressions'' - matching can be much more sophisticated than the internal NetHack - pattern matching, but requires 3rd party libraries on some plat- - forms. There are plenty of references available elsewhere for - explaining ``regular expressions''. You can verify which pattern - matching is used by your port with the #version command. - - NetHack's internal pattern matching routine uses the follow- - ing special characters in its pattern matching: - - *--- matches 0 or more characters. - ?--- matches any single character. - - Here's an example of a sound mapping using NetHack's inter- - nal pattern matching facility: - - SOUND=MESG "*chime of a cash register*" "gong.wav" 50 - - specifies that any message with "chime of a cash register" con- - tained in it will trigger the playing of "gong.wav". You can - have multiple SOUND entries in your config file. + specifies that any message with "chime of a cash register" con‐ + tained in it will trigger the playing of file gong.wav. You + can have multiple SOUND entries in your config file. 9.9. Modifying NetHack Symbols NetHack can load entire symbol sets from the symbol file. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 53 + + + The options that are used to select a particular symbol set from the symbol file are: @@ -3141,13 +3443,13 @@ Set the name of the symbol set that you want to load. roguesymset - Set the name of the symbol set that you want to load for dis- + Set the name of the symbol set that you want to load for dis‐ play on the rogue level. You can also override one or more symbols using the SYMBOLS config file option. Symbols are specified as name:value pairs. - Note that NetHack escape-processes the value string in conven- - tional C fashion. This means that \ is a prefix to take the fol- + Note that NetHack escape‐processes the value string in conven‐ + tional C fashion. This means that \ is a prefix to take the fol‐ lowing character literally. Thus \ needs to be represented as \\. The special escape form \m switches on the meta bit in the symbol value, and the \^ prefix causes the following character to be @@ -3155,26 +3457,13 @@ NetHack Symbols Default Symbol Name Description - ------------------------------------------------------------------------ + ──────────────────────────────────────────────────────────────────────── S_air (air) _ S_altar (altar) " S_amulet (amulet) - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 49 - - - A S_angel (angelic being) a S_ant (ant or other insect) - ^ S_anti_magic_trap (anti-magic field) + ^ S_anti_magic_trap (anti‐magic field) [ S_armor (suit or piece of armor) [ S_armour (suit or piece of armor) ^ S_arrow_trap (arrow trap) @@ -3182,37 +3471,50 @@ # S_bars (iron bars) B S_bat (bat or bird) ^ S_bear_trap (bear trap) - - S_blcorn (bottom left corner) + ‐ S_blcorn (bottom left corner) b S_blob (blob) + S_book (spellbook) ) S_boomleft (boomerang open left) ( S_boomright (boomerang open right) - ` S_boulder (boulder) - - S_brcorn (bottom right corner) + ‘ S_boulder (boulder) + ‐ S_brcorn (bottom right corner) C S_centaur (centaur) _ S_chain (iron chain) # S_cloud (cloud) c S_cockatrice (cockatrice) $ S_coin (pile of coins) # S_corr (corridor) - - S_crwall (wall) + ‐ S_crwall (wall) ^ S_dart_trap (dart trap) & S_demon (major demon) * S_digbeam (dig beam) > S_dnladder (ladder down) + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 54 + + + > S_dnstair (staircase down) d S_dog (dog or other canine) D S_dragon (dragon) ; S_eel (sea monster) E S_elemental (elemental) / S_explode1 (explosion top left) - - S_explode2 (explosion top center) - `\' S_explode3 (explosion top right) + ‐ S_explode2 (explosion top center) + ‘\’ S_explode3 (explosion top right) | S_explode4 (explosion middle left) S_explode5 (explosion middle center) | S_explode6 (explosion middle right) - `\' S_explode7 (explosion bottom left) - - S_explode8 (explosion bottom center) + ‘\’ S_explode7 (explosion bottom left) + ‐ S_explode8 (explosion bottom center) / S_explode9 (explosion bottom right) e S_eye (eye or sphere) ^ S_falling_rock_trap (falling rock trap) @@ -3225,31 +3527,18 @@ * S_gem (gem or rock) S_ghost (ghost) H S_giant (giant humanoid) - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 50 - - - G S_gnome (gnome) - ' S_golem (golem) + ’ S_golem (golem) | S_grave (grave) g S_gremlin (gremlin) - - S_hbeam (wall) + ‐ S_hbeam (wall) # S_hcdbridge (horizontal raised drawbridge) + S_hcdoor (closed door) | S_hodoor (open door) ^ S_hole (hole) @ S_human (human or elf) h S_humanoid (humanoid) - - S_hwall (horizontal wall) + ‐ S_hwall (horizontal wall) i S_imp (imp or minor demon) J S_jabberwock (jabberwock) j S_jelly (jelly) @@ -3263,9 +3552,22 @@ y S_light (light) # S_litcorr (lit corridor) : S_lizard (lizard) - `\' S_lslant (wall) + ‘\’ S_lslant (wall) ^ S_magic_portal (magic portal) ^ S_magic_trap (magic trap) + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 55 + + + m S_mimic (mimic) ] S_mimic_def (mimic) M S_mummy (mummy) @@ -3282,7 +3584,7 @@ q S_quadruped (quadruped) Q S_quantmech (quantum mechanic) = S_ring (ring) - ` S_rock (boulder or statue) + ‘ S_rock (boulder or statue) r S_rodent (rodent) ^ S_rolling_boulder_trap (rolling boulder trap) / S_rslant (wall) @@ -3291,19 +3593,6 @@ ? S_scroll (scroll) # S_sink (sink) ^ S_sleeping_gas_trap (sleeping gas trap) - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 51 - - - S S_snake (snake) s S_spider (arachnid or centipede) ^ S_spiked_pit (spiked pit) @@ -3314,27 +3603,40 @@ * S_ss4 (magic shield 4 of 4) ^ S_statue_trap (statue trap) S_stone (dark part of a room) - - S_sw_bc (swallow bottom center) - `\' S_sw_bl (swallow bottom left) + ‐ S_sw_bc (swallow bottom center) + ‘\’ S_sw_bl (swallow bottom left) / S_sw_br (swallow bottom right) | S_sw_ml (swallow middle left) | S_sw_mr (swallow middle right) - - S_sw_tc (swallow top center) + ‐ S_sw_tc (swallow top center) / S_sw_tl (swallow top left) - `\' S_sw_tr (swallow top right) - - S_tdwall (wall) + ‘\’ S_sw_tr (swallow top right) + ‐ S_tdwall (wall) ^ S_teleportation_trap (teleportation trap) S_throne (opulent throne) - - S_tlcorn (top left corner) + ‐ S_tlcorn (top left corner) | S_tlwall (wall) - ( S_tool (useful item (pick-axe key lamp...)) + ( S_tool (useful item (pick‐axe key lamp...)) ^ S_trap_door (trap door) t S_trapper (trapper or lurker above) - - S_trcorn (top right corner) + ‐ S_trcorn (top right corner) # S_tree (tree) + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 56 + + + T S_troll (troll) | S_trwall (wall) - - S_tuwall (wall) + ‐ S_tuwall (wall) U S_umber (umber hulk) u S_unicorn (unicorn or horse) < S_upladder (ladder up) @@ -3343,7 +3645,7 @@ | S_vbeam (wall) # S_vcdbridge (vertical raised drawbridge) + S_vcdoor (closed door) - - S_vodoor (open door) + ‐ S_vodoor (open door) v S_vortex (vortex) | S_vwall (vertical wall) / S_wand (wand) @@ -3357,48 +3659,47 @@ X S_xorn (xorn) Y S_yeti (apelike creature) Z S_zombie (zombie) - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 52 - - - z S_zruty (zruty) 9.10. Configuring NetHack for Play by the Blind NetHack can be set up to use only standard ASCII characters - for making maps of the dungeons. This makes the MS-DOS versions + for making maps of the dungeons. This makes the MS‐DOS versions of NetHack completely accessible to the blind who use speech and/or Braille access technologies. Players will require a good - working knowledge of their screen-reader's review features, and + working knowledge of their screen‐reader’s review features, and will have to know how to navigate horizontally and vertically - character by character. They will also find the search capabili- - ties of their screen-readers to be quite valuable. Be certain to + character by character. They will also find the search capabili‐ + ties of their screen‐readers to be quite valuable. Be certain to examine this Guidebook before playing so you have an idea what - the screen layout is like. You'll also need to be able to locate + the screen layout is like. You’ll also need to be able to locate the PC cursor. It is always where your character is located. - Merely searching for an @-sign will not always find your charac- + Merely searching for an @‐sign will not always find your charac‐ ter since there are other humanoids represented by the same sign. - Your screen-reader should also have a function which gives you + Your screen‐reader should also have a function which gives you the row and column of your review cursor and the PC cursor. - These co-ordinates are often useful in giving players a better + These co‐ordinates are often useful in giving players a better sense of the overall location of items on the screen. While it is not difficult for experienced users to edit the defaults.nh file to accomplish this, novices may find this task - somewhat daunting. Included within the ``symbols'' file of all + somewhat daunting. Included within the ‘‘symbols’’ file of all official distributions of NetHack is a symset called NHAccess. Selecting that symset in your configuration file will cause the game to run in a manner accessible to the blind. After you have gained some experience with the game and with editing files, you + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 57 + + + may want to alter settings via SYMBOLS= in your configuration file to better suit your preferences. The most crucial settings to make the game accessible are: @@ -3414,28 +3715,74 @@ This will assist in the interface to speech synthesizers. number_pad - A lot of speech access programs use the number-pad to review + A lot of speech access programs use the number‐pad to review the screen. If this is the case, disable the number_pad option - and use the traditional Rogue-like commands. + and use the traditional Rogue‐like commands. + + 9.11. Global Configuration for System Administrators + + If NetHack is compiled with the SYSCF option, a system ad‐ + ministrator should set up a global configuration; this is a file + in the same format as the traditional per‐user configuration file + (see above). This file should be named sysconf and placed in the + same directory as the other NetHack support files. The options + recognized in this file are listed below. Any option not set us‐ + es a compiled‐in default (which may not be appropriate for your + system). + + WIZARDS A space‐separated list of user names who are allowed to + play in wizard mode (the debugging mode, not the magic‐using + role). A value of a single asterisk (*) allows anyone to start + a game in wizard mode. + + SHELLERS A list of users who are allowed to use the shell es‐ + cape command (!). The syntax is the same as WIZARDS. + + MAXPLAYERS Limit the maximum number of games that can be run‐ + ning at the same time. + + SUPPORT A string explaining how to get local support (no de‐ + fault value). + + RECOVER A string explaining how to recover a game on this sys‐ + tem (no default value). + + SEDUCE 0 or 1 to disable or enable, respectively, the SEDUCE + option (see the source for details on this function). + + The following options affect the score file: + + PERSMAX Maximum number of entries for one person. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 58 + + + + ENTRYMAX Maximum number of entries in the score file. + + POINTSMIN Minimum number of points to get an entry in the score + file. + + PERS_IS_UID 0 or 1 to use user names or numeric userids, re‐ + spectively, to identify unique people for the score file. + + MAX_STATUENAME_RANK Maximum number of score file entries to use + for random statue names (default is 10). 10. Scoring NetHack maintains a list of the top scores or scorers on your machine, depending on how it is set up. In the latter case, - each account on the machine can post only one non-winning score + each account on the machine can post only one non‐winning score on this list. If you score higher than someone else on this - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 53 - - - list, or better your previous score, you will be inserted in the proper place under your current name. How many scores are kept can also be set up when NetHack is compiled. @@ -3446,280 +3793,397 @@ your gold intact. If, however, you get killed in the Mazes of Menace, the guild will only hear about 90% of your gold when your corpse is discovered (adventurers have been known to collect - finder's fees). So, consider whether you want to take one last + finder’s fees). So, consider whether you want to take one last hit at that monster and possibly live, or quit and stop with whatever you have. If you quit, you keep all your gold, but if you swing and live, you might find more. If you just want to see what the current top players/games - list is, you can type nethack -s all on most versions. + list is, you can type nethack ‐s all on most versions. 11. Explore mode NetHack is an intricate and difficult game. Novices might falter in fear, aware of their ignorance of the means to survive. - Well, fear not. Your dungeon may come equipped with an ``ex- - plore'' or ``discovery'' mode that enables you to keep old save - files and cheat death, at the paltry cost of not getting on the - high score list. + Well, fear not. Your dungeon comes equipped with an ‘‘explore’’ + or ‘‘discovery’’ mode that enables you to keep old save files and + cheat death, at the paltry cost of not getting on the high score + list. There are two ways of enabling explore mode. One is to - start the game with the -X switch. The other is to issue the `X' - command while already playing the game. The other benefits of - explore mode are left for the trepid reader to discover. + start the game with the ‐X command‐line switch or with the play‐ + mode:explore option. The other is to issue the ‘‘#exploremode’’ + extended command while already playing the game. Starting a new + game in explore mode provides your character with a wand of wish‐ + ing in initial inventory; switching during play does not. The + other benefits of explore mode are left for the trepid reader to + discover. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 59 + + + + 11.1. Debug mode + + Debug mode, also known as wizard mode, is undocumented aside + from this brief description. It is intended for tracking down + problems within the program rather than to provide god‐like pow‐ + ers to your character, and players who attempt debugging are ex‐ + pected to figure out how to use it themselves. It is initiated + by starting the game with the ‐D command‐line switch or with the + playmode:debug option. + + For some systems, the player must be logged in under a par‐ + ticular user name to be allowed to use debug mode; for others, + the hero must be given a particular character name (but may be + any role; there’s no connection between ‘‘wizard mode’’ and the + Wizard role). And on any system, the program might have been + configured to omit debug mode entirely. Attempting to start a + game in debug mode when not allowed or not available will result + in falling back to explore mode instead. 12. Credits - The original hack game was modeled on the Berkeley UNIX - rogue game. Large portions of this paper were shamelessly - cribbed from A Guide to the Dungeons of Doom, by Michael C. Toy - and Kenneth C. R. C. Arnold. Small portions were adapted from + The original hack game was modeled on the Berkeley UNIX + rogue game. Large portions of this paper were shamelessly + cribbed from A Guide to the Dungeons of Doom, by Michael C. Toy + and Kenneth C. R. C. Arnold. Small portions were adapted from Further Exploration of the Dungeons of Doom, by Ken Arromdee. - NetHack is the product of literally dozens of people's work. - Main events in the course of the game development are described + NetHack is the product of literally dozens of people’s work. + Main events in the course of the game development are described below: - Jay Fenlason wrote the original Hack, with help from Kenny + Jay Fenlason wrote the original Hack, with help from Kenny Woodland, Mike Thome and Jon Payne. - Andries Brouwer did a major re-write, transforming Hack into - a very different game, and published (at least) three versions + Andries Brouwer did a major re‐write, transforming Hack into + a very different game, and published (at least) three versions (1.0.1, 1.0.2, and 1.0.3) for UNIX machines to the Usenet. - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 54 - - - - Don G. Kneller ported Hack 1.0.3 to Microsoft C and MS-DOS, - producing PC HACK 1.01e, added support for DEC Rainbow graphics - in version 1.03g, and went on to produce at least four more ver- + Don G. Kneller ported Hack 1.0.3 to Microsoft C and MS‐DOS, + producing PC HACK 1.01e, added support for DEC Rainbow graphics + in version 1.03g, and went on to produce at least four more ver‐ sions (3.0, 3.2, 3.51, and 3.6). - R. Black ported PC HACK 3.51 to Lattice C and the Atari + R. Black ported PC HACK 3.51 to Lattice C and the Atari 520/1040ST, producing ST Hack 1.03. Mike Stephenson merged these various versions back together, - incorporating many of the added features, and produced NetHack - 1.4. He then coordinated a cast of thousands in enhancing and - debugging NetHack 1.4 and released NetHack versions 2.2 and 2.3. + incorporating many of the added features, and produced NetHack + 1.4. He then coordinated a cast of thousands in enhancing and + debugging NetHack 1.4 and released NetHack versions 2.2 and 2.3. + + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 60 + + Later, Mike coordinated a major rewrite of the game, heading - a team which included Ken Arromdee, Jean-Christophe Collet, Steve - Creps, Eric Hendrickson, Izchak Miller, John Rupley, Mike Threep- + a team which included Ken Arromdee, Jean‐Christophe Collet, Steve + Creps, Eric Hendrickson, Izchak Miller, John Rupley, Mike Threep‐ oint, and Janet Walz, to produce NetHack 3.0c. - NetHack 3.0 was ported to the Atari by Eric R. Smith, to - OS/2 by Timo Hakulinen, and to VMS by David Gentzel. The three + NetHack 3.0 was ported to the Atari by Eric R. Smith, to + OS/2 by Timo Hakulinen, and to VMS by David Gentzel. The three of them and Kevin Darcy later joined the main development team to produce subsequent revisions of 3.0. - Olaf Seibert ported NetHack 2.3 and 3.0 to the Amiga. Norm - Meluch, Stephen Spackman and Pierre Martineau designed overlay - code for PC NetHack 3.0. Johnny Lee ported NetHack 3.0 to the - Macintosh. Along with various other Dungeoneers, they continued - to enhance the PC, Macintosh, and Amiga ports through the later + Olaf Seibert ported NetHack 2.3 and 3.0 to the Amiga. Norm + Meluch, Stephen Spackman and Pierre Martineau designed overlay + code for PC NetHack 3.0. Johnny Lee ported NetHack 3.0 to the + Macintosh. Along with various other Dungeoneers, they continued + to enhance the PC, Macintosh, and Amiga ports through the later revisions of 3.0. - Headed by Mike Stephenson and coordinated by Izchak Miller - and Janet Walz, the development team which now included Ken Ar- - romdee, David Cohrs, Jean-Christophe Collet, Kevin Darcy, Matt - Day, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric - Raymond, and Eric Smith undertook a radical revision of 3.0. - They re-structured the game's design, and re-wrote major parts of - the code. They added multiple dungeons, a new display, special - individual character quests, a new endgame and many other new + Headed by Mike Stephenson and coordinated by Izchak Miller + and Janet Walz, the development team which now included Ken Ar‐ + romdee, David Cohrs, Jean‐Christophe Collet, Kevin Darcy, Matt + Day, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric + Raymond, and Eric Smith undertook a radical revision of 3.0. + They re‐structured the game’s design, and re‐wrote major parts of + the code. They added multiple dungeons, a new display, special + individual character quests, a new endgame and many other new features, and produced NetHack 3.1. - Ken Lorber, Gregg Wonderly and Greg Olson, with help from - Richard Addison, Mike Passaretti, and Olaf Seibert, developed + Ken Lorber, Gregg Wonderly and Greg Olson, with help from + Richard Addison, Mike Passaretti, and Olaf Seibert, developed NetHack 3.1 for the Amiga. - Norm Meluch and Kevin Smolkowski, with help from Carl Sche- + Norm Meluch and Kevin Smolkowski, with help from Carl Sche‐ lin, Stephen Spackman, Steve VanDevender, and Paul Winner, ported NetHack 3.1 to the PC. - Jon W{tte and Hao-yang Wang, with help from Ross Brown, Mike - Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny - Lee, Tim Lennan, Rob Menke, and Andy Swanson, developed NetHack - 3.1 for the Macintosh, porting it for MPW. Building on their de- + Jon W{tte and Hao‐yang Wang, with help from Ross Brown, Mike + Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny + Lee, Tim Lennan, Rob Menke, and Andy Swanson, developed NetHack + 3.1 for the Macintosh, porting it for MPW. Building on their de‐ velopment, Barton House added a Think C port. - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 55 - - - - Timo Hakulinen ported NetHack 3.1 to OS/2. Eric Smith port- - ed NetHack 3.1 to the Atari. Pat Rankin, with help from Joshua - Delahunty, was responsible for the VMS version of NetHack 3.1. + Timo Hakulinen ported NetHack 3.1 to OS/2. Eric Smith port‐ + ed NetHack 3.1 to the Atari. Pat Rankin, with help from Joshua + Delahunty, was responsible for the VMS version of NetHack 3.1. Michael Allison ported NetHack 3.1 to Windows NT. - Dean Luick, with help from David Cohrs, developed NetHack - 3.1 for X11. Warwick Allison wrote a tiled version of NetHack - for the Atari; he later contributed the tiles to the DevTeam and + Dean Luick, with help from David Cohrs, developed NetHack + 3.1 for X11. Warwick Allison wrote a tiled version of NetHack + for the Atari; he later contributed the tiles to the DevTeam and tile support was then added to other platforms. - The 3.2 development team, comprised of Michael Allison, Ken - Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, - Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric - Smith, Mike Stephenson, Janet Walz, and Paul Winner, released + The 3.2 development team, comprised of Michael Allison, Ken + Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, + Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 61 + + + + Smith, Mike Stephenson, Janet Walz, and Paul Winner, released version 3.2 in April of 1996. Version 3.2 marked the tenth anniversary of the formation of - the development team. In a testament to their dedication to the - game, all thirteen members of the original development team re- - mained on the team at the start of work on that release. During - the interval between the release of 3.1.3 and 3.2, one of the - founding members of the development team, Dr. Izchak Miller, was - diagnosed with cancer and passed away. That release of the game + the development team. In a testament to their dedication to the + game, all thirteen members of the original development team re‐ + mained on the team at the start of work on that release. During + the interval between the release of 3.1.3 and 3.2, one of the + founding members of the development team, Dr. Izchak Miller, was + diagnosed with cancer and passed away. That release of the game was dedicated to him by the development and porting teams. - During the lifespan of NetHack 3.1 and 3.2, several enthusi- - asts of the game added their own modifications to the game and - made these ``variants'' publicly available: + During the lifespan of NetHack 3.1 and 3.2, several enthusi‐ + asts of the game added their own modifications to the game and + made these ‘‘variants’’ publicly available: - Tom Proudfoot and Yuval Oren created NetHack++, which was - quickly renamed NetHack--. Working independently, Stephen White - wrote NetHack Plus. Tom Proudfoot later merged NetHack Plus and - his own NetHack-- to produce SLASH. Larry Stewart-Zerba and War- - wick Allison improved the spell casting system with the Wizard - Patch. Warwick Allison also ported NetHack to use the Qt inter- + Tom Proudfoot and Yuval Oren created NetHack++, which was + quickly renamed NetHack‐‐. Working independently, Stephen White + wrote NetHack Plus. Tom Proudfoot later merged NetHack Plus and + his own NetHack‐‐ to produce SLASH. Larry Stewart‐Zerba and War‐ + wick Allison improved the spell casting system with the Wizard + Patch. Warwick Allison also ported NetHack to use the Qt inter‐ face. - Warren Cheung combined SLASH with the Wizard Patch to pro- - duce Slash'em, and with the help of Kevin Hugo, added more fea- - tures. Kevin later joined the DevTeam and incorporated the best + Warren Cheung combined SLASH with the Wizard Patch to pro‐ + duce Slash’em, and with the help of Kevin Hugo, added more fea‐ + tures. Kevin later joined the DevTeam and incorporated the best of these ideas in NetHack 3.3. The final update to 3.2 was the bug fix release 3.2.3, which - was released simultaneously with 3.3.0 in December 1999 just in + was released simultaneously with 3.3.0 in December 1999 just in time for the Year 2000. The 3.3 development team, consisting of Michael Allison, Ken - Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, - Timo Hakulinen, Kevin Hugo, Steve Linhart, Ken Lorber, Dean - Luick, Pat Rankin, Eric Smith, Mike Stephenson, Janet Walz, and - Paul Winner, released 3.3.0 in December 1999 and 3.3.1 in August + Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, + Timo Hakulinen, Kevin Hugo, Steve Linhart, Ken Lorber, Dean + Luick, Pat Rankin, Eric Smith, Mike Stephenson, Janet Walz, and + Paul Winner, released 3.3.0 in December 1999 and 3.3.1 in August of 2000. - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 56 - - - Version 3.3 offered many firsts. It was the first version to - separate race and profession. The Elf class was removed in pref- + separate race and profession. The Elf class was removed in pref‐ erence to an elf race, and the races of dwarves, gnomes, and orcs - made their first appearance in the game alongside the familiar - human race. Monk and Ranger roles joined Archeologists, Barbar- - ians, Cavemen, Healers, Knights, Priests, Rogues, Samurai, - Tourists, Valkyries and of course, Wizards. It was also the - first version to allow you to ride a steed, and was the first - version to have a publicly available web-site listing all the - bugs that had been discovered. Despite that constantly growing - bug list, 3.3 proved stable enough to last for more than a year + made their first appearance in the game alongside the familiar + human race. Monk and Ranger roles joined Archeologists, Barbar‐ + ians, Cavemen, Healers, Knights, Priests, Rogues, Samurai, + Tourists, Valkyries and of course, Wizards. It was also the + first version to allow you to ride a steed, and was the first + version to have a publicly available web‐site listing all the + bugs that had been discovered. Despite that constantly growing + bug list, 3.3 proved stable enough to last for more than a year and a half. - The 3.5 development team initially consisted of Michael Al- - lison, Ken Arromdee, David Cohrs, Jessie Collet, Kevin Hugo, Ken - Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and - Paul Winner, with Warwick Allison joining just before the re- + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 62 + + + + The 3.4 development team initially consisted of Michael Al‐ + lison, Ken Arromdee, David Cohrs, Jessie Collet, Kevin Hugo, Ken + Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and + Paul Winner, with Warwick Allison joining just before the re‐ lease of NetHack 3.4.0 in March 2002. - As with version 3.3, various people contributed to the game + As with version 3.3, various people contributed to the game as a whole as well as supporting ports on the different platforms that NetHack runs on: - Pat Rankin maintained 3.5 for VMS. + Pat Rankin maintained 3.4 for VMS. - Michael Allison maintained NetHack 3.5 for the MS-DOS plat- + Michael Allison maintained NetHack 3.4 for the MS‐DOS plat‐ form. Paul Winner and Yitzhak Sapir provided encouragement. - Dean Luick, Mark Modrall, and Kevin Hugo maintained and en- + Dean Luick, Mark Modrall, and Kevin Hugo maintained and en‐ hanced the Macintosh port of 3.4. - Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, - and Yitzhak Sapir maintained and enhanced 3.5 for the Microsoft - Windows platform. Alex Kompel contributed a new graphical inter- - face for the Windows port. Alex Kompel also contributed a Win- + Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, + and Yitzhak Sapir maintained and enhanced 3.4 for the Microsoft + Windows platform. Alex Kompel contributed a new graphical inter‐ + face for the Windows port. Alex Kompel also contributed a Win‐ dows CE port for 3.4.1. Ron Van Iwaarden was the sole maintainer of NetHack for OS/2 - the past several releases. Unfortunately Ron's last OS/2 machine - stopped working in early 2006. A great many thanks to Ron for + the past several releases. Unfortunately Ron’s last OS/2 machine + stopped working in early 2006. A great many thanks to Ron for keeping NetHack alive on OS/2 all these years. - Janne Salmijarvi and Teemu Suikki maintained and enhanced - the Amiga port of 3.5 after Janne Salmijarvi resurrected it for + Janne Salmijarvi and Teemu Suikki maintained and enhanced + the Amiga port of 3.4 after Janne Salmijarvi resurrected it for 3.3.1. - Christian ``Marvin'' Bressler maintained 3.5 for the Atari + Christian ‘‘Marvin’’ Bressler maintained 3.4 for the Atari after he resurrected it for 3.3.1. - There is a NetHack web site maintained by Ken Lorber at + The release of NetHack 3.4.3 in December 2003 marked the be‐ + ginning of a long release hiatus. 3.4.3 proved to be a remarkably + stable version that provided continued enjoyment by the community + for more than a decade. The devteam slowly and quietly continued + to work on the game behind the scenes during the tenure of 3.4.3. + It was during that same period that several new variants emerged + within the NetHack community. Notably sporkhack by Derek S. Ray, + unnethack by Patric Mueller, nitrohack and its successors origi‐ + nally by Daniel Thaler and then by Alex Smith, and Dynahack by + Tung Nguyen. Some of those variants continue to be developed, + maintained, and enjoyed by the community to this day. + + In September 2014, an interim snapshot of the code under de‐ + velopment was released publicly by other parties. Since that code + was a work‐in‐progress and had not gone through a period of de‐ + bugging, it was decided that the version numbers present on that + code snapshot would be retired and never used in an official + NetHack release. An announcement was posted on the devteam’s + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 63 + + + + official nethack.org website to that effect, stating that there + would never be a 3.4.4, 3.5, or 3.5.0 official release version. + + In January 2015, preparation began for the release of + NetHack 3.6 + + At the beginning of development for what would eventually + get released as 3.6.0, the development team consisted of Warwick + Allison, Michael Allison, Ken Arromdee, David Cohrs, Jessie Col‐ + let, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet + Walz, and Paul Winner. Leading up to the release of 3.6.0 in + early 2015, new members Sean Hunt, Pasi Kallinen, and Derek S. + Ray joined the NetHack development team, + + 3.6.0 TODO insert apprpriate description of 3.6.0 here + + The development team, as well as Steve VanDevender and Kevin + Smolkowski ensured that NetHack 3.6.0 continued to operate on + various Unix flavors as well as maintaining the X11 interface. + + Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick main‐ + tained the port of NetHack 3.6.0 for Mac. + + Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, + and David Cohrs maintained the port of NetHack 3.6.0 for Mi‐ + crosoft Windows. + + Jeff Bailey created and maintained a port of NetHack 3.6.0 + for Chrome. + + TODO Alex Kompel maintained a port of NetHack 3.6.0 to Win‐ + dows Phone. + + This version of the game is special in a particular way. + Near the end of the development of 3.6, one of the significant + inspirations for many of the humorous and fun features found in + the game, author Terry Pratchett, passed away. This version of + the game is dedicated to him. + + The official NetHack web site is maintained by Ken Lorber at http://www.nethack.org/. - - - - - - - - - - - + SHOUT‐OUTS + + The devteam would like to give a special "shout‐out" to + thank the generous people primarily responsible for the public + NetHack servers available for playing the game at nethack.alt.org + and devnull.net. In addition to providing a way for the public to + play a game of NetHack from almost anywhere, they have hosted an‐ + nual NetHack tournaments for many, many years. + + On behalf of the NetHack community, thank you very much to + M. Drew Streib, Pasi Kallinen and Robin Bandy. - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 - NetHack Guidebook 57 + NetHack Guidebook 64 + ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ ‐ + From time to time, some depraved individual out there in netland sends a particularly intriguing modification to help out with the game. The Gods of the Dungeon sometimes make note of the names of the worst of these miscreants in this, the list of Dungeoneers: - Adam Aronow Izchak Miller Mike Passaretti - Alex Kompel J. Ali Harlow Mike Stephenson - Andreas Dorn Janet Walz Norm Meluch - Andy Church Janne Salmijarvi Olaf Seibert - Andy Swanson Jean-Christophe Collet Pasi Kallinen - Ari Huttunen Jochen Erwied Pat Rankin - Barton House John Kallen Paul Winner - Benson I. Margulies John Rupley Pierre Martineau - Bill Dyer John S. Bien Ralf Brown - Boudewijn Waijers Johnny Lee Ray Chason - Bruce Cox Jon W{tte Richard Addison - Bruce Holloway Jonathan Handler Richard Beigel - Bruce Mewborne Joshua Delahunty Richard P. Hughey - Carl Schelin Keizo Yamamoto Rob Menke + Adam Aronow J. Ali Harlow Mike Stephenson + Alex Kompel Janet Walz Norm Meluch + Andreas Dorn Janne Salmijarvi Olaf Seibert + Andy Church Jean‐Christophe Collet Pasi Kallinen + Andy Swanson Jeff Bailey Pat Rankin + Ari Huttunen Jochen Erwied Paul Winner + Barton House John Kallen Pierre Martineau + Benson I. Margulies John Rupley Ralf Brown + Bill Dyer John S. Bien Ray Chason + Boudewijn Waijers Johnny Lee Richard Addison + Bruce Cox Jon W{tte Richard Beigel + Bruce Holloway Jonathan Handler Richard P. Hughey + Bruce Mewborne Joshua Delahunty Rob Menke + Carl Schelin Keizo Yamamoto Robin Bandy Chris Russo Ken Arnold Robin Johnson David Cohrs Ken Arromdee Roderick Schertler David Damerell Ken Lorber Roland McGrath @@ -3727,10 +4191,11 @@ David Hairston Kevin Darcy Ronnen Miller Dean Luick Kevin Hugo Ross Brown Del Lamb Kevin Sitze Sascha Wostmann - Deron Meranda Kevin Smolkowski Scott Bigham - Dion Nicolaas Kevin Sweet Scott R. Turner - Dylan O'Donnell Lars Huttar Stephen Spackman - Eric Backus Leon Arnott Stephen White + Derek S. Ray Kevin Smolkowski Scott Bigham + Deron Meranda Kevin Sweet Scott R. Turner + Dion Nicolaas Lars Huttar Sean Hunt + Dylan O’Donnell Leon Arnott Stephen Spackman + Eric Backus M. Drew Streib Stephen White Eric Hendrickson Malcolm Ryan Steve Creps Eric R. Smith Mark Gooderum Steve Linhart Eric S. Raymond Mark Modrall Steve VanDevender @@ -3740,9 +4205,10 @@ Greg Laskin Michael Allison Tom Almy Greg Olson Michael Feir Tom West Gregg Wonderly Michael Hamel Warren Cheung - Hao-yang Wang Michael Sokolov Warwick Allison + Hao‐yang Wang Michael Sokolov Warwick Allison Helge Hafting Mike Engber Yitzhak Sapir - Irina Rempt-Drijfhout Mike Gallop + Irina Rempt‐Drijfhout Mike Gallop + Izchak Miller Mike Passaretti Brand and product names are trademarks or registered trademarks of their respective holders. @@ -3752,11 +4218,7 @@ - - - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 From cb79a82bfb1e64517ecf52bde6f915779123ad52 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 00:49:38 -0400 Subject: [PATCH 29/73] fix up some syntax errors in Guidebook.tex --- doc/Guidebook.tex | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 0310aaeb1..af2023f14 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -863,7 +863,7 @@ the exchange still takes place. %.lp \item[\tb{X}] Toggle two-weapon combat, if your character can do it. Also available -via the ``#twoweapon'' extended command +via the ``{\tt \#twoweapon}'' extended command %.lp \item[\tb{\^{}X}] Display basic information about your character.\\ @@ -3564,7 +3564,7 @@ There are two ways of enabling explore mode. One is to start the game with the {\tt -X} command-line switch or with the {\it playmode:explore\/} -option. The other is to issue the `{\tt #exploremode}' extended command while +option. The other is to issue the `{\tt \#exploremode}' extended command while already playing the game. Starting a new game in explore mode provides your character with a wand of wishing in initial inventory; switching during play does not. The other benefits of explore mode are left for @@ -3929,12 +3929,11 @@ people primarily responsible for the public NetHack servers available for playing the game at nethack.alt.org and devnull.net. In addition to providing a way for the public to play a game of NetHack from almost anywhere, they have hosted annual NetHack tournaments for many, many years. -%pg -\medskip +%.pg \nd On behalf of the NetHack community, thank you very much to {\it M. Drew Streib}, {\it Pasi Kallinen} and {\it Robin Bandy}. -.pg +%.pg %.hn 3 \subsection*{Dungeoneers} \bigskip From ec456ade9f16f4fa1ca9ea460d1477b9c2206ac4 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 01:06:28 -0400 Subject: [PATCH 30/73] a couple of substitution errors in Guidebook.tex --- doc/Guidebook.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index af2023f14..88e5a59b4 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3817,7 +3817,7 @@ enhanced the Macintosh port of 3.4. %.pg \medskip \nd {\it Michael Allison}, {\it David Cohrs}, {\it Alex Kompel}, {\it Dion Nicolaas}, and -{\it Yitzhak Sapir} maintained and enhanced 3.5 for the Microsoft Windows platform. +{\it Yitzhak Sapir} maintained and enhanced 3.4 for the Microsoft Windows platform. {\it Alex Kompel} contributed a new graphical interface for the Windows port. {\it Alex Kompel} also contributed a Windows CE port for 3.4.1. @@ -3831,7 +3831,7 @@ all these years. %.pg \medskip \nd {\it Janne Salmij\"{a}rvi} and {\it Teemu Suikki} maintained -and enhanced the Amiga port of 3.5 after {\it Janne Salmij\"{a}rvi} resurrected +and enhanced the Amiga port of 3.4 after {\it Janne Salmij\"{a}rvi} resurrected it for 3.3.1. %.pg From c6faa08b8fb24f62a1fdd56e3bb8fe0c19f5335a Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 10:00:44 +0200 Subject: [PATCH 31/73] Add sysconf for linux-X11 --- sys/unix/hints/linux-x11 | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/unix/hints/linux-x11 b/sys/unix/hints/linux-x11 index e0d98badd..cf5dfb6f3 100644 --- a/sys/unix/hints/linux-x11 +++ b/sys/unix/hints/linux-x11 @@ -16,6 +16,7 @@ HACKDIR=$(PREFIX)/games/lib/$(GAME)dir SHELLDIR = $(PREFIX)/games CFLAGS=-O -I../include -DNOTPARMDECL $(CFLAGS1) $(CFLAGS3) +CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" CFLAGS1=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\" CFLAGS3=-DX11_GRAPHICS -DDEFAULT_WINDOW_SYS=\"X11\" -DNOTTYGRAPHICS From c7d92a47e157a323ee9c425215e989d0666001d3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 10:55:41 +0200 Subject: [PATCH 32/73] Remove migrating monster from polearm targeting --- src/dog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dog.c b/src/dog.c index d8ab09e4f..fcc258b86 100644 --- a/src/dog.c +++ b/src/dog.c @@ -685,6 +685,7 @@ migrate_to_level(mtmp, tolev, xyloc, cc) mtmp->mux = new_lev.dnum; mtmp->muy = new_lev.dlevel; mtmp->mx = mtmp->my = 0; /* this implies migration */ + if (mtmp == context.polearm.hitmon) context.polearm.hitmon = NULL; } /* return quality of food; the lower the better */ From 2fce0074b3948aea4b2356e803d7658b44eed9fb Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 13:32:24 +0200 Subject: [PATCH 33/73] Show legal polearm hit positions User can press $ to display valid positions when asked for a position to pick, and the positions will be hilighted --- doc/fixes35.0 | 1 + include/extern.h | 1 + src/apply.c | 40 ++++++++++++++++++++++++++++++++++++---- src/do_name.c | 31 ++++++++++++++++++++++++++++++- 4 files changed, 68 insertions(+), 5 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 601be2ee0..e6d5e1368 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -887,6 +887,7 @@ show object symbols in menu headings in menus where those object symbols act as menu accelerators, toggleable via "menu_objsyms" option show t-shirt text at end of game inventory disclose hitting with a polearm remembers the position of the last monster you hit +allow showing legal polearm positions when asked for location to hit Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index d6347207c..1cee0f651 100644 --- a/include/extern.h +++ b/include/extern.h @@ -364,6 +364,7 @@ E void NDECL(heal_legs); /* ### do_name.c ### */ E int FDECL(getpos, (coord *,BOOLEAN_P,const char *)); +E void FDECL(getpos_sethilite, (void (*f)(int) )); E void FDECL(new_mname, (struct monst *,int)); E void FDECL(free_mname, (struct monst *)); E void FDECL(new_oname, (struct obj *,int)); diff --git a/src/apply.c b/src/apply.c index 4d6899710..ae7565f17 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2553,6 +2553,32 @@ int min_range, max_range; return TRUE; } +int polearm_range_min = -1; +int polearm_range_max = -1; + +void +display_polearm_positions(state) +int state; +{ + if (state == 0) { + tmp_at(DISP_BEAM, cmap_to_glyph(S_flashbeam)); + } else if (state == 1) { + int x,y, dx,dy; + for (dx = -4; dx <= 4; dx++) + for (dy = -4; dy <= 4; dy++) { + x = dx + (int)u.ux; + y = dy + (int)u.uy; + if (isok(x, y) && + distu(x, y) >= polearm_range_min && + distu(x, y) <= polearm_range_max) { + tmp_at(x, y); + } + } + } else { + tmp_at(DISP_END, 0); + } +} + /* Distance attacks by pole-weapons */ STATIC_OVL int use_pole(obj) @@ -2595,15 +2621,21 @@ use_pole(obj) else if (P_SKILL(typ) == P_SKILLED) max_range = 5; else max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */ + polearm_range_min = min_range; + polearm_range_max = max_range; + /* Prompt for a location */ pline(where_to_hit); - if (hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)) { + cc.x = u.ux; + cc.y = u.uy; + if (!find_poleable_mon(&cc, min_range, max_range) && + hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my) && + distu(hitm->mx,hitm->my) <= max_range && + distu(hitm->mx,hitm->my) >= min_range) { cc.x = hitm->mx; cc.y = hitm->my; - } else if (!find_poleable_mon(&cc, min_range, max_range)) { - cc.x = u.ux; - cc.y = u.uy; } + getpos_sethilite(display_polearm_positions); if (getpos(&cc, TRUE, "the spot to hit") < 0) return res; /* ESC; uses turn iff polearm became wielded */ diff --git a/src/do_name.c b/src/do_name.c index 0f837c9d4..b5c2bb711 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -25,6 +25,17 @@ nextmbuf() return bufs[bufidx]; } +/* function for getpos() to highlight desired map locations. + * parameter value 0 = initialize, 1 = highlight, 2 = done + */ +void (*getpos_hilitefunc)(int) = NULL; +void +getpos_sethilite(f) +void (*f)(int); +{ + getpos_hilitefunc = f; +} + /* the response for '?' help request in getpos() */ STATIC_OVL void getpos_help(force, goal) @@ -41,6 +52,8 @@ const char *goal; putstr(tmpwin, 0, "Use [HJKL] to move the cursor 8 units at a time."); putstr(tmpwin, 0, "Or enter a background symbol (ex. <)."); putstr(tmpwin, 0, "Use @ to move the cursor on yourself."); + if (getpos_hilitefunc != NULL) + putstr(tmpwin, 0, "Use $ to display valid locations."); putstr(tmpwin, 0, "Use # to toggle automatic description."); /* disgusting hack; the alternate selection characters work for any getpos call, but they only matter for dowhatis (and doquickwhatis) */ @@ -69,6 +82,7 @@ const char *goal; boolean show_goal_msg = FALSE; static const char pick_chars[] = ".,;:"; const char *cp; + boolean hilite_state = FALSE; if (!goal) goal = "desired location"; if (flags.verbose) { @@ -92,7 +106,7 @@ const char *goal; curs(WIN_MAP, cx, cy); flush_screen(0); show_goal_msg = FALSE; - } else if (auto_msg && !msg_given) { + } else if (auto_msg && !msg_given && !hilite_state) { coord cc; int sym = 0; char tmpbuf[BUFSZ]; @@ -110,6 +124,13 @@ const char *goal; c = nh_poskey(&tx, &ty, &sidx); + if (hilite_state) { + (*getpos_hilitefunc)(2); + hilite_state = FALSE; + curs(WIN_MAP, cx, cy); + flush_screen(0); + } + if (auto_msg) msg_given = FALSE; @@ -174,6 +195,13 @@ const char *goal; /* update message window to reflect that we're still targetting */ show_goal_msg = TRUE; msg_given = TRUE; + } else if ((c == '$') && (getpos_hilitefunc != NULL)) { + if (!hilite_state) { + (*getpos_hilitefunc)(0); + (*getpos_hilitefunc)(1); + hilite_state = TRUE; + } + goto nxtc; } else if (c == '#') { auto_msg = !auto_msg; pline("Automatic description %sis %s.", @@ -269,6 +297,7 @@ const char *goal; if (msg_given) clear_nhwindow(WIN_MESSAGE); ccp->x = cx; ccp->y = cy; + getpos_hilitefunc = NULL; return result; } From b17ecb149b862e2a366c5e8bebf2cbf88470e46b Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 16:24:25 +0200 Subject: [PATCH 34/73] Use existing function to count containers --- src/pickup.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pickup.c b/src/pickup.c index 476d85798..d2a76416c 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1498,6 +1498,7 @@ doloot() /* loot a container on the floor or loot saddle from mon. */ char qbuf[BUFSZ]; int prev_inquiry = 0; boolean prev_loot = FALSE; + int num_conts; if (check_capacity((char *)0)) { /* "Can't do that while carrying so much stuff." */ @@ -1518,15 +1519,11 @@ doloot() /* loot a container on the floor or loot saddle from mon. */ lootcont: - if (container_at(cc.x, cc.y, FALSE)) { + if ((num_conts = container_at(cc.x, cc.y, TRUE)) > 0) { boolean anyfound = FALSE; - int num_conts = 0; if (!able_to_loot(cc.x, cc.y, TRUE)) return 0; - for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = cobj->nexthere) - if (Is_container(cobj)) num_conts++; - if (num_conts > 1) { /* use a menu to loot many containers */ int n, i; From c035402c14c001c0545e35b3b1f083e0fbdc0b42 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 11:20:44 -0400 Subject: [PATCH 35/73] flavor enhance zap downwards/upwards when hiding Changes to be committed: modified: doc/fixes35.0 modified: include/extern.h modified: src/apply.c modified: src/zap.c On 3/23/2015 6:41 PM, a bug reporter wrote: > When you're hiding under an item (e.g. via garter snake polyform), and > that item gets polyshuddered into nonexistence, you continue hiding > (under nothing). This was addressed previously. > (Incidentally, it's a bit weird that you use > to aim at items that are > flavorwise above you at the time.) This addresses the flavorwise concern. --- doc/fixes35.0 | 2 ++ include/extern.h | 2 +- src/apply.c | 4 ++-- src/zap.c | 40 ++++++++++++++++++++++++++++++++-------- 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index e6d5e1368..2db942ec5 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1100,6 +1100,8 @@ pressing # when cursor positioning toggles automatic description of features under the cursor cursor positioning ignores uninteresting dungeon features allow reading many more items +when you're hiding under something a zap downward should not hit that + something, while a zap upward should Platform- and/or Interface-Specific New Features diff --git a/include/extern.h b/include/extern.h index 1cee0f651..38e751018 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2629,7 +2629,7 @@ E boolean FDECL(obj_resists, (struct obj *,int,int)); E boolean FDECL(obj_shudders, (struct obj *)); E void FDECL(do_osshock, (struct obj *)); E int FDECL(bhito, (struct obj *,struct obj *)); -E int FDECL(bhitpile, (struct obj *,int (*)(OBJ_P,OBJ_P),int,int)); +E int FDECL(bhitpile, (struct obj *,int (*)(OBJ_P,OBJ_P),int,int,SCHAR_P)); E int FDECL(zappable, (struct obj *)); E void FDECL(zapnodir, (struct obj *)); E int NDECL(dozap); diff --git a/src/apply.c b/src/apply.c index ae7565f17..2265ab519 100644 --- a/src/apply.c +++ b/src/apply.c @@ -3037,7 +3037,7 @@ do_break_wand(obj) /* if (context.botl) bot(); */ } if (affects_objects && level.objects[x][y]) { - (void) bhitpile(obj, bhito, x, y); + (void) bhitpile(obj, bhito, x, y, 0); if (context.botl) bot(); /* potion effects */ } } else { @@ -3054,7 +3054,7 @@ do_break_wand(obj) * since it's also used by retouch_equipment() for polyself.) */ if (affects_objects && level.objects[x][y]) { - (void) bhitpile(obj, bhito, x, y); + (void) bhitpile(obj, bhito, x, y, 0); if (context.botl) bot(); /* potion effects */ } damage = zapyourself(obj, FALSE); diff --git a/src/zap.c b/src/zap.c index fcf0047bf..3674e5a4a 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1750,9 +1750,9 @@ struct obj *obj, *otmp; if (Is_box(obj)) (void) boxlock(obj, otmp); if (obj_shudders(obj)) { - boolean cover = ((obj->ox == u.ux && obj->oy == u.uy) && - u.uundetected && - hides_under(youmonst.data)); + boolean cover = ((obj == level.objects[u.ux][u.uy]) && + u.uundetected && + hides_under(youmonst.data)); if (cansee(obj->ox, obj->oy)) learn_it = TRUE; do_osshock(obj); @@ -1892,10 +1892,11 @@ struct obj *obj, *otmp; /* returns nonzero if something was hit */ int -bhitpile(obj,fhito,tx,ty) +bhitpile(obj,fhito,tx,ty,zdir) struct obj *obj; int FDECL((*fhito), (OBJ_P,OBJ_P)); int tx, ty; + schar zdir; { int hitanything = 0; register struct obj *otmp, *next_obj; @@ -1917,7 +1918,14 @@ bhitpile(obj,fhito,tx,ty) for(otmp = level.objects[tx][ty]; otmp; otmp = next_obj) { /* Fix for polymorph bug, Tim Wright */ next_obj = otmp->nexthere; - hitanything += (*fhito)(otmp, obj); + /* + * game flavor: if you are hiding under something, + * a zap downwards shouldn't hit that obj, so honor that. + */ + if (!(u.uundetected && (zdir > 0) && + (otmp == level.objects[u.ux][u.uy]) && + hides_under(youmonst.data))) + hitanything += (*fhito)(otmp, obj); } if(poly_zapped >= 0) create_polymon(level.objects[tx][ty], poly_zapped); @@ -2568,7 +2576,7 @@ struct obj *obj; /* wand or spell */ if (u.dz < 0) { You("probe towards the %s.", ceiling(x,y)); } else { - ptmp += bhitpile(obj, bhito, x, y); + ptmp += bhitpile(obj, bhito, x, y, u.dz); You("probe beneath the %s.", surface(x,y)); ptmp += display_binventory(x, y, TRUE); } @@ -2688,7 +2696,7 @@ struct obj *obj; /* wand or spell */ if (u.dz > 0) { /* zapping downward */ - (void) bhitpile(obj, bhito, x, y); + (void) bhitpile(obj, bhito, x, y, u.dz); /* subset of engraving effects; none sets `disclose' */ if ((e = engr_at(x, y)) != 0 && e->engr_type != HEADSTONE) { @@ -2724,6 +2732,22 @@ struct obj *obj; /* wand or spell */ break; } } + } else if (u.dz < 0) { + /* zapping upward */ + + /* game flavor: if you're hiding under "something" + * a zap upward should hit that "something". + */ + if (u.uundetected && hides_under(youmonst.data)) { + int hitit = 0; + otmp = level.objects[u.ux][u.uy]; + + if (otmp) hitit = bhito(otmp, obj); + if (hitit) { + (void) hideunder(&youmonst); + disclose = TRUE; + } + } } return disclose; @@ -3095,7 +3119,7 @@ struct obj **pobj; /* object tossed/used, set to NULL } } if(fhito) { - if(bhitpile(obj,fhito,bhitpos.x,bhitpos.y)) + if(bhitpile(obj,fhito,bhitpos.x,bhitpos.y,0)) range--; } else { if(weapon == KICKED_WEAPON && From 0e4317fa6b2e121bee62abbe659e70f8bf827346 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 17:20:57 +0200 Subject: [PATCH 36/73] Balsa wands break easily --- src/apply.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apply.c b/src/apply.c index ae7565f17..9bba15186 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2891,6 +2891,7 @@ do_break_wand(obj) boolean fillmsg = FALSE; int expltype = EXPL_MAGICAL; char confirm[QBUFSZ], buf[BUFSZ]; + boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "balsa")); if (yn(safe_qbuf(confirm, "Are you really sure you want to break ", "?", obj, yname, ysimple_name, "the wand")) == 'n') @@ -2899,7 +2900,7 @@ do_break_wand(obj) if (nohands(youmonst.data)) { You_cant("break %s without hands!", yname(obj)); return 0; - } else if (ACURR(A_STR) < 10) { + } else if (ACURR(A_STR) < (is_fragile ? 5 : 10)) { You("don't have the strength to break %s!", yname(obj)); return 0; } From 9a4fefb5ad0c07d6103f2e1e6acabe9a5e8f9478 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 19:21:49 +0200 Subject: [PATCH 37/73] Add missing prototype --- src/apply.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apply.c b/src/apply.c index b65a2cabf..6f13d6623 100644 --- a/src/apply.c +++ b/src/apply.c @@ -27,6 +27,7 @@ STATIC_DCL void FDECL(use_trap, (struct obj *)); STATIC_DCL void FDECL(use_stone, (struct obj *)); STATIC_PTR int NDECL(set_trap); /* occupation callback */ STATIC_DCL int FDECL(use_whip, (struct obj *)); +STATIC_PTR void FDECL(display_polearm_positions, (int)); STATIC_DCL int FDECL(use_pole, (struct obj *)); STATIC_DCL int FDECL(use_cream_pie, (struct obj *)); STATIC_DCL int FDECL(use_grapple, (struct obj *)); From cbb155b0e67afa9c1c78bd9717a3cb1a9eefe1fd Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 19:31:01 +0200 Subject: [PATCH 38/73] YAFMs when trying to pick up terrain features --- doc/fixes35.0 | 1 + src/hack.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 2db942ec5..f2e1b2890 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -888,6 +888,7 @@ show object symbols in menu headings in menus where those object symbols show t-shirt text at end of game inventory disclose hitting with a polearm remembers the position of the last monster you hit allow showing legal polearm positions when asked for location to hit +add messages for trying to pick up some terrain features Platform- and/or Interface-Specific Fixes diff --git a/src/hack.c b/src/hack.c index 7f15af6ee..98e615ac8 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2207,7 +2207,19 @@ dopickup() } } if (!OBJ_AT(u.ux, u.uy)) { - There("is nothing here to pick up."); + register struct rm *lev = &levl[u.ux][u.uy]; + if (IS_THRONE(lev->typ)) + pline("It must weigh%s a ton!", + lev->looted ? " almost" : ""); + else if (IS_SINK(lev->typ)) + pline_The("plumbing connects it to the floor."); + else if (IS_GRAVE(lev->typ)) + You("don't need a gravestone. Yet."); + else if (IS_FOUNTAIN(lev->typ)) + You("could drink the water..."); + else if (IS_DOOR(lev->typ) && (lev->doormask & D_ISOPEN)) + pline("It won't come off the hinges."); + else There("is nothing here to pick up."); return 0; } if (!can_reach_floor(TRUE)) { From cf7143094f54ab5eb2310c9109c5f415baf26d16 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 19:38:15 +0200 Subject: [PATCH 39/73] Feedback when boomerang hits sink --- doc/fixes35.0 | 1 + src/zap.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index f2e1b2890..1882ad286 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -889,6 +889,7 @@ show t-shirt text at end of game inventory disclose hitting with a polearm remembers the position of the last monster you hit allow showing legal polearm positions when asked for location to hit add messages for trying to pick up some terrain features +boomerang makes noise when hitting a sink Platform- and/or Interface-Specific Fixes diff --git a/src/zap.c b/src/zap.c index 3674e5a4a..b8c846be3 100644 --- a/src/zap.c +++ b/src/zap.c @@ -3283,8 +3283,10 @@ int dx, dy; } tmp_at(bhitpos.x, bhitpos.y); delay_output(); - if(IS_SINK(levl[bhitpos.x][bhitpos.y].typ)) + if(IS_SINK(levl[bhitpos.x][bhitpos.y].typ)) { + if (!Deaf) pline("Klonk!"); break; /* boomerang falls on sink */ + } /* ct==0, initial position, we want next delta to be same; ct==5, opposite position, repeat delta undoes first one */ if (ct % 5 != 0) i += (counterclockwise ? -1 : 1); From 4cd14a7a2a44537ea27329637e2d7f312862cea3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 20:39:40 +0200 Subject: [PATCH 40/73] It's Wonka Bar, not just Wonka --- src/read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/read.c b/src/read.c index 51a5b5295..aa7a20508 100644 --- a/src/read.c +++ b/src/read.c @@ -225,7 +225,7 @@ doread() "Choco Nummer", "Om-nom", /* Cat Macro */ "Fruity Oaty", /* Serenity */ - "Wonka" /* Charlie and the Chocolate Factory */ + "Wonka Bar" /* Charlie and the Chocolate Factory */ }; if (Blind) { You_cant("feel any Braille writing."); From 011520d61a9fc5cb2d60cec139dd54905bef0d4a Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 15:23:28 -0400 Subject: [PATCH 41/73] Guidebook transcription typo --- doc/Guidebook.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 88e5a59b4..79e39c599 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3463,7 +3463,7 @@ Rogue-like commands. \subsection*{Global Configuration for System Administrators} %.pg -If NetHack is compiled with teh SYSCF option, a system administrator +If NetHack is compiled with the SYSCF option, a system administrator should set up a global configuration; this is a file in the same format as the traditional per-user configuration file (see above). From 35d80f5922dcb29386ec7a667250ab0175ee1146 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 18:05:42 -0400 Subject: [PATCH 42/73] remove #ifdef TOURIST straggler Changes to be committed: modified: src/worn.c --- src/worn.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/worn.c b/src/worn.c index a542f3be4..70ba11b3a 100644 --- a/src/worn.c +++ b/src/worn.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 worn.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 worn.c $NHDT-Date: 1427580338 2015/03/28 22:05:38 $ $NHDT-Branch: master $:$NHDT-Revision: 1.35 $ */ /* NetHack 3.5 worn.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.32 $ */ /* SCCS Id: @(#)worn.c 3.5 2009/02/28 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ @@ -591,9 +591,7 @@ long flag; case W_ARMS: return uarms; case W_ARMG: return uarmg; case W_ARMF: return uarmf; -#ifdef TOURIST case W_ARMU: return uarmu; -#endif default: impossible("bad flag in which_armor"); return 0; From e69b5ae944f4fc3fa8c87300a648d499eae6e7ff Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 18:08:09 -0400 Subject: [PATCH 43/73] fix C343-357 Rust monsters may chew non-ferrous items Changes to be committed: modified: src/mon.c website should be updated to reflect this bug closure. C343-357 Rust monsters may chew non-ferrous items. --- src/mon.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mon.c b/src/mon.c index 607845e7a..41d17e671 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mon.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.139 $ */ +/* NetHack 3.5 mon.c $NHDT-Date: 1427580482 2015/03/28 22:08:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.142 $ */ /* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -615,7 +615,10 @@ meatmetal(mtmp) /* Eats topmost metal object if it is there */ for (otmp = level.objects[mtmp->mx][mtmp->my]; otmp; otmp = otmp->nexthere) { - if (mtmp->data == &mons[PM_RUST_MONSTER] && !is_rustprone(otmp)) + /* Don't eat indigestible/choking/inappropriate objects */ + if ((mtmp->data == &mons[PM_RUST_MONSTER] && !is_rustprone(otmp)) || + (otmp->otyp == AMULET_OF_STRANGULATION) || + (otmp->otyp == RIN_SLOW_DIGESTION)) continue; if (is_metallic(otmp) && !obj_resists(otmp, 5, 95) && touch_artifact(otmp,mtmp)) { @@ -632,9 +635,7 @@ meatmetal(mtmp) pline("%s spits %s out in disgust!", Monnam(mtmp), distant_name(otmp,doname)); } - /* KMH -- Don't eat indigestible/choking objects */ - } else if (otmp->otyp != AMULET_OF_STRANGULATION && - otmp->otyp != RIN_SLOW_DIGESTION) { + } else { if (cansee(mtmp->mx,mtmp->my) && flags.verbose) pline("%s eats %s!", Monnam(mtmp), distant_name(otmp,doname)); From 5855deae6e78d6eb0f30bb4bbc0cd91079bd8970 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 18:20:19 -0400 Subject: [PATCH 44/73] doc/fixes update for C343-357 --- doc/fixes35.0 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 1882ad286..53fac6b5c 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -890,6 +890,8 @@ hitting with a polearm remembers the position of the last monster you hit allow showing legal polearm positions when asked for location to hit add messages for trying to pick up some terrain features boomerang makes noise when hitting a sink +non-pet rust monsters would eat rust-proofed non-digestibles but ignore + those non-digestibles otherwise Platform- and/or Interface-Specific Fixes From de2364da945d1a557658efde2047237ac6263aae Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 29 Mar 2015 14:56:23 +0300 Subject: [PATCH 45/73] Save playmode in xlogfile --- src/topten.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/topten.c b/src/topten.c index b68ad1bce..19eaa2ed2 100644 --- a/src/topten.c +++ b/src/topten.c @@ -66,6 +66,7 @@ STATIC_DCL void FDECL(discardexcess, (FILE *)); STATIC_DCL void FDECL(readentry, (FILE *,struct toptenentry *)); STATIC_DCL void FDECL(writeentry, (FILE *,struct toptenentry *)); STATIC_DCL void FDECL(writexlentry, (FILE*, struct toptenentry *)); +STATIC_DCL long NDECL(encodexlogflags); STATIC_DCL long NDECL(encodeconduct); STATIC_DCL long NDECL(encodeachieve); STATIC_DCL void FDECL(free_ttlist, (struct toptenentry *)); @@ -341,10 +342,23 @@ struct toptenentry *tt; Fprintf(rfile, "%cgender0=%s%calign0=%s", XLOG_SEP, genders[flags.initgend].filecode, XLOG_SEP, aligns[1 - u.ualignbase[A_ORIGINAL]].filecode); + Fprintf(rfile, "%cflags=0x%lx", + XLOG_SEP, encodexlogflags()); Fprintf(rfile, "\n"); #undef XLOG_SEP } +STATIC_OVL long +encodexlogflags() +{ + long e = 0L; + + if (wizard) e |= 1L << 0; + if (discover) e |= 1L << 1; + + return e; +} + STATIC_OVL long encodeconduct() { From 1e49567937fba71b7272c955595dcd513b7e9788 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 29 Mar 2015 15:49:01 +0300 Subject: [PATCH 46/73] Use dark gray color for black glyphs in TTY This is Michael Deutschmann's use_darkgray -patch. Adds a boolean option use_darkgray, settable in config file. This patch has been in use on NAO for years, and I have heard once someone say their terminal didn't support the dark gray color. --- dat/opthelp | 1 + doc/Guidebook.mn | 2 + doc/Guidebook.tex | 3 ++ doc/fixes35.0 | 1 + include/flag.h | 1 + include/winprocs.h | 3 +- src/options.c | 2 + win/tty/termcap.c | 128 +++++++++++++++++++++++++++++++++++++-------- win/tty/wintty.c | 2 +- 9 files changed, 118 insertions(+), 25 deletions(-) diff --git a/dat/opthelp b/dat/opthelp index 836e33d87..ce1d743cc 100644 --- a/dat/opthelp +++ b/dat/opthelp @@ -45,6 +45,7 @@ tombstone print tombstone when you die [TRUE] toptenwin print topten in a window rather than stdout [FALSE] travel enable the command to travel to a map location via [TRUE] a shortest-path algorithm, usually invoked by '_'. +use_darkgray use bold black instead of blue for black glyphs. [TRUE] use_inverse display detected monsters in highlighted manner [FALSE] verbose print more commentary during the game [TRUE] diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index eb340dff5..496d588de 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2453,6 +2453,8 @@ Specify the name of an alternative tile file to override the default. Specify the preferred height of each tile in a tile capable port. .lp tile_width Specify the preferred width of each tile in a tile capable port +.lp use_darkgray +Use bold black instead of blue for black glyphs (TTY only). .lp use_inverse NetHack should display inverse when the game specifies it. .lp vary_msgcount diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 79e39c599..6c3ccbded 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2964,6 +2964,9 @@ Specify the preferred height of each tile in a tile capable port. \item[\ib{tile\_width}] Specify the preferred width of each tile in a tile capable port %.lp +\item[\ib{use\_darkgray}] +Use bold black instead of blue for black glyphs (TTY only). +%.lp \item[\ib{use\_inverse}] NetHack should display inverse when the game specifies it. %.lp diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 53fac6b5c..0d7fb3cde 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1143,6 +1143,7 @@ adopt/adapt/improve the Paranoid_Quit patch; default is paranoid_confirm:pray paranoid_confirm:Remove always pick from inventory for 'R' and 'T' adopt/adapt/improve Dungeon Overview Aardvark Joe's Extended Logfile +Michael Deutschmann's use_darkgray Code Cleanup and Reorganization diff --git a/include/flag.h b/include/flag.h index e7ebafa26..9eb7a68c6 100644 --- a/include/flag.h +++ b/include/flag.h @@ -295,6 +295,7 @@ struct instance_flags { boolean wc2_softkeyboard; /* use software keyboard */ boolean wc2_wraptext; /* wrap text */ boolean wc2_selectsaved; /* display a menu of user's saved games */ + boolean wc2_darkgray; /* try to use dark-gray color for black glyphs */ boolean cmdassist; /* provide detailed assistance for some commands */ boolean clicklook; /* allow right-clicking for look */ boolean obsolete; /* obsolete options can point at this, it isn't used */ diff --git a/include/winprocs.h b/include/winprocs.h index 72dad2315..398ba9cba 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -219,7 +219,8 @@ NEARDATA struct window_procs windowprocs; #define WC2_WRAPTEXT 0x04L /* 03 wrap long lines of text */ #define WC2_HILITE_STATUS 0x08L /* 04 hilite fields in status */ #define WC2_SELECTSAVED 0x10L /* 05 saved game selection menu */ - /* 27 free bits */ +#define WC2_DARKGRAY 0x20L /* 06 use bold black for black glyphs */ + /* 26 free bits */ #define ALIGN_LEFT 1 #define ALIGN_RIGHT 2 diff --git a/src/options.c b/src/options.c index 285603351..e1ff15ff0 100644 --- a/src/options.c +++ b/src/options.c @@ -201,6 +201,7 @@ static struct Bool_Opt {"tombstone",&flags.tombstone, TRUE, SET_IN_GAME}, {"toptenwin",&iflags.toptenwin, FALSE, SET_IN_GAME}, {"travel", &flags.travelcmd, TRUE, SET_IN_GAME}, + {"use_darkgray", &iflags.wc2_darkgray, TRUE, SET_IN_FILE}, #ifdef WIN32CON {"use_inverse", &iflags.wc_inverse, TRUE, SET_IN_GAME}, /*WC*/ #else @@ -4398,6 +4399,7 @@ struct wc_Opt wc2_options[] = { {"fullscreen", WC2_FULLSCREEN}, {"softkeyboard", WC2_SOFTKEYBOARD}, {"wraptext", WC2_WRAPTEXT}, + {"use_darkgray", WC2_DARKGRAY}, #ifdef STATUS_VIA_WINDOWPORT {"hilite_status", WC2_HILITE_STATUS}, #endif diff --git a/win/tty/termcap.c b/win/tty/termcap.c index b06a9abfe..1455bf21a 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -809,10 +809,9 @@ cl_eos() /* free after Robert Viduya */ extern char *tparm(); #endif -# ifdef COLOR_BLACK /* trust include file */ -#undef COLOR_BLACK -# else +# ifndef COLOR_BLACK /* trust include file */ # ifndef _M_UNIX /* guess BGR */ +#define COLOR_BLACK 0 #define COLOR_BLUE 1 #define COLOR_GREEN 2 #define COLOR_CYAN 3 @@ -821,6 +820,7 @@ extern char *tparm(); #define COLOR_YELLOW 6 #define COLOR_WHITE 7 # else /* guess RGB */ +#define COLOR_BLACK 0 #define COLOR_RED 1 #define COLOR_GREEN 2 #define COLOR_YELLOW 3 @@ -830,43 +830,125 @@ extern char *tparm(); #define COLOR_WHITE 7 # endif # endif -#define COLOR_BLACK COLOR_BLUE -const int ti_map[8] = { - COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, - COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE }; +/* Mapping data for the six terminfo colors that resolve to pairs of nethack + * colors. Black and white are handled specially. + */ +const struct {int ti_color, nh_color, nh_bright_color;} ti_map[6] = +{ + {COLOR_RED,CLR_RED,CLR_ORANGE}, + {COLOR_GREEN,CLR_GREEN,CLR_BRIGHT_GREEN}, + {COLOR_YELLOW,CLR_BROWN,CLR_YELLOW}, + {COLOR_BLUE,CLR_BLUE,CLR_BRIGHT_BLUE}, + {COLOR_MAGENTA,CLR_MAGENTA,CLR_BRIGHT_MAGENTA}, + {COLOR_CYAN,CLR_CYAN,CLR_BRIGHT_CYAN} +}; + static void init_hilite() { register int c; char *setf, *scratch; - - for (c = 0; c < SIZE(hilites); c++) - hilites[c] = nh_HI; - hilites[CLR_GRAY] = hilites[NO_COLOR] = (char *)0; + int md_len; if (tgetnum("Co") < 8 || (MD == NULL) || (strlen(MD) == 0) || ((setf = tgetstr("AF", (char **)0)) == (char *)0 && (setf = tgetstr("Sf", (char **)0)) == (char *)0)) + { + /* Fallback when colors not available + * It's arbitrary to collapse all colors except gray + * together, but that's what the previous code did. + */ + hilites[CLR_BLACK] = nh_HI; + hilites[CLR_RED] = nh_HI; + hilites[CLR_GREEN] = nh_HI; + hilites[CLR_BROWN] = nh_HI; + hilites[CLR_BLUE] = nh_HI; + hilites[CLR_MAGENTA] = nh_HI; + hilites[CLR_CYAN] = nh_HI; + hilites[CLR_GRAY] = ""; + hilites[NO_COLOR] = ""; + hilites[CLR_ORANGE] = nh_HI; + hilites[CLR_BRIGHT_GREEN] = nh_HI; + hilites[CLR_YELLOW] = nh_HI; + hilites[CLR_BRIGHT_BLUE] = nh_HI; + hilites[CLR_BRIGHT_MAGENTA] = nh_HI; + hilites[CLR_BRIGHT_CYAN] = nh_HI; + hilites[CLR_WHITE] = nh_HI; return; - - for (c = 0; c < CLR_MAX / 2; c++) { - scratch = tparm(setf, ti_map[c]); - if (c != CLR_GRAY) { - hilites[c] = (char *) alloc(strlen(scratch) + 1); - Strcpy(hilites[c], scratch); - } - if (c != CLR_BLACK) { - hilites[c|BRIGHT] = (char*) alloc(strlen(scratch)+strlen(MD)+1); - Strcpy(hilites[c|BRIGHT], MD); - Strcat(hilites[c|BRIGHT], scratch); } + md_len = strlen(MD); + + c = 6; + while (c--) { + char *work; + scratch = tparm(setf,ti_map[c].ti_color); + work = (char *) alloc(strlen(scratch) + md_len + 1); + Strcpy(work,MD); + hilites[ti_map[c].nh_bright_color] = work; + work += md_len; + Strcpy(work,scratch); + hilites[ti_map[c].nh_color] = work; + } + + scratch = tparm(setf,COLOR_WHITE); + hilites[CLR_WHITE] = (char *) alloc(strlen(scratch) + md_len + 1); + Strcpy(hilites[CLR_WHITE],MD); + Strcat(hilites[CLR_WHITE],scratch); + + hilites[CLR_GRAY] = ""; + hilites[NO_COLOR] = ""; + + if (iflags.wc2_darkgray) { + /* On many terminals, esp. those using classic PC CGA/EGA/VGA + * textmode, specifying "hilight" and "black" simultaneously + * produces a dark shade of gray that is visible against a + * black background. We can use it to represent black objects. + */ + scratch = tparm(setf,COLOR_BLACK); + hilites[CLR_BLACK] = (char *) alloc(strlen(scratch) + md_len + 1); + Strcpy(hilites[CLR_BLACK],MD); + Strcat(hilites[CLR_BLACK],scratch); + } else { + /* But it's concievable that hilighted black-on-black could + * still be invisible on many others. We substitute blue for + * black. + */ + hilites[CLR_BLACK] = hilites[CLR_BLUE]; } } +static void +kill_hilite() +{ + /* if colors weren't available, no freeing needed */ + if (hilites[CLR_BLACK] == nh_HI) + return; + + if (hilites[CLR_BLACK] != hilites[CLR_BLUE]) + free(hilites[CLR_BLACK]); + + /* CLR_BLUE overlaps CLR_BRIGHT_BLUE, do not free */ + /* CLR_GREEN overlaps CLR_BRIGHT_GREEN, do not free */ + /* CLR_CYAN overlaps CLR_BRIGHT_CYAN, do not free */ + /* CLR_RED overlaps CLR_ORANGE, do not free */ + /* CLR_MAGENTA overlaps CLR_BRIGHT_MAGENTA, do not free */ + /* CLR_BROWN overlaps CLR_YELLOW, do not free */ + /* CLR_GRAY is a constant "", do not free */ + /* NO_COLOR is a constant "", do not free */ + free(hilites[CLR_BRIGHT_BLUE]); + free(hilites[CLR_BRIGHT_GREEN]); + free(hilites[CLR_BRIGHT_CYAN]); + free(hilites[CLR_YELLOW]); + free(hilites[CLR_ORANGE]); + free(hilites[CLR_BRIGHT_MAGENTA]); + free(hilites[CLR_WHITE]); +} + + # else /* UNIX && TERMINFO */ # ifndef TOS @@ -1011,7 +1093,6 @@ init_hilite() # endif # endif /* TOS */ } -# endif /* UNIX */ static void kill_hilite() @@ -1029,6 +1110,7 @@ kill_hilite() # endif return; } +# endif /* UNIX */ #endif /* TEXTCOLOR */ diff --git a/win/tty/wintty.c b/win/tty/wintty.c index afe0e204e..bffce05d7 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -56,7 +56,7 @@ struct window_procs tty_procs = { #if defined(SELECTSAVED) WC2_SELECTSAVED| #endif - 0L, + WC2_DARKGRAY, tty_init_nhwindows, tty_player_selection, tty_askname, From 6c58e7f03fecefc7f0ddd666d0f7df2b867fa408 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 29 Mar 2015 17:44:59 +0300 Subject: [PATCH 47/73] Kicking a grave may topple the gravestone ...with similar alignment hit as when digging up a grave. --- doc/fixes35.0 | 1 + src/dokick.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 0d7fb3cde..6d859ff4d 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -892,6 +892,7 @@ add messages for trying to pick up some terrain features boomerang makes noise when hitting a sink non-pet rust monsters would eat rust-proofed non-digestibles but ignore those non-digestibles otherwise +kicking a grave may topple the gravestone Platform- and/or Interface-Specific Fixes diff --git a/src/dokick.c b/src/dokick.c index 645eb5cf2..d558bdd38 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -991,7 +991,28 @@ dokick() exercise(A_DEX, TRUE); return(1); } - if(IS_GRAVE(maploc->typ) || maploc->typ == IRONBARS) + if (IS_GRAVE(maploc->typ)) { + if(Levitation) goto dumb; + if (rn2(4)) goto ouch; + exercise(A_WIS, FALSE); + if (Role_if(PM_ARCHEOLOGIST) || + Role_if(PM_SAMURAI) || + ((u.ualign.type == A_LAWFUL) && (u.ualign.record > -10))) { + adjalign(-sgn(u.ualign.type)); + } + maploc->typ = ROOM; + maploc->doormask = 0; + (void) mksobj_at(ROCK, x,y, TRUE, FALSE); + del_engr_at(x,y); + if (Blind) + pline("Crack! %s broke!", Something); + else { + pline_The("headstone topples over and breaks!"); + newsym(x,y); + } + return 1; + } + if(maploc->typ == IRONBARS) goto ouch; if(IS_TREE(maploc->typ)) { struct obj *treefruit; From 2c9ad065c18510152e963c198d3b09684e6bc563 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 29 Mar 2015 10:50:39 -0400 Subject: [PATCH 48/73] add data.base suggestion for whistle On 1/24/2014 6:48 AM, a bug reporter wrote: > The whistle in Nethack has no encyclopedia entry. I suggest for the next > release something from the M. R. James ghost story 'Oh, Whistle, and I'll Come > to You My Lad'. > --- dat/data.base | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dat/data.base b/dat/data.base index 6bca23177..57aea652e 100644 --- a/dat/data.base +++ b/dat/data.base @@ -5321,6 +5321,22 @@ web Oh what a tangled web we weave, When first we practise to deceive! [ Marmion, by Sir Walter Scott ] +whistle + There were legends both on the front and on the back of the + whistle. The one read thus: + + FLA FUR BIS FLE The other: QUIS EST ISTE QUI VENIT + 'I ought to be able to make it out,' he thought; + 'but I suppose I am a little rusty in my Latin. + When I come to think of it, I don't believe I even + know the word for a whistle. The long one does seem + simple enough. It ought to mean, "Who is this who is coming?" + + Well, the best way to find out is evidently to whistle + for him.' + + [Ghost Stories of an Antiquary, by Montague Rhodes James + 'Oh, Whistle, and I'll Come to You My Lad'] # werecritter -- see "lycanthrope" *wight When he came to himself again, for a moment he could recall From 411ee585939f3d1e6dc1b48854518d6832080de6 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 29 Mar 2015 22:08:46 +0300 Subject: [PATCH 49/73] Add more explicit helpless reasons Instead of just "while helpless", the death reason will tell more explicitly why the player was helpless. For example: "while frozen by a monster's gaze" --- doc/fixes35.0 | 1 + include/decl.h | 1 + src/apply.c | 6 +++++- src/artifact.c | 1 + src/decl.c | 1 + src/detect.c | 1 + src/dig.c | 1 + src/do_wear.c | 2 ++ src/dothrow.c | 1 + src/eat.c | 4 ++++ src/end.c | 7 ++++++- src/hack.c | 3 +++ src/mcastu.c | 2 ++ src/mhitu.c | 1 + src/pickup.c | 2 ++ src/polyself.c | 1 + src/potion.c | 4 ++++ src/pray.c | 3 +++ src/priest.c | 1 + src/sounds.c | 1 + src/spell.c | 3 +++ src/steal.c | 1 + src/timeout.c | 4 ++++ src/trap.c | 1 + src/uhitm.c | 3 +++ 25 files changed, 54 insertions(+), 2 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 6d859ff4d..03cb10a96 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1107,6 +1107,7 @@ cursor positioning ignores uninteresting dungeon features allow reading many more items when you're hiding under something a zap downward should not hit that something, while a zap upward should +show more explicit reason why player was helpless at death Platform- and/or Interface-Specific New Features diff --git a/include/decl.h b/include/decl.h index 15191842e..417ca9d62 100644 --- a/include/decl.h +++ b/include/decl.h @@ -28,6 +28,7 @@ E char SAVEP[]; E NEARDATA int bases[MAXOCLASSES]; E NEARDATA int multi; +E const char *multi_reason; E NEARDATA int nroom; E NEARDATA int nsubroom; E NEARDATA int occtime; diff --git a/src/apply.c b/src/apply.c index 6f13d6623..386365f49 100644 --- a/src/apply.c +++ b/src/apply.c @@ -737,8 +737,10 @@ struct obj *obj; pline("Yow! The %s stares back!", mirror); else pline("Yikes! You've frozen yourself!"); - if (!Hallucination || !rn2(4)) + if (!Hallucination || !rn2(4)) { nomul(-rnd(MAXULEV + 6 - u.ulevel)); + multi_reason = "gazing into a mirror"; + } nomovemsg = 0; /* default, "you can move again" */ } } else if (youmonst.data->mlet == S_VAMPIRE) @@ -916,6 +918,7 @@ struct obj **optr; break; case 2: /* no explanation; it just happens... */ nomovemsg = ""; + multi_reason = NULL; nomul(-rnd(2)); break; } @@ -1509,6 +1512,7 @@ int magic; /* 0=Physical, otherwise skill level */ teleds(cc.x, cc.y, TRUE); sokoban_guilt(); nomul(-1); + multi_reason = "jumping around"; nomovemsg = ""; morehungry(rnd(25)); return 1; diff --git a/src/artifact.c b/src/artifact.c index c9baaf365..81bfd4cf0 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -983,6 +983,7 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */ resisted = TRUE; } else { nomul(-3); + multi_reason = "being scared stiff"; nomovemsg = ""; if (magr && magr == u.ustuck && sticks(youmonst.data)) { u.ustuck = (struct monst *)0; diff --git a/src/decl.c b/src/decl.c index 75203c056..2df304575 100644 --- a/src/decl.c +++ b/src/decl.c @@ -21,6 +21,7 @@ char *catmore = 0; /* default pager */ NEARDATA int bases[MAXOCLASSES] = DUMMY; NEARDATA int multi = 0; +const char *multi_reason = NULL; NEARDATA int nroom = 0; NEARDATA int nsubroom = 0; NEARDATA int occtime = 0; diff --git a/src/detect.c b/src/detect.c index ecc4d3878..2af53021e 100644 --- a/src/detect.c +++ b/src/detect.c @@ -890,6 +890,7 @@ struct obj *obj; } You("peer into %s...", the(xname(obj))); nomul(-rnd(10)); + multi_reason = "gazing into a crystal ball"; nomovemsg = ""; if (obj->spe <= 0) pline_The("vision is unclear."); diff --git a/src/dig.c b/src/dig.c index fa25f76a0..f50d8aa76 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1023,6 +1023,7 @@ struct obj *obj; /* you ought to be able to let go; tough luck */ /* (maybe `move_into_trap()' would be better) */ nomul(-d(2,2)); + multi_reason = "stuck in a spider web"; nomovemsg = "You pull free."; } else if (lev->typ == IRONBARS) { pline("Clang!"); diff --git a/src/do_wear.c b/src/do_wear.c index 39d3b6c3f..ef04ee360 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -1407,6 +1407,7 @@ register struct obj *otmp; if(cursed(otmp)) return(0); if(delay) { nomul(delay); + multi_reason = "disrobing"; if (is_helmet(otmp)) { /* ick... */ nomovemsg = !strcmp(helm_simple_name(otmp), "hat") ? @@ -1664,6 +1665,7 @@ dowear() delay = -objects[otmp->otyp].oc_delay; if(delay){ nomul(delay); + multi_reason = "dressing up"; if(is_boots(otmp)) afternmv = Boots_on; if(is_helmet(otmp)) afternmv = Helmet_on; if(is_gloves(otmp)) afternmv = Gloves_on; diff --git a/src/dothrow.c b/src/dothrow.c index aedb4fc40..ab4b96497 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -693,6 +693,7 @@ hurtle(dx, dy, range, verbose) if(!range || (!dx && !dy) || u.ustuck) return; /* paranoia */ nomul(-range); + multi_reason = "moving through the air"; nomovemsg = ""; /* it just happens */ if (verbose) You("%s in the opposite direction.", range > 1 ? "hurtle" : "float"); diff --git a/src/eat.c b/src/eat.c index a5b413772..cc87f399e 100644 --- a/src/eat.c +++ b/src/eat.c @@ -962,6 +962,7 @@ register int pm; /* A pile of gold can't ride. */ if (u.usteed) dismount_steed(DISMOUNT_FELL); nomul(-tmp); + multi_reason = "pretending to be a pile of gold"; Sprintf(buf, Hallucination ? "You suddenly dread being peeled and mimic %s again!" : "You now prefer mimicking %s again.", @@ -1479,6 +1480,7 @@ struct obj *obj; pline_The("world spins and %s %s.", what, where); incr_itimeout(&HDeaf, duration); nomul(-duration); + multi_reason = "unconscious from rotten food"; nomovemsg = "You are conscious again."; afternmv = Hear_again; return(1); @@ -2677,6 +2679,7 @@ boolean incr; if (!Levitation) selftouch("Falling, you"); incr_itimeout(&HDeaf, duration); nomul(-duration); + multi_reason = "fainted from lack of food"; nomovemsg = "You regain consciousness."; afternmv = unfaint; newhs = FAINTED; @@ -2853,6 +2856,7 @@ vomit() /* A good idea from David Neves */ else make_sick(0L, (char *)0, TRUE, SICK_VOMITABLE); nomul(-2); + multi_reason = "vomiting"; nomovemsg = You_can_move_again; } diff --git a/src/end.c b/src/end.c index 7ada39767..35a5393bd 100644 --- a/src/end.c +++ b/src/end.c @@ -465,7 +465,12 @@ int how; Sprintf(eos(buf), " called %s", MNAME(mtmp)); } - if (multi) Strcat(buf, ", while helpless"); + if (multi) { + if (multi_reason) + Sprintf(eos(buf), ", while %s", multi_reason); + else + Strcat(buf, ", while helpless"); + } Strcpy(killer.name, buf); if (mptr->mlet == S_WRAITH) u.ugrave_arise = PM_WRAITH; diff --git a/src/hack.c b/src/hack.c index 98e615ac8..32ceb8e69 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1568,6 +1568,7 @@ domove() /* must come after we finished picking up, in spoteffects() */ if (cause_delay) { nomul(-2); + multi_reason = "dragging an iron ball"; nomovemsg = ""; } @@ -2434,6 +2435,7 @@ nomul(nval) u.uinvulnerable = FALSE; /* Kludge to avoid ctrl-C bug -dlc */ u.usleep = 0; multi = nval; + if (nval == 0) multi_reason = NULL; context.travel = context.travel1 = context.mv = context.run = 0; } @@ -2448,6 +2450,7 @@ const char *msg_override; if (*nomovemsg) pline1(nomovemsg); nomovemsg = 0; u.usleep = 0; + multi_reason = NULL; if (afternmv) (*afternmv)(); afternmv = 0; } diff --git a/src/mcastu.c b/src/mcastu.c index a677db12e..03c06f2ed 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -634,12 +634,14 @@ int spellnum; if (multi >= 0) You("stiffen briefly."); nomul(-1); + multi_reason = "paralyzed by a monster"; } else { if (multi >= 0) You("are frozen in place!"); dmg = 4 + (int)mtmp->m_lev; if (Half_spell_damage) dmg = (dmg + 1) / 2; nomul(-dmg); + multi_reason = "paralyzed by a monster"; } nomovemsg = 0; dmg = 0; diff --git a/src/mhitu.c b/src/mhitu.c index 6aa4225f7..9ec602895 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1053,6 +1053,7 @@ dopois: else You("are frozen by %s!", mon_nam(mtmp)); nomovemsg = You_can_move_again; nomul(-rnd(10)); + multi_reason = "paralyzed by a monster"; exercise(A_DEX, FALSE); } } diff --git a/src/pickup.c b/src/pickup.c index d2a76416c..bf5d06129 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -2121,6 +2121,7 @@ int held; /* even if the trap fails, you've used up this turn */ if (multi >= 0) { /* in case we didn't become paralyzed */ nomul(-1); + multi_reason = "opening a container"; nomovemsg = ""; } return 1; @@ -2630,6 +2631,7 @@ struct obj *box; /* or bag */ /* even if the trap fails, you've used up this turn */ if (multi >= 0) { /* in case we didn't become paralyzed */ nomul(-1); + multi_reason = "tipping a container"; nomovemsg = ""; } } else if (box->otyp == BAG_OF_TRICKS || box->otyp == HORN_OF_PLENTY) { diff --git a/src/polyself.c b/src/polyself.c index 3effba8b2..023b1f44a 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -1285,6 +1285,7 @@ dogaze() -d((int)mtmp->m_lev+1, (int)mtmp->data->mattk[0].damd) : -200); + multi_reason = "frozen by a monster's gaze"; nomovemsg = 0; return 1; } else diff --git a/src/potion.c b/src/potion.c index d9e5e9ca8..d32c65b65 100644 --- a/src/potion.c +++ b/src/potion.c @@ -375,6 +375,7 @@ ghost_from_bottle() if(flags.verbose) You("are frightened to death, and unable to move."); nomul(-3); + multi_reason = "being frightened to death"; nomovemsg = "You regain your composure."; } @@ -678,6 +679,7 @@ peffects(otmp) Your("%s are frozen to the %s!", makeplural(body_part(FOOT)), surface(u.ux, u.uy)); nomul(-(rn1(10, 25 - 12*bcsign(otmp)))); + multi_reason = "frozen by a potion"; nomovemsg = You_can_move_again; exercise(A_DEX, FALSE); } @@ -1467,6 +1469,7 @@ register struct obj *obj; if (!Free_action) { pline("%s seems to be holding you.", Something); nomul(-rnd(5)); + multi_reason = "frozen by a potion"; nomovemsg = You_can_move_again; exercise(A_DEX, FALSE); } else You("stiffen momentarily."); @@ -1476,6 +1479,7 @@ register struct obj *obj; if (!Free_action && !Sleep_resistance) { You_feel("rather tired."); nomul(-rnd(5)); + multi_reason = "sleeping off a magical draught"; nomovemsg = You_can_move_again; exercise(A_DEX, FALSE); } else You("yawn."); diff --git a/src/pray.c b/src/pray.c index ffdee9b49..bd95018c4 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1269,6 +1269,7 @@ dosacrifice() dmon->mpeaceful = TRUE; You("are terrified, and unable to move."); nomul(-3); + multi_reason = "being terrified of a demon"; nomovemsg = 0; } else pline_The("%s.", demonless_msg); } @@ -1655,6 +1656,7 @@ dopray() } } nomul(-3); + multi_reason = "praying"; nomovemsg = "You finish your prayer."; afternmv = prayer_done; @@ -1817,6 +1819,7 @@ doturn() } } nomul(-5); + multi_reason = "trying to turn the monsters"; nomovemsg = You_can_move_again; return(1); } diff --git a/src/priest.c b/src/priest.c index a28f2b8d4..0b520cfdf 100644 --- a/src/priest.c +++ b/src/priest.c @@ -475,6 +475,7 @@ int roomno; if (flags.verbose) You("are frightened to death, and unable to move."); nomul(-3); + multi_reason = "being terrified of a demon"; nomovemsg = "You regain your composure."; } } diff --git a/src/sounds.c b/src/sounds.c index d8d78b4cc..f1dec986f 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -710,6 +710,7 @@ register struct monst *mtmp; pline("%s rattles noisily.", Monnam(mtmp)); You("freeze for a moment."); nomul(-2); + multi_reason = "scared by rattling"; nomovemsg = 0; break; case MS_LAUGH: diff --git a/src/spell.c b/src/spell.c index 53b8626f0..5ce0a6015 100644 --- a/src/spell.c +++ b/src/spell.c @@ -329,6 +329,7 @@ learn(VOID_ARGS) context.spbook.book = 0; /* no longer studying */ context.spbook.o_id = 0; nomul(context.spbook.delay); /* remaining delay is uninterrupted */ + multi_reason = "reading a book"; nomovemsg = 0; context.spbook.delay = 0; return(0); @@ -506,6 +507,7 @@ register struct obj *spellbook; boolean gone = cursed_book(spellbook); nomul(context.spbook.delay); /* study time */ + multi_reason = "reading a book"; nomovemsg = 0; context.spbook.delay = 0; if(gone || !rn2(3)) { @@ -522,6 +524,7 @@ register struct obj *spellbook; spellbook->in_use = FALSE; } nomul(context.spbook.delay); + multi_reason = "reading a book"; nomovemsg = 0; context.spbook.delay = 0; return(1); diff --git a/src/steal.c b/src/steal.c index c73878310..f803ae4da 100644 --- a/src/steal.c +++ b/src/steal.c @@ -361,6 +361,7 @@ gotobj: named++; /* the following is to set multi for later on */ nomul(-armordelay); + multi_reason = "taking off clothes"; nomovemsg = 0; remove_worn_item(otmp, TRUE); otmp->cursed = curssv; diff --git a/src/timeout.c b/src/timeout.c index e47d863fb..e1ccaf96e 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -51,6 +51,7 @@ stoned_dialogue() case 3: /* limbs turned to stone */ stop_occupation(); nomul(-3); /* can't move anymore */ + multi_reason = "getting stoned"; nomovemsg = You_can_move_again; /* not unconscious */ break; default: @@ -377,6 +378,7 @@ nh_timeout() if (u.umoved && !Levitation) { slip_or_trip(); nomul(-2); + multi_reason = "fumbling"; nomovemsg = ""; /* The more you are carrying the more likely you * are to make noise when you fumble. Adjustments @@ -409,6 +411,7 @@ boolean wakeup_msg; { stop_occupation(); nomul(how_long); + multi_reason = "sleeping"; /* generally don't notice sounds while sleeping */ if (wakeup_msg && multi == how_long) { /* caller can follow with a direct call to Hear_again() if @@ -1271,6 +1274,7 @@ do_storms() if(!u.uinvulnerable) { stop_occupation(); nomul(-3); + multi_reason = "hiding from thunderstorm"; nomovemsg = 0; } } else diff --git a/src/trap.c b/src/trap.c index 47d8d99b2..775bca5cb 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4447,6 +4447,7 @@ boolean disarm; if (!Free_action) { pline("Suddenly you are frozen in place!"); nomul(-d(5, 6)); + multi_reason = "frozen by a trap"; exercise(A_DEX, FALSE); nomovemsg = You_can_move_again; } else You("momentarily stiffen."); diff --git a/src/uhitm.c b/src/uhitm.c index 80f38addf..2bf963c94 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1871,6 +1871,7 @@ register struct attack *mattk; You("digest %s.", mon_nam(mdef)); if (Slow_digestion) tmp *= 2; nomul(-tmp); + multi_reason = "digesting something"; nomovemsg = msgbuf; } else pline1(msgbuf); if (pd == &mons[PM_GREEN_SLIME]) { @@ -2353,6 +2354,7 @@ boolean wep_was_destroyed; You("are frozen by %s gaze!", s_suffix(mon_nam(mon))); nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -127); + multi_reason = "frozen by a monster's gaze"; nomovemsg = 0; } } else { @@ -2366,6 +2368,7 @@ boolean wep_was_destroyed; You("are frozen by %s!", mon_nam(mon)); nomovemsg = You_can_move_again; nomul(-tmp); + multi_reason = "frozen by a monster"; exercise(A_DEX, FALSE); } break; From 94256853c63844c674ed59ff4eac4479e7a892ad Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sun, 29 Mar 2015 18:20:26 -0400 Subject: [PATCH 50/73] Fix a compiler warning. --- win/tty/wintty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index bffce05d7..8c8f5294c 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 wintty.c $NHDT-Date: 1427505884 2015/03/28 01:24:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */ +/* NetHack 3.5 wintty.c $NHDT-Date: 1427667623 2015/03/29 22:20:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.75 $ */ /* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1657,7 +1657,7 @@ struct WinDesc *cw; boolean on_curr_page = FALSE; int lineno = 0; tty_getlin("Search for:", tmpbuf); - if (!tmpbuf || tmpbuf[0] == '\033') break; + if (!tmpbuf[0] || tmpbuf[0] == '\033') break; Sprintf(searchbuf, "*%s*", tmpbuf); for (curr = cw->mlist; curr; curr = curr->next) { if (on_curr_page) lineno++; From 2a9c913c1c818106a583c989f4d38412a0775aec Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sun, 29 Mar 2015 19:10:46 -0400 Subject: [PATCH 51/73] Add new hallucinatory gods. --- doc/fixes35.0 | 1 + src/pray.c | 66 ++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 11 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 03cb10a96..507480768 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1108,6 +1108,7 @@ allow reading many more items when you're hiding under something a zap downward should not hit that something, while a zap upward should show more explicit reason why player was helpless at death +added new hallucinatory-only gods Platform- and/or Interface-Specific New Features diff --git a/src/pray.c b/src/pray.c index bd95018c4..20e5d348d 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pray.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pray.c $NHDT-Date: 1427670643 2015/03/29 23:10:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.69 $ */ /* NetHack 3.5 pray.c $Date: 2012/05/07 01:44:38 $ $Revision: 1.62 $ */ /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1863,26 +1863,70 @@ aligntyp alignment; return gnam; } +static const char *hallu_gods[] = { + "the Flying Spaghetti Monster", /* Church of the FSM */ + "Eris", /* Discordianism */ + "the Martians", /* every science fiction ever */ + "Xom", /* Crawl */ + "AnDoR dRaKoN", /* ADOM */ + "the Central Bank of Yendor", /* economics */ + "Tooth Fairy", /* real world(?) */ + "Om", /* Discworld */ + "Yawgmoth", /* Magic: the Gathering */ + "Morgoth", /* LoTR */ + "Cthulhu", /* Lovecraft */ + "the Ori", /* Stargate */ + "destiny", /* why not? */ + "your Friend the Computer", /* Paranoia */ +}; + /* hallucination handling for priest/minion names: select a random god iff character is hallucinating */ const char * halu_gname(alignment) aligntyp alignment; { - const char *gnam; + const char *gnam = NULL; int which; - if (!Hallucination) return align_gname(alignment); + if (!Hallucination) + return align_gname(alignment); - which = randrole(); - switch (rn2(3)) { - case 0: gnam = roles[which].lgod; break; - case 1: gnam = roles[which].ngod; break; - case 2: gnam = roles[which].cgod; break; - default: gnam = 0; break; /* lint suppression */ + /* The priest may not have initialized god names. If this is the + * case, and we roll priest, we need to try again. */ + do + which = randrole(); + while (!roles[which].lgod); + + switch (rn2(9)) { + case 0: + case 1: + gnam = roles[which].lgod; + break; + case 2: + case 3: + gnam = roles[which].ngod; + break; + case 4: + case 5: + gnam = roles[which].cgod; + break; + case 6: + case 7: + gnam = hallu_gods[rn2(sizeof hallu_gods / sizeof *hallu_gods)]; + break; + case 8: + gnam = Moloch; + break; + default: + impossible("rn2 broken in halu_gname?!?"); } - if (!gnam) gnam = Moloch; - if (*gnam == '_') ++gnam; + if (!gnam) { + impossible("No random god name?"); + gnam = "your Friend the Computer"; /* Paranoia */ + } + if (*gnam == '_') + ++gnam; return gnam; } From 5a90f5f3666f1527122e2c169aabf80750939b64 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 29 Mar 2015 20:07:41 -0400 Subject: [PATCH 52/73] fix some compiler warnings windows cmdline Changes to be committed: modified: src/hack.c modified: src/vision.c --- src/hack.c | 2 +- src/vision.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hack.c b/src/hack.c index 32ceb8e69..5e14a3fab 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1104,7 +1104,7 @@ domove() register struct monst *mtmp; register struct rm *tmpr; register xchar x,y; - struct trap *trap; + struct trap *trap = (struct trap *)0; int wtcap; boolean on_ice; xchar chainx, chainy, ballx, bally; /* ball&chain new positions */ diff --git a/src/vision.c b/src/vision.c index a6585de14..8abf63c79 100644 --- a/src/vision.c +++ b/src/vision.c @@ -2198,9 +2198,9 @@ right_side(row, left, right_mark, limits) int deeper; /* if TRUE, call self as needed */ int result; /* set by q?_path() */ register int i; /* loop counter */ - register char *rowp; /* row optimization */ - char *row_min; /* left most [used by macro set_min()] */ - char *row_max; /* right most [used by macro set_max()] */ + register char *rowp = NULL; /* row optimization */ + char *row_min = NULL; /* left most [used by macro set_min()] */ + char *row_max = NULL; /* right most [used by macro set_max()] */ int lim_max; /* right most limit of circle */ #ifdef GCC_WARN @@ -2374,8 +2374,8 @@ left_side(row, left_mark, right, limits) { int left, left_edge, nrow, deeper, result; register int i; - register char *rowp; - char *row_min, *row_max; + register char *rowp = NULL; + char *row_min = NULL, *row_max = NULL; int lim_min; #ifdef GCC_WARN From 07518420835d5a3b2f6af70125b51dae57339787 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 29 Mar 2015 20:28:38 -0400 Subject: [PATCH 53/73] clean up cmdline Makefile for VS2010,VS2013,... VS2010 tested ok. VS2013 tested ok. VS2015 generated a _lot_ of linker warnings building NetHack, but it built. --- sys/winnt/Makefile.msc | 235 +++++++++++++++++++---------------------- 1 file changed, 107 insertions(+), 128 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index a1dfdbcd8..29c781ea7 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,4 +1,4 @@ -# NetHack 3.5 Makefile.msc $NHDT-Date: 1426967393 2015/03/21 19:49:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.72 $ */ +# NetHack 3.5 Makefile.msc $NHDT-Date: 1427675315 2015/03/30 00:28:35 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */ # Copyright (c) NetHack PC Development Team 1993-2015 # #============================================================================== @@ -133,72 +133,11 @@ cc=cl link=link rc=Rc -# -#============================================= -# Visual Studio versions >= 2013 specific stuff -#============================================= - -!IF "$(TARGET_CPU)" == "" -TARGET_CPU=x86 -!ENDIF - -# Common compiler flags: -# -c - compile without linking -# -W3 - Set warning level to level 3 (-W4 for 64-bit compilations) -# -Zi - generate debugging information -# -Od - disable all optimizations -# -Ox - use maximum optimizations -# -Zd - generate only public symbols and line numbers for debugging -# -GS - enable security checks -# -ccommon=-c $(CDBFLAG) -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c -lflags=/INCREMENTAL:NO /NOLOGO - -!IF "$(TARGET_CPU)" == "x86" -cflags = $(ccommon) -D_X86_=1 -DWIN32 -D_WIN32 -W3 -scall = -Gz - -!ELSEIF "$(TARGET_CPU)" == "x64" -cflags = $(ccommon) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -cflags = $(cflags) -W4 -scall = -!ENDIF - -# declarations for use on Intel x86 systems -!IF "$(TARGET_CPU)" == "x86" -DLLENTRY = @12 -!ENDIF - -# declarations for use on AMD64 systems -!IF "$(TARGET_CPU)" == "x64" -DLLENTRY = -!ENDIF - -# for Windows applications -conlflags = $(lflags) -subsystem:console,$(EXEVER) -guilflags = $(lflags) -subsystem:windows,$(EXEVER) -dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll - -# basic subsystem specific libraries, less the C Run-Time -baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib -winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib - -# for Windows applications that use the C Run-Time libraries -conlibs = $(baselibs) -guilibs = $(winlibs) -# -# End of VS2013 and greater stuff -#============================================= - # #========================================== # Exe File Info. #========================================== -# -# For the level compiler bits, -# we just defer to win\win32\dgnstuff.mak -# and win\win32\levstuff.mak # # # Optional high-quality BSD random number generation routines @@ -271,44 +210,90 @@ DLBFLG = #========================================== #========================================== -INCLDIR= /I..\include +!IF "$(TARGET_CPU)" == "" +TARGET_CPU=x86 +!ENDIF + +!IF "$(_NMAKE_VER)" == "10.00.40219.01" +CL2013= +!ELSE +! IF ($(VSVER) > 2010) +CL2013=-sdl +! ENDIF +!ENDIF + +ccommon= -c -nologo -D"_CONSOLE" -D"_CRT_NONSTDC_NO_DEPRECATE" -D"_CRT_SECURE_NO_DEPRECATE" \ + -D"_LIB" -D"_SCL_SECURE_NO_DEPRECATE" -D"_VC80_UPGRADE=0x0600" -D"DLB" -D"_MBCS" \ + -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D"NDEBUG" -D"YY_NO_UNISTD_H" -EHsc -fp:precise -Gd -GF -GS -Gy \ + $(CL2013) -WX- -Zc:forScope -Zc:wchar_t -Zi +cdebug= -analyze- -D"_DEBUG" -Gm -MTd -RTC1 -Od +crelease= -analyze- -D"_MBCS" -errorReport:prompt -GL -Gm- -MT -O2 -Ot -Ox -Oy + +lcommon= /NOLOGO /INCREMENTAL:NO !IF "$(DEBUGINFO)" == "Y" -CDBGFLAG=-Zi -LDBGFLAG=/debug -cdebug = -Zi -Od ldebug = /DEBUG +cflags1=$(ccommon) $(cdebug) +lflags1=$(lcommon) $(ldebug) !ELSE -CDBGFLAG= -LDBGFLAG= -ldebug = -cdebug = +ldebug= +cflags1=$(ccomon) $(crelease) +lflags1=$(lcommon) $(ldebug) !ENDIF -!IF ("$(ldebug)" != "") -!IF ("$(ldebug)" != "/RELEASE") -ldebug = /DEBUG -!ENDIF +lflags= $(lflags1) + +!IF "$(TARGET_CPU)" == "x86" +cflags = $(cflags1) -D_X86_=1 -DWIN32 -D_WIN32 -W3 +scall = -Gz + +!ELSEIF "$(TARGET_CPU)" == "x64" +cflags = $(cflags1) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 +scall = !ENDIF -!IF ("$(cdebug)" != "") -!IF ("$(cdebug)" != "-Ox -DNDEBUG") -cdebug = -Zi -Od -!ENDIF +!IF "$(_NMAKE_VER)" == "10.00.40219.01" +cflags = $(cflags:-W4=-W3) !ENDIF -cflags2 = $(cflags:-W4=-W3) -#More verbose below -#cflags2 = $(cflags) -wd4131 -#cflags2 = $(cflags:-W4=-Wall) +#More verbose warning output options below +#cflags = $(cflags:-W4=-wd4131 +#cflags = $(cflags:-W4=-Wall) +#cflags = $(cflags:-W3=-wd4131 +#cflags = $(cflags:-W3=-Wall) + +# declarations for use on Intel x86 systems +!IF "$(TARGET_CPU)" == "x86" +DLLENTRY = @12 +!ENDIF + +# declarations for use on AMD64 systems +!IF "$(TARGET_CPU)" == "x64" +DLLENTRY = +!ENDIF + +# for Windows applications +conlflags = $(lflags) -subsystem:console,$(EXEVER) +guilflags = $(lflags) -subsystem:windows,$(EXEVER) +dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll + +# basic subsystem specific libraries, less the C Run-Time +baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib +winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib + +# for Windows applications that use the C Run-Time libraries +conlibs = $(baselibs) +guilibs = $(winlibs) +# + +INCLDIR= /I..\include #========================================== # Util builds #========================================== -cflagsUtil = $(cdebug) $(cflags2) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) -lflagsUtil = $(ldebug) $(lflags) $(conlibs) +cflagsUtil = $(cflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) +lflagsUtil = $(lflags) $(conlibs) #========================================== # - Game build @@ -320,15 +305,13 @@ LIBS= user32.lib winmm.lib $(ZLIB) !IF ("$(GRAPHICAL)"=="Y") -cflagsGame = $(cdebug) $(cflags2) $(guiflags) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) -lflagsGame = $(ldebug) $(lflags) $(guilibs) $(GAMEPDBFILE) $(GAMEMAPFILE) +cflagsGame = $(cflags) $(guiflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) +lflagsGame = $(lflags) $(guilibs) $(GAMEPDBFILE) $(GAMEMAPFILE) !ELSE -cflagsGame = $(cdebug) $(cflags2) $(conflags) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) -lflagsGame = $(ldebug) $(lflags) $(conlibs) $(GAMEPDBFILE) $(GAMEMAPFILE) +cflagsGame = $(cflags) $(conflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) +lflagsGame = $(lflags) $(conlibs) $(GAMEPDBFILE) $(GAMEMAPFILE) !ENDIF @@ -429,21 +412,15 @@ U = $(UTIL)^\ # Utility Objects. # -MAKESRC = $(U)makedefs.c +MAKESRC = $(U)makedefs.c -MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o +MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o -#SPLEVOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ -# $(O)alloc.o $(O)decl.o $(O)drawing.o \ -# $(O)monst.o $(O)objects.o $(O)panic.o - -SPLEVOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ - $(O)alloc.o $(O)decl.o $(O)drawing.o \ - $(O)monst.o $(O)objects.o $(O)panic.o - -DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \ - $(O)alloc.o $(O)panic.o +LEVCOMPOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ + $(O)alloc.o $(O)decl.o $(O)drawing.o $(O)monst.o $(O)objects.o $(O)panic.o +DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \ + $(O)alloc.o $(O)panic.o RECOVOBJS = $(O)recover.o @@ -703,7 +680,7 @@ $(NHRES): $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico $(GAMEFILE) : $(ALLOBJ) $(NHRES) $(O)gamedir.tag $(WINDLLS) @if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR) - @echo Linking.... + @echo Linking $@ $(link) $(lflagsGame) /STACK:2048 $(LIBS) $(COMCTRL) -out:$@ @<<$(GAME).lnk $(ALLOBJ:^ =^ ) $(NHRES) @@ -781,12 +758,14 @@ $(GAMEDIR)\nhraykey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def # Makedefs Stuff #========================================== $(U)nhsizes.exe: $(O)nhsizes.o + @echo Linking $@ $(link) $(lflagsUtil) -out:$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o $(O)nhsizes.o: $(CONFIG_H) nhsizes.c @$(CC) $(cflagsUtil) -Fo$@ nhsizes.c $(U)makedefs.exe: $(MAKEOBJS) + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(MAKEOBJS) $(O)makedefs.o: $(CONFIG_H) $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\objclass.h \ @@ -794,7 +773,7 @@ $(O)makedefs.o: $(CONFIG_H) $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\objcla $(U)makedefs.c @if not exist $(OBJ)\*.* echo creating directory $(OBJ) @if not exist $(OBJ)\*.* mkdir $(OBJ) - $(CC) $(cflagsUtil) -Fo$@ $(U)makedefs.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)makedefs.c # # date.h should be remade every time any of the source or include @@ -835,6 +814,7 @@ $(DAT)\bogusmon: $(DAT)\bogusmon.txt $(U)makedefs.exe #========================================== $(U)uudecode.exe: $(O)uudecode.o + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(O)uudecode.o $(O)uudecode.o: $(SSYS)\uudecode.c @@ -890,24 +870,20 @@ $(WIN32)\splash.bmp: $(U)uudecode.exe $(WIN32)\splash.uu $(U)lev_yacc.c $(INCL)\lev_comp.h: $(U)lev_comp.y nmake -nologo -f ..\win\win32\levstuff.mak default -LEVCFLAGS=-c -nologo -DWIN32 -D_WIN32 -I$(INCL) -nologo -Z7 -Od -DDLB - $(O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c - $(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_yacc.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)lev_yacc.c -$(O)lev_lex.o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) \ +$(O)lev_lex.o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) \ $(U)lev_lex.c - $(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_lex.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)lev_lex.c -$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H) - $(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_main.c +$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H) + @$(CC) $(cflagsUtil) -Fo$@ $(U)lev_main.c -$(U)levcomp.exe: $(SPLEVOBJS) - @echo Linking $@... - echo $(link) - echo $(lflagsUtil) - $(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk - $(SPLEVOBJS:^ =^ +$(U)levcomp.exe: $(LEVCOMPOBJS) + @echo Linking $@ + @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk + $(LEVCOMPOBJS:^ =^ ) << @@ -921,17 +897,17 @@ $(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y nmake -nologo -f ..\win\win32\dgnstuff.mak default $(O)dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_yacc.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)dgn_yacc.c $(O)dgn_lex.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h \ $(U)dgn_lex.c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_lex.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)dgn_lex.c $(O)dgn_main.o: $(HACK_H) $(U)dgn_main.c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_main.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)dgn_main.c $(U)dgncomp.exe: $(DGNCOMPOBJS) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(DGNCOMPOBJS:^ =^ ) @@ -989,6 +965,7 @@ $(INCL)\win32api.h: $(MSWSYS)\win32api.h #========================================== $(U)dlb_main.exe: $(DLBOBJ) $(O)dlb.o + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(O)dlb_main.o $(O)dlb.o @@ -1038,10 +1015,11 @@ nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ #========================================== $(U)recover.exe: $(RECOVOBJS) + @echo Linking $@ $(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(RECOVOBJS) $(O)recover.o: $(CONFIG_H) $(U)recover.c $(INCL)\win32api.h - $(CC) $(cflagsUtil) -Fo$@ $(U)recover.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)recover.c #========================================== # Tile Mapping @@ -1052,6 +1030,7 @@ $(SRC)\tile.c: $(U)tilemap.exe @$(U)tilemap $(U)tilemap.exe: $(O)tilemap.o + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(O)tilemap.o $(O)tilemap.o: $(WSHR)\tilemap.c $(HACK_H) @@ -1083,7 +1062,7 @@ $(O)tilete32.o: $(WSHR)\tiletext.c $(CONFIG_H) $(TILE_H) #========================================== $(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(GIFREADERS:^ =^ ) @@ -1092,7 +1071,7 @@ $(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO) << $(U)gif2tx32.exe: $(GIFREADERS32) $(TEXT_IO32) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(GIFREADERS32:^ =^ ) @@ -1101,7 +1080,7 @@ $(U)gif2tx32.exe: $(GIFREADERS32) $(TEXT_IO32) << $(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(PPMWRITERS:^ =^ ) @@ -1123,7 +1102,7 @@ $(TILEBMP32): !ENDIF $(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(O)tile2bmp.o $(TEXT_IO:^ =^ @@ -1131,7 +1110,7 @@ $(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO) << $(U)til2bm32.exe: $(O)til2bm32.o $(TEXT_IO32) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(O)til2bm32.o $(TEXT_IO32:^ =^ From 6ab783b05b5b4af1002f73671047c4bcc81417f9 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 29 Mar 2015 21:00:50 -0400 Subject: [PATCH 54/73] cmdline Makefile updates --- sys/winnt/Makefile.msc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 29c781ea7..66449cd9e 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,4 +1,4 @@ -# NetHack 3.5 Makefile.msc $NHDT-Date: 1427675315 2015/03/30 00:28:35 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */ +# NetHack 3.5 Makefile.msc $NHDT-Date: 1426967393 2015/03/21 19:49:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.72 $ */ # Copyright (c) NetHack PC Development Team 1993-2015 # #============================================================================== From e305b8a51ed6ec5effd9314e9300aa93b2c411e5 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 30 Mar 2015 17:09:12 +0300 Subject: [PATCH 55/73] New T-shirt texts, bogusmon, one YAFM --- dat/bogusmon.txt | 3 +++ src/eat.c | 2 ++ src/read.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/dat/bogusmon.txt b/dat/bogusmon.txt index 2ec3e7fe7..59bfdbe3a 100644 --- a/dat/bogusmon.txt +++ b/dat/bogusmon.txt @@ -245,6 +245,9 @@ flying pig hippocampus hippogriff kelpie +catoblepas +phoenix +amphisbaena # Unusually animate body parts bouncing eye diff --git a/src/eat.c b/src/eat.c index cc87f399e..cb92f16c1 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1574,6 +1574,8 @@ eatcorpse(otmp) /* called when a corpse is selected as food */ } else if ((mnum == PM_COCKATRICE || mnum == PM_CHICKATRICE) && (Stone_resistance || Hallucination)) { pline("This tastes just like chicken!"); + } else if (mnum == PM_FLOATING_EYE && u.umonnum == PM_RAVEN) { + You("peck the eyeball with delight."); } else { /* [is this right? omnivores end up always disliking the taste] */ boolean yummy = (vegan(&mons[mnum]) ? diff --git a/src/read.c b/src/read.c index aa7a20508..9d8cac038 100644 --- a/src/read.c +++ b/src/read.c @@ -88,6 +88,55 @@ char *buf; "Don't Panic", /* HHGTTG */ "Furinkan High School Athletic Dept.", /* Ranma 1/2 */ "Hel-LOOO, Nurse!", /* Animaniacs */ + "=^.^=", + "100% goblin hair - do not wash", + "Aberzombie and Fitch", + "cK -- Cockatrice touches the Kop", + "Don't ask me, I only adventure here", + "Down with pants!", + "d, your dog or a killer?", + "FREE PUG AND NEWT!", + "Go team ant!", + "Got newt?", + "Hello, my darlings!", /* Charlie Drake */ + "Hey! Nymphs! Steal This T-Shirt!", + "I <3 Dungeon of Doom", + "I <3 Maud", + "I am a Valkyrie. If you see me running, try to keep up.", + "I am not a pack rat - I am a collector", + "I bounced off a rubber tree", /* Monkey Island */ + "Plunder Island Brimstone Beach Club", /* Monkey Island */ + "If you can read this, I can hit you with my polearm", + "I'm confused!", + "I scored with the princess", + "I want to live forever or die in the attempt.", + "Lichen Park", + "LOST IN THOUGHT - please send search party", + "Meat is Mordor", + "Minetown Better Business Bureau", + "Minetown Watch", + "Ms. Palm's House of Negotiable Affection -- A Very Reputable House Of Disrepute", + "Protection Racketeer", + "Real men love Crom", + "Somebody stole my Mojo!", + "The Hellhound Gang", + "The Werewolves", + "They Might Be Storm Giants", + "Weapons don't kill people, I kill people", + "White Zombie", + "You're killing me!", + "Anhur State University - Home of the Fighting Fire Ants!", + "FREE HUGS", + "Serial Ascender", + "Real men are valkyries", + "Young Men's Cavedigging Association", + "Occupy Fort Ludios", + "I couldn't afford this T-shirt so I stole it!", + "Mind flayers suck", + "I'm not wearing any pants", + "Down with the living!", + "Pudding farmer", + "Vegetarian", }; Strcpy(buf, shirt_msgs[tshirt->o_id % SIZE(shirt_msgs)]); return erode_obj_text(tshirt, buf); From 84a067a0162187383d0551aa5d4e130874b7bc57 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 30 Mar 2015 22:09:20 +0300 Subject: [PATCH 56/73] Options to create the character blind or nudist For those pro players who really want to try their hand at that zen samurai, without needing to reroll thousands of times to start with blindfold. Nudist starts without any armor, and keeps tabs whether you wore any during the game, for even more bragging rights. Also makes the Book of the Dead readable even while blind, for obvious reasons. --- doc/Guidebook.mn | 4 ++++ doc/Guidebook.tex | 6 ++++++ doc/fixes35.0 | 1 + include/patchlevel.h | 2 +- include/you.h | 6 ++++++ include/youprop.h | 2 +- src/attrib.c | 2 ++ src/cmd.c | 3 +++ src/options.c | 2 ++ src/read.c | 2 +- src/topten.c | 2 ++ src/u_init.c | 10 ++++++++++ src/worn.c | 1 + 13 files changed, 40 insertions(+), 3 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 496d588de..df7301a81 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1921,6 +1921,8 @@ quality of the weapon; you are free to manually fill your quiver or quiver sack or make ready with the `Q' command instead. If no weapon is found or the option is false, the `t' (throw) command is executed instead. (default false) +.lp blind +Start the character permanently blind. (default false) .lp bones Allow saving and loading bones files. (default true) .lp boulder @@ -2143,6 +2145,8 @@ Cannot be set with the `O' command. Read the NetHack news file, if present (default on). Since the news is shown at the beginning of the game, there's no point in setting this with the `O' command. +.lp nudist +Start the character with no armor (default false). .lp "null " Send padding nulls to the terminal (default on). .lp number_pad diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 6c3ccbded..7c2464664 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2322,6 +2322,9 @@ or make ready with the `Q' command instead. If no weapon is found or the option is false, the `t' (throw) command is executed instead. (default false) %.lp +\item[\ib{blind}] +Start the character permanently blind. (default false) +%.lp \item[\ib{bones}] Allow saving and loading bones files. (default true) %.lp @@ -2576,6 +2579,9 @@ Read the {\it NetHack\/} news file, if present (default on). Since the news is shown at the beginning of the game, there's no point in setting this with the `{\tt O}' command. %.lp +\item[\ib{nudist}] +Start the character with no armor (default false). +%.lp \item[\ib{null}] Send padding nulls to the terminal (default on). %.lp diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 507480768..b5dfeea67 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1109,6 +1109,7 @@ when you're hiding under something a zap downward should not hit that something, while a zap upward should show more explicit reason why player was helpless at death added new hallucinatory-only gods +options to create the character blind or nudist Platform- and/or Interface-Specific New Features diff --git a/include/patchlevel.h b/include/patchlevel.h index 1b0ebf241..f4281139e 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -14,7 +14,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 59 +#define EDITLEVEL 60 #define COPYRIGHT_BANNER_A \ "NetHack, Copyright 1985-2015" diff --git a/include/you.h b/include/you.h index 0fc5c6073..a69fe4de3 100644 --- a/include/you.h +++ b/include/you.h @@ -92,6 +92,11 @@ struct u_conduct { /* number of times... */ /* genocides already listed at end of game */ }; +struct u_roleplay { + boolean blind; /* permanently blind */ + boolean nudist; /* has not worn any armor, ever */ +}; + /*** Unified structure containing role information ***/ struct Role { /*** Strings that name various things ***/ @@ -330,6 +335,7 @@ struct you { struct u_event uevent; /* certain events have happened */ struct u_have uhave; /* you're carrying special objects */ struct u_conduct uconduct; /* KMH, conduct */ + struct u_roleplay uroleplay; struct attribs acurr, /* your current attributes (eg. str)*/ aexe, /* for gain/loss via "exercise" */ abon, /* your bonus attributes (eg. str) */ diff --git a/include/youprop.h b/include/youprop.h index 1dfe3a9e9..cdecb6c82 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -91,7 +91,7 @@ #define Blinded u.uprops[BLINDED].intrinsic #define Blindfolded (ublindf && ublindf->otyp != LENSES) /* ...means blind because of a cover */ -#define Blind ((Blinded || Blindfolded || !haseyes(youmonst.data)) && \ +#define Blind ((u.uroleplay.blind || Blinded || Blindfolded || !haseyes(youmonst.data)) && \ !(ublindf && ublindf->oartifact == ART_EYES_OF_THE_OVERWORLD)) /* ...the Eyes operate even when you really are blind or don't have any eyes */ diff --git a/src/attrib.c b/src/attrib.c index b9ce67596..f7af4fee8 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -691,6 +691,8 @@ int propidx; /* special cases can have negative values */ Sprintf(buf, because_of, obj->oartifact ? bare_artifactname(obj) : ysimple_name(obj)); + else if (propidx == BLINDED && u.uroleplay.blind) + Sprintf(buf, " from birth"); else if (propidx == BLINDED && Blindfolded_only) Sprintf(buf, because_of, ysimple_name(ublindf)); diff --git a/src/cmd.c b/src/cmd.c index 5d9bcfc27..51bc10896 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -2246,6 +2246,9 @@ int final; en_win = create_nhwindow(NHW_MENU); putstr(en_win, 0, "Voluntary challenges:"); + if (u.uroleplay.blind) you_have_been("blind from birth"); + if (u.uroleplay.nudist) you_have_been("faithfully nudist"); + if (!u.uconduct.food) enl_msg(You_, "have gone", "went", " without food", ""); /* But beverages are okay */ diff --git a/src/options.c b/src/options.c index e1ff15ff0..742958fc3 100644 --- a/src/options.c +++ b/src/options.c @@ -85,6 +85,7 @@ static struct Bool_Opt #else {"BIOS", (boolean *)0, FALSE, SET_IN_FILE}, #endif + {"blind", &u.uroleplay.blind, FALSE, DISP_IN_GAME}, {"bones", &flags.bones, TRUE, SET_IN_FILE}, #ifdef INSURANCE {"checkpoint", &flags.ins_chkpt, TRUE, SET_IN_GAME}, @@ -149,6 +150,7 @@ static struct Bool_Opt #else {"news", (boolean *)0, FALSE, SET_IN_FILE}, #endif + {"nudist", &u.uroleplay.nudist, FALSE, DISP_IN_GAME}, {"null", &flags.null, TRUE, SET_IN_GAME}, #if defined(SYSFLAGS) && defined(MAC) {"page_wait", &sysflags.page_wait, TRUE, SET_IN_GAME}, diff --git a/src/read.c b/src/read.c index 9d8cac038..3ad28e8aa 100644 --- a/src/read.c +++ b/src/read.c @@ -287,7 +287,7 @@ doread() && scroll->oclass != SPBOOK_CLASS) { pline(silly_thing_to, "read"); return(0); - } else if (Blind) { + } else if (Blind && (scroll->otyp != SPE_BOOK_OF_THE_DEAD)) { const char *what = 0; if (scroll->oclass == SPBOOK_CLASS) what = "mystic runes"; diff --git a/src/topten.c b/src/topten.c index 19eaa2ed2..48c69cb8e 100644 --- a/src/topten.c +++ b/src/topten.c @@ -397,6 +397,8 @@ encodeachieve() if(u.uachieve.mines_luckstone) r |= 1L << 9; if(u.uachieve.finish_sokoban) r |= 1L << 10; if(u.uachieve.killed_medusa) r |= 1L << 11; + if(u.uroleplay.blind) r |= 1L << 12; + if(u.uroleplay.nudist) r |= 1L << 13; return r; } diff --git a/src/u_init.c b/src/u_init.c index 79954841c..3c32637dd 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -491,6 +491,7 @@ void u_init() { register int i; + struct u_roleplay tmpuroleplay = u.uroleplay; /* these set by rcfile options */ flags.female = flags.initgend; flags.beginner = 1; @@ -502,6 +503,8 @@ u_init() (void) memset((genericptr_t)&ubirthday, 0, sizeof(ubirthday)); (void) memset((genericptr_t)&urealtime, 0, sizeof(urealtime)); + u.uroleplay = tmpuroleplay; /* restore options set via rcfile */ + #if 0 /* documentation of more zero values as desirable */ u.usick_cause[0] = 0; u.uluck = u.moreluck = 0; @@ -922,6 +925,13 @@ register struct trobj *trop; nocreate4 = otyp; } + /* nudist gets no armor */ + if (u.uroleplay.nudist && obj->oclass == ARMOR_CLASS) { + dealloc_obj(obj); + trop++; + continue; + } + if (trop->trclass == COIN_CLASS) { /* no "blessed" or "identified" money */ obj->quan = u.umoney0; diff --git a/src/worn.c b/src/worn.c index 70ba11b3a..b810332ea 100644 --- a/src/worn.c +++ b/src/worn.c @@ -57,6 +57,7 @@ long mask; uskin = obj; /* assert( !uarm ); */ } else { + if ((mask & W_ARMOR)) u.uroleplay.nudist = FALSE; for(wp = worn; wp->w_mask; wp++) if(wp->w_mask & mask) { oobj = *(wp->w_obj); if(oobj && !(oobj->owornmask & wp->w_mask)) From ec7238ac221c13301b627b09e426ed879ba805fa Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 30 Mar 2015 16:10:14 -0700 Subject: [PATCH 57/73] lint cleanup for tty 'gray' gcc complained about assigning string literals to variables that aren't const. String literals don't have const type but modifying them results in undefined behavior, so the warning is justified. Except in this case the strings were never being modified so if wasn't justified after all. Switch to a static buffer anyway. --- win/tty/termcap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/win/tty/termcap.c b/win/tty/termcap.c index 1455bf21a..5329417d5 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 termcap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 termcap.c $NHDT-Date: 1427756993 2015/03/30 23:09:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ */ /* NetHack 3.5 termcap.c $Date: 2009/05/06 10:59:19 $ $Revision: 1.13 $ */ /* SCCS Id: @(#)termcap.c 3.5 2007/12/12 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ @@ -844,6 +844,7 @@ const struct {int ti_color, nh_color, nh_bright_color;} ti_map[6] = {COLOR_CYAN,CLR_CYAN,CLR_BRIGHT_CYAN} }; +static char nilstring[] = ""; static void init_hilite() @@ -868,8 +869,8 @@ init_hilite() hilites[CLR_BLUE] = nh_HI; hilites[CLR_MAGENTA] = nh_HI; hilites[CLR_CYAN] = nh_HI; - hilites[CLR_GRAY] = ""; - hilites[NO_COLOR] = ""; + hilites[CLR_GRAY] = nilstring; + hilites[NO_COLOR] = nilstring; hilites[CLR_ORANGE] = nh_HI; hilites[CLR_BRIGHT_GREEN] = nh_HI; hilites[CLR_YELLOW] = nh_HI; @@ -899,8 +900,8 @@ init_hilite() Strcpy(hilites[CLR_WHITE],MD); Strcat(hilites[CLR_WHITE],scratch); - hilites[CLR_GRAY] = ""; - hilites[NO_COLOR] = ""; + hilites[CLR_GRAY] = nilstring; + hilites[NO_COLOR] = nilstring; if (iflags.wc2_darkgray) { /* On many terminals, esp. those using classic PC CGA/EGA/VGA @@ -937,8 +938,8 @@ kill_hilite() /* CLR_RED overlaps CLR_ORANGE, do not free */ /* CLR_MAGENTA overlaps CLR_BRIGHT_MAGENTA, do not free */ /* CLR_BROWN overlaps CLR_YELLOW, do not free */ - /* CLR_GRAY is a constant "", do not free */ - /* NO_COLOR is a constant "", do not free */ + /* CLR_GRAY is static 'nilstring', do not free */ + /* NO_COLOR is static 'nilstring', do not free */ free(hilites[CLR_BRIGHT_BLUE]); free(hilites[CLR_BRIGHT_GREEN]); free(hilites[CLR_BRIGHT_CYAN]); From f2d97b2d00667989fa88fb54b70be8a867e81ffd Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 08:36:32 +0300 Subject: [PATCH 58/73] Silence GCC warnings ...when compiling with -Wall --pedantic --- src/cmd.c | 8 -------- src/dig.c | 4 ++-- src/dog.c | 4 ++-- src/mkroom.c | 6 +----- src/potion.c | 4 +--- src/read.c | 2 +- src/restore.c | 6 +++--- src/trap.c | 7 ++----- 8 files changed, 12 insertions(+), 29 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 51bc10896..8b7408533 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -997,11 +997,8 @@ wiz_levltyp_legend(VOID_ARGS) STATIC_PTR int wiz_smell(VOID_ARGS) { - char out_str[BUFSZ]; - struct permonst *pm = 0; int ans = 0; int mndx; /* monster index */ - int found; /* count of matching mndxs found */ coord cc; /* screen pos of unknown glyph */ int glyph; /* glyph at selected position */ @@ -1015,11 +1012,6 @@ wiz_smell(VOID_ARGS) pline("You can move the cursor to a monster that you want to smell."); do { - /* Reset some variables. */ - pm = (struct permonst *)0; - found = 0; - out_str[0] = '\0'; - pline("Pick a monster to smell."); ans = getpos(&cc, TRUE, "a monster"); if (ans < 0 || cc.x < 0) { diff --git a/src/dig.c b/src/dig.c index f50d8aa76..a99c93729 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1284,7 +1284,7 @@ zap_dig() struct monst *mtmp; struct obj *otmp; struct trap *trap_with_u = (struct trap *)0; - int zx, zy, diridx, digdepth, flow_x, flow_y; + int zx, zy, diridx = 8, digdepth, flow_x = -1, flow_y = -1; boolean shopdoor, shopwall, maze_dig, pitdig = FALSE, pitflow = FALSE; /* @@ -1462,7 +1462,7 @@ zap_dig() } /* while */ tmp_at(DISP_END,0); /* closing call */ - if (pitflow) { + if (pitflow && isok(flow_x, flow_y)) { struct trap *ttmp = t_at(flow_x, flow_y); if (ttmp && (ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT)) { schar filltyp = fillholetyp(ttmp->tx, ttmp->ty, TRUE); diff --git a/src/dog.c b/src/dog.c index fcc258b86..10e33677f 100644 --- a/src/dog.c +++ b/src/dog.c @@ -423,7 +423,7 @@ boolean with_you; * probably because the level is full. * Dump the monster's cargo and leave the monster dead. */ - struct obj *obj, *corpse; + struct obj *obj; while ((obj = mtmp->minvent) != 0) { obj_extract_self(obj); obj_no_longer_held(obj); @@ -437,7 +437,7 @@ boolean with_you; impossible("Can't find relocated object."); } } - corpse = mkcorpstat(CORPSE, (struct monst *)0, mtmp->data, + (void) mkcorpstat(CORPSE, (struct monst *)0, mtmp->data, xlocale, ylocale, CORPSTAT_NONE); mongone(mtmp); } diff --git a/src/mkroom.c b/src/mkroom.c index 2581ce996..6ef03054a 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -219,14 +219,10 @@ struct mkroom *sroom; { struct monst *mon; register int sx,sy,i; - int sh, tx, ty, goldlim, type = sroom->rtype; + int sh, tx = 0, ty = 0, goldlim = 0, type = sroom->rtype; int rmno = (int)((sroom - rooms) + ROOMOFFSET); coord mm; -#ifdef GCC_WARN - tx = ty = goldlim = 0; -#endif - sh = sroom->fdoor; switch(type) { case COURT: diff --git a/src/potion.c b/src/potion.c index d32c65b65..86fdcdff8 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1055,7 +1055,7 @@ boolean useeit; const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ { void FDECL((*func), (OBJ_P)) = 0; - const char *how = 0, *glowcolor = 0; + const char *glowcolor = 0; #define COST_alter (-2) #define COST_none (-1) int costchange = COST_none; @@ -1064,7 +1064,6 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ if (!potion || potion->otyp != POT_WATER) return FALSE; if (potion->blessed) { - how = "softly glow"; if (targobj->cursed) { func = uncurse; glowcolor = NH_AMBER; @@ -1076,7 +1075,6 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ altfmt = TRUE; /* "with a aura" */ } } else if (potion->cursed) { - how = "glow"; if (targobj->blessed) { func = unbless; glowcolor = "brown"; diff --git a/src/read.c b/src/read.c index 3ad28e8aa..7d35620bc 100644 --- a/src/read.c +++ b/src/read.c @@ -2198,7 +2198,7 @@ create_particular() { char buf[BUFSZ], *bufp, monclass; int which, tryct, i, firstchoice = NON_PM; - struct permonst *whichpm; + struct permonst *whichpm = NULL; struct monst *mtmp; boolean madeany = FALSE; boolean maketame, makepeaceful, makehostile; diff --git a/src/restore.c b/src/restore.c index be1126be8..4c4b049ce 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1144,9 +1144,9 @@ get_plname_from_file(fd, plbuf) int fd; char *plbuf; { - int rlen, pltmpsiz = 0; - rlen = read(fd, (genericptr_t) &pltmpsiz, sizeof(pltmpsiz)); - rlen = read(fd, (genericptr_t) plbuf, pltmpsiz); + int pltmpsiz = 0; + (void) read(fd, (genericptr_t) &pltmpsiz, sizeof(pltmpsiz)); + (void) read(fd, (genericptr_t) plbuf, pltmpsiz); return; } diff --git a/src/trap.c b/src/trap.c index 775bca5cb..4c8adccbd 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1406,13 +1406,12 @@ struct obj *otmp; { struct monst *steed = u.usteed; int tt; - boolean in_sight, trapkilled, steedhit; + boolean trapkilled, steedhit; if (!steed || !trap) return 0; tt = trap->ttyp; steed->mx = u.ux; steed->my = u.uy; - in_sight = !Blind; trapkilled = steedhit = FALSE; switch (tt) { @@ -4266,7 +4265,7 @@ boolean trapdoor_only; boolean *noticed; /* set to true iff hero notices the effect; */ { /* otherwise left with its previous value intact */ struct trap *t; - boolean ishero = (mon == &youmonst), result; + boolean ishero = (mon == &youmonst); if (mon == u.usteed) ishero = TRUE; t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my); @@ -4281,7 +4280,6 @@ boolean *noticed; /* set to true iff hero notices the effect; */ if (u.utrap) return FALSE; /* already trapped */ *noticed = TRUE; dotrap(t, FORCETRAP); - result = (u.utrap != 0); } else { if (mon->mtrapped) return FALSE; /* already trapped */ /* you notice it if you see the trap close/tremble/whatever @@ -4290,7 +4288,6 @@ boolean *noticed; /* set to true iff hero notices the effect; */ /* monster will be angered; mintrap doesn't handle that */ wakeup(mon); ++force_mintrap; - result = (mintrap(mon) != 0); --force_mintrap; /* mon might now be on the migrating monsters list */ } From aa7144daf69605d1d850992a807c3f928abe45b0 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 09:38:38 +0300 Subject: [PATCH 59/73] Bear traps wound legs --- src/trap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/trap.c b/src/trap.c index 4c8adccbd..f30fb5a6d 100644 --- a/src/trap.c +++ b/src/trap.c @@ -946,6 +946,7 @@ unsigned trflags; } else { pline("%s bear trap closes on your %s!", A_Your[trap->madeby_u], body_part(FOOT)); + set_wounded_legs(rn2(2) ? RIGHT_SIDE : LEFT_SIDE, rn1(10,10)); if(u.umonnum == PM_OWLBEAR || u.umonnum == PM_BUGBEAR) You("howl in anger!"); losehp(Maybe_Half_Phys(dmg), "bear trap", KILLED_BY_AN); From cc00b2117830118d3e980b8196fa7ee6d51cbdee Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 30 Mar 2015 23:20:45 -0700 Subject: [PATCH 60/73] bhitpile lint bit The 'zdir' function parameter has the same name as 'zdir' global variable, triggering a 'shadowing' warning. I had to read the 'if' statement multiple times to convince myself it was doing what was intended. It was, but I think this rewrite is easier to understand (at least for my feeble reptilian brain). I don't know who Tim Wright is, but his 15 mintues of fame has lasted for at least a decade so I cut his comment out. (The 28.5 year old GAN one a dozen lines lower was a tempting target for removal, but I managed to stop myself; otherwise it never ends.) --- src/zap.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/zap.c b/src/zap.c index b8c846be3..2852cf995 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 zap.c $NHDT-Date: 1427249230 2015/03/25 02:07:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.197 $ */ +/* NetHack 3.5 zap.c $NHDT-Date: 1427782839 2015/03/31 06:20:39 $ $NHDT-Branch: master $:$NHDT-Revision: 1.200 $ */ /* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1892,11 +1892,11 @@ struct obj *obj, *otmp; /* returns nonzero if something was hit */ int -bhitpile(obj,fhito,tx,ty,zdir) +bhitpile(obj, fhito, tx, ty, zz) struct obj *obj; int FDECL((*fhito), (OBJ_P,OBJ_P)); int tx, ty; - schar zdir; + schar zz; { int hitanything = 0; register struct obj *otmp, *next_obj; @@ -1916,16 +1916,12 @@ bhitpile(obj,fhito,tx,ty,zdir) poly_zapped = -1; for(otmp = level.objects[tx][ty]; otmp; otmp = next_obj) { - /* Fix for polymorph bug, Tim Wright */ next_obj = otmp->nexthere; - /* - * game flavor: if you are hiding under something, - * a zap downwards shouldn't hit that obj, so honor that. - */ - if (!(u.uundetected && (zdir > 0) && - (otmp == level.objects[u.ux][u.uy]) && - hides_under(youmonst.data))) - hitanything += (*fhito)(otmp, obj); + /* for zap downwards, don't hit object poly'd hero is hiding under */ + if (zz > 0 && u.uundetected && otmp == level.objects[u.ux][u.uy] + && hides_under(youmonst.data)) continue; + + hitanything += (*fhito)(otmp, obj); } if(poly_zapped >= 0) create_polymon(level.objects[tx][ty], poly_zapped); From f0eae55d347cc18ff79f6014044e1594d4bbb763 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 31 Mar 2015 00:18:00 -0700 Subject: [PATCH 61/73] add .gitignore entries: tile.h, NetHack.ad Add a couple of missing .gitignore entries for files put into place when building. include/tile.h is genearated for tiles and dat/NetHack.ad is copied for X11 resource definitions. --- dat/.gitignore | 1 + include/.gitignore | 1 + 2 files changed, 2 insertions(+) diff --git a/dat/.gitignore b/dat/.gitignore index 1784229ab..caece5a59 100644 --- a/dat/.gitignore +++ b/dat/.gitignore @@ -20,3 +20,4 @@ nhdat dlb.lst guioptions porthelp +NetHack.ad diff --git a/include/.gitignore b/include/.gitignore index b9bd5d8ab..cb5a92532 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -5,3 +5,4 @@ pm.h vis_tab.h dgn_comp.h lev_comp.h +tile.h From 19aeb91dc4f5597059676a5205afa3e2c3e7ff8e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 10:20:20 +0300 Subject: [PATCH 62/73] Revert one GCC warning --- src/trap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/trap.c b/src/trap.c index f30fb5a6d..3c3f66642 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4266,7 +4266,7 @@ boolean trapdoor_only; boolean *noticed; /* set to true iff hero notices the effect; */ { /* otherwise left with its previous value intact */ struct trap *t; - boolean ishero = (mon == &youmonst); + boolean ishero = (mon == &youmonst), result; if (mon == u.usteed) ishero = TRUE; t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my); @@ -4281,6 +4281,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ if (u.utrap) return FALSE; /* already trapped */ *noticed = TRUE; dotrap(t, FORCETRAP); + result = (u.utrap != 0); } else { if (mon->mtrapped) return FALSE; /* already trapped */ /* you notice it if you see the trap close/tremble/whatever @@ -4289,6 +4290,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ /* monster will be angered; mintrap doesn't handle that */ wakeup(mon); ++force_mintrap; + result = (mintrap(mon) != 0); --force_mintrap; /* mon might now be on the migrating monsters list */ } From 9f605ed2b330709f011714ee0677d9e00fa6d06d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 11:46:41 +0300 Subject: [PATCH 63/73] Moving clouds on the plane of air Reusing the plane of water air bubbles code --- dat/endgame.des | 40 +++---- src/allmain.c | 2 +- src/do.c | 2 +- src/mkmaze.c | 309 ++++++++++++++++++++++++++---------------------- 4 files changed, 191 insertions(+), 162 deletions(-) diff --git a/dat/endgame.des b/dat/endgame.des index 4758ff518..1f811ad61 100644 --- a/dat/endgame.des +++ b/dat/endgame.des @@ -139,26 +139,26 @@ GEOMETRY:center,center # This map has no visible outer boundary, and # is all "air". MAP -AAAAAAAAAAAAAAAAAAAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAACCCCCCAAAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAACCAACCCCCAAAAAACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAACCACCCCCCCAAAAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAACCCCAAACCAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAACCCCAAAAAACCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAACCCCCCCAAAACCACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAACCCCAAAAAAACCACAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCAACCCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCAAACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACACACCCCCAAACCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCCAAAACCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACACCCCCCCCAAACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCAACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAACACCCCCCCCCCACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCAAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAACCAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ENDMAP # Use up and down regions to partition the level into three parts; # teleportation can't cross from one part into another. diff --git a/src/allmain.c b/src/allmain.c index 45c319037..5f5ab44c7 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -292,7 +292,7 @@ boolean resuming; } restore_attrib(); /* underwater and waterlevel vision are done here */ - if (Is_waterlevel(&u.uz)) + if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) movebubbles(); else if (Underwater) under_water(0); diff --git a/src/do.c b/src/do.c index c690ad4fa..eae360425 100644 --- a/src/do.c +++ b/src/do.c @@ -1286,7 +1286,7 @@ boolean at_stairs, falling, portal; } /* initial movement of bubbles just before vision_recalc */ - if (Is_waterlevel(&u.uz)) + if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) movebubbles(); if (level_info[new_ledger].flags & FORGOTTEN) { diff --git a/src/mkmaze.c b/src/mkmaze.c index 87a3a870b..c0036d170 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -344,7 +344,8 @@ fixup_special() was_waterlevel = FALSE; u.uinwater = 0; unsetup_waterlevel(); - } else if (Is_waterlevel(&u.uz)) { + } + if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) { level.flags.hero_memory = 0; was_waterlevel = TRUE; /* water level is an odd beast - it has to be set up @@ -922,98 +923,110 @@ movebubbles() struct trap *btrap; static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0, 0, 0, 0, 0, 0 }; + static const struct rm air_pos = + { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, 1, 0, 0, 0 }; /* set up the portal the first time bubbles are moved */ if (!wportal) set_wportal(); vision_recalc(2); - /* keep attached ball&chain separate from bubble objects */ - if (Punished) unplacebc(); - /* - * Pick up everything inside of a bubble then fill all bubble - * locations. - */ + if (Is_waterlevel(&u.uz)) { - for (b = up ? bbubbles : ebubbles; b; b = up ? b->next : b->prev) { - if (b->cons) panic("movebubbles: cons != null"); - for (i = 0, x = b->x; i < (int) b->bm[0]; i++, x++) - for (j = 0, y = b->y; j < (int) b->bm[1]; j++, y++) - if (b->bm[j + 2] & (1 << i)) { - if (!isok(x,y)) { - impossible("movebubbles: bad pos (%d,%d)", x,y); - continue; - } + /* keep attached ball&chain separate from bubble objects */ + if (Punished) unplacebc(); - /* pick up objects, monsters, hero, and traps */ - if (OBJ_AT(x,y)) { - struct obj *olist = (struct obj *) 0, *otmp; - struct container *cons = (struct container *) - alloc(sizeof(struct container)); + /* + * Pick up everything inside of a bubble then fill all bubble + * locations. + */ - while ((otmp = level.objects[x][y]) != 0) { - remove_object(otmp); - otmp->ox = otmp->oy = 0; - otmp->nexthere = olist; - olist = otmp; + for (b = up ? bbubbles : ebubbles; b; b = up ? b->next : b->prev) { + if (b->cons) panic("movebubbles: cons != null"); + for (i = 0, x = b->x; i < (int) b->bm[0]; i++, x++) + for (j = 0, y = b->y; j < (int) b->bm[1]; j++, y++) + if (b->bm[j + 2] & (1 << i)) { + if (!isok(x,y)) { + impossible("movebubbles: bad pos (%d,%d)", x,y); + continue; } - cons->x = x; - cons->y = y; - cons->what = CONS_OBJ; - cons->list = (genericptr_t) olist; - cons->next = b->cons; - b->cons = cons; + /* pick up objects, monsters, hero, and traps */ + if (OBJ_AT(x,y)) { + struct obj *olist = (struct obj *) 0, *otmp; + struct container *cons = (struct container *) + alloc(sizeof(struct container)); + + while ((otmp = level.objects[x][y]) != 0) { + remove_object(otmp); + otmp->ox = otmp->oy = 0; + otmp->nexthere = olist; + olist = otmp; + } + + cons->x = x; + cons->y = y; + cons->what = CONS_OBJ; + cons->list = (genericptr_t) olist; + cons->next = b->cons; + b->cons = cons; + } + if (MON_AT(x,y)) { + struct monst *mon = m_at(x,y); + struct container *cons = (struct container *) + alloc(sizeof(struct container)); + + cons->x = x; + cons->y = y; + cons->what = CONS_MON; + cons->list = (genericptr_t) mon; + + cons->next = b->cons; + b->cons = cons; + + if(mon->wormno) + remove_worm(mon); + else + remove_monster(x, y); + + newsym(x,y); /* clean up old position */ + mon->mx = mon->my = 0; + } + if (!u.uswallow && x == u.ux && y == u.uy) { + struct container *cons = (struct container *) + alloc(sizeof(struct container)); + + cons->x = x; + cons->y = y; + cons->what = CONS_HERO; + cons->list = (genericptr_t) 0; + + cons->next = b->cons; + b->cons = cons; + } + if ((btrap = t_at(x,y)) != 0) { + struct container *cons = (struct container *) + alloc(sizeof(struct container)); + + cons->x = x; + cons->y = y; + cons->what = CONS_TRAP; + cons->list = (genericptr_t) btrap; + + cons->next = b->cons; + b->cons = cons; + } + + levl[x][y] = water_pos; + block_point(x,y); } - if (MON_AT(x,y)) { - struct monst *mon = m_at(x,y); - struct container *cons = (struct container *) - alloc(sizeof(struct container)); - - cons->x = x; - cons->y = y; - cons->what = CONS_MON; - cons->list = (genericptr_t) mon; - - cons->next = b->cons; - b->cons = cons; - - if(mon->wormno) - remove_worm(mon); - else - remove_monster(x, y); - - newsym(x,y); /* clean up old position */ - mon->mx = mon->my = 0; - } - if (!u.uswallow && x == u.ux && y == u.uy) { - struct container *cons = (struct container *) - alloc(sizeof(struct container)); - - cons->x = x; - cons->y = y; - cons->what = CONS_HERO; - cons->list = (genericptr_t) 0; - - cons->next = b->cons; - b->cons = cons; - } - if ((btrap = t_at(x,y)) != 0) { - struct container *cons = (struct container *) - alloc(sizeof(struct container)); - - cons->x = x; - cons->y = y; - cons->what = CONS_TRAP; - cons->list = (genericptr_t) btrap; - - cons->next = b->cons; - b->cons = cons; - } - - levl[x][y] = water_pos; - block_point(x,y); - } + } + } else if (Is_airlevel(&u.uz)) { + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) { + levl[x][y] = air_pos; + unblock_point(x,y); + } } /* @@ -1032,7 +1045,7 @@ movebubbles() } /* put attached ball&chain back */ - if (Punished) placebc(); + if (Is_waterlevel(&u.uz) && Punished) placebc(); vision_full_recalc = 1; } @@ -1076,7 +1089,7 @@ int fd, mode; { register struct bubble *b; - if (!Is_waterlevel(&u.uz)) return; + if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz)) return; if (perform_bwrite(mode)) { int n = 0; @@ -1101,7 +1114,7 @@ register int fd; register int i; int n; - if (!Is_waterlevel(&u.uz)) return; + if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz)) return; set_wportal(); mread(fd,(genericptr_t)&n,sizeof(int)); @@ -1177,6 +1190,7 @@ setup_waterlevel() register int x, y; register int xskip, yskip; register int water_glyph = cmap_to_glyph(S_water); + register int air_glyph = cmap_to_glyph(S_air); /* ouch, hardcoded... */ @@ -1189,12 +1203,18 @@ setup_waterlevel() for (x = xmin; x <= xmax; x++) for (y = ymin; y <= ymax; y++) - levl[x][y].glyph = water_glyph; + levl[x][y].glyph = Is_waterlevel(&u.uz) ? water_glyph : air_glyph; /* make bubbles */ - xskip = 10 + rn2(10); - yskip = 4 + rn2(4); + if (Is_waterlevel(&u.uz)) { + xskip = 10 + rn2(10); + yskip = 4 + rn2(4); + } else { + xskip = 6 + rn2(4); + yskip = 3 + rn2(3); + } + for (x = bxmin; x <= bxmax; x += xskip) for (y = bymin; y <= bymax; y += yskip) mk_bubble(x,y,rn2(7)); @@ -1280,67 +1300,76 @@ register boolean ini; register int x, y, i, j, colli = 0; struct container *cons, *ctemp; - /* move bubble */ - if (dx < -1 || dx > 1 || dy < -1 || dy > 1) { - /* pline("mv_bubble: dx = %d, dy = %d", dx, dy); */ - dx = sgn(dx); - dy = sgn(dy); + /* clouds move slowly */ + if (!Is_airlevel(&u.uz) || !rn2(6)) { + /* move bubble */ + if (dx < -1 || dx > 1 || dy < -1 || dy > 1) { + /* pline("mv_bubble: dx = %d, dy = %d", dx, dy); */ + dx = sgn(dx); + dy = sgn(dy); + } + + /* + * collision with level borders? + * 1 = horizontal border, 2 = vertical, 3 = corner + */ + if (b->x <= bxmin) colli |= 2; + if (b->y <= bymin) colli |= 1; + if ((int) (b->x + b->bm[0] - 1) >= bxmax) colli |= 2; + if ((int) (b->y + b->bm[1] - 1) >= bymax) colli |= 1; + + if (b->x < bxmin) { + pline("bubble xmin: x = %d, xmin = %d", b->x, bxmin); + b->x = bxmin; + } + if (b->y < bymin) { + pline("bubble ymin: y = %d, ymin = %d", b->y, bymin); + b->y = bymin; + } + if ((int) (b->x + b->bm[0] - 1) > bxmax) { + pline("bubble xmax: x = %d, xmax = %d", + b->x + b->bm[0] - 1, bxmax); + b->x = bxmax - b->bm[0] + 1; + } + if ((int) (b->y + b->bm[1] - 1) > bymax) { + pline("bubble ymax: y = %d, ymax = %d", + b->y + b->bm[1] - 1, bymax); + b->y = bymax - b->bm[1] + 1; + } + + /* bounce if we're trying to move off the border */ + if (b->x == bxmin && dx < 0) dx = -dx; + if (b->x + b->bm[0] - 1 == bxmax && dx > 0) dx = -dx; + if (b->y == bymin && dy < 0) dy = -dy; + if (b->y + b->bm[1] - 1 == bymax && dy > 0) dy = -dy; + + b->x += dx; + b->y += dy; } - /* - * collision with level borders? - * 1 = horizontal border, 2 = vertical, 3 = corner - */ - if (b->x <= bxmin) colli |= 2; - if (b->y <= bymin) colli |= 1; - if ((int) (b->x + b->bm[0] - 1) >= bxmax) colli |= 2; - if ((int) (b->y + b->bm[1] - 1) >= bymax) colli |= 1; - - if (b->x < bxmin) { - pline("bubble xmin: x = %d, xmin = %d", b->x, bxmin); - b->x = bxmin; - } - if (b->y < bymin) { - pline("bubble ymin: y = %d, ymin = %d", b->y, bymin); - b->y = bymin; - } - if ((int) (b->x + b->bm[0] - 1) > bxmax) { - pline("bubble xmax: x = %d, xmax = %d", - b->x + b->bm[0] - 1, bxmax); - b->x = bxmax - b->bm[0] + 1; - } - if ((int) (b->y + b->bm[1] - 1) > bymax) { - pline("bubble ymax: y = %d, ymax = %d", - b->y + b->bm[1] - 1, bymax); - b->y = bymax - b->bm[1] + 1; - } - - /* bounce if we're trying to move off the border */ - if (b->x == bxmin && dx < 0) dx = -dx; - if (b->x + b->bm[0] - 1 == bxmax && dx > 0) dx = -dx; - if (b->y == bymin && dy < 0) dy = -dy; - if (b->y + b->bm[1] - 1 == bymax && dy > 0) dy = -dy; - - b->x += dx; - b->y += dy; - - /* void positions inside bubble */ - + /* draw the bubbles */ for (i = 0, x = b->x; i < (int) b->bm[0]; i++, x++) for (j = 0, y = b->y; j < (int) b->bm[1]; j++, y++) if (b->bm[j + 2] & (1 << i)) { + if (Is_waterlevel(&u.uz)) { levl[x][y].typ = AIR; levl[x][y].lit = 1; unblock_point(x,y); + } else if (Is_airlevel(&u.uz)) { + levl[x][y].typ = CLOUD; + levl[x][y].lit = 1; + block_point(x,y); + } } - /* replace contents of bubble */ - for (cons = b->cons; cons; cons = ctemp) { - ctemp = cons->next; - cons->x += dx; - cons->y += dy; + if (Is_waterlevel(&u.uz)) { + /* replace contents of bubble */ + for (cons = b->cons; cons; cons = ctemp) { + ctemp = cons->next; + cons->x += dx; + cons->y += dy; - switch(cons->what) { + switch(cons->what) { case CONS_OBJ: { struct obj *olist, *otmp; @@ -1381,13 +1410,13 @@ register boolean ini; default: impossible("mv_bubble: unknown bubble contents"); break; + } + free((genericptr_t)cons); } - free((genericptr_t)cons); + b->cons = 0; } - b->cons = 0; /* boing? */ - switch (colli) { case 1: b->dy = -b->dy; break; case 3: b->dy = -b->dy; /* fall through */ From ef9a89c99d4acb88386ff4e8f646c8dadbaab9c3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 12:41:35 +0300 Subject: [PATCH 64/73] Update fixes35.0 --- doc/fixes35.0 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index b5dfeea67..2d3b8c7ad 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1110,6 +1110,7 @@ when you're hiding under something a zap downward should not hit that show more explicit reason why player was helpless at death added new hallucinatory-only gods options to create the character blind or nudist +moving clouds on the plane of air Platform- and/or Interface-Specific New Features From cbd1657976e92e09236278a4b079f4570c0b1f16 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 12:59:27 +0300 Subject: [PATCH 65/73] Use a menu when user wants to query a glyph When user presses '/', pop up a meny asking what the user wants to look at: What do you want to look at: a - something on the map b - something you're carrying c - something else This replaces the "Specify unknown object by cursor?" -prompt, while keepng backwards compatibility, and also allows querying about items in the inventory. --- src/pager.c | 79 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 18 deletions(-) diff --git a/src/pager.c b/src/pager.c index f2f5b9968..4c0f69d17 100644 --- a/src/pager.c +++ b/src/pager.c @@ -679,7 +679,7 @@ do_look(mode, click_cc) char out_str[BUFSZ]; const char *firstmatch = 0; struct permonst *pm = 0; - int i, ans = 0; + int i = '\0', ans = 0; int sym; /* typed symbol or converted glyph */ int found; /* count of matching syms found */ coord cc; /* screen pos of unknown glyph */ @@ -689,25 +689,68 @@ do_look(mode, click_cc) if (!clicklook) { if (quick) { from_screen = TRUE; /* yes, we want to use the cursor */ - } else { - i = ynq("Specify unknown object by cursor?"); - if (i == 'q') return 0; - from_screen = (i == 'y'); + i = 'y'; + } + + if (i != 'y') { + menu_item *pick_list = (menu_item *)0; + winid win; + anything any; + win = create_nhwindow(NHW_MENU); + start_menu(win); + any.a_void = 0; any.a_char ='a'; + /* 'y' and 'n' to keep backwards compat with previous versions */ + add_menu(win, NO_GLYPH, &any, 'a', 'y', ATR_NONE, "something on the map", MENU_UNSELECTED); + any.a_void = 0; any.a_char ='b'; + add_menu(win, NO_GLYPH, &any, 'b', 0, ATR_NONE, "something you're carrying", MENU_UNSELECTED); + any.a_void = 0; any.a_char ='c'; + add_menu(win, NO_GLYPH, &any, 'c', 'n', ATR_NONE, "something else", MENU_UNSELECTED); + end_menu(win, "What do you want to look at:"); + if (select_menu(win, PICK_ONE, &pick_list) > 0) { + i = pick_list->item.a_char; + free((genericptr_t)pick_list); + } + destroy_nhwindow(win); } - if (from_screen) { - cc.x = u.ux; - cc.y = u.uy; - sym = 0; /* gcc -Wall lint */ - } else { - getlin("Specify what? (type the word)", out_str); - if (out_str[0] == '\0' || out_str[0] == '\033') - return 0; - if (out_str[1]) { /* user typed in a complete string */ - checkfile(out_str, pm, TRUE, TRUE); - return 0; - } - sym = out_str[0]; + switch (i) { + default: + case 'q': return 0; + case 'y': + case 'a': + from_screen = TRUE; + sym = 0; + cc.x = u.ux; + cc.y = u.uy; + break; + case 'b': + { + char invlet; + struct obj *invobj; + invlet = display_inventory(NULL, TRUE); + if (!invlet) return 0; + for (invobj = invent; invobj; invobj = invobj->nobj) + if (invobj->invlet == invlet) { + strcpy(out_str, singular(invobj, xname)); + break; + } + if (!out_str[1]) return 0; + checkfile(out_str, pm, TRUE, TRUE); + return 0; + } + break; + case 'c': + from_screen = FALSE; + getlin("Specify what? (type the word)", out_str); + if (out_str[0] == '\0' || out_str[0] == '\033') + return 0; + + if (out_str[1]) { /* user typed in a complete string */ + checkfile(out_str, pm, TRUE, TRUE); + return 0; + } + sym = out_str[0]; + break; } } else { /* clicklook */ cc.x = click_cc->x; From 8ee2d5976e9e5843668f244793966f431f25fa0c Mon Sep 17 00:00:00 2001 From: keni Date: Tue, 31 Mar 2015 09:50:02 -0400 Subject: [PATCH 66/73] NHDT substitution version 2. Re-run nhgitset.pl to install. "perldoc DEVEL/hooksdir/nhsub" for details. General docs still to come. Quick notes: - "git nhsub" lets you apply substitutions to a file without involving any version control. - When doing nhadd/nhcommit, the working directory WILL reflect the results of the substitutions. Let's see what this breaks. --- .gitattributes | 4 +- DEVEL/.gitattributes | 6 +- DEVEL/hooksdir/NHadd | 9 +- DEVEL/hooksdir/nhsub | 376 ++++++++++++++++++++++++++++++++++ DEVEL/nhgitset.pl | 27 ++- dat/.gitattributes | 6 +- doc/.gitattributes | 8 +- sys/amiga/.gitattributes | 2 +- sys/mac/.gitattributes | 2 +- sys/msdos/.gitattributes | 8 +- sys/os2/.gitattributes | 2 +- sys/share/.gitattributes | 2 +- sys/unix/.gitattributes | 2 +- sys/unix/hints/.gitattributes | 2 +- sys/vms/.gitattributes | 2 +- sys/wince/.gitattributes | 6 +- sys/winnt/.gitattributes | 8 +- util/.gitattributes | 4 +- 18 files changed, 435 insertions(+), 41 deletions(-) mode change 100755 => 100644 DEVEL/hooksdir/NHadd create mode 100644 DEVEL/hooksdir/nhsub diff --git a/.gitattributes b/.gitattributes index 894a91c8e..9af92ddc6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ -*.[ch] filter=NHtext merge=NHsubst -*.sh filter=NHtext merge=NHsubst +*.[ch] NHSUBST +*.sh NHSUBST * text=auto *.hqx -text *.sln -text diff --git a/DEVEL/.gitattributes b/DEVEL/.gitattributes index 3e157372b..cc0b542f3 100644 --- a/DEVEL/.gitattributes +++ b/DEVEL/.gitattributes @@ -1,4 +1,4 @@ -Developer.txt filter=NHtext merge=NHsubst -nhgitset.pl filter=NHtext merge=NHsubst -hookdir/* filter=NHtext merge=NHsubst +Developer.txt NHSUBST +nhgitset.pl NHSUBST +hooksdir/* NHSUBST * text=auto diff --git a/DEVEL/hooksdir/NHadd b/DEVEL/hooksdir/NHadd old mode 100755 new mode 100644 index 55a86ee08..55138e738 --- a/DEVEL/hooksdir/NHadd +++ b/DEVEL/hooksdir/NHadd @@ -1,14 +1,19 @@ #!/usr/bin/perl # wrapper for nhadd and nhcommit aliases -# $NHDT-Date$ +# $NHDT-Date: 1427408239 2015/03/26 22:17:19 $ %ok = map { $_ => 1 } ('add', 'commit'); die "Bad subcommand '$ARGV[0]'" unless $ok{$ARGV[0]}; +# we won't fail on a failure, so just system() +$rv = system('.git/hooks/nhsub',"--$ARGV[0]",@ARGV[1..$#ARGV]); +if($rv){ + print "warning: nhsub failed: $rv $!\n"; +} + if(length $ENV{GIT_PREFIX}){ chdir($ENV{GIT_PREFIX}) or die "Can't chdir $ENV{GIT_PREFIX}: $!"; } -$ENV{NHMODE} = 1; exec "git", @ARGV or die "Can't exec git: $!"; diff --git a/DEVEL/hooksdir/nhsub b/DEVEL/hooksdir/nhsub new file mode 100644 index 000000000..b8cdd9f67 --- /dev/null +++ b/DEVEL/hooksdir/nhsub @@ -0,0 +1,376 @@ +#!/usr/bin/perl +# nhsub +# $NHDT-Date: 1427408239 2015/03/26 22:17:19 $ + +# Note: was originally called nhdate; the rename is not reflected in the code. + +use strict; +my %opt; #cmd v n f F (other single char, but we don't care) +my $mode; # a c d f (add, commit, date, date -f) + +#SO how do we know if a file has changed? +#(git status: git status --porcelain --ignored -- FILES. +#maybe + -z but it's a question of rename operations - probably doesn't +# matter, but need to experiment. + +# key: [dacf] first character of opt{cmd} (f if nhsub -f or add -f) +# first 2 chars of "git status --porcelain --ignored" +# (see "git help status" for table) +# No default. Undef means something unexpected happened. +my %codes = ( + 'f M'=>1, 'f D'=>1, # [MD] not updated + 'a M'=>0, 'a D'=>0, + 'd M'=>0, 'd D'=>0, + 'c M'=>0, 'c D'=>0, + +# M [ MD] updated in index + + 'dA '=>1, 'dAM'=>1, 'dAD'=>1, + 'aA '=>1, 'aAM'=>1, 'aAD'=>1, + 'cA '=>1, 'cAM'=>1, 'cAD'=>1, + 'fA '=>1, 'fAM'=>1, 'fAD'=>1, + # A [ MD] added to index + + 'dD '=>0, 'dDM'=>0, + 'aD '=>1, 'aDM'=>1, + 'cD '=>0, 'cDM'=>0, + 'fD '=>1, 'fDM'=>1, + # D [ M] deleted from index + +# R [ MD] renamed in index + +# C [ MD] copied in index + + 'aM '=>1, 'aA '=>1, 'aR '=>1, 'aC '=>1, + 'fM '=>1, 'fA '=>1, 'fR '=>1, 'fC '=>1, + # [MARC] index and work tree matches + + 'd M'=>1, 'dMM'=>1, 'dAM'=>1, 'dRM'=>1, 'dCM'=>1, + 'a M'=>1, 'aMM'=>1, 'aAM'=>1, 'aRM'=>1, 'aCM'=>1, + 'c M'=>1, 'cMM'=>1, 'cAM'=>1, 'cRM'=>1, 'cCM'=>1, + 'f M'=>1, 'fMM'=>1, 'fAM'=>1, 'fRM'=>1, 'fCM'=>1, + # [ MARC] M work tree changed since index + + 'd D'=>0, 'dMD'=>0, 'dAD'=>0, 'dRD'=>0, 'dCD'=>0, + 'a D'=>0, 'aMD'=>0, 'aAD'=>0, 'aRD'=>0, 'aCD'=>0, + 'c D'=>0, 'cMD'=>0, 'cAD'=>0, 'cRD'=>0, 'cCD'=>0, + 'f D'=>0, 'fMD'=>0, 'fAD'=>0, 'fRD'=>0, 'fCD'=>0, + # [ MARC] D deleted in work tree + + # ------------------------------------------------- + # DD unmerged, both deleted + # AU unmerged, added by us + # UD unmerged, deleted by them + # UA unmerged, added by them + # DU unmerged, deleted by us + # AA unmerged, both added + # UU unmerged, both modified + # ------------------------------------------------- + 'a??'=>1, 'f??'=>1, # ?? untracked + 'd??'=>0, 'c??'=>0, + + 'f!!'=>1, # !! ignored + 'a!!'=>0, 'd!!'=>0, 'c!!'=>0 +); + +# OS hackery +my $PDS = '/'; +if ($^O eq "MSWin32") +{ + $PDS = '\\'; +} + +# pick up the prefix for substitutions in this repo +my $PREFIX = &git_config('nethack','substprefix'); +print "PREFIX: '$PREFIX'\n" if($opt{v}); + +my @rawlist = &cmdparse(@ARGV); +push(@rawlist,'.') if($#rawlist == -1); + +while(@rawlist){ + my $raw = shift @rawlist; + if(-f $raw){ + &schedule_work($raw); + next; + } + if(-d $raw){ + if($raw =~ m!$PDS.git$!o){ + print "SKIP $raw\n" if($opt{v}>=2); + next; + } + opendir RDIR,$raw or die "Can't opendir: $raw"; + local($_); # needed until perl 5.11.2 + while($_ = readdir RDIR){ + next if(m/^\.\.?$/); + if(m/^\./ && $opt{f}){ + print " IGNORE-f: $raw$PDS$_\n" if($opt{v}>=2); + next; + } + push(@rawlist, $raw.$PDS.$_); + } + closedir RDIR; + } + # ignore other file types +} + +# XXX could batch things up - later + +sub schedule_work { + my($file) = @_; + print "CHECK: '$file'\n" if($opt{v}>=2); + local($_) = `git status --porcelain --ignored -- $file`; + my $key = $mode . join('',(m/^(.)(.)/)); + if(length $key == 1){ + # Hack. An unmodified, tracked file produces no output from + # git status. Treat as ignored. + $key .= '!!'; + } + $key =~ s/-/ /g; # for Keni's locally mod'ed git + if(!exists $codes{$key}){ + die "I'm lost.\nK='$key' F=$file\nST=$_"; + } + if($codes{$key}==0){ + if($opt{v}>=2){ + print " IGNORE: $_" if(length); + print " IGNORE: !! $file\n" if(!length); + } + return; + } + if($opt{F}){ + my $ign = `git check-ignore $file`; + if($ign !~ m/^\s*$/){ + print " IGNORE-F: $ign" if($opt{v}>=2); + return; + } + } +# FALLTHROUGH and continue +#print "ACCEPT TEST\n"; # XXXXXXXXXX TEST +#return; + + my $attr = `git check-attr NHSUBST -- $file`; + if($attr =~ m/NHSUBST:\s+(.*)/){ +# XXX this is a bug in git. What if the value of an attribute is the +# string "unset"? Sigh. + if(! $opt{F}){ + if($1 eq "unset" || $1 eq "unspecified"){ + print " NOATTR: $attr" if($opt{v}>=2); + return; + } + } + &process_file($file); + return; + } + die "Can't parse check-attr return: $attr\n"; +} + +sub process_file { + my($file) = @_; + print "DOFIL: $file\n" if($opt{v}>=1); + + # For speed we read in the entire file then do the substitutions. + local($_) = ''; + my $len; + open INFILE, "<", $file or die "Can't open $file: $!"; + while(1){ + # On at least some systems we only get 64K. + my $len = sysread(INFILE, $_, 999999, length($_)); + last if($len == 0); + die "read failed: $!" unless defined($len); + } + close INFILE; + + local $::current_file = $file; # used under handlevar + # $1 - var and value (including trailing space but not $) + # $2 - var + # $4 - value or undef +#s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\N{DOLLAR SIGN}]+))?)\$/&handlevar($2,$4)/eg; +my $count = s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2,$4)/eg; +# XXX had o modifier, why? + return unless($count>0); + return if($opt{n}); + + my $ofile = $file . ".nht"; + open(TOUT, ">", $ofile) or die "Can't open $ofile"; + die "write failed: $!" unless defined syswrite(TOUT, $_); + close TOUT or die "Can't close $ofile"; + rename $ofile, $file or die "Can't rename $ofile to $file"; +} + +sub cmdparse { + my(@in) = @_; + + # What are we doing? + $opt{cmd} = 'date'; # really nhsub + if($in[0] eq '--add'){ + $opt{cmd} = 'add'; + shift @in; + } + if($in[0] eq '--commit'){ + $opt{cmd} = 'commit'; + shift @in; + } + +# add: -n -v +# commit: --dry-run -v +# nhsub: -n -v + while($in[0] =~ m/^-/){ + local($_) = $in[0]; + if($_ eq '--'){ + shift @in; + last; + } + if(m/^--/){ + if($opt{cmd} eq 'commit' && $_ eq '--dry-run'){ + $opt{'n'} = 1; + } + shift @in; + next; + } + if(m/^-(.*)/){ + foreach my $single ( split(//,$1) ){ + # don't do -v here from add/commit + if($single ne 'v'){ + $opt{$single}++; + } elsif($opt{cmd} eq 'date'){ + $opt{$single}++; + } + } + } + shift @in; + } + + ($mode) = ($opt{cmd} =~ m/^(.)/); + $mode = 'f' if($opt{cmd} eq 'date' && ($opt{f}||$opt{F})); + $mode = 'f' if($opt{cmd} eq 'add' && $opt{f}); + + return @in; # this is our file list +} + +sub git_config { + my($section, $var) = @_; + my $raw = `git config --local --get $section.$var`; + $raw =~ s/[\r\n]*$//g; + return $raw if(length $raw); + die "Missing config var: [$section] $var\n"; +} + +sub handlevar { + my($var, $val) = @_; +# print "HIT '$var' '$val'\n" if($debug2); + + my $subname = "PREFIX::$var"; + if(defined &$subname){ + no strict; + print " SUBIN: $var '$val'\n" if($opt{v}>=3); + $val =~ s/\s+$//; + $val = &$subname($val); + print " SUBOT: $var '$val'\n" if($opt{v}>=3); + } else { + warn "No handler for \$$PREFIX-$var\n"; + } + + if(length $val){ + return "\$$PREFIX-$var: $val \$"; + } else { + return "\$$PREFIX-$var\$"; + } +} + +package PREFIX; +use POSIX qw(strftime); + +# On push, put in the current date because we changed the file. +# On pull, keep the current value so we can see the last change date. +sub Date { + my($val) = @_; + # we add this to make merge easier for now XXX + my $now = time; # not %s below - may not be portable + # YYYY/MM/DD HH:MM:SS + $val = "$now " . strftime("%Y/%m/%d %H:%M:%S", gmtime($now)); + return $val; +} + +#sub Header { +#} +#sub Author { +#} + +# NB: the standard-ish Revision line isn't enough - you need Branch:Revision - +# but we split it into 2 so we can use the standard processing code on Revision +# and just slip Branch in. +sub Branch { + my($val) = @_; + $val = `git symbolic-ref -q --short HEAD`; + $val =~ s/[\n\r]*$//; + $val =~ s/^\*\s*//; + $val = "(unknown)" unless($val =~ m/^[[:print:]]+$/); + return $val; +} + +sub Revision { + my($val) = @_; + my @val = `git log --follow --oneline $::current_file`; + my $ver = 0+$#val; + $ver = 0 if($ver < 0); + $val = "1.$ver"; + return $val; +} +__END__ + +=head1 NAME + +C - NetHack git command for substitution variables + +=head1 SYNOPSIS + +C + +=head1 DESCRIPTION + +C rewrites the specified files by doing variable substitution for +variables starting with the prefix specified in the repository's +C configuration variable. C is also invoked +internally from the implementation of the C and C +commands. + +The program re-writes those files listed on the command line; if the file +is actually a directory, the program recurses into that directory tree. +Not all files found are re-written; some are ignored and those with no +substitution variables are not re-written. Unless changed by the options, +files that have not changed are not affected. + +If no files are listed on the command line, the current directory is +checked as if specified as C<.>. +Files listed directly on the command line are always checked. +The C<.git> directory is never processed. + +The following command line options are available: + +=over + +=item C<-v[v[v]]> + +Verbose output; may be (usefully) specified up to 3 times. Not available +when invoked as part of C or C. + +=item C<-n> + +Do not write any files. + +=item C<-f> + +Force, version 1: +Perform substitution even if the file has not changed, +except no dot files are processed unless listed directly on the command line. +This prevents accidents with editor temprorary files while recursing. Note +that this overloads the C<-f> option of C and C. + +=item C<-F> + +Force, version 2: +Perform substitution even if the file has not changed, +even if the NHSUBST attribute is not set for the +file, and only if the file is not ignored by git. Not available +when invoked as part of C or C. + +=back diff --git a/DEVEL/nhgitset.pl b/DEVEL/nhgitset.pl index 183c73d69..08068484a 100755 --- a/DEVEL/nhgitset.pl +++ b/DEVEL/nhgitset.pl @@ -3,7 +3,7 @@ # value of nethack.setupversion we will end up with when this is done # version 1 is reserved for repos checked out before versioning was added -my $version_new = 2; +my $version_new = 3; my $version_old = 0; # current version, if any (0 is no entry ergo new repo) use Cwd; @@ -100,16 +100,29 @@ print STDERR "Installing aliases\n" if($opt_v); $addpath = catfile(curdir(),'.git','hooks','NHadd'); &add_alias('nhadd', "!$addpath add"); &add_alias('nhcommit', "!$addpath commit"); +my $nhsub = catfile(curdir(),'.git','hooks','nhsub'); +&add_alias('nhsub', "!$nhsub"); print STDERR "Installing filter/merge\n" if($opt_v); -if($^O eq "MSWin32"){ - $cmd = '.git\\\\hooks\\\\NHtext'; -} else { - $cmd = catfile(curdir(),'.git','hooks','NHtext'); +# XXXX need it in NHadd to find nhsub??? +# removed at version 3 +#if($^O eq "MSWin32"){ +# $cmd = '.git\\\\hooks\\\\NHtext'; +#} else { +# $cmd = catfile(curdir(),'.git','hooks','NHtext'); +#} +#&add_config('filter.NHtext.clean', "$cmd --clean %f"); +#&add_config('filter.NHtext.smudge', "$cmd --smudge %f"); +if($version_old == 1 or $version_old == 2){ + print STDERR "Removing filter.NHtext\n" if($opt_v); + system('git','config','--unset','filter.NHtext.clean') unless($opt_n); + system('git','config','--unset','filter.NHtext.smudge') unless($opt_n); + system('git','config','--remove-section','filter.NHtext') unless($opt_n); + + print STDERR "Removing NHtext\n" if($opt_v); + unlink catfile(curdir(),'.git','hooks','NHtext') unless($opt_n); } -&add_config('filter.NHtext.clean', "$cmd --clean %f"); -&add_config('filter.NHtext.smudge', "$cmd --smudge %f"); $cmd = catfile(curdir(),'.git','hooks','NHsubst'); &add_config('merge.NHsubst.name', 'NetHack Keyword Substitution'); diff --git a/dat/.gitattributes b/dat/.gitattributes index 72aa05edd..b59108e49 100644 --- a/dat/.gitattributes +++ b/dat/.gitattributes @@ -1,3 +1,3 @@ -*.def filter=NHtext merge=NHsubst -*.des filter=NHtext merge=NHsubst -*.txt filter=NHtext merge=NHsubst +*.def NHSUBST +*.des NHSUBST +*.txt NHSUBST diff --git a/doc/.gitattributes b/doc/.gitattributes index 9ca881076..a9a06f4c8 100644 --- a/doc/.gitattributes +++ b/doc/.gitattributes @@ -1,5 +1,5 @@ -*.mn filter=NHtext merge=NHsubst -*.6 filter=NHtext merge=NHsubst -fixes.* filter=NHtext merge=NHsubst -window.doc filter=NHtext merge=NHsubst +*.mn NHSUBST +*.6 NHSUBST +fixes.* NHSUBST +window.doc NHSUBST diff --git a/sys/amiga/.gitattributes b/sys/amiga/.gitattributes index 7a28030a9..7735c64ea 100644 --- a/sys/amiga/.gitattributes +++ b/sys/amiga/.gitattributes @@ -1 +1 @@ -*.p filter=NHtext merge=NHsubst +*.p NHSUBST diff --git a/sys/mac/.gitattributes b/sys/mac/.gitattributes index 62b9832d7..8f8defc69 100644 --- a/sys/mac/.gitattributes +++ b/sys/mac/.gitattributes @@ -1 +1 @@ -NHDeflts filter=NHtext merge=NHsubst +NHDeflts NHSUBST diff --git a/sys/msdos/.gitattributes b/sys/msdos/.gitattributes index baef52e46..7e8941f2d 100644 --- a/sys/msdos/.gitattributes +++ b/sys/msdos/.gitattributes @@ -1,4 +1,4 @@ -*.BC filter=NHtext merge=NHsubst -*.bat filter=NHtext merge=NHsubst -Makefile.* filter=NHtext merge=NHsubst -Install.* filter=NHtext merge=NHsubst +*.BC NHSUBST +*.bat NHSUBST +Makefile.* NHSUBST +Install.* NHSUBST diff --git a/sys/os2/.gitattributes b/sys/os2/.gitattributes index 8cffb77ae..31e18fe84 100644 --- a/sys/os2/.gitattributes +++ b/sys/os2/.gitattributes @@ -1 +1 @@ -Makefile.* filter=NHtext merge=NHsubst +Makefile.* NHSUBST diff --git a/sys/share/.gitattributes b/sys/share/.gitattributes index 8cffb77ae..31e18fe84 100644 --- a/sys/share/.gitattributes +++ b/sys/share/.gitattributes @@ -1 +1 @@ -Makefile.* filter=NHtext merge=NHsubst +Makefile.* NHSUBST diff --git a/sys/unix/.gitattributes b/sys/unix/.gitattributes index 8cffb77ae..31e18fe84 100644 --- a/sys/unix/.gitattributes +++ b/sys/unix/.gitattributes @@ -1 +1 @@ -Makefile.* filter=NHtext merge=NHsubst +Makefile.* NHSUBST diff --git a/sys/unix/hints/.gitattributes b/sys/unix/hints/.gitattributes index a079959f1..db77844f7 100644 --- a/sys/unix/hints/.gitattributes +++ b/sys/unix/hints/.gitattributes @@ -1 +1 @@ -* filter=NHtext merge=NHsubst +* NHSUBST diff --git a/sys/vms/.gitattributes b/sys/vms/.gitattributes index 8cffb77ae..31e18fe84 100644 --- a/sys/vms/.gitattributes +++ b/sys/vms/.gitattributes @@ -1 +1 @@ -Makefile.* filter=NHtext merge=NHsubst +Makefile.* NHSUBST diff --git a/sys/wince/.gitattributes b/sys/wince/.gitattributes index e034edc5e..fbe75bcd4 100644 --- a/sys/wince/.gitattributes +++ b/sys/wince/.gitattributes @@ -1,3 +1,3 @@ -*.ce filter=NHtext merge=NHsubst -*.mak filter=NHtext merge=NHsubst -*.bat filter=NHtext merge=NHsubst +*.ce NHSUBST +*.mak NHSUBST +*.bat NHSUBST diff --git a/sys/winnt/.gitattributes b/sys/winnt/.gitattributes index 2a38b029c..88f970c96 100644 --- a/sys/winnt/.gitattributes +++ b/sys/winnt/.gitattributes @@ -1,4 +1,4 @@ -Install.nt filter=NHtext merge=NHsubst -Makefile.* filter=NHtext merge=NHsubst -*.rc filter=NHtext merge=NHsubst -*.bat filter=NHtext merge=NHsubst +Install.nt NHSUBST +Makefile.* NHSUBST +*.rc NHSUBST +*.bat NHSUBST diff --git a/util/.gitattributes b/util/.gitattributes index 15e23d268..8b2657e61 100644 --- a/util/.gitattributes +++ b/util/.gitattributes @@ -1,2 +1,2 @@ -*.pl filter=NHtext merge=NHsubst -*.[ly] filter=NHtext merge=NHsubst +*.pl NHSUBST +*.[ly] NHSUBST From ca80675d590cbffcb9abd4a79bf01ceb97eef0b3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 18:14:10 +0300 Subject: [PATCH 67/73] Allow admin to disable explore mode Some public servers want to disable explore mode, so make it configurable in sysconf. --- doc/Guidebook.mn | 4 ++++ doc/Guidebook.tex | 4 ++++ include/sys.h | 1 + src/cmd.c | 8 ++++++++ src/files.c | 3 +++ src/sys.c | 1 + sys/unix/sysconf | 3 +++ sys/winnt/sysconf | 3 +++ 8 files changed, 27 insertions(+) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index df7301a81..4293fdb3e 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2922,6 +2922,10 @@ SHELLERS A list of users who are allowed to use the shell escape command (!). The syntax is the same as WIZARDS. .lp +EXPLORERS +A list of users who are allowed to use the explore mode. The +syntax is the same as WIZARDS. +.lp MAXPLAYERS Limit the maximum number of games that can be running at the same time. .lp diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 7c2464664..5f1ae5e4b 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3494,6 +3494,10 @@ asterisk (*) allows anyone to start a game in wizard mode. A list of users who are allowed to use the shell escape command (!). The syntax is the same as WIZARDS. %.lp +\item[\ib{EXPLORERS}] +A list of users who are allowed to use the explore mode. +The syntax is the same as WIZARDS. +%.lp \item[\ib{MAXPLAYERS}] Limit the maximum number of games taht can be running at the same time. %.lp diff --git a/include/sys.h b/include/sys.h index b97f7ca80..84d42b5b6 100644 --- a/include/sys.h +++ b/include/sys.h @@ -10,6 +10,7 @@ struct sysopt { char *support; /* local support contact */ char *recover; /* how to run recover - may be overridden by win port */ char *wizards; + char *explorers; char *shellers; /* like wizards, for ! command (-DSHELL) */ char *debugfiles; /* files to show debugplines in. '*' is all. */ int env_dbgfl; /* 1: debugfiles comes from getenv("DEBUGFILES") diff --git a/src/cmd.c b/src/cmd.c index 8b7408533..b028c57a3 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -509,6 +509,14 @@ enter_explore_mode(VOID_ARGS) } else if (discover) { You("are already in explore mode."); } else { +#ifdef SYSCF + if (!sysopt.explorers || + !sysopt.explorers[0] || + !check_user_string(sysopt.explorers)) { + You("cannot access explore mode."); + return 0; + } +#endif pline( "Beware! From explore mode there will be no return to normal game."); if (paranoid_query(ParanoidQuit, diff --git a/src/files.c b/src/files.c index ace417e7d..179cd3437 100644 --- a/src/files.c +++ b/src/files.c @@ -2184,6 +2184,9 @@ int src; } else if (src == SET_IN_SYS && match_varname(buf, "SHELLERS", 8)) { if (sysopt.shellers) free(sysopt.shellers); sysopt.shellers = dupstr(bufp); + } else if (src == SET_IN_SYS && match_varname(buf, "EXPLORERS", 7)) { + if (sysopt.explorers) free(sysopt.explorers); + sysopt.explorers = dupstr(bufp); } else if (src == SET_IN_SYS && match_varname(buf, "DEBUGFILES", 5)) { if (sysopt.debugfiles) free(sysopt.debugfiles); /* if showdebug() has already been called (perhaps we've added diff --git a/src/sys.c b/src/sys.c index 35e46b7c8..6ca0017f7 100644 --- a/src/sys.c +++ b/src/sys.c @@ -33,6 +33,7 @@ sys_early_init() #endif sysopt.env_dbgfl = 0; /* haven't checked getenv("DEBUGFILES") yet */ sysopt.shellers = NULL; + sysopt.explorers = NULL; sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */ /* record file */ diff --git a/sys/unix/sysconf b/sys/unix/sysconf index cff28b04f..50fa74085 100644 --- a/sys/unix/sysconf +++ b/sys/unix/sysconf @@ -14,6 +14,9 @@ WIZARDS=root games # Uses the same syntax as the WIZARDS option above. #SHELLERS= +# Users allowed to use #exploremode. Same syntax as WIZARDS above. +EXPLORERS=* + # Show debugging information originating from these source files. # Use '*' for all, or list source files separated by spaces. # Only available if game has been compiled with DEBUG. diff --git a/sys/winnt/sysconf b/sys/winnt/sysconf index 67c0b814d..808546da8 100644 --- a/sys/winnt/sysconf +++ b/sys/winnt/sysconf @@ -14,6 +14,9 @@ WIZARDS=* # Uses the same syntax as the WIZARDS option above. #SHELLERS= +# Users allowed to use #exploremode. Same syntax as WIZARDS above. +EXPLORERS=* + # Show debugging information originating from these source files. # Use '*' for all, or list source files separated by spaces. # Only available if game has been compiled with DEBUG. From 322d004e12e894508de025d416cf615e9c07426f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 18:32:23 +0300 Subject: [PATCH 68/73] Some spam for mail daemon to deliver --- src/mail.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mail.c b/src/mail.c index cc01b97d3..c4cf8f61c 100644 --- a/src/mail.c +++ b/src/mail.c @@ -437,6 +437,11 @@ struct obj *otmp; "Only Amiga makes it possible.", "CATS have all the answers.", #endif + "This mail complies with the Yendorian Anti-Spam Act (YASA)", + "Please find enclosed a small token to represent your Owlbear", + "**FR33 P0T10N 0F FULL H34L1NG**", + "Please return to sender (Asmodeus)", + "Buy a potion of gain level for only $19.99! Guaranteed to be blessed!", "Invitation: Visit the NetHack web site at http://www.nethack.org!" }; From fdd49dde86f935dbade9dffa633655357850cc48 Mon Sep 17 00:00:00 2001 From: keni Date: Tue, 31 Mar 2015 12:29:58 -0400 Subject: [PATCH 69/73] Update docs for NHDT V2. --- DEVEL/Developer.txt | 8 ++++---- DEVEL/git_recipes.txt | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/DEVEL/Developer.txt b/DEVEL/Developer.txt index 5e9e76356..49cebe12f 100644 --- a/DEVEL/Developer.txt +++ b/DEVEL/Developer.txt @@ -136,9 +136,9 @@ B. Enabling variable expansion Variable expansion is controlled by the .gitattributes file. To enable variable expansion: - pattern filter=NHtext merge=NHsubst + pattern NHSUBST To disable variable expansion: - pattern -filter + pattern -NHSUBST More information: "git help gitattributes" @@ -147,8 +147,8 @@ C. Oddities instead of "git add" or "git commit." Nothing terrible will happen if you use the wrong one, but the values will not be updated. - Due to the way this abuses git filters, the updated values are not visible - in your working tree. + Variable expansion modifies the files in the work tree - your editor or + IDE may or may not be happy with this. D. Using your own hooks You can use your own hooks - put them in .git/hooks as usual BUT name them diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt index 5e8d872f9..1a2ec0acf 100644 --- a/DEVEL/git_recipes.txt +++ b/DEVEL/git_recipes.txt @@ -42,9 +42,12 @@ you specify: Adds the changes you've made in (filename) to the pre-commit staging area. (also referred to as the 'index') + OR +Make a new file be tracked by git. "nhadd" is the preferred syntax and will automatically update the source file -headers with the latest date, branch, and version. +headers with the latest date, branch, and version. See Developer.txt for +details. [*] git commit [-a] [-m "text"] @@ -57,7 +60,8 @@ Including -m will use "text" as the commit message instead of opening an editor window for you to create one. "nhcommit" is the preferred syntax and will automatically update the source file -headers with the latest date, branch, and version. +headers with the latest date, branch, and version. See Developer.txt for +details. [*] git push [--all] [-u origin (branch)] From 055cc1b4d57151686dfb9f55999f652f9a077509 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 21:40:49 +0300 Subject: [PATCH 70/73] Show legal jumping positions --- doc/fixes35.0 | 1 + src/apply.c | 68 +++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 2d3b8c7ad..46b87d58f 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -893,6 +893,7 @@ boomerang makes noise when hitting a sink non-pet rust monsters would eat rust-proofed non-digestibles but ignore those non-digestibles otherwise kicking a grave may topple the gravestone +allow showing legal jumping positions when asked for location to jump to Platform- and/or Interface-Specific Fixes diff --git a/src/apply.c b/src/apply.c index 386365f49..65482c337 100644 --- a/src/apply.c +++ b/src/apply.c @@ -20,6 +20,7 @@ STATIC_DCL void FDECL(use_candelabrum, (struct obj *)); STATIC_DCL void FDECL(use_candle, (struct obj **)); STATIC_DCL void FDECL(use_lamp, (struct obj *)); STATIC_DCL void FDECL(light_cocktail, (struct obj *)); +STATIC_PTR void FDECL(display_jump_positions, (int)); STATIC_DCL void FDECL(use_tinning_kit, (struct obj *)); STATIC_DCL void FDECL(use_figurine, (struct obj **)); STATIC_DCL void FDECL(use_grease, (struct obj *)); @@ -1361,6 +1362,53 @@ dojump() return jump(0); } +boolean +is_valid_jump_pos(x,y, magic, showmsg) +int x,y, magic; +boolean showmsg; +{ + if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && + distu(x, y) != 5) { + /* The Knight jumping restriction still applies when riding a + * horse. After all, what shape is the knight piece in chess? + */ + if (showmsg) pline("Illegal move!"); + return FALSE; + } else if (distu(x, y) > (magic ? 6+magic*3 : 9)) { + if (showmsg) pline("Too far!"); + return FALSE; + } else if (!cansee(x, y)) { + if (showmsg) You("cannot see where to land!"); + return FALSE; + } else if (!isok(x, y)) { + if (showmsg) You("cannot jump there!"); + return FALSE; + } + return TRUE; +} + +int jumping_is_magic; + +void +display_jump_positions(state) +int state; +{ + if (state == 0) { + tmp_at(DISP_BEAM, cmap_to_glyph(S_flashbeam)); + } else if (state == 1) { + int x,y, dx, dy; + for (dx = -4; dx <= 4; dx++) + for (dy = -4; dy <= 4; dy++) { + x = dx + (int)u.ux; + y = dy + (int)u.uy; + if (isok(x,y) && is_valid_jump_pos(x,y, jumping_is_magic, FALSE)) + tmp_at(x,y); + } + } else { + tmp_at(DISP_END, 0); + } +} + int jump(magic) int magic; /* 0=Physical, otherwise skill level */ @@ -1440,24 +1488,12 @@ int magic; /* 0=Physical, otherwise skill level */ pline("Where do you want to jump?"); cc.x = u.ux; cc.y = u.uy; + jumping_is_magic = magic; + getpos_sethilite(display_jump_positions); if (getpos(&cc, TRUE, "the desired position") < 0) return 0; /* user pressed ESC */ - if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && - distu(cc.x, cc.y) != 5) { - /* The Knight jumping restriction still applies when riding a - * horse. After all, what shape is the knight piece in chess? - */ - pline("Illegal move!"); - return 0; - } else if (distu(cc.x, cc.y) > (magic ? 6+magic*3 : 9)) { - pline("Too far!"); - return 0; - } else if (!cansee(cc.x, cc.y)) { - You("cannot see where to land!"); - return 0; - } else if (!isok(cc.x, cc.y)) { - You("cannot jump there!"); - return 0; + if (!is_valid_jump_pos(cc.x, cc.y, magic, TRUE)) { + return 0; } else { coord uc; int range, temp; From 8fb23b4a4113cf275cb560afdbafc1e07b0d04b0 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 31 Mar 2015 19:07:25 -0400 Subject: [PATCH 71/73] non-Unix build was broken today Changes to be committed: modified: src/cmd.c ../src/cmd.c(515) : warning C4013: 'check_user_string' undefined; assuming extern returning int) link error - cmd.o : error LNK2019: unresolved external symbol _check_user_string referenced in function _enter_explore_mode --- src/cmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd.c b/src/cmd.c index b028c57a3..3798a4fb0 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -510,12 +510,14 @@ enter_explore_mode(VOID_ARGS) You("are already in explore mode."); } else { #ifdef SYSCF +# if defined(UNIX) if (!sysopt.explorers || !sysopt.explorers[0] || !check_user_string(sysopt.explorers)) { You("cannot access explore mode."); return 0; } +# endif #endif pline( "Beware! From explore mode there will be no return to normal game."); From 3f885ef58356453f322f77e5e762cf7b39c67061 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Apr 2015 08:29:12 +0300 Subject: [PATCH 72/73] Remove EXPLORERS from winnt sysconf Stupidly added this to the winnt sysconf, when it should've been *nix only. --- sys/winnt/sysconf | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/winnt/sysconf b/sys/winnt/sysconf index 808546da8..67c0b814d 100644 --- a/sys/winnt/sysconf +++ b/sys/winnt/sysconf @@ -14,9 +14,6 @@ WIZARDS=* # Uses the same syntax as the WIZARDS option above. #SHELLERS= -# Users allowed to use #exploremode. Same syntax as WIZARDS above. -EXPLORERS=* - # Show debugging information originating from these source files. # Use '*' for all, or list source files separated by spaces. # Only available if game has been compiled with DEBUG. From d3205d98d648a890135b8e07119c9302f35a8ca7 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 1 Apr 2015 02:47:04 -0700 Subject: [PATCH 73/73] X11 menu hack for ':' Same functionality as was recently implemented for tty. If a character like ':' is an explicit menu selector and the player types it, select that menu entry rather than treating it as a search request. (Same for other menu commands like '>', but offhand I can't think of anything besides container looting's ': - look inside' that uses any non-letter selectors other than '$', which isn't used as a menu meta command.) --- win/X11/winmenu.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/win/X11/winmenu.c b/win/X11/winmenu.c index b28dc3361..6ab51fae9 100644 --- a/win/X11/winmenu.c +++ b/win/X11/winmenu.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 winmenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winmenu.c $NHDT-Date: 1427881480 2015/04/01 09:44:40 $ $NHDT-Branch: master $:$NHDT-Revision: 1.5 $ */ /* NetHack 3.5 winmenu.c $Date: 2009/05/06 10:55:53 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)winmenu.c 3.5 1996/08/15 */ /* Copyright (c) Dean Luick, 1992 */ @@ -206,6 +206,7 @@ menu_key(w, event, params, num_params) struct xwindow *wp; char ch; int count; + boolean selected_something; wp = find_widget(w); menu_info = wp->menu_information; @@ -218,6 +219,13 @@ menu_key(w, event, params, num_params) } if (menu_info->is_active) { /* waiting for input */ + /* first check for an explicit selector match, so that it won't be + overridden if it happens to duplicate a mapped menu command (':' + to look inside a container vs ':' to select via search string) */ + for (curr = menu_info->curr_menu.base; curr; curr = curr->next) + if (curr->identifier.a_void != 0 && curr->selector == ch) + goto make_selection; + ch = map_menu_cmd(ch); if (ch == '\033') { /* quit */ if (menu_info->counting) { @@ -294,7 +302,8 @@ menu_key(w, event, params, num_params) X11_nhbell(); return; } else { - boolean selected_something = FALSE; + make_selection: + selected_something = FALSE; for (count = 0, curr = menu_info->curr_menu.base; curr; curr = curr->next, count++) if (curr->identifier.a_void != 0 && curr->selector == ch) break;