Accessibility: more message locations pt 7

This commit is contained in:
Pasi Kallinen
2024-12-14 16:37:49 +02:00
parent 79affad312
commit e778d95ace
+42 -36
View File
@@ -88,7 +88,7 @@ mhitm_mgc_atk_negated(
if (mdef == &gy.youmonst) if (mdef == &gy.youmonst)
You("avoid harm."); You("avoid harm.");
else if (gv.vis && canseemon(mdef)) else if (gv.vis && canseemon(mdef))
pline("%s avoids harm.", Monnam(mdef)); pline_mon(mdef, "%s avoids harm.", Monnam(mdef));
} }
return TRUE; return TRUE;
} }
@@ -2242,7 +2242,7 @@ mhitm_ad_rust(
return; return;
if (completelyrusts(pd)) { /* PM_IRON_GOLEM */ if (completelyrusts(pd)) { /* PM_IRON_GOLEM */
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline("%s %s to pieces!", Monnam(mdef), pline_mon(mdef, "%s %s to pieces!", Monnam(mdef),
!mlifesaver(mdef) ? "falls" : "starts to fall"); !mlifesaver(mdef) ? "falls" : "starts to fall");
monkilled(mdef, (char *) 0, AD_RUST); monkilled(mdef, (char *) 0, AD_RUST);
if (!DEADMONSTER(mdef)) { if (!DEADMONSTER(mdef)) {
@@ -2322,7 +2322,7 @@ mhitm_ad_dcay(
/* note: the life-saved case is hypothetical because /* note: the life-saved case is hypothetical because
life-saving doesn't work for golems */ life-saving doesn't work for golems */
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline("%s %s to pieces!", Monnam(mdef), pline_mon(mdef, "%s %s to pieces!", Monnam(mdef),
!mlifesaver(mdef) ? "falls" : "starts to fall"); !mlifesaver(mdef) ? "falls" : "starts to fall");
monkilled(mdef, (char *) 0, AD_DCAY); monkilled(mdef, (char *) 0, AD_DCAY);
if (!DEADMONSTER(mdef)) { if (!DEADMONSTER(mdef)) {
@@ -2424,7 +2424,7 @@ mhitm_ad_drli(
if (!is_death) /* Stormbringer uses monhp_per_lvl (1d8) */ if (!is_death) /* Stormbringer uses monhp_per_lvl (1d8) */
mhm->damage = d(2, 6); mhm->damage = d(2, 6);
if (gv.vis && canspotmon(mdef)) if (gv.vis && canspotmon(mdef))
pline("%s becomes weaker!", Monnam(mdef)); pline_mon(mdef, "%s becomes weaker!", Monnam(mdef));
if (mdef->mhpmax - mhm->damage > (int) mdef->m_lev) { if (mdef->mhpmax - mhm->damage > (int) mdef->m_lev) {
mdef->mhpmax -= mhm->damage; mdef->mhpmax -= mhm->damage;
} else { } else {
@@ -2518,12 +2518,12 @@ mhitm_ad_fire(
return; return;
} }
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline("%s is %s!", Monnam(mdef), on_fire(pd, mattk)); pline_mon(mdef, "%s is %s!", Monnam(mdef), on_fire(pd, mattk));
if (completelyburns(pd)) { /* paper golem or straw golem */ if (completelyburns(pd)) { /* paper golem or straw golem */
/* note: the life-saved case is hypothetical because /* note: the life-saved case is hypothetical because
life-saving doesn't work for golems */ life-saving doesn't work for golems */
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline("%s %s!", Monnam(mdef), pline_mon(mdef, "%s %s!", Monnam(mdef),
!mlifesaver(mdef) ? "burns completely" !mlifesaver(mdef) ? "burns completely"
: "is totally engulfed in flames"); : "is totally engulfed in flames");
monkilled(mdef, (char *) 0, AD_FIRE); monkilled(mdef, (char *) 0, AD_FIRE);
@@ -2595,7 +2595,7 @@ mhitm_ad_cold(
return; return;
} }
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline("%s is covered in frost!", Monnam(mdef)); pline_mon(mdef, "%s is covered in frost!", Monnam(mdef));
if (resists_cold(mdef) || defended(mdef, AD_COLD)) { if (resists_cold(mdef) || defended(mdef, AD_COLD)) {
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline_The("frost doesn't seem to chill %s!", mon_nam(mdef)); pline_The("frost doesn't seem to chill %s!", mon_nam(mdef));
@@ -2653,7 +2653,7 @@ mhitm_ad_elec(
return; return;
} }
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline("%s gets zapped!", Monnam(mdef)); pline_mon(mdef, "%s gets zapped!", Monnam(mdef));
if (resists_elec(mdef) || defended(mdef, AD_ELEC)) { if (resists_elec(mdef) || defended(mdef, AD_ELEC)) {
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline_The("zap doesn't shock %s!", mon_nam(mdef)); pline_The("zap doesn't shock %s!", mon_nam(mdef));
@@ -2702,7 +2702,7 @@ mhitm_ad_acid(
Monnam(mdef), hliquid("acid")); Monnam(mdef), hliquid("acid"));
mhm->damage = 0; mhm->damage = 0;
} else if (gv.vis && canseemon(mdef)) { } else if (gv.vis && canseemon(mdef)) {
pline("%s is covered in %s!", Monnam(mdef), hliquid("acid")); pline_mon(mdef, "%s is covered in %s!", Monnam(mdef), hliquid("acid"));
pline("It burns %s!", mon_nam(mdef)); pline("It burns %s!", mon_nam(mdef));
} }
if (!rn2(30)) if (!rn2(30))
@@ -2858,7 +2858,7 @@ mhitm_ad_tlpt(
; /* no negation message */ ; /* no negation message */
} else if (mhitm_mgc_atk_negated(magr, mdef, TRUE)) { } else if (mhitm_mgc_atk_negated(magr, mdef, TRUE)) {
if (gv.vis) if (gv.vis)
pline("%s is not affected.", Monnam(mdef)); pline_mon(mdef, "%s is not affected.", Monnam(mdef));
} else { } else {
char mdef_Monnam[BUFSZ]; char mdef_Monnam[BUFSZ];
boolean wasseen = canspotmon(mdef); boolean wasseen = canspotmon(mdef);
@@ -2972,7 +2972,7 @@ mhitm_ad_curs(
if (Blind) { if (Blind) {
You_hear("laughter."); You_hear("laughter.");
} else { } else {
pline("%s chuckles.", Monnam(magr)); pline_mon(magr, "%s chuckles.", Monnam(magr));
} }
} }
if (u.umonnum == PM_CLAY_GOLEM) { if (u.umonnum == PM_CLAY_GOLEM) {
@@ -2996,7 +2996,7 @@ mhitm_ad_curs(
if (gv.vis && canseemon(mdef)) { if (gv.vis && canseemon(mdef)) {
pline("Some writing vanishes from %s head!", pline("Some writing vanishes from %s head!",
s_suffix(mon_nam(mdef))); s_suffix(mon_nam(mdef)));
pline("%s is destroyed!", Monnam(mdef)); pline_mon(mdef, "%s is destroyed!", Monnam(mdef));
} }
mondied(mdef); mondied(mdef);
if (!DEADMONSTER(mdef)) { if (!DEADMONSTER(mdef)) {
@@ -3016,7 +3016,7 @@ mhitm_ad_curs(
if (!gv.vis) if (!gv.vis)
You_hear("laughter."); You_hear("laughter.");
else if (canseemon(magr)) else if (canseemon(magr))
pline("%s chuckles.", Monnam(magr)); pline_mon(magr, "%s chuckles.", Monnam(magr));
} }
} }
} }
@@ -3187,7 +3187,7 @@ mhitm_ad_drin(
if (gn.notonhead || !has_head(pd)) { if (gn.notonhead || !has_head(pd)) {
if (gv.vis && canspotmon(mdef)) if (gv.vis && canspotmon(mdef))
pline("%s doesn't seem harmed.", Monnam(mdef)); pline_mon(mdef, "%s doesn't seem harmed.", Monnam(mdef));
/* Not clear what to do for green slimes */ /* Not clear what to do for green slimes */
mhm->damage = 0; mhm->damage = 0;
/* don't bother with additional DRIN attacks since they wouldn't /* don't bother with additional DRIN attacks since they wouldn't
@@ -3318,10 +3318,11 @@ mhitm_ad_wrap(
mhm->damage = 0; mhm->damage = 0;
if (flags.verbose) { if (flags.verbose) {
if (coil) if (coil)
pline("%s brushes against you.", Monnam(magr)); pline_mon(magr, "%s brushes against you.",
Monnam(magr));
else else
pline("%s brushes against your %s.", Monnam(magr), pline_mon(magr, "%s brushes against your %s.",
body_part(LEG)); Monnam(magr), body_part(LEG));
} }
} }
} else } else
@@ -3591,7 +3592,7 @@ mhitm_ad_slow(
mon_adjust_speed(mdef, -1, (struct obj *) 0); mon_adjust_speed(mdef, -1, (struct obj *) 0);
mdef->mstrategy &= ~STRAT_WAITFORU; mdef->mstrategy &= ~STRAT_WAITFORU;
if (mdef->mspeed != oldspeed && gv.vis && canspotmon(mdef)) if (mdef->mspeed != oldspeed && gv.vis && canspotmon(mdef))
pline("%s slows down.", Monnam(mdef)); pline_mon(mdef, "%s slows down.", Monnam(mdef));
} }
} }
} }
@@ -3628,7 +3629,7 @@ mhitm_ad_conf(
*/ */
if (!magr->mcan && !mdef->mconf && !magr->mspec_used) { if (!magr->mcan && !mdef->mconf && !magr->mspec_used) {
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline("%s looks confused.", Monnam(mdef)); pline_mon(mdef, "%s looks confused.", Monnam(mdef));
mdef->mconf = 1; mdef->mconf = 1;
mdef->mstrategy &= ~STRAT_WAITFORU; mdef->mstrategy &= ~STRAT_WAITFORU;
} }
@@ -3698,7 +3699,8 @@ mhitm_ad_famn(
goto mhitm_famn; goto mhitm_famn;
} else if (mdef == &gy.youmonst) { } else if (mdef == &gy.youmonst) {
/* mhitu */ /* mhitu */
pline("%s reaches out, and your body shrivels.", Monnam(magr)); pline_mon(magr, "%s reaches out, and your body shrivels.",
Monnam(magr));
exercise(A_CON, FALSE); exercise(A_CON, FALSE);
if (!is_fainted()) if (!is_fainted())
morehungry(rn1(40, 40)); morehungry(rn1(40, 40));
@@ -3728,7 +3730,8 @@ mhitm_ad_pest(
goto mhitm_pest; goto mhitm_pest;
} else if (mdef == &gy.youmonst) { } else if (mdef == &gy.youmonst) {
/* mhitu */ /* mhitu */
pline("%s reaches out, and you feel fever and chills.", Monnam(magr)); pline_mon(magr, "%s reaches out, and you feel fever and chills.",
Monnam(magr));
(void) diseasemu(pa); (void) diseasemu(pa);
/* plus the normal damage */ /* plus the normal damage */
} else { } else {
@@ -3756,7 +3759,7 @@ mhitm_ad_deth(
goto mhitm_deth; goto mhitm_deth;
} else if (mdef == &gy.youmonst) { } else if (mdef == &gy.youmonst) {
/* mhitu */ /* mhitu */
pline("%s reaches out with its deadly touch.", Monnam(magr)); pline_mon(magr, "%s reaches out with its deadly touch.", Monnam(magr));
if (is_undead(pd)) { if (is_undead(pd)) {
/* still does some damage */ /* still does some damage */
mhm->damage = (mhm->damage + 1) / 2; mhm->damage = (mhm->damage + 1) / 2;
@@ -3819,7 +3822,7 @@ mhitm_ad_halu(
/* mhitm */ /* mhitm */
if (!magr->mcan && haseyes(pd) && mdef->mcansee) { if (!magr->mcan && haseyes(pd) && mdef->mcansee) {
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline("%s looks %sconfused.", Monnam(mdef), pline_mon(mdef, "%s looks %sconfused.", Monnam(mdef),
mdef->mconf ? "more " : ""); mdef->mconf ? "more " : "");
mdef->mconf = 1; mdef->mconf = 1;
mdef->mstrategy &= ~STRAT_WAITFORU; mdef->mstrategy &= ~STRAT_WAITFORU;
@@ -3867,7 +3870,7 @@ do_stone_mon(
} }
if (!resists_ston(mdef)) { if (!resists_ston(mdef)) {
if (gv.vis && canseemon(mdef)) if (gv.vis && canseemon(mdef))
pline("%s turns to stone!", Monnam(mdef)); pline_mon(mdef, "%s turns to stone!", Monnam(mdef));
monstone(mdef); monstone(mdef);
post_stone: post_stone:
if (!DEADMONSTER(mdef)) { if (!DEADMONSTER(mdef)) {
@@ -3935,7 +3938,7 @@ mhitm_ad_phys(
mhm->hitflags |= M_ATTK_MISS; mhm->hitflags |= M_ATTK_MISS;
} else { } else {
set_ustuck(magr); set_ustuck(magr);
pline("%s grabs you!", Monnam(magr)); pline_mon(magr, "%s grabs you!", Monnam(magr));
mhm->hitflags |= M_ATTK_HIT; mhm->hitflags |= M_ATTK_HIT;
} }
} else if (u.ustuck == magr) { } else if (u.ustuck == magr) {
@@ -3953,8 +3956,9 @@ mhitm_ad_phys(
if (otmp->otyp == CORPSE if (otmp->otyp == CORPSE
&& touch_petrifies(&mons[otmp->corpsenm])) { && touch_petrifies(&mons[otmp->corpsenm])) {
mhm->damage = 1; mhm->damage = 1;
pline("%s hits you with the %s corpse.", Monnam(magr), pline_mon(magr, "%s hits you with the %s corpse.",
mons[otmp->corpsenm].pmnames[NEUTRAL]); Monnam(magr),
mons[otmp->corpsenm].pmnames[NEUTRAL]);
if (!Stoned) { if (!Stoned) {
if (do_stone_u(magr)) { if (do_stone_u(magr)) {
mhm->hitflags = M_ATTK_HIT; mhm->hitflags = M_ATTK_HIT;
@@ -4051,7 +4055,7 @@ mhitm_ad_phys(
if (!artifact_hit(magr, mdef, mwep, &mhm->damage, if (!artifact_hit(magr, mdef, mwep, &mhm->damage,
mhm->dieroll)) { mhm->dieroll)) {
if (gv.vis) if (gv.vis)
pline("%s hits %s.", Monnam(magr), pline_mon(magr, "%s hits %s.", Monnam(magr),
mon_nam_too(mdef, magr)); mon_nam_too(mdef, magr));
mhm->hitflags |= M_ATTK_HIT; mhm->hitflags |= M_ATTK_HIT;
} }
@@ -4198,7 +4202,8 @@ mhitm_ad_heal(
&& !uarms && !uarmg && !uarmf && !uarmh) { && !uarms && !uarmg && !uarmf && !uarmh) {
boolean goaway = FALSE; boolean goaway = FALSE;
pline("%s hits! (I hope you don't mind.)", Monnam(magr)); pline_mon(magr, "%s hits! (I hope you don't mind.)",
Monnam(magr));
if (Upolyd) { if (Upolyd) {
u.mh += rnd(7); u.mh += rnd(7);
if (!rn2(7)) { if (!rn2(7)) {
@@ -4291,7 +4296,7 @@ mhitm_ad_stun(
if (magr->mcan) if (magr->mcan)
return; return;
if (canseemon(mdef)) if (canseemon(mdef))
pline("%s %s for a moment.", Monnam(mdef), pline_mon(mdef, "%s %s for a moment.", Monnam(mdef),
makeplural(stagger(pd, "stagger"))); makeplural(stagger(pd, "stagger")));
mdef->mstun = 1; mdef->mstun = 1;
mhitm_ad_phys(magr, mattk, mdef, mhm); mhitm_ad_phys(magr, mattk, mdef, mhm);
@@ -4330,7 +4335,7 @@ mhitm_ad_legs(
pline("%s tries to reach your %s %s!", Monst_name, sidestr, leg); pline("%s tries to reach your %s %s!", Monst_name, sidestr, leg);
mhm->damage = 0; mhm->damage = 0;
} else if (magr->mcan) { } else if (magr->mcan) {
pline("%s nuzzles against your %s %s!", Monnam(magr), pline_mon(magr, "%s nuzzles against your %s %s!", Monnam(magr),
sidestr, leg); sidestr, leg);
mhm->damage = 0; mhm->damage = 0;
} else { } else {
@@ -4389,7 +4394,7 @@ mhitm_ad_dgst(
/* eating a Rider or its corpse is fatal */ /* eating a Rider or its corpse is fatal */
if (is_rider(pd)) { if (is_rider(pd)) {
if (gv.vis && canseemon(magr)) if (gv.vis && canseemon(magr))
pline("%s %s!", Monnam(magr), pline_mon(magr, "%s %s!", Monnam(magr),
(pd == &mons[PM_FAMINE]) (pd == &mons[PM_FAMINE])
? "belches feebly, shrivels up and dies" ? "belches feebly, shrivels up and dies"
: (pd == &mons[PM_PESTILENCE]) : (pd == &mons[PM_PESTILENCE])
@@ -4523,7 +4528,7 @@ mhitm_ad_sedu(
is disabled, it would be changed to another damage is disabled, it would be changed to another damage
type, but when defending, it remains as-is */ type, but when defending, it remains as-is */
|| dmgtype(gy.youmonst.data, AD_SSEX)) { || dmgtype(gy.youmonst.data, AD_SSEX)) {
pline("%s %s.", Monnam(magr), pline_mon(magr, "%s %s.", Monnam(magr),
Deaf ? "says something but you can't hear it" Deaf ? "says something but you can't hear it"
: magr->minvent : magr->minvent
? "brags about the goods some dungeon explorer provided" ? "brags about the goods some dungeon explorer provided"
@@ -4561,8 +4566,9 @@ mhitm_ad_sedu(
(void) rloc(magr, RLOC_MSG); (void) rloc(magr, RLOC_MSG);
if (is_animal(magr->data) && *buf) { if (is_animal(magr->data) && *buf) {
if (canseemon(magr)) if (canseemon(magr))
pline("%s tries to %s away with %s.", Monnam(magr), pline_mon(magr, "%s tries to %s away with %s.",
locomotion(magr->data, "run"), buf); Monnam(magr),
locomotion(magr->data, "run"), buf);
} }
monflee(magr, 0, FALSE, FALSE); monflee(magr, 0, FALSE, FALSE);
mhm->hitflags = M_ATTK_AGR_DONE; /* return 3??? */ mhm->hitflags = M_ATTK_AGR_DONE; /* return 3??? */
@@ -6239,7 +6245,7 @@ flash_hits_mon(
void void
light_hits_gremlin(struct monst *mon, int dmg) light_hits_gremlin(struct monst *mon, int dmg)
{ {
pline("%s %s!", Monnam(mon), pline_mon(mon, "%s %s!", Monnam(mon),
(dmg > mon->mhp / 2) ? "wails in agony" : "cries out in pain"); (dmg > mon->mhp / 2) ? "wails in agony" : "cries out in pain");
mon->mhp -= dmg; mon->mhp -= dmg;
wake_nearto(mon->mx, mon->my, 30); wake_nearto(mon->mx, mon->my, 30);