]> granicus.if.org Git - nethack/commitdiff
unrevert some unintentionally reverted bands
authornhmall <nhmall@nethack.org>
Thu, 29 Jul 2021 20:01:55 +0000 (16:01 -0400)
committernhmall <nhmall@nethack.org>
Thu, 29 Jul 2021 20:01:55 +0000 (16:01 -0400)
fixes #560

src/cmd.c
src/minion.c
src/muse.c
src/objnam.c
src/pray.c

index 838322c73018c45b0a23486a4e7d2cdea36239a8..bc872135d2c78dae33220d2b33843c43557a999b 100644 (file)
--- 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;
     }
 
index 0b3a992b59f8c7fff5d76e3906c80c108a516b8c..94fc3b6c5154d23b32230556c43e9dce17640498 100644 (file)
@@ -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;
index 2d7f0542c6ae57f7928f6ba13329644c01613239..72988f5fa67a820ee169cd31d64da4be9ea64e22 100644 (file)
@@ -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);
     }
index 4c3f49f828526bc18714f24be296b15ff3707af0..af45f14eafa0d548c780182b99b6938a887d28ca 100644 (file)
@@ -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 "<class> [ 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 <class>" */
             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;*/
             }
index 478edd1ccf11eb67880f3d58dbea6b287fd9c513..95e1476edf138fac82166deb32a72ceb5c72894c 100644 (file)
@@ -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;