From: nhmall Date: Thu, 29 Jul 2021 20:01:55 +0000 (-0400) Subject: unrevert some unintentionally reverted bands X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf2475285daa60e93c9fc4d4a49732b35d189034;p=nethack unrevert some unintentionally reverted bands fixes #560 --- diff --git a/src/cmd.c b/src/cmd.c index 838322c73..bc872135d 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -3349,7 +3349,8 @@ randomkey(void) c = (char) rn1('9' - '0' + 1, '0'); break; case 14: - c = (char) rn2(iflags.wc_eight_bit_input ? 256 : 128); + /* any char, but avoid '\0' because it's used for mouse click */ + c = (char) rnd(iflags.wc_eight_bit_input ? 255 : 127); break; } diff --git a/src/minion.c b/src/minion.c index 0b3a992b5..94fc3b6c5 100644 --- a/src/minion.c +++ b/src/minion.c @@ -236,9 +236,13 @@ summon_minion(aligntyp alignment, boolean talk) } if (mon) { if (talk) { - pline_The("voice of %s booms:", align_gname(alignment)); + if (!Deaf) + pline_The("voice of %s booms:", align_gname(alignment)); + else + You_feel("%s booming voice:", + s_suffix(align_gname(alignment))); verbalize("Thou shalt pay for thine indiscretion!"); - if (!Blind) + if (canspotmon(mon)) pline("%s appears before you.", Amonnam(mon)); mon->mstrategy &= ~STRAT_APPEARMSG; } @@ -289,16 +293,18 @@ demon_talk(register struct monst *mtmp) newsym(mtmp->mx, mtmp->my); } if (g.youmonst.data->mlet == S_DEMON) { /* Won't blackmail their own. */ - pline("%s says, \"Good hunting, %s.\"", Amonnam(mtmp), - flags.female ? "Sister" : "Brother"); + if (!Deaf) + pline("%s says, \"Good hunting, %s.\"", Amonnam(mtmp), + flags.female ? "Sister" : "Brother"); + else if (canseemon(mtmp)) + pline("%s says something.", Amonnam(mtmp)); if (!tele_restrict(mtmp)) (void) rloc(mtmp, TRUE); return 1; } cash = money_cnt(g.invent); - demand = - (cash * (rnd(80) + 20 * Athome)) - / (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); + demand = (cash * (rnd(80) + 20 * Athome)) + / (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); if (!demand || g.multi < 0) { /* you have no gold or can't move */ mtmp->mpeaceful = 0; @@ -308,13 +314,21 @@ demon_talk(register struct monst *mtmp) /* make sure that the demand is unmeetable if the monster has the Amulet, preventing monster from being satisfied and removed from the game (along with said Amulet...) */ - if (mon_has_amulet(mtmp)) - demand = cash + (long) rn1(1000, 40); - - pline("%s demands %ld %s for safe passage.", Amonnam(mtmp), demand, - currency(demand)); - - if ((offer = bribe(mtmp)) >= demand) { + /* [actually the Amulet is safe; it would be dropped when + mongone() gets rid of the monster; force combat anyway; + also make it unmeetable if the player is Deaf, to simplify + handling that case as player-won't-pay] */ + if (mon_has_amulet(mtmp) || Deaf) + /* 125: 5*25 in case hero has maximum possible charisma */ + demand = cash + (long) rn1(1000, 125); + + if (!Deaf) + pline("%s demands %ld %s for safe passage.", + Amonnam(mtmp), demand, currency(demand)); + else if (canseemon(mtmp)) + pline("%s seems to be demanding something.", Amonnam(mtmp)); + offer = 0L; + if (!Deaf && ((offer = bribe(mtmp)) >= demand)) { pline("%s vanishes, laughing about cowardly mortals.", Amonnam(mtmp)); } else if (offer > 0L @@ -477,12 +491,18 @@ gain_guardian_angel(void) Hear_again(); /* attempt to cure any deafness now (divine message will be heard even if that fails) */ if (Conflict) { - pline("A voice booms:"); + if (!Deaf) + pline("A voice booms:"); + else + You_feel("a booming voice:"); verbalize("Thy desire for conflict shall be fulfilled!"); /* send in some hostile angels instead */ lose_guardian_angel((struct monst *) 0); } else if (u.ualign.record > 8) { /* fervent */ - pline("A voice whispers:"); + if (!Deaf) + pline("A voice whispers:"); + else + You_feel("a soft voice:"); verbalize("Thou hast been worthy of me!"); mm.x = u.ux; mm.y = u.uy; diff --git a/src/muse.c b/src/muse.c index 2d7f0542c..72988f5fa 100644 --- a/src/muse.c +++ b/src/muse.c @@ -2829,7 +2829,10 @@ muse_unslime( dmg = d(3, 4); /* [**TEMP** (different from hero)] */ m_useup(mon, obj); } else { /* wand/horn of fire w/ positive charge count */ - mplayhorn(mon, obj, TRUE); + if (obj->otyp == FIRE_HORN) + mplayhorn(mon, obj, TRUE); + else + mzapwand(mon, obj, TRUE); /* -1 => monster's wand of fire; 2 => # of damage dice */ dmg = zhitm(mon, by_you ? 1 : -1, 2, &odummyp); } diff --git a/src/objnam.c b/src/objnam.c index 4c3f49f82..af45f14ea 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -2956,7 +2956,7 @@ rnd_otyp_by_namedesc( * probabilities are not very useful because they don't take * the class generation probability into account. [If 10% * of spellbooks were blank and 1% of scrolls were blank, - * "blank" would have 10/11 chance to yield a blook even though + * "blank" would have 10/11 chance to yield a book even though * scrolls are supposed to be much more common than books.] */ for (i = lo; i <= hi; ++i) { @@ -3910,6 +3910,7 @@ readobjnam_postparse1(struct _readobjnam_data *d) for (i = 0; i < (int) (sizeof wrpsym); i++) { register int j = strlen(wrp[i]); + /* check for " [ of ] something" */ if (!strncmpi(d->bp, wrp[i], j)) { d->oclass = wrpsym[i]; if (d->oclass != AMULET_CLASS) { @@ -3921,12 +3922,27 @@ readobjnam_postparse1(struct _readobjnam_data *d) d->actualn = d->bp; return 1; /*goto srch;*/ } + /* check for "something " */ if (!BSTRCMPI(d->bp, d->p - j, wrp[i])) { d->oclass = wrpsym[i]; - d->p -= j; - *d->p = 0; - if (d->p > d->bp && d->p[-1] == ' ') - d->p[-1] = 0; + /* for "foo amulet", leave the class name so that + wishymatch() can do "of inversion" to try matching + "amulet of foo"; other classes don't include their + class name in their full object names (where + "potion of healing" is just "healing", for instance) */ + if (d->oclass != AMULET_CLASS) { + d->p -= j; + *d->p = '\0'; + if (d->p > d->bp && d->p[-1] == ' ') + d->p[-1] = '\0'; + } else { + /* amulet without "of"; convoluted wording but better a + special case that's handled than one that's missing */ + if (!strncmpi(d->bp, "versus poison ", 14)) { + d->typ = AMULET_VERSUS_POISON; + return 2; /*goto typfnd;*/ + } + } d->actualn = d->dn = d->bp; return 1; /*goto srch;*/ } diff --git a/src/pray.c b/src/pray.c index 478edd1cc..95e1476ed 100644 --- a/src/pray.c +++ b/src/pray.c @@ -720,8 +720,9 @@ angrygods(aligntyp resp_god) (on_altar() && (a_align(u.ux, u.uy) != resp_god)) ? "scorn" : "call upon"); + /* [why isn't this using verbalize()?] */ pline("\"Then die, %s!\"", - g.youmonst.data->mlet == S_HUMAN ? "mortal" : "creature"); + (g.youmonst.data->mlet == S_HUMAN) ? "mortal" : "creature"); summon_minion(resp_god, FALSE); break;