granular verbose message suppression mechanics

Switch to using a macro invocation Verbos(n, s) in place of the
flags.verbose checks.

Provide the mechanics for individual suppression of any of the
existing messages that were considered verbose.

Mechanics only - this code update does not provide any means of
setting the suppression bits.

iflags.verbose = 0
is still a master suppression of all the verbose messages.

iflags.verbose = 1
turns on the verbose messages only for those whose suppression
bit is 0 (not set).
This commit is contained in:
nhmall
2022-06-09 13:53:20 -04:00
parent fe235b7292
commit be76727265
41 changed files with 312 additions and 137 deletions

View File

@@ -483,7 +483,7 @@ do_attack(struct monst *mtmp)
if (g.unweapon) {
g.unweapon = FALSE;
if (flags.verbose) {
if (Verbose(4, do_attack)) {
if (uwep)
You("begin bashing monsters with %s.", yname(uwep));
else if (!cantwield(g.youmonst.data))
@@ -547,7 +547,7 @@ known_hitum(
if (g.override_confirmation) {
/* this may need to be generalized if weapons other than
Stormbringer acquire similar anti-social behavior... */
if (flags.verbose)
if (Verbose(4, known_hitum))
Your("bloodthirsty blade attacks!");
}
@@ -1381,7 +1381,7 @@ hmon_hitmon(
if ((mclone = clone_mon(mon, 0, 0)) != 0) {
withwhat[0] = '\0';
if (u.twoweap && flags.verbose)
if (u.twoweap && Verbose(4, hmon_hitmon1))
Sprintf(withwhat, " with %s", yname(obj));
pline("%s divides as you hit it%s!", Monnam(mon), withwhat);
hittxt = TRUE;
@@ -1394,7 +1394,7 @@ hmon_hitmon(
|| (thrown && g.m_shot.n > 1 && g.m_shot.o == obj->otyp))) {
if (thrown)
hit(mshot_xname(obj), mon, exclam(tmp));
else if (!flags.verbose)
else if (!Verbose(4, hmon_hitmon2))
You("hit it.");
else /* hand_to_hand */
You("%s %s%s",
@@ -2443,7 +2443,7 @@ mhitm_ad_tlpt(struct monst *magr, struct attack *mattk, struct monst *mdef,
hitmsg(magr, mattk);
if (!negated) {
if (flags.verbose)
if (Verbose(4, mhitm_ad_tlpt))
Your("position suddenly seems %suncertain!",
(Teleport_control && !Stunned && !unconscious()) ? ""
: "very ");
@@ -2850,7 +2850,7 @@ mhitm_ad_wrap(struct monst *magr, struct attack *mattk, struct monst *mdef,
pline("%s is being crushed.", Monnam(mdef));
} else {
mhm->damage = 0;
if (flags.verbose)
if (Verbose(4, mhitm_ad_wrap1))
You("brush against %s %s.", s_suffix(mon_nam(mdef)),
mbodypart(mdef, LEG));
}
@@ -2885,7 +2885,7 @@ mhitm_ad_wrap(struct monst *magr, struct attack *mattk, struct monst *mdef,
}
} else {
mhm->damage = 0;
if (flags.verbose)
if (Verbose(4, mhitm_ad_wrap2))
pline("%s brushes against your %s.", Monnam(magr),
body_part(LEG));
}
@@ -3878,7 +3878,7 @@ mhitm_ad_dgst(struct monst *magr, struct attack *mattk UNUSED,
mhm->done = TRUE;
return;
}
if (flags.verbose && !Deaf)
if (Verbose(4, mhitm_ad_dgst) && !Deaf)
verbalize("Burrrrp!");
mhm->damage = mdef->mhp;
/* Use up amulet of life saving */
@@ -4211,7 +4211,7 @@ damageum(
You_feel("embarrassed for a moment.");
if (mhm.damage)
xkilled(mdef, XKILL_NOMSG);
} else if (!flags.verbose) {
} else if (!Verbose(4, damageum)) {
You("destroy it!");
if (mhm.damage)
xkilled(mdef, XKILL_NOMSG);
@@ -4516,7 +4516,7 @@ missum(struct monst *mdef, struct attack *mattk, boolean wouldhavehit)
if (could_seduce(&g.youmonst, mdef, mattk))
You("pretend to be friendly to %s.", mon_nam(mdef));
else if (canspotmon(mdef) && flags.verbose)
else if (canspotmon(mdef) && Verbose(4, missum))
You("miss %s.", mon_nam(mdef));
else
You("miss it.");
@@ -4738,7 +4738,7 @@ hmonas(struct monst *mon)
if (mattk->aatyp == AT_CLAW)
verb = "hit"; /* not "claws" */
You("%s %s.", verb, mon_nam(mon));
if (silverhit && flags.verbose)
if (silverhit && Verbose(4, hmonas1))
silver_sears(&g.youmonst, mon, silverhit);
}
sum[i] = damageum(mon, mattk, specialdmg);
@@ -4802,7 +4802,7 @@ hmonas(struct monst *mon)
choking hug; deals damage but never grabs hold */
if (specialdmg) {
You("%s %s%s", verb, mon_nam(mon), exclam(specialdmg));
if (silverhit && flags.verbose)
if (silverhit && Verbose(4, hmonas2))
silver_sears(&g.youmonst, mon, silverhit);
sum[i] = damageum(mon, mattk, specialdmg);
} else {
@@ -4817,7 +4817,7 @@ hmonas(struct monst *mon)
byhand ? "throttled" : "crushed",
/* extra feedback for non-breather being choked */
unconcerned ? " but doesn't seem concerned" : "");
if (silverhit && flags.verbose)
if (silverhit && Verbose(4, hmonas3))
silver_sears(&g.youmonst, mon, silverhit);
sum[i] = damageum(mon, mattk, specialdmg);
} else if (i >= 2 && (sum[i - 1] > MM_MISS)
@@ -4829,7 +4829,7 @@ hmonas(struct monst *mon)
uunstick();
You("grab %s!", mon_nam(mon));
set_ustuck(mon);
if (silverhit && flags.verbose)
if (silverhit && Verbose(4, hmonas4))
silver_sears(&g.youmonst, mon, silverhit);
sum[i] = damageum(mon, mattk, specialdmg);
}
@@ -4971,7 +4971,7 @@ passive(struct monst *mon,
break;
case AD_ACID:
if (mhitb && rn2(2)) {
if (Blind || !flags.verbose)
if (Blind || !Verbose(4, passive))
You("are splashed!");
else
You("are splashed by %s %s!", s_suffix(mon_nam(mon)),
@@ -5361,7 +5361,7 @@ flash_hits_mon(struct monst *mtmp,
mtmp->mcansee = 0;
mtmp->mblinded = (tmp < 3) ? 0 : rnd(1 + 50 / tmp);
}
} else if (flags.verbose && useeit) {
} else if (Verbose(4, flash_hits_mon) && useeit) {
if (lev->lit)
pline("The flash of light shines on %s.", mon_nam(mtmp));
else