eye message formatting (trunk only)

Noticed while making the Unaware changes; redo several eye/eyes
messages to use vtense() instead of doing their own verb handling.
This commit is contained in:
nethack.rankin
2006-09-02 04:09:50 +00:00
parent 06e9fa91de
commit 7ba02dda00
4 changed files with 34 additions and 39 deletions
+11 -10
View File
@@ -1595,16 +1595,17 @@ boolean from_invent;
} else if (distu(x,y) <= 2) { } else if (distu(x,y) <= 2) {
if (!breathless(youmonst.data) || haseyes(youmonst.data)) { if (!breathless(youmonst.data) || haseyes(youmonst.data)) {
if (obj->otyp != POT_WATER) { if (obj->otyp != POT_WATER) {
if (!breathless(youmonst.data)) if (!breathless(youmonst.data)) {
/* [what about "familiar odor" when known?] */ /* [what about "familiar odor" when known?] */
You("smell a peculiar odor..."); You("smell a peculiar odor...");
else { } else {
int numeyes = eyecount(youmonst.data); const char *eyes = body_part(EYE);
Your("%s water%s.",
(numeyes == 1) ? body_part(EYE) : if (eyecount(youmonst.data) != 1)
makeplural(body_part(EYE)), eyes = makeplural(eyes);
(numeyes == 1) ? "s" : ""); Your("%s %s.", eyes,
} vtense(eyes, "water"));
}
} }
potionbreathe(obj); potionbreathe(obj);
} }
+5 -5
View File
@@ -391,13 +391,13 @@ struct obj *obj; /* missile (or stack providing it) */
something, something,
body_part(FACE)); body_part(FACE));
} else if(singleobj->otyp == BLINDING_VENOM) { } else if(singleobj->otyp == BLINDING_VENOM) {
int num_eyes = eyecount(youmonst.data); const char *eyes = body_part(EYE);
if (eyecount(youmonst.data) != 1)
eyes = makeplural(eyes);
/* venom in the eyes */ /* venom in the eyes */
if(!Blind) pline_The("venom blinds you."); if(!Blind) pline_The("venom blinds you.");
else Your("%s sting%s.", else Your("%s %s.", eyes, vtense(eyes, "sting"));
(num_eyes == 1) ? body_part(EYE) :
makeplural(body_part(EYE)),
(num_eyes == 1) ? "s" : "");
} }
} }
if (hitu && singleobj->otyp == EGG) { if (hitu && singleobj->otyp == EGG) {
+15 -19
View File
@@ -213,8 +213,7 @@ boolean talk;
{ {
long old = Blinded; long old = Blinded;
boolean u_could_see, can_see_now; boolean u_could_see, can_see_now;
int eyecnt; const char *eyes;
char buf[BUFSZ];
/* we need to probe ahead in case the Eyes of the Overworld /* we need to probe ahead in case the Eyes of the Overworld
are or will be overriding blindness */ are or will be overriding blindness */
@@ -238,10 +237,9 @@ boolean talk;
if (!haseyes(youmonst.data)) { if (!haseyes(youmonst.data)) {
strange_feeling((struct obj *)0, (char *)0); strange_feeling((struct obj *)0, (char *)0);
} else if (Blindfolded) { } else if (Blindfolded) {
Strcpy(buf, body_part(EYE)); eyes = body_part(EYE);
eyecnt = eyecount(youmonst.data); if (eyecount(youmonst.data) != 1) eyes = makeplural(eyes);
Your(eyemsg, (eyecnt == 1) ? buf : makeplural(buf), Your(eyemsg, eyes, vtense(eyes, "itch"));
(eyecnt == 1) ? "itches" : "itch");
} else { /* Eyes of the Overworld */ } else { /* Eyes of the Overworld */
Your(vismsg, "brighten", Your(vismsg, "brighten",
Hallucination ? "sadder" : "normal"); Hallucination ? "sadder" : "normal");
@@ -264,10 +262,9 @@ boolean talk;
if (!haseyes(youmonst.data)) { if (!haseyes(youmonst.data)) {
strange_feeling((struct obj *)0, (char *)0); strange_feeling((struct obj *)0, (char *)0);
} else if (Blindfolded) { } else if (Blindfolded) {
Strcpy(buf, body_part(EYE)); eyes = body_part(EYE);
eyecnt = eyecount(youmonst.data); if (eyecount(youmonst.data) != 1) eyes = makeplural(eyes);
Your(eyemsg, (eyecnt == 1) ? buf : makeplural(buf), Your(eyemsg, eyes, vtense(eyes, "twitch"));
(eyecnt == 1) ? "twitches" : "twitch");
} else { /* Eyes of the Overworld */ } else { /* Eyes of the Overworld */
Your(vismsg, "dim", Your(vismsg, "dim",
Hallucination ? "happier" : "normal"); Hallucination ? "happier" : "normal");
@@ -322,12 +319,10 @@ long mask; /* nonzero if resistance status should change by mask */
if (!haseyes(youmonst.data)) { if (!haseyes(youmonst.data)) {
strange_feeling((struct obj *)0, (char *)0); strange_feeling((struct obj *)0, (char *)0);
} else if (Blind) { } else if (Blind) {
char buf[BUFSZ]; const char *eyes = body_part(EYE);
int eyecnt = eyecount(youmonst.data);
Strcpy(buf, body_part(EYE)); if (eyecount(youmonst.data) != 1) eyes = makeplural(eyes);
Your(eyemsg, (eyecnt == 1) ? buf : makeplural(buf), Your(eyemsg, eyes, vtense(eyes, "itch"));
(eyecnt == 1) ? "itches" : "itch");
} else { /* Grayswandir */ } else { /* Grayswandir */
Your(vismsg, "flatten", "normal"); Your(vismsg, "flatten", "normal");
} }
@@ -1367,10 +1362,11 @@ register struct obj *obj;
if (!breathless(youmonst.data)) if (!breathless(youmonst.data))
pline("Ulch! That potion smells terrible!"); pline("Ulch! That potion smells terrible!");
else if (haseyes(youmonst.data)) { else if (haseyes(youmonst.data)) {
int numeyes = eyecount(youmonst.data); const char *eyes = body_part(EYE);
Your("%s sting%s!",
(numeyes == 1) ? body_part(EYE) : makeplural(body_part(EYE)), if (eyecount(youmonst.data) != 1)
(numeyes == 1) ? "s" : ""); eyes = makeplural(eyes);
Your("%s %s!", eyes, vtense(eyes, "sting"));
} }
break; break;
} else { } else {
+3 -5
View File
@@ -442,12 +442,10 @@ decurse:
break; break;
case TROUBLE_BLIND: case TROUBLE_BLIND:
{ {
int num_eyes = eyecount(youmonst.data); const char *eyes = body_part(EYE);
const char *eye = body_part(EYE);
Your("%s feel%s better.", if (eyecount(youmonst.data) != 1) eyes = makeplural(eyes);
(num_eyes == 1) ? eye : makeplural(eye), Your("%s %s better.", eyes, vtense(eyes, "feel"));
(num_eyes == 1) ? "s" : "");
u.ucreamed = 0; u.ucreamed = 0;
make_blinded(0L,FALSE); make_blinded(0L,FALSE);
break; break;