From fbf787c4fedc8d2fa81a004a012207e6308307af Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 23 Apr 2015 19:27:07 +0300 Subject: [PATCH 01/13] Indicate how far you fall down a hole or trapdoor No extra message when falling down to the next level, otherwise give "You fall down a [very] [deep] shaft!". --- src/trap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/trap.c b/src/trap.c index 3efae477d..dbfa00b5f 100644 --- a/src/trap.c +++ b/src/trap.c @@ -481,8 +481,13 @@ boolean td; /* td == TRUE : trap door or hole */ if (Is_stronghold(&u.uz)) { find_hell(&dtmp); } else { + int dist = newlevel - dunlev(&u.uz); dtmp.dnum = u.uz.dnum; dtmp.dlevel = newlevel; + if (dist > 1) + You("fall down a %s%sshaft!", + dist > 3 ? "very " : "", + dist > 2 ? "deep " : ""); } if (!td) Sprintf(msgbuf, "The hole in the %s above you closes up.", From 23ad7a8635c28e7be4079290522c0c70569d71ed Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 23 Apr 2015 20:30:49 +0300 Subject: [PATCH 02/13] Hallucinated currencies Originally via UnNetHack by Patric Mueller --- src/invent.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/invent.c b/src/invent.c index a7c24fc65..2cc65798d 100644 --- a/src/invent.c +++ b/src/invent.c @@ -710,12 +710,37 @@ register int type; return((struct obj *) 0); } +/** Fictional and not-so-fictional currencies. + * http://concord.wikia.com/wiki/List_of_Fictional_Currencies */ +static const char * const currencies[] = { + "Altarian Dollar", /* The Hitchhiker's Guide to the Galaxy */ + "Ankh-Morpork Dollar", /* Discworld */ + "auric", /* The Domination of Draka */ + "buckazoid", /* Space Quest */ + "cirbozoid", /* Starslip */ + "credit chit", /* Deus Ex */ + "cubit", /* Battlestar Galactica */ + "Flanian Pobble Bead", /* The Hitchhiker's Guide to the Galaxy */ + "fretzer", /* Jules Verne */ + "imperial credit", /* Star Wars */ + "Hong Kong Luna Dollar",/* The Moon is a Harsh Mistress */ + "kongbuck", /* Snow Crash */ + "nanite", /* System Shock 2 */ + "quatloo", /* Sim City */ + "simoleon", /* Sim City */ + "solari", /* Spaceballs */ + "spacebuck", /* Spaceballs */ + "sporebuck", /* Spore */ + "Triganic Pu", /* The Hitchhiker's Guide to the Galaxy */ + "woolong", /* Cowboy Bebop */ +}; + const char * currency(amount) long amount; { - if (amount == 1L) return "zorkmid"; - else return "zorkmids"; + if (amount == 1L) return (Hallucination ? currencies[rn2(SIZE(currencies))] : "zorkmid"); + else return (Hallucination ? makeplural(currencies[rn2(SIZE(currencies))]) : "zorkmids"); } boolean From ea6157c475ba31e275b5c5e53fea2178510bd169 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 23 Apr 2015 21:19:19 +0300 Subject: [PATCH 03/13] Give gnomes occasionally a candle ...and if in unlit area, light the candle. --- doc/fixes35.0 | 1 + src/makemon.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index dea654380..93d528795 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1125,6 +1125,7 @@ tribute to Terry Pratchett Some levels in Gehennom now use the old corridor-style maze instead of the new room-style. Beelzebub's level always does this and the "beetle legs" are restored. +gnomes will occasionally have a candle Platform- and/or Interface-Specific New Features diff --git a/src/makemon.c b/src/makemon.c index cb466220e..1ddefb142 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -619,6 +619,15 @@ register struct monst *mtmp; (void)mongets(mtmp, WAN_FIRE); } break; + case S_GNOME: + if (!rn2((In_mines(&u.uz) ? 5 : 10))) { + otmp = mksobj(rn2(4) ? TALLOW_CANDLE : WAX_CANDLE, TRUE, FALSE); + otmp->quan = 1; + otmp->owt = weight(otmp); + if (!mpickobj(mtmp, otmp) && !levl[mtmp->mx][mtmp->my].lit) + begin_burn(otmp, FALSE); + } + break; default: break; } From aea472c0c0623dc931414421378ec322034e4fe6 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 23 Apr 2015 21:46:02 +0300 Subject: [PATCH 04/13] Give honorifics to vampires and elves --- doc/fixes35.0 | 1 + include/mondata.h | 2 ++ src/polyself.c | 7 +++---- src/shk.c | 33 ++++++++++++++++++++++----------- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 93d528795..8f4a04890 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -902,6 +902,7 @@ camera may contain a picture-painting demon some monsters can eat through iron bars inaccessible niches occasionally have iron bars in front sinks may teleport or polymorph +shopkeepers give honorifics to vampires and elves Platform- and/or Interface-Specific Fixes diff --git a/include/mondata.h b/include/mondata.h index e5c7332ea..1a4d8eb9c 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -172,6 +172,8 @@ #define is_mind_flayer(ptr) ((ptr) == &mons[PM_MIND_FLAYER] || \ (ptr) == &mons[PM_MASTER_MIND_FLAYER]) +#define is_vampire(ptr) ((ptr)->mlet == S_VAMPIRE) + #define nonliving(ptr) (is_golem(ptr) || is_undead(ptr) || \ (ptr)->mlet == S_VORTEX || \ (ptr) == &mons[PM_MANES]) diff --git a/src/polyself.c b/src/polyself.c index df78a3bc4..3f03a058a 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -350,7 +350,7 @@ int psflags; monsterpoly = (psflags == 2), draconian = (uarm && Is_dragon_armor(uarm)), iswere = (u.ulycn >= LOW_PM), - isvamp = (youmonst.data->mlet == S_VAMPIRE), + isvamp = is_vampire(youmonst.data), controllable_poly = Polymorph_control && !(Stunned || Unaware); if (Unchanging) { @@ -730,7 +730,7 @@ int mntmp; pline(use_thec,monsterc,"emit a mental blast"); if (youmonst.data->msound == MS_SHRIEK) /* worthless, actually */ pline(use_thec,monsterc,"shriek"); - if (youmonst.data->mlet == S_VAMPIRE) + if (is_vampire(youmonst.data)) pline(use_thec,monsterc,"change shape"); if (lays_eggs(youmonst.data) && flags.female) @@ -1386,9 +1386,8 @@ dohide() int dopoly() { - boolean isvampire = youmonst.data->mlet == S_VAMPIRE; struct permonst *savedat = youmonst.data; - if (isvampire) { + if (is_vampire(youmonst.data)) { polyself(2); if (savedat != youmonst.data) { You("transform into %s.", an(youmonst.data->mname)); diff --git a/src/shk.c b/src/shk.c index ffc827482..9a8ed96cd 100644 --- a/src/shk.c +++ b/src/shk.c @@ -28,6 +28,7 @@ STATIC_VAR NEARDATA long int followmsg; /* last time of follow message */ STATIC_VAR const char and_its_contents[] = " and its contents"; STATIC_VAR const char the_contents_of[] = "the contents of "; +STATIC_DCL void FDECL(append_honorific, (char *)); STATIC_DCL void FDECL(setpaid, (struct monst *)); STATIC_DCL long FDECL(addupbill, (struct monst *)); STATIC_DCL void FDECL(pacify_shk, (struct monst *)); @@ -2344,23 +2345,13 @@ boolean ininv, dummy, silent; The(xname(obj)), ltmp, currency(ltmp), (obj->quan > 1L) ? " each" : ""); } else { - /* (chooses among [0]..[3] normally; [1]..[4] after the - Wizard has been killed or invocation ritual performed) */ - static const char * const honored[] = { - "good", "honored", "most gracious", "esteemed", - "most renowned and sacred" - }; long save_quan = obj->quan; Strcpy(buf, "\"For you, "); if (ANGRY(shkp)) { Strcat(buf, "scum;"); } else { - int idx = rn2(SIZE(honored) - 1) + u.uevent.udemigod; - - Strcat(buf, honored[idx]); - Strcat(buf, !is_human(youmonst.data) ? " creature" : - (flags.female) ? " lady" : " sir"); + append_honorific(buf); Strcat(buf, "; only"); } obj->quan = 1L; /* fool xname() into giving singular */ @@ -2385,6 +2376,26 @@ boolean ininv, dummy, silent; } } +void +append_honorific(buf) +char *buf; +{ + /* (chooses among [0]..[3] normally; [1]..[4] after the + Wizard has been killed or invocation ritual performed) */ + static const char * const honored[] = { + "good", "honored", "most gracious", "esteemed", + "most renowned and sacred" + }; + Strcat(buf, honored[rn2(SIZE(honored) - 1) + u.uevent.udemigod]); + if (is_vampire(youmonst.data)) + Strcat(buf, (flags.female) ? " dark lady" : " dark lord"); + else if (is_elf(youmonst.data)) + Strcat(buf,(flags.female) ? " hiril" : " hir"); + else + Strcat(buf, !is_human(youmonst.data) ? " creature" : + (flags.female) ? " lady" : " sir"); +} + void splitbill(obj, otmp) register struct obj *obj, *otmp; From d65fba4ebe30dd8c4aedd5120ba9455485b87e30 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 23 Apr 2015 19:25:01 -0700 Subject: [PATCH 05/13] do_look bits I didn't find Michael's crasher, but I did find a couple of minor problems: knight's saddled pony wasn't found in the file lookup either though there is an entry for pony ("tame saddled " stripped off "tame " but not "saddled "; "saddled " would only be found of there was a wildcard entry key of "*", like "*horse" to catch both horse and warhorse); "wombat" matched the bat entry rather than reporting an unknown entity. --- dat/data.base | 1 + src/pager.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dat/data.base b/dat/data.base index 57aea652e..52d85930d 100644 --- a/dat/data.base +++ b/dat/data.base @@ -430,6 +430,7 @@ barbed devil are quite difficult to kill. # takes "bat or bird" when specifying 'B' ~combat +~wombat *bat bat or bird A bat, flitting in the darkness outside, took the wrong turn diff --git a/src/pager.c b/src/pager.c index 036ee018c..a799650b5 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pager.c $NHDT-Date: 1429408230 2015/04/19 01:50:30 $ $NHDT-Branch: master $:$NHDT-Revision: 1.62 $ */ +/* NetHack 3.5 pager.c $NHDT-Date: 1429842296 2015/04/24 02:24:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.63 $ */ /* NetHack 3.5 pager.c $Date: 2012/01/15 09:27:06 $ $Revision: 1.41 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -332,6 +332,8 @@ checkfile(inp, pm, user_typed_name, without_asking) dbase_str += 9; if (!strncmp(dbase_str, "invisible ", 10)) dbase_str += 10; + if (!strncmp(dbase_str, "saddled ", 8)) + dbase_str += 8; if (!strncmp(dbase_str, "statue of ", 10)) dbase_str[6] = '\0'; else if (!strncmp(dbase_str, "figurine of ", 12)) From ce58721890ae6c2abdd031a3a80b7332d0b092f4 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 24 Apr 2015 02:18:07 -0700 Subject: [PATCH 06/13] more data.base lookup tidbits Still doesn't address the reported stack corruption. * 'alt' points to a buffer which has already been processed by lcase(), so remove the redundant call to that routine; * common error exit accessed via 'goto' could potentially leave a dangling window structure (only if 'data' is corrupted though; it's the only way a failure at that late point could occur). --- src/pager.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/pager.c b/src/pager.c index a799650b5..0d4d62b9e 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pager.c $NHDT-Date: 1429842296 2015/04/24 02:24:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.63 $ */ +/* NetHack 3.5 pager.c $NHDT-Date: 1429867083 2015/04/24 09:18:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.64 $ */ /* NetHack 3.5 pager.c $Date: 2012/01/15 09:27:06 $ $Revision: 1.41 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -302,6 +302,7 @@ checkfile(inp, pm, user_typed_name, without_asking) unsigned long txt_offset; int chk_skip; boolean found_in_file = FALSE, skipping_entry = FALSE; + winid datawin = WIN_ERR; fp = dlb_fopen(DATAFILE, "r"); if (!fp) { @@ -358,12 +359,8 @@ checkfile(inp, pm, user_typed_name, without_asking) * will usually be found under their name, rather than under their * object type, so looking for a singular form is pointless. */ - if (!alt) alt = makesingular(dbase_str); - else - if (user_typed_name) - (void) lcase(alt); /* skip first record; read second */ txt_offset = 0L; @@ -410,14 +407,15 @@ checkfile(inp, pm, user_typed_name, without_asking) if (!dlb_fgets(buf, BUFSZ, fp)) goto bad_data_file; } while (!digit(*buf)); if (sscanf(buf, "%ld,%d\n", &entry_offset, &entry_count) < 2) { -bad_data_file: impossible("'data' file in wrong format"); - (void) dlb_fclose(fp); - return; + bad_data_file: + impossible("'data' file in wrong format or corrupted"); + /* window will exist if we came here from below via 'goto' */ + if (datawin != WIN_ERR) destroy_nhwindow(datawin); + (void) dlb_fclose(fp); + return; } if (user_typed_name || without_asking || yn("More info?") == 'y') { - winid datawin; - if (dlb_fseek(fp, (long)txt_offset + entry_offset, SEEK_SET) < 0) { pline("? Seek error on 'data' file!"); (void) dlb_fclose(fp); From a2dcc898382e0b61b38ea8f3be87190d23656d94 Mon Sep 17 00:00:00 2001 From: keni Date: Fri, 24 Apr 2015 09:11:33 -0400 Subject: [PATCH 07/13] force the date (really testing email) --- DEVEL/Developer.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVEL/Developer.txt b/DEVEL/Developer.txt index 202778c7b..3e1cae9fa 100644 --- a/DEVEL/Developer.txt +++ b/DEVEL/Developer.txt @@ -4,7 +4,7 @@ |___/\___|\_/\___|_\___/ .__/\___|_| |_| -$NHDT-Date$ +$NHDT-Date: 1429881078 2015/04/24 13:11:18 $ Welcome to the NetHack Infrastructure Developer's Guide. From 1369b17e3b7fee2be36ab21c7d3e91d00030819f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 24 Apr 2015 16:24:50 +0300 Subject: [PATCH 08/13] Stop travel or run when you get hungry --- doc/fixes35.0 | 1 + src/eat.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 8f4a04890..072dbc6f3 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1127,6 +1127,7 @@ Some levels in Gehennom now use the old corridor-style maze instead of the new room-style. Beelzebub's level always does this and the "beetle legs" are restored. gnomes will occasionally have a candle +stop travel or run when you get hungry Platform- and/or Interface-Specific New Features diff --git a/src/eat.c b/src/eat.c index 5e12876f5..df1df169e 100644 --- a/src/eat.c +++ b/src/eat.c @@ -2712,6 +2712,7 @@ boolean incr; if (incr && occupation && (occupation != eatfood && occupation != opentin)) stop_occupation(); + context.travel = context.travel1 = context.mv = context.run = 0; break; case WEAK: if (Hallucination) @@ -2731,6 +2732,7 @@ boolean incr; if (incr && occupation && (occupation != eatfood && occupation != opentin)) stop_occupation(); + context.travel = context.travel1 = context.mv = context.run = 0; break; } u.uhs = newhs; From 27742786076b9ecb2dad4071d9212461acf18847 Mon Sep 17 00:00:00 2001 From: keni Date: Fri, 24 Apr 2015 09:32:50 -0400 Subject: [PATCH 09/13] enable subst for all DEVEL/*.txt (really another mail test) --- DEVEL/.gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVEL/.gitattributes b/DEVEL/.gitattributes index cc0b542f3..914704e1c 100644 --- a/DEVEL/.gitattributes +++ b/DEVEL/.gitattributes @@ -1,4 +1,4 @@ -Developer.txt NHSUBST +*.txt NHSUBST nhgitset.pl NHSUBST hooksdir/* NHSUBST * text=auto From 34508d5df294d68ef3b2f91861aae6fe620d8205 Mon Sep 17 00:00:00 2001 From: keni Date: Fri, 24 Apr 2015 09:56:24 -0400 Subject: [PATCH 10/13] add a date line (another mail test) --- DEVEL/git_recipes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt index 1a2ec0acf..b580c4c8e 100644 --- a/DEVEL/git_recipes.txt +++ b/DEVEL/git_recipes.txt @@ -1,6 +1,7 @@ Git has a messy learning curve. This file is an attempt to serve as a quick reference for basic tasks while you get up to speed. +$NHDT-Date$ ------------------------ [*] git checkout [-f] (branch) From de87c7550c28fc097d4d2187497552651910e142 Mon Sep 17 00:00:00 2001 From: keni Date: Fri, 24 Apr 2015 10:01:00 -0400 Subject: [PATCH 11/13] and fill in the line (another mail test) --- DEVEL/git_recipes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt index b580c4c8e..bf69ace20 100644 --- a/DEVEL/git_recipes.txt +++ b/DEVEL/git_recipes.txt @@ -1,7 +1,7 @@ Git has a messy learning curve. This file is an attempt to serve as a quick reference for basic tasks while you get up to speed. -$NHDT-Date$ +$NHDT-Date: 1429884051 2015/04/24 14:00:51 $ ------------------------ [*] git checkout [-f] (branch) From 24eb44a8c0c193fedee24ad0f032457822dda47a Mon Sep 17 00:00:00 2001 From: keni Date: Fri, 24 Apr 2015 10:11:17 -0400 Subject: [PATCH 12/13] force date change (another mail test) --- DEVEL/Developer.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVEL/Developer.txt b/DEVEL/Developer.txt index 3e1cae9fa..956ed11de 100644 --- a/DEVEL/Developer.txt +++ b/DEVEL/Developer.txt @@ -4,7 +4,7 @@ |___/\___|\_/\___|_\___/ .__/\___|_| |_| -$NHDT-Date: 1429881078 2015/04/24 13:11:18 $ +$NHDT-Date: 1429884664 2015/04/24 14:11:04 $ Welcome to the NetHack Infrastructure Developer's Guide. From 65e699b646c36e8d020dd4ed688492585b6461bd Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 24 Apr 2015 11:23:07 -0400 Subject: [PATCH 13/13] fix an observed stack corruption Changes to be committed: modified: src/pager.c --- src/pager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pager.c b/src/pager.c index 0d4d62b9e..12bf5e985 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pager.c $NHDT-Date: 1429867083 2015/04/24 09:18:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.64 $ */ +/* NetHack 3.5 pager.c $NHDT-Date: 1429888966 2015/04/24 15:22:46 $ $NHDT-Branch: master $:$NHDT-Revision: 1.65 $ */ /* NetHack 3.5 pager.c $Date: 2012/01/15 09:27:06 $ $Revision: 1.41 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -676,7 +676,7 @@ do_look(mode, click_cc) { boolean quick = (mode == 1); /* use cursor && don't search for "more info" */ boolean clicklook = (mode == 2); /* right mouse-click method */ - char out_str[BUFSZ]; + char out_str[BUFSZ] = {0}; const char *firstmatch = 0; struct permonst *pm = 0; int i = '\0', ans = 0;