From: nhmall Date: Fri, 18 Dec 2015 17:50:25 +0000 (-0500) Subject: fix H4101: can hear pets while deaf X-Git-Tag: NetHack-3.6.1_RC01~1150 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7019a7da77593e77d165a427f9839fc50f832d90;p=nethack fix H4101: can hear pets while deaf This is a fix for H4101, bz192. add non-audio (felt) outcome to yelp() This also add #wizintrinsic command because testing this was a pain without a simple, straightforward way to go deaf that didn't time-out before the situation being tested recurred. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index bedec8986..b307e0b74 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -40,6 +40,7 @@ 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 +avoid hearing yelps when you are deaf Platform- and/or Interface-Specific Fixes @@ -62,7 +63,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 ------------------------------------------------ diff --git a/src/cmd.c b/src/cmd.c index 156cf82fa..7e992560f 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -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: 1450460999 2015/12/18 17:49:59 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.210 $ */ /* 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,48 @@ 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); + } + + 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 +2814,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 +2844,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 }, diff --git a/src/sounds.c b/src/sounds.c index 5f5595018..a57f30e88 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -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: 1450461007 2015/12/18 17:50:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.76 $ */ /* 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" : "quivers"; 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) { diff --git a/src/trap.c b/src/trap.c index 747f626e6..7770d4188 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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