Merge branch 'NetHack-3.6.0'

This commit is contained in:
nhmall
2015-12-18 21:58:59 -05:00
25 changed files with 185 additions and 108 deletions

View File

@@ -4425,7 +4425,7 @@ scalpel
This mace was created aeons ago in some unknown cave,
and has been passed down from generation to generation of
cave dwellers. It is a very mighty mace indeed, and in
addition will protect anyone who carries it from magic
addition will protect anyone who wields it from magic
missile attacks. When invoked, it causes conflict in the
area around it.
scimitar

View File

@@ -108,7 +108,7 @@ Algernon
All else failed...
All hail RNG
All right, we'll call it a draw!
All's well that end well
All's well that ends well
Alone at last!
Always attack a floating eye from behind!
Am I having fun yet?

View File

@@ -163,38 +163,6 @@ align Your starting alignment (align:lawful, align:neutral,
or align:chaotic). You may specify just the first letter. [RANDOM]
catname the name of your first cat [NONE]
dogname the name of your first dog [NONE]
dungeon a list of symbols to be used in place of the default ones for
drawing the dungeon.
The symbols are subjected to a fair amount of processing, so
that you can use C-style escapes such as \n or \081 as well as
indicate control characters by ^x or meta characters by \Mx.
As usual, \ can force the next character to be taken literally.
Since many of the default symbols are overloaded, they are
given here by name instead of symbol, with some added notes:
stone (solid rock, normally ' ')
vwall hwall tlcorn trcorn blcorn brcorn (room boundaries)
crwall tuwall tdwall tlwall trwall (wallified maze characters)
nodoor vodoor hodoor (no, vertical, horizontal open door)
vcdoor hcdoor (vertical, horizontal closed door)
ironbars tree room darkcorr litcorr
upstair dnstair upladder dnladder
altar grave throne sink fountain pool ice lava
vodbridge hodbridge (vertical, horizontal open drawbridge)
vcdbridge hcdbridge (vertical, horizontal closed drawbridge)
air cloud water
default: \ |--------||.-|++##.##<><>_\\#{}.}..##\ #}
effects like dungeon, but for special effects symbols
vbeam hbeam lslant rslant (generic zap beams)
digbeam flashbeam (special beams for digging and cameras)
boomleft boomright (boomerangs)
ss1 ss2 ss3 ss4 (shielding sequence)
sw_topl, sw_topm, sw_topr, (swallow, top row)
sw_midl, sw_midr, (swallow, middle row [no center])
sw_botl, sw_botm, sw_botr (swallow, bottom row)
extl extm extr (explosion matrix top row)
exml exmm exmr (explosion matrix middle row)
exbl exbm exbr (explosion matrix bottom row)
default: |-\\/*!)(0#@*/-\\||\\-//-\\|\ |\\-/
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"
@@ -215,14 +183,9 @@ menu_* create single character accelerators for menu commands. Below
menu_search search for a menu item [:](gxta)
menu_select_all select all items in a menu [.](gxta)
menu_select_page select all items on this menu page [,](gta)
monsters like dungeon, but for monster symbols
default: abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ@\ \\&;:~]
msghistory number of top line messages to save [20]
name the name of your character [obtained by asking the system or
the player]
objects like dungeon, but for object symbols
default: ])[="(%!?+/$*`0_.
pettype your preferred type of pet (cat or dog), if your character
class uses both types; or none for no pet [RANDOM]
playmode normal play or non-scoring explore mode or debug mode [normal]
@@ -234,13 +197,6 @@ role Your starting role (e.g., role:Barbarian, role:Valk).
as possible. You can also still denote your role by
appending it to the "name" option (e.g., name:Vic-V), but the
"role" option will take precedence. [RANDOM]
traps like dungeon, but for trap symbols
arrow_trap dart_trap falling_rock_trap squeaky_board
bear_trap land_mine rolling_boulder_trap sleeping_gas_trap
rust_trap fire_trap pit spiked_pit hole trap_door
teleportation_trap level_teleporter magic_portal web statue_trap
magic_trap anti_magic_trap polymorph_trap
default: ^^^^^^^^^^^^^^^^^"^^^^
windowtype windowing system to be used [depends on operating system]
@@ -254,5 +210,4 @@ msg_window the type of message window to use:
Some sample options lists are:
!autopickup,!tombstone,name:Gandalf,scores:own/3 top/2 around
female,nonews,dogname:Rover,dungeon: |--------||.-|++.##<><>_\\#{}.}..## #}
rest_on_space,!verbose,menustyle:traditional
female,nonews,dogname:Rover,rest_on_space,!verbose,menustyle:traditional

View File

@@ -36,12 +36,23 @@ make a previously-discovered scroll written with marker while blind have its
label known so it can be read while blind
#name or C for discoveries list that spanned multiple pages would exit on
space instead of advancing to next page (workaround: use '>' instead)
don't show the old level when you die going down the stairs because of an
iron ball
new high score with ", while helpless" attribute appended would erroneously
result in ", while helpless" being appended to all scores
allow bright aliases for colors in menucolors
make MAXPLAYERS option in sysconf accept 0 value
avoid hearing yelps when you are deaf
make corpse visible if stethoscope told you about it being there
sceptre of might database entry word change
Platform- and/or Interface-Specific Fixes
-----------------------------------------
tty: M-N gave "Unknown command 'M-" with "'." finishing the sentence on the
line below it, leaving bogus '.' displayed on the top row of the map
tty: specifying all four of role, race, gender, and alignment still prompted
for confirmation with "Is this ok?" before starting play
unix/X11: in top level Makefile, some commented out definitions of VARDATND
misspelled pilemark.xbm (as pilemark.xpm)
win32gui: getversionstring() was overflowing the provided Help About buffer
@@ -56,6 +67,7 @@ General New Features
--------------------
naming Sting or Orcrist now breaks illiterate conduct
different feedback for reading a scroll of mail created by writing with marker
wizard mode #wizintrinsic
Platform- and/or Interface-Specific New Features

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1449051498 2015/12/02 10:18:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.520 $ */
/* NetHack 3.6 extern.h $NHDT-Date: 1450432755 2015/12/18 09:59:15 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.521 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2293,7 +2293,7 @@ E void NDECL(timer_sanity_check);
/* ### topten.c ### */
E void FDECL(formatkiller, (char *, unsigned, int));
E void FDECL(formatkiller, (char *, unsigned, int, BOOLEAN_P));
E void FDECL(topten, (int, time_t));
E void FDECL(prscore, (int, char **));
E struct obj *FDECL(tt_oname, (struct obj *));

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 apply.c $NHDT-Date: 1446808436 2015/11/06 11:13:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.210 $ */
/* NetHack 3.6 apply.c $NHDT-Date: 1450481050 2015/12/18 23:24:10 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.214 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -237,6 +237,13 @@ int rx, ry, *resp;
} else if (corpse) {
boolean here = (rx == u.ux && ry == u.uy),
one = (corpse->quan == 1L && !more_corpses), reviver = FALSE;
int visglyph, corpseglyph;
visglyph = glyph_at(rx, ry);
corpseglyph = obj_to_glyph(corpse);
if (Blind && (visglyph != corpseglyph))
map_object(corpse, TRUE);
if (Role_if(PM_HEALER)) {
/* ok to reset `corpse' here; we're done with it */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 ball.c $NHDT-Date: 1446808438 2015/11/06 11:13:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.28 $ */
/* NetHack 3.6 ball.c $NHDT-Date: 1450402033 2015/12/18 01:27:13 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.29 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -809,6 +809,9 @@ drag_down()
if (carried(uball))
You("lose your grip on the iron ball.");
cls(); /* previous level is still displayed although you
went down the stairs. Avoids bug C343-20 */
if (forward) {
if (rn2(6)) {
pline_The("iron ball drags you downstairs!");

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 bones.c $NHDT-Date: 1450261363 2015/12/16 10:22:43 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.67 $ */
/* NetHack 3.6 bones.c $NHDT-Date: 1450432756 2015/12/18 09:59:16 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.68 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985,1993. */
/* NetHack may be freely redistributed. See license for details. */
@@ -479,7 +479,7 @@ make_bones:
Sprintf(newbones->who, "%s-%.3s-%.3s-%.3s-%.3s", plname, urole.filecode,
urace.filecode, genders[flags.female].filecode,
aligns[1 - u.ualign.type].filecode);
formatkiller(newbones->how, sizeof newbones->how, how);
formatkiller(newbones->how, sizeof newbones->how, how, TRUE);
Strcpy(newbones->when, yyyymmddhhmmss(when));
/* final resting place, used to decide when bones are discovered */
newbones->frpx = u.ux, newbones->frpy = u.uy;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1450178549 2015/12/15 11:22:29 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.209 $ */
/* NetHack 3.6 cmd.c $NHDT-Date: 1450473780 2015/12/18 21:23:00 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.211 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -122,6 +122,7 @@ STATIC_PTR int NDECL(dotravel);
STATIC_PTR int NDECL(doterrain);
STATIC_PTR int NDECL(wiz_wish);
STATIC_PTR int NDECL(wiz_identify);
STATIC_PTR int NDECL(wiz_intrinsic);
STATIC_PTR int NDECL(wiz_map);
STATIC_PTR int NDECL(wiz_genesis);
STATIC_PTR int NDECL(wiz_where);
@@ -1102,6 +1103,50 @@ wiz_smell(VOID_ARGS)
return 0;
}
/* #wizinstrinsic command to set some intrinsics for testing */
STATIC_PTR int
wiz_intrinsic(VOID_ARGS)
{
if (wizard) {
winid win;
anything any;
int i, n, accelerator;
menu_item *pick_list = (menu_item *) 0;
static const char *const intrinsics[] = {
"deafness",
};
win = create_nhwindow(NHW_MENU);
start_menu(win);
accelerator = 0;
for (i = 0; i < SIZE(intrinsics); ++i) {
accelerator = intrinsics[i][0];
any.a_int = i + 1;
add_menu(win, NO_GLYPH, &any, accelerator, 0, ATR_NONE, intrinsics[i], FALSE);
}
end_menu(win, "Which intrinsic?");
n = select_menu(win, PICK_ONE, &pick_list);
destroy_nhwindow(win);
if (n >= 1) {
i = pick_list[0].item.a_int-1;
free((genericptr_t) pick_list);
} else {
return 0;
}
if (!strcmp(intrinsics[i],"deafness")) {
You("go deaf.");
incr_itimeout(&HDeaf, 30);
}
} else
pline("Unavailable command '%s'.",
visctrl((int) cmd_from_func(wiz_intrinsic)));
return 0;
}
/* #wizrumorcheck command - verify each rumor access */
STATIC_PTR int
wiz_rumor_check(VOID_ARGS)
@@ -2771,6 +2816,7 @@ struct ext_func_tab extcmdlist[] = {
{ (char *) 0, (char *) 0, donull, TRUE }, /* vanquished */
{ (char *) 0, (char *) 0, donull, TRUE }, /* vision */
{ (char *) 0, (char *) 0, donull, TRUE }, /* wizsmell */
{ (char *) 0, (char *) 0, donull, TRUE }, /* wizintrinsic */
#ifdef DEBUG
{ (char *) 0, (char *) 0, donull, TRUE }, /* wizdebug_traveldisplay */
{ (char *) 0, (char *) 0, donull, TRUE }, /* wizdebug_bury */
@@ -2800,6 +2846,7 @@ static const struct ext_func_tab debug_extcmdlist[] = {
{ "vanquished", "list vanquished monsters", dovanquished, TRUE },
{ "vision", "show vision array", wiz_show_vision, TRUE },
{ "wizsmell", "smell monster", wiz_smell, TRUE },
{ "wizintrinsic", "set intrinsic", wiz_intrinsic, TRUE },
#ifdef DEBUG
{ "wizdebug_traveldisplay", "wizard debug: toggle travel display",
wiz_debug_cmd_traveldisplay, TRUE },

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 dungeon.c $NHDT-Date: 1448862377 2015/11/30 05:46:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.69 $ */
/* NetHack 3.6 dungeon.c $NHDT-Date: 1450432757 2015/12/18 09:59:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.70 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2895,7 +2895,7 @@ boolean printdun;
if (died_here) {
/* disclosure occurs before bones creation, so listing dead
hero here doesn't give away whether bones are produced */
formatkiller(tmpbuf, sizeof tmpbuf, how);
formatkiller(tmpbuf, sizeof tmpbuf, how, TRUE);
/* rephrase a few death reasons to work with "you" */
(void) strsubst(tmpbuf, " himself", " yourself");
(void) strsubst(tmpbuf, " herself", " yourself");

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 end.c $NHDT-Date: 1450231174 2015/12/16 01:59:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.110 $ */
/* NetHack 3.6 end.c $NHDT-Date: 1450432758 2015/12/18 09:59:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.111 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1039,7 +1039,7 @@ int how;
}
corpse = mk_named_object(CORPSE, &mons[mnum], u.ux, u.uy, plname);
Sprintf(pbuf, "%s, ", plname);
formatkiller(eos(pbuf), sizeof pbuf - strlen(pbuf), how);
formatkiller(eos(pbuf), sizeof pbuf - strlen(pbuf), how, TRUE);
make_grave(u.ux, u.uy, pbuf);
}
pbuf[0] = '\0'; /* clear grave text; also lint suppression */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 makemon.c $NHDT-Date: 1449269917 2015/12/04 22:58:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.105 $ */
/* NetHack 3.6 makemon.c $NHDT-Date: 1450451931 2015/12/18 15:18:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.106 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -599,6 +599,8 @@ register struct monst *mtmp;
else if (mac < 10 && rn2(2))
mac += 1 + mongets(mtmp, LEATHER_CLOAK);
nhUse(mac); /* suppress 'dead increment' from static analyzer */
if (ptr != &mons[PM_GUARD] && ptr != &mons[PM_WATCHMAN]
&& ptr != &mons[PM_WATCH_CAPTAIN]) {
if (!rn2(3))

View File

@@ -1221,14 +1221,20 @@ static const struct {
{ "magenta", CLR_MAGENTA },
{ "cyan", CLR_CYAN },
{ "gray", CLR_GRAY },
{ "grey", CLR_GRAY },
{ "orange", CLR_ORANGE },
{ "light green", CLR_BRIGHT_GREEN },
{ "yellow", CLR_YELLOW },
{ "light blue", CLR_BRIGHT_BLUE },
{ "light magenta", CLR_BRIGHT_MAGENTA },
{ "light cyan", CLR_BRIGHT_CYAN },
{ "white", CLR_WHITE }
{ "white", CLR_WHITE },
{ NULL, CLR_BLACK }, /* everything after this is an alias */
{ "grey", CLR_GRAY },
{ "bright red", CLR_ORANGE },
{ "bright green", CLR_BRIGHT_GREEN },
{ "bright blue", CLR_BRIGHT_BLUE },
{ "bright magenta", CLR_BRIGHT_MAGENTA },
{ "bright cyan", CLR_BRIGHT_CYAN }
};
static const struct {
@@ -1250,7 +1256,7 @@ int clr;
int i;
for (i = 0; i < SIZE(colornames); i++)
if (colornames[i].color == clr)
if (colornames[i].name && colornames[i].color == clr)
return colornames[i].name;
return (char *) 0;
}
@@ -1279,8 +1285,8 @@ query_color()
start_menu(tmpwin);
any = zeroany;
for (i = 0; i < SIZE(colornames); i++) {
if (!strcmp(colornames[i].name, "grey"))
continue;
if (!colornames[i].name)
break;
any.a_int = i + 1;
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, colornames[i].name,
MENU_UNSELECTED);
@@ -1547,7 +1553,8 @@ char *str;
(also junk like "_l i-gh_t---b l u e" but we won't worry about that);
also copes with trailing space; mungspaces removed any leading space */
for (i = 0; i < SIZE(colornames); i++)
if (fuzzymatch(tmps, colornames[i].name, " -_", TRUE)) {
if (colornames[i].name
&& fuzzymatch(tmps, colornames[i].name, " -_", TRUE)) {
c = colornames[i].color;
break;
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 read.c $NHDT-Date: 1450261365 2015/12/16 10:22:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.128 $ */
/* NetHack 3.6 read.c $NHDT-Date: 1450490118 2015/12/19 01:55:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.130 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 rip.c $NHDT-Date: 1436753522 2015/07/13 02:12:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ */
/* NetHack 3.6 rip.c $NHDT-Date: 1450432760 2015/12/18 09:59:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -112,7 +112,7 @@ time_t when;
center(GOLD_LINE, buf);
/* Put together death description */
formatkiller(buf, sizeof buf, how);
formatkiller(buf, sizeof buf, how, FALSE);
/* Put death type on stone */
for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 sounds.c $NHDT-Date: 1450306219 2015/12/16 22:50:19 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.75 $ */
/* NetHack 3.6 sounds.c $NHDT-Date: 1450461632 2015/12/18 18:00:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.77 $ */
/* Copyright (c) 1989 Janet Walz, Mike Threepoint */
/* NetHack may be freely redistributed. See license for details. */
@@ -387,23 +387,23 @@ register struct monst *mtmp;
else
switch (mtmp->data->msound) {
case MS_MEW:
yelp_verb = "yowl";
yelp_verb = (!Deaf) ? "yowl" : "arch";
break;
case MS_BARK:
case MS_GROWL:
yelp_verb = "yelp";
yelp_verb = (!Deaf) ? "yelp" : "recoil";
break;
case MS_ROAR:
yelp_verb = "snarl";
yelp_verb = (!Deaf) ? "snarl" : "bluff";
break;
case MS_SQEEK:
yelp_verb = "squeal";
yelp_verb = (!Deaf) ? "squeal" : "quiver";
break;
case MS_SQAWK:
yelp_verb = "screak";
yelp_verb = (!Deaf) ? "screak" : "thrash";
break;
case MS_WAIL:
yelp_verb = "wail";
yelp_verb = (!Deaf) ? "wail" : "cringe";
break;
}
if (yelp_verb) {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 topten.c $NHDT-Date: 1450231176 2015/12/16 01:59:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.41 $ */
/* NetHack 3.6 topten.c $NHDT-Date: 1450451497 2015/12/18 15:11:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.44 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -64,10 +64,12 @@ STATIC_DCL void FDECL(outentry, (int, struct toptenentry *, BOOLEAN_P));
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 *));
#ifdef XLOGFILE
STATIC_DCL void FDECL(writexlentry, (FILE *, struct toptenentry *, int));
STATIC_DCL long NDECL(encodexlogflags);
STATIC_DCL long NDECL(encodeconduct);
STATIC_DCL long NDECL(encodeachieve);
#endif
STATIC_DCL void FDECL(free_ttlist, (struct toptenentry *));
STATIC_DCL int FDECL(classmon, (char *, BOOLEAN_P));
STATIC_DCL int FDECL(score_wanted, (BOOLEAN_P, int, struct toptenentry *, int,
@@ -81,10 +83,11 @@ static winid toptenwin = WIN_ERR;
/* "killed by",&c ["an"] 'killer.name' */
void
formatkiller(buf, siz, how)
formatkiller(buf, siz, how, incl_helpless)
char *buf;
unsigned siz;
int how;
boolean incl_helpless;
{
static NEARDATA const char *const killed_by_prefix[] = {
/* DIED, CHOKING, POISONING, STARVING, */
@@ -118,6 +121,18 @@ int how;
/* we're writing into buf[0] (after possibly advancing buf) rather than
appending, but strncat() appends a terminator and strncpy() doesn't */
(void) strncat(buf, kname, siz - 1);
if (incl_helpless && multi) {
siz -= strlen(buf);
buf = eos(buf);
/* X <= siz: 'sizeof "string"' includes 1 for '\0' terminator */
if (multi_reason && strlen(multi_reason) + sizeof ", while " <= siz)
Sprintf(buf, ", while %s", multi_reason);
/* either multi_reason wasn't specified or wouldn't fit */
else if (sizeof ", while helpless" <= siz)
Strcpy(buf, ", while helpless");
/* else extra death info won't fit, so leave it out */
}
}
STATIC_OVL void
@@ -269,10 +284,10 @@ struct toptenentry *tt;
static const char fmt33[] = "%s %s %s %s "; /* role,race,gndr,algn */
#ifndef NO_SCAN_BRACK
static const char fmt0[] = "%d.%d.%d %ld %d %d %d %d %d %d %ld %ld %d ";
static const char fmtX[] = "%s,%s%s%s\n";
static const char fmtX[] = "%s,%s\n";
#else /* NO_SCAN_BRACK */
static const char fmt0[] = "%d %d %d %ld %d %d %d %d %d %d %ld %ld %d ";
static const char fmtX[] = "%s %s%s%s\n";
static const char fmtX[] = "%s %s\n";
nsb_mung_line(tt->name);
nsb_mung_line(tt->death);
@@ -288,9 +303,7 @@ struct toptenentry *tt;
(void) fprintf(rfile, fmt33, tt->plrole, tt->plrace, tt->plgend,
tt->plalign);
(void) fprintf(rfile, fmtX, onlyspace(tt->name) ? "_" : tt->name,
tt->death,
(multi ? ", while " : ""),
(multi ? (multi_reason ? multi_reason : "helpless") : ""));
tt->death);
#ifdef NO_SCAN_BRACK
nsb_unmung_line(tt->name);
@@ -298,15 +311,18 @@ struct toptenentry *tt;
#endif
}
#ifdef XLOGFILE
/* as tab is never used in eg. plname or death, no need to mangle those. */
STATIC_OVL void
writexlentry(rfile, tt)
writexlentry(rfile, tt, how)
FILE *rfile;
struct toptenentry *tt;
int how;
{
#define Fprintf (void) fprintf
#define XLOG_SEP '\t' /* xlogfile field separator. */
char buf[BUFSZ];
char buf[BUFSZ], tmpbuf[DTHSZ + 1];
Sprintf(buf, "version=%d.%d.%d", tt->ver_major, tt->ver_minor,
tt->patchlevel);
@@ -321,9 +337,11 @@ struct toptenentry *tt;
Sprintf(buf, "%crole=%s%crace=%s%cgender=%s%calign=%s", XLOG_SEP,
tt->plrole, XLOG_SEP, tt->plrace, XLOG_SEP, tt->plgend, XLOG_SEP,
tt->plalign);
/* make a copy of death reason that doesn't include ", while helpless" */
formatkiller(tmpbuf, sizeof tmpbuf, how, FALSE);
Fprintf(rfile, "%s%cname=%s%cdeath=%s",
buf, /* (already includes separator) */
XLOG_SEP, plname, XLOG_SEP, tt->death);
XLOG_SEP, plname, XLOG_SEP, tmpbuf);
if (multi)
Fprintf(rfile, "%cwhile=%s", XLOG_SEP,
multi_reason ? multi_reason : "helpless");
@@ -425,6 +443,8 @@ encodeachieve()
return r;
}
#endif /* XLOGFILE */
STATIC_OVL void
free_ttlist(tt)
struct toptenentry *tt;
@@ -512,7 +532,7 @@ time_t when;
copynchars(t0->plgend, genders[flags.female].filecode, ROLESZ);
copynchars(t0->plalign, aligns[1 - u.ualign.type].filecode, ROLESZ);
copynchars(t0->name, plname, NAMSZ);
formatkiller(t0->death, sizeof t0->death, how);
formatkiller(t0->death, sizeof t0->death, how, TRUE);
t0->birthdate = yyyymmdd(ubirthday);
t0->deathdate = yyyymmdd(when);
t0->tt_next = 0;
@@ -536,7 +556,7 @@ time_t when;
if (!(xlfile = fopen_datafile(XLOGFILE, "a", SCOREPREFIX))) {
HUP raw_print("Cannot open extended log file!");
} else {
writexlentry(xlfile, t0);
writexlentry(xlfile, t0, how);
(void) fclose(xlfile);
}
unlock_file(XLOGFILE);
@@ -547,6 +567,7 @@ time_t when;
if (how != PANICKED)
HUP {
char pbuf[BUFSZ];
topten_print("");
Sprintf(pbuf,
"Since you were in %s mode, the score list will not be checked.",

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 trap.c $NHDT-Date: 1449977947 2015/12/13 03:39:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.250 $ */
/* NetHack 3.6 trap.c $NHDT-Date: 1450461008 2015/12/18 17:50:08 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.251 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3048,6 +3048,7 @@ domagictrap()
/* Most of the time, it creates some monsters. */
register int cnt = rnd(4);
/* blindness effects */
if (!resists_blnd(&youmonst)) {
You("are momentarily blinded by a flash of light!");
make_blinded((long) rn1(5, 10), FALSE);
@@ -3055,9 +3056,17 @@ domagictrap()
Your1(vision_clears);
} else if (!Blind) {
You_see("a flash of light!");
} else
}
/* deafness effects */
if (!Deaf) {
You_hear("a deafening roar!");
incr_itimeout(&HDeaf, rn1(20, 30));
incr_itimeout(&HDeaf, rn1(20, 30));
} else {
/* magic vibrations still hit you */
You_feel("rankled.");
incr_itimeout(&HDeaf, rn1(5, 15));
}
while (cnt--)
(void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS);
} else

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 amirip.c $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */
/* NetHack 3.6 amirip.c $NHDT-Date: 1450453302 2015/12/18 15:41:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ */
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1991,1992,1993,1995,1996.
*/
/* NetHack may be freely redistributed. See license for details. */
@@ -161,7 +161,7 @@ time_t when;
0xc0, 0xff, NULL);
/* Put together death description */
formatkiller(buf, sizeof buf, how);
formatkiller(buf, sizeof buf, how, FALSE);
tw = TextLength(rp, buf, STONE_LINE_LEN) + 40;
@@ -196,7 +196,7 @@ time_t when;
tomb_text(buf);
/* Put together death description */
formatkiller(buf, sizeof buf, how);
formatkiller(buf, sizeof buf, how, FALSE);
/* Put death type on stone */
for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) {

View File

@@ -282,7 +282,9 @@ build_package_root:
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR)/save >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/license >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/nhdat >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/symbols >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/perm >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/record >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/logfile >> PKGSCRIPTS/postinstall

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 wintext.c $NHDT-Date: 1432512807 2015/05/25 00:13:27 $ $NHDT-Branch: master $:$NHDT-Revision: 1.14 $ */
/* NetHack 3.6 wintext.c $NHDT-Date: 1450453309 2015/12/18 15:41:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.15 $ */
/* Copyright (c) Dean Luick, 1992 */
/* NetHack may be freely redistributed. See license for details. */
@@ -498,7 +498,7 @@ calculate_rip_text(int how, time_t when)
/* Put $ on stone */
Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money);
/* Put together death description */
formatkiller(buf, sizeof buf, how);
formatkiller(buf, sizeof buf, how, FALSE);
/* Put death type on stone */
for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 wingem.c $NHDT-Date: 1433806613 2015/06/08 23:36:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ */
/* NetHack 3.6 wingem.c $NHDT-Date: 1450453304 2015/12/18 15:41:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.26 $ */
/* Copyright (c) Christian Bressler, 1999 */
/* NetHack may be freely redistributed. See license for details. */
@@ -1083,7 +1083,7 @@ time_t when;
/* Put $ on stone */
Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money);
/* Put together death description */
formatkiller(buf, sizeof buf, how);
formatkiller(buf, sizeof buf, how, FALSE);
/* Put death type on stone */
for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 gnbind.c $NHDT-Date: 1433806614 2015/06/08 23:36:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.32 $ */
/* NetHack 3.6 gnbind.c $NHDT-Date: 1450453305 2015/12/18 15:41:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.33 $ */
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
/* NetHack may be freely redistributed. See license for details. */
@@ -1182,7 +1182,7 @@ gnome_outrip(winid wid, int how, time_t when)
Strcat(ripString, buf);
/* Put together death description */
formatkiller(buf, sizeof buf, how);
formatkiller(buf, sizeof buf, how, FALSE);
/* Put death type on stone */
Strcat(ripString, buf);

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 wintty.c $NHDT-Date: 1450320157 2015/12/17 02:42:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.117 $ */
/* NetHack 3.6 wintty.c $NHDT-Date: 1450363024 2015/12/17 14:37:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.118 $ */
/* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */
@@ -331,14 +331,25 @@ void
tty_player_selection()
{
int i, k, n, choice, nextpick;
boolean getconfirmation;
boolean getconfirmation, picksomething;
char pick4u = 'n';
char pbuf[QBUFSZ], plbuf[QBUFSZ];
winid win;
anything any;
menu_item *selected = 0;
if (flags.randomall) {
/* Used to avoid "Is this ok?" if player has already specified all
* four facets of role.
* Note that rigid_role_checks might force any unspecified facets to
* have a specific value, but that will still require confirmation;
* player can specify the forced ones if avoiding that is demanded.
*/
picksomething = (ROLE == ROLE_NONE || RACE == ROLE_NONE
|| GEND == ROLE_NONE || ALGN == ROLE_NONE);
/* Used for '-@';
* choose randomly without asking for all unspecified facets.
*/
if (flags.randomall && picksomething) {
if (ROLE == ROLE_NONE)
ROLE = ROLE_RANDOM;
if (RACE == ROLE_NONE)
@@ -349,7 +360,8 @@ tty_player_selection()
ALGN = ROLE_RANDOM;
}
/* prevent an unnecessary prompt */
/* prevent unnecessary prompting if role forces race (samurai) or gender
(valkyrie) or alignment (rogue), or race forces alignment (orc), &c */
rigid_role_checks();
/* Should we randomly pick for the player? */
@@ -742,7 +754,7 @@ makepicks:
* q - quit
* (end)
*/
getconfirmation = (pick4u != 'a' && !flags.randomall);
getconfirmation = (picksomething && pick4u != 'a' && !flags.randomall);
while (getconfirmation) {
tty_clear_nhwindow(BASE_WINDOW);
role_selection_prolog(ROLE_NONE, BASE_WINDOW);

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mswproc.c $NHDT-Date: 1450306253 2015/12/16 22:50:53 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.96 $ */
/* NetHack 3.6 mswproc.c $NHDT-Date: 1450453307 2015/12/18 15:41:47 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.97 $ */
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
@@ -1845,7 +1845,7 @@ mswin_outrip(winid wid, int how, time_t when)
putstr(wid, 0, buf);
/* Put together death description */
formatkiller(buf, sizeof buf, how);
formatkiller(buf, sizeof buf, how, FALSE);
/* Put death type on stone */
putstr(wid, 0, buf);