From 4dabfb5c3c7a5e37509b5bc7dab57bff0cbd787d Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 1 Aug 2018 17:39:02 -0700 Subject: [PATCH 1/2] fix github issue #120 - quest message typo Fixes #120 The one-line summary [for inclusion in message history] of the priest quest's block message when bringing the quest artifact back to leader misspelled "congratulations". --- dat/quest.txt | 2 +- doc/fixes36.2 | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dat/quest.txt b/dat/quest.txt index 64bde2fe3..75face8f0 100644 --- a/dat/quest.txt +++ b/dat/quest.txt @@ -1800,7 +1800,7 @@ a minion of %d. %d commands that you retain of Yendor. "Go forth, and let %d guide your steps." -%E [Congraulations, %p. Keep %o; go and recover the Amulet.] +%E [Congratulations, %p. Keep %o; go and recover the Amulet.] %Cc Pri 00082 %lC reiterates that %o is yours now. diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 134788868..315203891 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -72,6 +72,9 @@ remembered corpse which isn't there anymore would be described by farlook as the corpse of a random monster type when eating a tin of spinach, don't "feel like Popeye" is sustain-abilities prevents any strength gain +summary text [for message history] of quest message Pri 00081 (Priest quest + success message given when bringing quest artifact to leader) + misspelled "congratulations" Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository From 77ad700801d7aebced12416cbb40fd45cba5b18e Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 2 Aug 2018 18:44:41 -0700 Subject: [PATCH 2/2] fix #H7334 - hearing seduction msgs while deaf Various seduction messages with a verbal component were being given to hero even when deaf. This uses alternate messages if some cases and bypasses the message in others. In particular, if hero is deaf then he or she will not be given the choice to decline removing a piece of armor--or taking off or putting on a ring of adornment-- that can ordinarily occur (based on die roll against Charisma). The seduction code was also using '!Blind' to test whether the hero could see his/her seducer, ignoring the possibility that it might be invisible. I think the only ramification is that "It" would appear in messages instead of the "She" or "He" that are explicitly used when not seen due to blindness. --- doc/fixes36.2 | 1 + src/mhitu.c | 116 +++++++++++++++++++++++++++----------------------- 2 files changed, 63 insertions(+), 54 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 315203891..e98a9245c 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -75,6 +75,7 @@ when eating a tin of spinach, don't "feel like Popeye" is sustain-abilities summary text [for message history] of quest message Pri 00081 (Priest quest success message given when bringing quest artifact to leader) misspelled "congratulations" +verbal charm/seduce messages were given even when hero was deaf Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/mhitu.c b/src/mhitu.c index e8ff0b4d3..195dc025a 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -11,7 +11,7 @@ STATIC_VAR NEARDATA struct obj *mon_currwep = (struct obj *) 0; STATIC_DCL boolean FDECL(u_slip_free, (struct monst *, struct attack *)); STATIC_DCL int FDECL(passiveum, (struct permonst *, struct monst *, struct attack *)); -STATIC_DCL void FDECL(mayberem, (struct obj *, const char *)); +STATIC_DCL void FDECL(mayberem, (const char *, struct obj *, const char *)); STATIC_DCL boolean FDECL(diseasemu, (struct permonst *)); STATIC_DCL int FDECL(hitmu, (struct monst *, struct attack *)); STATIC_DCL int FDECL(gulpmu, (struct monst *, struct attack *)); @@ -39,7 +39,7 @@ struct attack *mattk; if ((compat = could_seduce(mtmp, &youmonst, mattk)) != 0 && !mtmp->mcan && !mtmp->mspec_used) { pline("%s %s you %s.", Monst_name, - Blind ? "talks to" : "smiles at", + !Blind ? "smiles at" : !Deaf ? "talks to" : "touches", (compat == 2) ? "engagingly" : "seductively"); } else { switch (mattk->aatyp) { @@ -155,7 +155,7 @@ struct attack *mattk; /* maybe it's attacking an image around the corner? */ compat = ((mattk->adtyp == AD_SEDU || mattk->adtyp == AD_SSEX) - && could_seduce(mtmp, &youmonst, (struct attack *) 0)); + ? could_seduce(mtmp, &youmonst, (struct attack *) 0) : 0); Monst_name = Monnam(mtmp); if (!mtmp->mcansee || (Invis && !perceives(mtmp->data))) { @@ -188,17 +188,16 @@ struct attack *mattk; } } else if (Displaced) { + /* give 'displaced' message even if hero is Blind */ if (compat) pline("%s smiles %s at your %sdisplaced image...", Monst_name, (compat == 2) ? "engagingly" : "seductively", Invis ? "invisible " : ""); else pline("%s strikes at your %sdisplaced image and misses you!", - /* Note: if you're both invisible and displaced, - * only monsters which see invisible will attack your - * displaced image, since the displaced image is also - * invisible. - */ + /* Note: if you're both invisible and displaced, only + * monsters which see invisible will attack your displaced + * image, since the displaced image is also invisible. */ Monst_name, Invis ? "invisible " : ""); } else if (Underwater) { @@ -1328,7 +1327,8 @@ register struct attack *mattk; } else if (dmgtype(youmonst.data, AD_SEDU) || (SYSOPT_SEDUCE && dmgtype(youmonst.data, AD_SSEX))) { pline("%s %s.", Monnam(mtmp), - mtmp->minvent + Deaf ? "says something but you can't hear it" + : mtmp->minvent ? "brags about the goods some dungeon explorer provided" : "makes some remarks about how difficult theft is lately"); if (!tele_restrict(mtmp)) @@ -1883,6 +1883,7 @@ struct attack *mattk; if (can_blnd(mtmp, &youmonst, mattk->aatyp, (struct obj *) 0)) { if (!Blind) { long was_blinded = Blinded; + if (!Blinded) You_cant("see in here!"); make_blinded((long) tmp, FALSE); @@ -2355,24 +2356,27 @@ struct monst *mon; { struct obj *ring, *nring; boolean fem = (mon->data == &mons[PM_SUCCUBUS]); /* otherwise incubus */ + boolean seewho, naked; /* True iff no armor */ int attr_tot, tried_gloves = 0; - char qbuf[QBUFSZ]; + char qbuf[QBUFSZ], Who[QBUFSZ]; if (mon->mcan || mon->mspec_used) { pline("%s acts as though %s has got a %sheadache.", Monnam(mon), mhe(mon), mon->mcan ? "severe " : ""); return 0; } - if (unconscious()) { pline("%s seems dismayed at your lack of response.", Monnam(mon)); return 0; } - - if (Blind) - pline("It caresses you..."); + seewho = canseemon(mon); + if (!seewho) + pline("Someone caresses you..."); else You_feel("very attracted to %s.", mon_nam(mon)); + /* cache the seducer's name in a local buffer */ + Strcpy(Who, (!seewho ? (fem ? "She" : "He") : Monnam(mon))); + /* if in the process of putting armor on or taking armor off, interrupt that activity now */ (void) stop_donning((struct obj *) 0); @@ -2388,11 +2392,12 @@ struct monst *mon; if (ring->owornmask && uarmg) { /* don't take off worn ring if gloves are in the way */ if (!tried_gloves++) - mayberem(uarmg, "gloves"); + mayberem(Who, uarmg, "gloves"); if (uarmg) continue; /* next ring might not be worn */ } - if (rn2(20) < ACURR(A_CHA)) { + /* confirmation prompt when charisma is high bypassed if deaf */ + if (!Deaf && rn2(20) < ACURR(A_CHA)) { (void) safe_qbuf(qbuf, "\"That ", " looks pretty. May I have it?\"", ring, xname, simpleonames, "ring"); @@ -2401,16 +2406,11 @@ struct monst *mon; continue; } else pline("%s decides she'd like %s, and takes it.", - Blind ? "She" : Monnam(mon), yname(ring)); + Who, yname(ring)); makeknown(RIN_ADORNMENT); - if (ring == uleft || ring == uright) - Ring_gone(ring); - if (ring == uwep) - setuwep((struct obj *) 0); - if (ring == uswapwep) - setuswapwep((struct obj *) 0); - if (ring == uquiver) - setuqwep((struct obj *) 0); + /* might be in left or right ring slot or weapon/alt-wep/quiver */ + if (ring->owornmask) + remove_worn_item(ring, FALSE); freeinv(ring); (void) mpickobj(mon, ring); } else { @@ -2422,41 +2422,40 @@ struct monst *mon; if (uarmg) { /* don't put on ring if gloves are in the way */ if (!tried_gloves++) - mayberem(uarmg, "gloves"); + mayberem(Who, uarmg, "gloves"); if (uarmg) break; /* no point trying further rings */ } - if (rn2(20) < ACURR(A_CHA)) { + /* confirmation prompt when charisma is high bypassed if deaf */ + if (!Deaf && rn2(20) < ACURR(A_CHA)) { (void) safe_qbuf(qbuf, "\"That ", - " looks pretty. Would you wear it for me?\"", + " looks pretty. Would you wear it for me?\"", ring, xname, simpleonames, "ring"); makeknown(RIN_ADORNMENT); if (yn(qbuf) == 'n') continue; } else { pline("%s decides you'd look prettier wearing %s,", - Blind ? "He" : Monnam(mon), yname(ring)); + Who, yname(ring)); pline("and puts it on your finger."); } makeknown(RIN_ADORNMENT); if (!uright) { pline("%s puts %s on your right %s.", - Blind ? "He" : Monnam(mon), the(xname(ring)), - body_part(HAND)); + Who, the(xname(ring)), body_part(HAND)); setworn(ring, RIGHT_RING); } else if (!uleft) { pline("%s puts %s on your left %s.", - Blind ? "He" : Monnam(mon), the(xname(ring)), - body_part(HAND)); + Who, the(xname(ring)), body_part(HAND)); setworn(ring, LEFT_RING); } else if (uright && uright->otyp != RIN_ADORNMENT) { - pline("%s replaces %s with %s.", Blind ? "He" : Monnam(mon), - yname(uright), yname(ring)); + pline("%s replaces %s with %s.", + Who, yname(uright), yname(ring)); Ring_gone(uright); setworn(ring, RIGHT_RING); } else if (uleft && uleft->otyp != RIN_ADORNMENT) { - pline("%s replaces %s with %s.", Blind ? "He" : Monnam(mon), - yname(uleft), yname(ring)); + pline("%s replaces %s with %s.", + Who, yname(uleft), yname(ring)); Ring_gone(uleft); setworn(ring, LEFT_RING); } else @@ -2466,26 +2465,31 @@ struct monst *mon; } } - if (!uarmc && !uarmf && !uarmg && !uarms && !uarmh && !uarmu) - pline("%s murmurs sweet nothings into your ear.", - Blind ? (fem ? "She" : "He") : Monnam(mon)); - else - pline("%s murmurs in your ear, while helping you undress.", - Blind ? (fem ? "She" : "He") : Monnam(mon)); - mayberem(uarmc, cloak_simple_name(uarmc)); + naked = (!uarmc && !uarmf && !uarmg && !uarms && !uarmh && !uarmu); + pline("%s %s%s.", Who, + Deaf ? "seems to murmur into your ear" + : naked ? "murmurs sweet nothings into your ear" + : "murmurs in your ear", + naked ? "" : ", while helping you undress"); + mayberem(Who, uarmc, cloak_simple_name(uarmc)); if (!uarmc) - mayberem(uarm, "suit"); - mayberem(uarmf, "boots"); + mayberem(Who, uarm, "suit"); + mayberem(Who, uarmf, "boots"); if (!tried_gloves) - mayberem(uarmg, "gloves"); - mayberem(uarms, "shield"); - mayberem(uarmh, helm_simple_name(uarmh)); + mayberem(Who, uarmg, "gloves"); + mayberem(Who, uarms, "shield"); + mayberem(Who, uarmh, helm_simple_name(uarmh)); if (!uarmc && !uarm) - mayberem(uarmu, "shirt"); + mayberem(Who, uarmu, "shirt"); if (uarm || uarmc) { - verbalize("You're such a %s; I wish...", - flags.female ? "sweet lady" : "nice guy"); + if (!Deaf) + verbalize("You're such a %s; I wish...", + flags.female ? "sweet lady" : "nice guy"); + else if (seewho) + pline("%s appears to sigh.", Monnam(mon)); + /* else no regret message if can't see or hear seducer */ + if (!tele_restrict(mon)) (void) rloc(mon, TRUE); return 1; @@ -2623,7 +2627,8 @@ struct monst *mon; } STATIC_OVL void -mayberem(obj, str) +mayberem(seducer, obj, str) +const char *seducer; /* only used for alternate message */ struct obj *obj; const char *str; { @@ -2632,7 +2637,10 @@ const char *str; if (!obj || !obj->owornmask) return; - if (rn2(20) < ACURR(A_CHA)) { + /* being deaf overrides confirmation prompt for high charisma */ + if (Deaf) { + pline("%s takes off your %s.", seducer, str); + } else if (rn2(20) < ACURR(A_CHA)) { Sprintf(qbuf, "\"Shall I remove your %s, %s?\"", str, (!rn2(2) ? "lover" : !rn2(2) ? "dear" : "sweetheart")); if (yn(qbuf) == 'n')