verb agreement

add and use new APIs, Tobjnam, otense and vtense, is_plural
to determine tense/form of verbs and a few pronouns as well
This commit is contained in:
cohrs
2002-02-09 00:30:33 +00:00
parent 91c5521009
commit aac7f717c2
12 changed files with 91 additions and 96 deletions
+29 -24
View File
@@ -173,7 +173,7 @@ register struct obj *obj;
obj->spe = 0; obj->spe = 0;
if (obj->otyp == OIL_LAMP || obj->otyp == BRASS_LANTERN) if (obj->otyp == OIL_LAMP || obj->otyp == BRASS_LANTERN)
obj->age = 0; obj->age = 0;
Your("%s vibrates briefly.",xname(obj)); Your("%s %s briefly.",xname(obj), otense(obj, "vibrate"));
} else pline(nothing_happens); } else pline(nothing_happens);
} }
} }
@@ -183,7 +183,7 @@ p_glow1(otmp)
register struct obj *otmp; register struct obj *otmp;
{ {
Your("%s %s briefly.", xname(otmp), Your("%s %s briefly.", xname(otmp),
Blind ? "vibrates" : "glows"); otense(otmp, Blind ? "vibrate" : "glow"));
} }
static void static void
@@ -191,10 +191,11 @@ p_glow2(otmp,color)
register struct obj *otmp; register struct obj *otmp;
register const char *color; register const char *color;
{ {
Your("%s %s%s for a moment.", Your("%s %s%s%s for a moment.",
xname(otmp), xname(otmp),
Blind ? "vibrates" : "glows ", otense(otmp, Blind ? "vibrate" : "glow"),
Blind ? (const char *)"" : hcolor(color)); Blind ? "" : " ",
Blind ? nul : hcolor(color));
} }
/* Is the object chargeable? For purposes of inventory display; it is */ /* Is the object chargeable? For purposes of inventory display; it is */
@@ -285,8 +286,8 @@ int curse_bless;
/* destruction depends on current state, not adjustment */ /* destruction depends on current state, not adjustment */
if (obj->spe > rn2(7) || obj->spe <= -5) { if (obj->spe > rn2(7) || obj->spe <= -5) {
Your("%s pulsates momentarily, then explodes!", Your("%s %s momentarily, then %s!",
xname(obj)); xname(obj), otense(obj,"pulsate"), otense(obj,"explode"));
if (is_on) Ring_gone(obj); if (is_on) Ring_gone(obj);
s = rnd(3 * abs(obj->spe)); /* amount of damage */ s = rnd(3 * abs(obj->spe)); /* amount of damage */
useup(obj); useup(obj);
@@ -365,7 +366,7 @@ int curse_bless;
stripspe(obj); stripspe(obj);
if (obj->lamplit) { if (obj->lamplit) {
if (!Blind) if (!Blind)
pline("%s goes out!", The(xname(obj))); pline("%s out!", Tobjnam(obj, "go"));
end_burn(obj, TRUE); end_burn(obj, TRUE);
} }
} else if (is_blessed) { } else if (is_blessed) {
@@ -694,26 +695,28 @@ register struct obj *sobj;
otmp->oerodeproof = !(sobj->cursed); otmp->oerodeproof = !(sobj->cursed);
if(Blind) { if(Blind) {
otmp->rknown = FALSE; otmp->rknown = FALSE;
Your("%s feels warm for a moment.", Your("%s %s warm for a moment.",
xname(otmp)); xname(otmp), otense(otmp, "feel"));
} else { } else {
otmp->rknown = TRUE; otmp->rknown = TRUE;
Your("%s is covered by a %s %s %s!", Your("%s %s covered by a %s %s %s!",
xname(otmp), xname(otmp), otense(otmp, "are"),
sobj->cursed ? "mottled" : "shimmering", sobj->cursed ? "mottled" : "shimmering",
hcolor(sobj->cursed ? Black : golden), hcolor(sobj->cursed ? Black : golden),
sobj->cursed ? "glow" : sobj->cursed ? "glow" :
(is_shield(otmp) ? "layer" : "shield")); (is_shield(otmp) ? "layer" : "shield"));
} }
if (otmp->oerodeproof && (otmp->oeroded || otmp->oeroded2)) { if (otmp->oerodeproof &&
(otmp->oeroded || otmp->oeroded2)) {
otmp->oeroded = otmp->oeroded2 = 0; otmp->oeroded = otmp->oeroded2 = 0;
Your("%s %s as good as new!", Your("%s %s as good as new!",
xname(otmp), Blind ? "feels" : "looks"); xname(otmp),
otense(otmp, Blind ? "feel" : "look"));
} }
break; break;
} }
special_armor = is_elven_armor(otmp) || special_armor = is_elven_armor(otmp) ||
(Role_if(PM_WIZARD) && otmp->otyp == CORNUTHAUM); (Role_if(PM_WIZARD) && otmp->otyp == CORNUTHAUM);
if (sobj->cursed) if (sobj->cursed)
same_color = same_color =
(otmp->otyp == BLACK_DRAGON_SCALE_MAIL || (otmp->otyp == BLACK_DRAGON_SCALE_MAIL ||
@@ -728,11 +731,13 @@ register struct obj *sobj;
/* KMH -- catch underflow */ /* KMH -- catch underflow */
s = sobj->cursed ? -otmp->spe : otmp->spe; s = sobj->cursed ? -otmp->spe : otmp->spe;
if (s > (special_armor ? 5 : 3) && rn2(s)) { if (s > (special_armor ? 5 : 3) && rn2(s)) {
Your("%s violently %s%s%s for a while, then evaporates.", Your("%s violently %s%s%s for a while, then %s.",
xname(otmp), xname(otmp),
Blind ? "vibrates" : "glows", otense(otmp, Blind ? "vibrate" : "glow"),
(!Blind && !same_color) ? " " : nul, (!Blind && !same_color) ? " " : nul,
(Blind || same_color) ? nul : hcolor(sobj->cursed ? Black : silver)); (Blind || same_color) ? nul :
hcolor(sobj->cursed ? Black : silver),
otense(otmp, "evaporate"));
if(is_cloak(otmp)) (void) Cloak_off(); if(is_cloak(otmp)) (void) Cloak_off();
if(is_boots(otmp)) (void) Boots_off(); if(is_boots(otmp)) (void) Boots_off();
if(is_helmet(otmp)) (void) Helmet_off(); if(is_helmet(otmp)) (void) Helmet_off();
@@ -765,7 +770,7 @@ register struct obj *sobj;
Your("%s %s%s%s%s for a %s.", Your("%s %s%s%s%s for a %s.",
xname(otmp), xname(otmp),
s == 0 ? "violently " : nul, s == 0 ? "violently " : nul,
Blind ? "vibrates" : "glows", otense(otmp, Blind ? "vibrate" : "glow"),
(!Blind && !same_color) ? " " : nul, (!Blind && !same_color) ? " " : nul,
(Blind || same_color) ? nul : hcolor(sobj->cursed ? Black : silver), (Blind || same_color) ? nul : hcolor(sobj->cursed ? Black : silver),
(s*s>1) ? "while" : "moment"); (s*s>1) ? "while" : "moment");
@@ -780,8 +785,8 @@ register struct obj *sobj;
if ((otmp->spe > (special_armor ? 5 : 3)) && if ((otmp->spe > (special_armor ? 5 : 3)) &&
(special_armor || !rn2(7))) (special_armor || !rn2(7)))
Your("%s suddenly vibrates %s.", Your("%s suddenly %s %s.",
xname(otmp), xname(otmp), otense(otmp, "vibrate"),
Blind ? "again" : "unexpectedly"); Blind ? "again" : "unexpectedly");
break; break;
} }
@@ -808,7 +813,7 @@ register struct obj *sobj;
} else } else
known = TRUE; known = TRUE;
} else { /* armor and scroll both cursed */ } else { /* armor and scroll both cursed */
Your("%s vibrates.", xname(otmp)); Your("%s %s.", xname(otmp), otense(otmp, "vibrate"));
if (otmp->spe >= -6) otmp->spe--; if (otmp->spe >= -6) otmp->spe--;
make_stunned(HStun + rn1(10, 10), TRUE); make_stunned(HStun + rn1(10, 10), TRUE);
} }
+1 -1
View File
@@ -335,7 +335,7 @@ rndcurse() /* curse a few inventory items at random! */
if(otmp->oartifact && spec_ability(otmp, SPFX_INTEL) && if(otmp->oartifact && spec_ability(otmp, SPFX_INTEL) &&
rn2(10) < 8) { rn2(10) < 8) {
pline("%s resists!", The(xname(otmp))); pline("%s!", Tobjnam(otmp, "resist"));
continue; continue;
} }
+3 -3
View File
@@ -322,7 +322,7 @@ register struct monst *mtmp;
else else
growl_verb = growl_sound(mtmp); growl_verb = growl_sound(mtmp);
if (growl_verb) { if (growl_verb) {
pline("%s %s!", Monnam(mtmp), makeplural(growl_verb)); pline("%s %s!", Monnam(mtmp), vtense((char *)0, growl_verb));
if(flags.run) nomul(0); if(flags.run) nomul(0);
wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 18); wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 18);
} }
@@ -363,7 +363,7 @@ register struct monst *mtmp;
break; break;
} }
if (yelp_verb) { if (yelp_verb) {
pline("%s %ss!", Monnam(mtmp), yelp_verb); pline("%s %s!", Monnam(mtmp), vtense((char *)0, yelp_verb));
if(flags.run) nomul(0); if(flags.run) nomul(0);
wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 12); wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 12);
} }
@@ -395,7 +395,7 @@ register struct monst *mtmp;
break; break;
} }
if (whimper_verb) { if (whimper_verb) {
pline("%s %ss.", Monnam(mtmp), whimper_verb); pline("%s %s.", Monnam(mtmp), vtense((char *)0, whimper_verb));
if(flags.run) nomul(0); if(flags.run) nomul(0);
wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 6); wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 6);
} }
+1 -1
View File
@@ -132,7 +132,7 @@ cursed_book(lev)
Your("gloves seem unaffected."); Your("gloves seem unaffected.");
} else if (uarmg->oeroded2 < MAX_ERODE) { } else if (uarmg->oeroded2 < MAX_ERODE) {
if (uarmg->greased) { if (uarmg->greased) {
grease_protect(uarmg, "gloves", TRUE, &youmonst); grease_protect(uarmg, "gloves", &youmonst);
} else { } else {
Your("gloves corrode%s!", Your("gloves corrode%s!",
uarmg->oeroded2+1 == MAX_ERODE ? uarmg->oeroded2+1 == MAX_ERODE ?
+1 -2
View File
@@ -433,8 +433,7 @@ register struct obj *otmp;
attacktype(mtmp->data, AT_ENGL)) { attacktype(mtmp->data, AT_ENGL)) {
/* this is probably a burning object that you dropped or threw */ /* this is probably a burning object that you dropped or threw */
if (u.uswallow && mtmp == u.ustuck && !Blind) if (u.uswallow && mtmp == u.ustuck && !Blind)
pline("%s go%s out.", The(xname(otmp)), pline("%s out.", Tobjnam(otmp, "go"));
otmp->quan == 1L ? "es" : "");
snuff_otmp = TRUE; snuff_otmp = TRUE;
} }
/* Must do carrying effects on object prior to add_to_minv() */ /* Must do carrying effects on object prior to add_to_minv() */
+23 -28
View File
@@ -120,7 +120,6 @@ struct monst *victim;
static NEARDATA const char *action[] = { "smoulder", "rust", "rot", "corrode" }; static NEARDATA const char *action[] = { "smoulder", "rust", "rot", "corrode" };
static NEARDATA const char *msg[] = { "burnt", "rusted", "rotten", "corroded" }; static NEARDATA const char *msg[] = { "burnt", "rusted", "rotten", "corroded" };
boolean vulnerable = FALSE; boolean vulnerable = FALSE;
boolean plural;
boolean grprot = FALSE; boolean grprot = FALSE;
boolean is_primary = TRUE; boolean is_primary = TRUE;
boolean vismon = (victim != &youmonst) && canseemon(victim); boolean vismon = (victim != &youmonst) && canseemon(victim);
@@ -146,40 +145,37 @@ struct monst *victim;
if (!print && (!vulnerable || otmp->oerodeproof || erosion == MAX_ERODE)) if (!print && (!vulnerable || otmp->oerodeproof || erosion == MAX_ERODE))
return FALSE; return FALSE;
plural = (is_gloves(otmp) || is_boots(otmp)) &&
!strstri(ostr, "pair of "); /* "pair of *s" is singular */
if (!vulnerable) { if (!vulnerable) {
if (flags.verbose) { if (flags.verbose) {
if (victim == &youmonst) if (victim == &youmonst)
Your("%s %s not affected.", ostr, plural ? "are" : "is"); Your("%s %s not affected.", ostr, vtense(ostr, "are"));
else if (vismon) else if (vismon)
pline("%s's %s %s not affected.", Monnam(victim), ostr, pline("%s's %s %s not affected.", Monnam(victim), ostr,
plural ? "are" : "is"); vtense(ostr, "are"));
} }
} else if (erosion < MAX_ERODE) { } else if (erosion < MAX_ERODE) {
if (grprot && otmp->greased) { if (grprot && otmp->greased) {
grease_protect(otmp,ostr,plural,victim); grease_protect(otmp,ostr,victim);
} else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) { } else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) {
if (flags.verbose) { if (flags.verbose) {
if (victim == &youmonst) if (victim == &youmonst)
pline("Somehow, your %s %s not affected.", pline("Somehow, your %s %s not affected.",
ostr, plural ? "are" : "is"); ostr, vtense(ostr, "are"));
else if (vismon) else if (vismon)
pline("Somehow, %s's %s %s not affected.", pline("Somehow, %s's %s %s not affected.",
mon_nam(victim), ostr, plural ? "are" : "is"); mon_nam(victim), ostr, vtense(ostr, "are"));
} }
} else { } else {
if (victim == &youmonst) if (victim == &youmonst)
Your("%s %s%s%s!", ostr, action[type], Your("%s %s%s!", ostr,
plural ? "" : "s", vtense(ostr, action[type]),
erosion+1 == MAX_ERODE ? " completely" : erosion+1 == MAX_ERODE ? " completely" :
erosion ? " further" : ""); erosion ? " further" : "");
else if (vismon) else if (vismon)
pline("%s's %s %s%s%s!", Monnam(victim), ostr, action[type], pline("%s's %s %s%s!", Monnam(victim), ostr,
plural ? "" : "s", vtense(ostr, action[type]),
erosion+1 == MAX_ERODE ? " completely" : erosion+1 == MAX_ERODE ? " completely" :
erosion ? " further" : ""); erosion ? " further" : "");
if (is_primary) if (is_primary)
otmp->oeroded++; otmp->oeroded++;
else else
@@ -189,23 +185,22 @@ struct monst *victim;
} else { } else {
if (flags.verbose) { if (flags.verbose) {
if (victim == &youmonst) if (victim == &youmonst)
Your("%s %s%s completely %s.", ostr, Your("%s %s completely %s.", ostr,
Blind ? "feel" : "look", vtense(ostr, Blind ? "feel" : "look"),
plural ? "" : "s", msg[type]); msg[type]);
else if (vismon) else if (vismon)
pline("%s's %s look%s completely %s.", pline("%s's %s %s completely %s.",
Monnam(victim), ostr, Monnam(victim), ostr,
plural ? "" : "s", msg[type]); vtense(ostr, "look"), msg[type]);
} }
} }
return(TRUE); return(TRUE);
} }
void void
grease_protect(otmp,ostr,plu,victim) grease_protect(otmp,ostr,victim)
register struct obj *otmp; register struct obj *otmp;
register const char *ostr; register const char *ostr;
register boolean plu;
struct monst *victim; struct monst *victim;
{ {
static const char txt[] = "protected by the layer of grease!"; static const char txt[] = "protected by the layer of grease!";
@@ -213,10 +208,10 @@ struct monst *victim;
if (ostr) { if (ostr) {
if (victim == &youmonst) if (victim == &youmonst)
Your("%s %s %s",ostr,plu ? "are" : "is", txt); Your("%s %s %s", ostr, vtense(ostr, "are"), txt);
else if (vismon) else if (vismon)
pline("%s's %s %s %s", Monnam(victim), pline("%s's %s %s %s", Monnam(victim),
ostr, plu ? "are" : "is", txt); ostr, vtense(ostr, "are"), txt);
} else { } else {
if (victim == &youmonst) if (victim == &youmonst)
Your("%s %s",aobjnam(otmp,"are"), txt); Your("%s %s",aobjnam(otmp,"are"), txt);
@@ -2375,7 +2370,7 @@ xchar x, y;
} else if (is_flammable(obj) && obj->oeroded < MAX_ERODE && } else if (is_flammable(obj) && obj->oeroded < MAX_ERODE &&
!(obj->oerodeproof || (obj->blessed && !rnl(4)))) { !(obj->oerodeproof || (obj->blessed && !rnl(4)))) {
if (in_sight) { if (in_sight) {
pline("%s burn%s%s.", Yname2(obj), obj->quan > 1 ? "": "s", pline("%s %s%s.", Yname2(obj), otense(obj, "burn"),
obj->oeroded+1 == MAX_ERODE ? " completely" : obj->oeroded+1 == MAX_ERODE ? " completely" :
obj->oeroded ? " further" : ""); obj->oeroded ? " further" : "");
} }
@@ -3292,7 +3287,7 @@ boolean disarm;
insider = (*u.ushops && inside_shop(u.ux, u.uy) && insider = (*u.ushops && inside_shop(u.ux, u.uy) &&
*in_rooms(ox, oy, SHOPBASE) == *u.ushops); *in_rooms(ox, oy, SHOPBASE) == *u.ushops);
pline("%s explodes!", The(xname(obj))); pline("%s!", Tobjnam(obj, "explode"));
Sprintf(buf, "exploding %s", xname(obj)); Sprintf(buf, "exploding %s", xname(obj));
if(costly) if(costly)
+4 -4
View File
@@ -588,9 +588,9 @@ int thrown;
setmnotwielded(mon,monwep); setmnotwielded(mon,monwep);
MON_NOWEP(mon); MON_NOWEP(mon);
mon->weapon_check = NEED_WEAPON; mon->weapon_check = NEED_WEAPON;
pline("%s %s shatter%s from the force of your blow!", pline("%s %s %s from the force of your blow!",
s_suffix(Monnam(mon)), xname(monwep), s_suffix(Monnam(mon)), xname(monwep),
(monwep->quan) == 1L ? "s" : ""); otense(monwep, "shatter"));
m_useup(mon, monwep); m_useup(mon, monwep);
/* If someone just shattered MY weapon, I'd flee! */ /* If someone just shattered MY weapon, I'd flee! */
if (rn2(4)) { if (rn2(4)) {
@@ -868,8 +868,8 @@ int thrown;
} }
if (obj && !rn2(nopoison)) { if (obj && !rn2(nopoison)) {
obj->opoisoned = FALSE; obj->opoisoned = FALSE;
Your("%s%s no longer poisoned.", xname(obj), Your("%s %s no longer poisoned.", xname(obj),
(obj->quan == 1L) ? " is" : "s are"); /**FIXME**/ otense(obj, "are"));
} }
if (resists_poison(mon)) if (resists_poison(mon))
needpoismsg = TRUE; needpoismsg = TRUE;
+7 -7
View File
@@ -622,7 +622,7 @@ register struct monst *mon;
if (bimanual(mw_tmp)) mon_hand = makeplural(mon_hand); if (bimanual(mw_tmp)) mon_hand = makeplural(mon_hand);
Sprintf(welded_buf, "%s welded to %s %s", Sprintf(welded_buf, "%s welded to %s %s",
(mw_tmp->quan == 1L) ? "is" : "are", otense(mw_tmp, "are"),
mhis(mon), mon_hand); mhis(mon), mon_hand);
if (obj->otyp == PICK_AXE) { if (obj->otyp == PICK_AXE) {
@@ -651,8 +651,7 @@ register struct monst *mon;
if (obj->cursed && obj->otyp != CORPSE) { if (obj->cursed && obj->otyp != CORPSE) {
pline("%s %s to %s %s!", pline("%s %s to %s %s!",
The(xname(obj)), The(xname(obj)),
(obj->quan == 1L) ? "welds itself" is_plural(obj) ? "welds itself" : "weld themselves",
: "weld themselves",
s_suffix(mon_nam(mon)), mbodypart(mon,HAND)); s_suffix(mon_nam(mon)), mbodypart(mon,HAND));
obj->bknown = 1; obj->bknown = 1;
} }
@@ -660,8 +659,8 @@ register struct monst *mon;
if (artifact_light(obj) && !obj->lamplit) { if (artifact_light(obj) && !obj->lamplit) {
begin_burn(obj, FALSE); begin_burn(obj, FALSE);
if (canseemon(mon)) if (canseemon(mon))
pline("%s glows brilliantly in %s %s!", pline("%s brilliantly in %s %s!",
The(xname(obj)), Tobjnam(obj, "glow"),
s_suffix(mon_nam(mon)), mbodypart(mon,HAND)); s_suffix(mon_nam(mon)), mbodypart(mon,HAND));
} }
obj->owornmask = W_WEP; obj->owornmask = W_WEP;
@@ -1215,8 +1214,9 @@ register struct obj *obj;
if (artifact_light(obj) && obj->lamplit) { if (artifact_light(obj) && obj->lamplit) {
end_burn(obj, FALSE); end_burn(obj, FALSE);
if (canseemon(mon)) if (canseemon(mon))
pline("%s in %s %s stops glowing.", The(xname(obj)), pline("%s in %s %s %s glowing.", The(xname(obj)),
s_suffix(mon_nam(mon)), mbodypart(mon,HAND)); s_suffix(mon_nam(mon)), mbodypart(mon,HAND),
otense(obj, "stop"));
} }
obj->owornmask &= ~W_WEP; obj->owornmask &= ~W_WEP;
} }
+11 -11
View File
@@ -101,7 +101,7 @@ register struct obj *obj;
setworn(obj, W_WEP); setworn(obj, W_WEP);
if (uwep == obj && artifact_light(olduwep) && olduwep->lamplit) { if (uwep == obj && artifact_light(olduwep) && olduwep->lamplit) {
end_burn(olduwep, FALSE); end_burn(olduwep, FALSE);
if (!Blind) pline("%s stops glowing.", The(xname(olduwep))); if (!Blind) pline("%s glowing.", Tobjnam(olduwep, "stop"));
} }
/* Note: Explicitly wielding a pick-axe will not give a "bashing" /* Note: Explicitly wielding a pick-axe will not give a "bashing"
* message. Wielding one via 'a'pplying it will. * message. Wielding one via 'a'pplying it will.
@@ -184,7 +184,7 @@ struct obj *wep;
if (artifact_light(wep) && !wep->lamplit) { if (artifact_light(wep) && !wep->lamplit) {
begin_burn(wep, FALSE); begin_burn(wep, FALSE);
if (!Blind) if (!Blind)
pline("%s begins to glow brilliantly!", The(xname(wep))); pline("%s to glow brilliantly!", Tobjnam(wep, "begin"));
} }
#if 0 #if 0
@@ -369,7 +369,7 @@ dowieldquiver()
} else if (newquiver == uwep) { } else if (newquiver == uwep) {
/* Prevent accidentally readying the main weapon */ /* Prevent accidentally readying the main weapon */
pline("%s already being used as a weapon!", pline("%s already being used as a weapon!",
(uwep->quan == 1L) ? "That is" : "They are"); !is_plural(uwep) ? "That is" : "They are");
return(0); return(0);
} else if (newquiver->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL } else if (newquiver->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL
#ifdef STEED #ifdef STEED
@@ -415,15 +415,15 @@ can_twoweapon()
else if (NOT_WEAPON(uwep) || NOT_WEAPON(uswapwep)) { else if (NOT_WEAPON(uwep) || NOT_WEAPON(uswapwep)) {
otmp = NOT_WEAPON(uwep) ? uwep : uswapwep; otmp = NOT_WEAPON(uwep) ? uwep : uswapwep;
pline("%s %s.", Yname2(otmp), pline("%s %s.", Yname2(otmp),
(otmp->quan) > 1L ? "aren't weapons" : "isn't a weapon"); is_plural(otmp) ? "aren't weapons" : "isn't a weapon");
} else if (bimanual(uwep) || bimanual(uswapwep)) { } else if (bimanual(uwep) || bimanual(uswapwep)) {
otmp = bimanual(uwep) ? uwep : uswapwep; otmp = bimanual(uwep) ? uwep : uswapwep;
pline("%s isn't one-handed.", Yname2(otmp)); pline("%s isn't one-handed.", Yname2(otmp));
} else if (uarms) } else if (uarms)
You_cant("use two weapons while wearing a shield."); You_cant("use two weapons while wearing a shield.");
else if (uswapwep->oartifact) else if (uswapwep->oartifact)
pline("%s resists being held second to another weapon!", pline("%s %s being held second to another weapon!",
Yname2(uswapwep)); Yname2(uswapwep), otense(uswapwep, "resist"));
else if (!uarmg && !Stone_resistance && (uswapwep->otyp == CORPSE && else if (!uarmg && !Stone_resistance && (uswapwep->otyp == CORPSE &&
touch_petrifies(&mons[uswapwep->corpsenm]))) { touch_petrifies(&mons[uswapwep->corpsenm]))) {
char kbuf[BUFSZ]; char kbuf[BUFSZ];
@@ -481,7 +481,7 @@ uwepgone()
if (uwep) { if (uwep) {
if (artifact_light(uwep) && uwep->lamplit) { if (artifact_light(uwep) && uwep->lamplit) {
end_burn(uwep, FALSE); end_burn(uwep, FALSE);
if (!Blind) pline("%s stops glowing.", The(xname(uwep))); if (!Blind) pline("%s glowing.", Tobjnam(uwep, "stop"));
} }
setworn((struct obj *)0, W_WEP); setworn((struct obj *)0, W_WEP);
unweapon = TRUE; unweapon = TRUE;
@@ -540,7 +540,7 @@ boolean fade_scrolls;
erosion = acid_dmg ? target->oeroded2 : target->oeroded; erosion = acid_dmg ? target->oeroded2 : target->oeroded;
if (target->greased) { if (target->greased) {
grease_protect(target,(char *)0,FALSE,victim); grease_protect(target,(char *)0,victim);
} else if (target->oclass == SCROLL_CLASS) { } else if (target->oclass == SCROLL_CLASS) {
if(fade_scrolls && target->otyp != SCR_BLANK_PAPER if(fade_scrolls && target->otyp != SCR_BLANK_PAPER
#ifdef MAIL #ifdef MAIL
@@ -650,9 +650,9 @@ register int amount;
if(((uwep->spe > 5 && amount >= 0) || (uwep->spe < -5 && amount < 0)) if(((uwep->spe > 5 && amount >= 0) || (uwep->spe < -5 && amount < 0))
&& rn2(3)) { && rn2(3)) {
if (!Blind) if (!Blind)
Your("%s %s for a while and then evaporate%s.", Your("%s %s for a while and then %s.",
aobjnam(uwep, "violently glow"), color, aobjnam(uwep, "violently glow"), color,
uwep->quan == 1L ? "s" : ""); otense(uwep, "evaporate"));
else else
Your("%s.", aobjnam(uwep, "evaporate")); Your("%s.", aobjnam(uwep, "evaporate"));
@@ -709,7 +709,7 @@ register struct obj *obj;
savewornmask = obj->owornmask; savewornmask = obj->owornmask;
Your("%s %s welded to your %s!", Your("%s %s welded to your %s!",
xname(obj), (obj->quan == 1L) ? "is" : "are", xname(obj), otense(obj, "are"),
bimanual(obj) ? (const char *)makeplural(body_part(HAND)) bimanual(obj) ? (const char *)makeplural(body_part(HAND))
: body_part(HAND)); : body_part(HAND));
obj->owornmask = savewornmask; obj->owornmask = savewornmask;
+3 -3
View File
@@ -64,11 +64,11 @@ amulet()
if(ttmp->ttyp == MAGIC_PORTAL) { if(ttmp->ttyp == MAGIC_PORTAL) {
int du = distu(ttmp->tx, ttmp->ty); int du = distu(ttmp->tx, ttmp->ty);
if (du <= 9) if (du <= 9)
pline("%s feels hot!", The(xname(amu))); pline("%s hot!", Tobjnam(amu, "feel"));
else if (du <= 64) else if (du <= 64)
pline("%s feels very warm.", The(xname(amu))); pline("%s very warm.", Tobjnam(amu, "feel"));
else if (du <= 144) else if (du <= 144)
pline("%s feels warm.", The(xname(amu))); pline("%s warm.", Tobjnam(amu, "feel"));
/* else, the amulet feels normal */ /* else, the amulet feels normal */
break; break;
} }
+2 -2
View File
@@ -85,8 +85,8 @@ register struct obj *pen;
return 0; return 0;
} else if (Glib) { } else if (Glib) {
dropx(pen); dropx(pen);
pline("%s slips from your %s.", The(xname(pen)), pline("%s from your %s.",
makeplural(body_part(FINGER))); Tobjnam(pen, "slip"), makeplural(body_part(FINGER)));
return 1; return 1;
} }
+6 -10
View File
@@ -1446,7 +1446,7 @@ struct obj *obj, *otmp;
return 0; return 0;
else { else {
#ifdef DEBUG #ifdef DEBUG
pline("%s pulsates for a moment.", The(xname(obj))); pline("%s for a moment.", Tobjnam(obj, "pulsate"));
#endif #endif
obj->bypass = 0; obj->bypass = 0;
} }
@@ -1499,7 +1499,7 @@ struct obj *obj, *otmp;
obj->dknown = 1; obj->dknown = 1;
if (Has_contents(obj)) { if (Has_contents(obj)) {
if (!obj->cobj) if (!obj->cobj)
pline("%s is empty.", The(xname(obj))); pline("%s empty.", Tobjnam(obj, "are"));
else { else {
struct obj *o; struct obj *o;
/* view contents (not recursively) */ /* view contents (not recursively) */
@@ -1815,7 +1815,7 @@ dozap()
current_wand = 0; current_wand = 0;
} }
if (obj && obj->spe < 0) { if (obj && obj->spe < 0) {
pline("%s turns to dust.", The(xname(obj))); pline("%s to dust.", Tobjnam(obj, "turn"));
useup(obj); useup(obj);
} }
update_inventory(); /* maybe used a charge */ update_inventory(); /* maybe used a charge */
@@ -2515,12 +2515,10 @@ register const char *str;
register struct monst *mtmp; register struct monst *mtmp;
register const char *force; /* usually either "." or "!" */ register const char *force; /* usually either "." or "!" */
{ {
int pl = strcmp(str, makesingular(str));
if((!cansee(bhitpos.x,bhitpos.y) && !canspotmon(mtmp)) if((!cansee(bhitpos.x,bhitpos.y) && !canspotmon(mtmp))
|| !flags.verbose) || !flags.verbose)
pline("%s %s it.", The(str), pl ? "hit" : "hits"); pline("%s %s it.", The(str), vtense(str, "hit"));
else pline("%s %s %s%s", The(str), pl ? "hit" : "hits", else pline("%s %s %s%s", The(str), vtense(str, "hit"),
mon_nam(mtmp), force); mon_nam(mtmp), force);
} }
@@ -2529,9 +2527,7 @@ miss(str,mtmp)
register const char *str; register const char *str;
register struct monst *mtmp; register struct monst *mtmp;
{ {
int pl = strcmp(str, makesingular(str)); pline("%s %s %s.", The(str), vtense(str, "miss"),
pline("%s %s %s.", The(str), pl ? "miss" : "misses",
((cansee(bhitpos.x,bhitpos.y) || canspotmon(mtmp)) ((cansee(bhitpos.x,bhitpos.y) || canspotmon(mtmp))
&& flags.verbose) ? && flags.verbose) ?
mon_nam(mtmp) : "it"); mon_nam(mtmp) : "it");