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:24:49 +00:00
parent cf37a7bac0
commit 91c5521009
17 changed files with 277 additions and 182 deletions
+12 -10
View File
@@ -226,7 +226,7 @@ Cloak_on()
} }
break; break;
case OILSKIN_CLOAK: case OILSKIN_CLOAK:
pline("%s fits very tightly.",The(xname(uarmc))); pline("%s very tightly.", Tobjnam(uarmc, "fit"));
break; break;
/* Alchemy smock gives poison _and_ acid resistance */ /* Alchemy smock gives poison _and_ acid resistance */
case ALCHEMY_SMOCK: case ALCHEMY_SMOCK:
@@ -317,9 +317,11 @@ Helmet_on()
/*FALLTHRU*/ /*FALLTHRU*/
case DUNCE_CAP: case DUNCE_CAP:
if (!uarmh->cursed) { if (!uarmh->cursed) {
pline("%s %s%s for a moment.", The(xname(uarmh)), if (Blind)
Blind ? "vibrates" : "glows ", pline("%s for a moment.", Tobjnam(uarmh, "vibrate"));
Blind ? (const char *)"" : hcolor(Black)); else
pline("%s %s for a moment.",
Tobjnam(uarmh, "glow"), hcolor(Black));
curse(uarmh); curse(uarmh);
} }
flags.botl = 1; /* reveal new alignment or INT & WIS */ flags.botl = 1; /* reveal new alignment or INT & WIS */
@@ -435,9 +437,9 @@ Gloves_off()
touch_petrifies(&mons[uwep->corpsenm])) { touch_petrifies(&mons[uwep->corpsenm])) {
char kbuf[BUFSZ]; char kbuf[BUFSZ];
You("wield the %s corpse in your bare %s.", You("wield the %s in your bare %s.",
mons[uwep->corpsenm].mname, makeplural(body_part(HAND))); corpse_xname(uwep, TRUE), makeplural(body_part(HAND)));
Sprintf(kbuf, "%s corpse", an(mons[uwep->corpsenm].mname)); Strcpy(kbuf, an(corpse_xname(uwep, TRUE)));
instapetrify(kbuf); instapetrify(kbuf);
uwepgone(); /* life-saved still doesn't allow touching cockatrice */ uwepgone(); /* life-saved still doesn't allow touching cockatrice */
} }
@@ -447,10 +449,10 @@ Gloves_off()
touch_petrifies(&mons[uswapwep->corpsenm])) { touch_petrifies(&mons[uswapwep->corpsenm])) {
char kbuf[BUFSZ]; char kbuf[BUFSZ];
You("wield the %s corpse in your bare %s.", You("wield the %s in your bare %s.",
mons[uswapwep->corpsenm].mname, body_part(HAND)); corpse_xname(uswapwep, TRUE), body_part(HAND));
Sprintf(kbuf, "%s corpse", an(mons[uswapwep->corpsenm].mname)); Strcpy(kbuf, an(corpse_xname(uswapwep, TRUE)));
instapetrify(kbuf); instapetrify(kbuf);
uswapwepgone(); /* lifesaved still doesn't allow touching cockatrice */ uswapwepgone(); /* lifesaved still doesn't allow touching cockatrice */
} }
+1 -1
View File
@@ -721,7 +721,7 @@ register struct obj *obj;
Monnam(mtmp), the(xname(obj)), Monnam(mtmp), the(xname(obj)),
!big_corpse ? "." : ", or vice versa!"); !big_corpse ? "." : ", or vice versa!");
} else if (cansee(mtmp->mx,mtmp->my)) } else if (cansee(mtmp->mx,mtmp->my))
pline("%s stops.", The(xname(obj))); pline("%s.", Tobjnam(obj, "stop"));
/* dog_eat expects a floor object */ /* dog_eat expects a floor object */
place_object(obj, mtmp->mx, mtmp->my); place_object(obj, mtmp->mx, mtmp->my);
(void) dog_eat(mtmp, obj, mtmp->mx, mtmp->my, FALSE); (void) dog_eat(mtmp, obj, mtmp->mx, mtmp->my, FALSE);
+23 -24
View File
@@ -370,16 +370,16 @@ xchar x, y;
if(kickobj->otyp == CORPSE && touch_petrifies(&mons[kickobj->corpsenm]) if(kickobj->otyp == CORPSE && touch_petrifies(&mons[kickobj->corpsenm])
&& !Stone_resistance && !uarmf) { && !Stone_resistance && !uarmf) {
char kbuf[BUFSZ]; char kbuf[BUFSZ];
You("kick the %s corpse with your bare %s.", You("kick the %s with your bare %s.",
mons[kickobj->corpsenm].mname, makeplural(body_part(FOOT))); corpse_xname(kickobj, TRUE), makeplural(body_part(FOOT)));
if (!(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) { if (!(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) {
You("turn to stone..."); You("turn to stone...");
killer_format = KILLED_BY; killer_format = KILLED_BY;
/* KMH -- otmp should be kickobj */ /* KMH -- otmp should be kickobj */
Sprintf(kbuf, "kicking a %s corpse without boots", Sprintf(kbuf, "kicking %s without boots",
mons[kickobj->corpsenm].mname); an(corpse_xname(kickobj, TRUE)));
killer = kbuf; killer = kbuf;
done(STONING); done(STONING);
} }
@@ -451,7 +451,8 @@ xchar x, y;
} }
if(costly && loss) { if(costly && loss) {
if(!insider) { if(!insider) {
You("caused %ld %s worth of damage!", loss, currency(loss)); You("caused %ld %s worth of damage!",
loss, currency(loss));
make_angry_shk(shkp, x, y); make_angry_shk(shkp, x, y);
} else { } else {
You("owe %s %ld %s for objects destroyed.", You("owe %s %ld %s for objects destroyed.",
@@ -486,15 +487,15 @@ xchar x, y;
|| IS_ROCK(levl[u.ux][u.uy].typ) || IS_ROCK(levl[u.ux][u.uy].typ)
|| closed_door(u.ux, u.uy)) { || closed_door(u.ux, u.uy)) {
if (Blind) pline("It doesn't come loose."); if (Blind) pline("It doesn't come loose.");
else pline("%s do%sn't come loose.", else pline("%s %sn't come loose.",
The(distant_name(kickobj, xname)), The(distant_name(kickobj, xname)),
(kickobj->quan == 1L) ? "es" : ""); otense(kickobj, "do"));
return(!rn2(3) || martial()); return(!rn2(3) || martial());
} }
if (Blind) pline("It comes loose."); if (Blind) pline("It comes loose.");
else pline("%s come%s loose.", else pline("%s %s loose.",
The(distant_name(kickobj, xname)), The(distant_name(kickobj, xname)),
(kickobj->quan == 1L) ? "s" : ""); otense(kickobj, "come"));
obj_extract_self(kickobj); obj_extract_self(kickobj);
newsym(x, y); newsym(x, y);
if (costly && (!costly_spot(u.ux, u.uy) if (costly && (!costly_spot(u.ux, u.uy)
@@ -522,9 +523,8 @@ xchar x, y;
if (kickobj->quan > 1L && !isgold) kickobj = splitobj(kickobj, 1L); if (kickobj->quan > 1L && !isgold) kickobj = splitobj(kickobj, 1L);
if (slide && !Blind) if (slide && !Blind)
pline("Whee! %s slide%s across the %s.", Doname2(kickobj), pline("Whee! %s %s across the %s.", Doname2(kickobj),
kickobj->quan > 1L ? "" : "s", otense(kickobj, "slide"), surface(x,y));
surface(x,y));
obj_extract_self(kickobj); obj_extract_self(kickobj);
(void) snuff_candle(kickobj); (void) snuff_candle(kickobj);
@@ -861,10 +861,10 @@ dokick()
if (!rn2(2) && !(maploc->looted & TREE_LOOTED) && if (!rn2(2) && !(maploc->looted & TREE_LOOTED) &&
(treefruit = rnd_treefruit_at(x, y))) { (treefruit = rnd_treefruit_at(x, y))) {
treefruit->quan = (long)(8 - rnl(8)); treefruit->quan = (long)(8 - rnl(8));
if (treefruit->quan > 1L) if (is_plural(treefruit))
pline("Some %s fall from the tree!", xname(treefruit)); pline("Some %s fall from the tree!", xname(treefruit));
else else
pline("%s falls from the tree!", An(xname(treefruit))); pline("%s falls from the tree!", An(xname(treefruit)));
scatter(x,y,2,MAY_HIT,treefruit); scatter(x,y,2,MAY_HIT,treefruit);
exercise(A_DEX, TRUE); exercise(A_DEX, TRUE);
exercise(A_WIS, TRUE); /* discovered a new food source! */ exercise(A_WIS, TRUE); /* discovered a new food source! */
@@ -1385,19 +1385,18 @@ long num;
xname(otmp)); xname(otmp));
if(num) { /* means: other objects are impacted */ if(num) { /* means: other objects are impacted */
Sprintf(eos(obuf), " hit%s %s object%s", Sprintf(eos(obuf), " %s %s object%s",
otmp->quan == 1L ? "s" : "", otense(otmp, "hit"),
num == 1L ? "another" : "other", num == 1L ? "another" : "other",
num > 1L ? "s" : ""); num > 1L ? "s" : "");
if(nodrop) if(nodrop)
Sprintf(eos(obuf), "."); Sprintf(eos(obuf), ".");
else else
Sprintf(eos(obuf), " and fall%s %s.", Sprintf(eos(obuf), " and %s %s.",
otmp->quan == 1L ? "s" : "", gate_str); otense(otmp, "fall"), gate_str);
pline("%s", obuf); pline("%s", obuf);
} else if(!nodrop) } else if(!nodrop)
pline("%s fall%s %s.", obuf, pline("%s %s %s.", obuf, otense(otmp, "fall"), gate_str);
otmp->quan == 1L ? "s" : "", gate_str);
} }
/* migration destination for objects which fall down to next level */ /* migration destination for objects which fall down to next level */
+11 -11
View File
@@ -827,13 +827,13 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
if ((obj->cursed || obj->greased) && (u.dx || u.dy) && !rn2(7)) { if ((obj->cursed || obj->greased) && (u.dx || u.dy) && !rn2(7)) {
boolean slipok = TRUE; boolean slipok = TRUE;
if (ammo_and_launcher(obj, uwep)) if (ammo_and_launcher(obj, uwep))
pline("%s misfires!", The(xname(obj))); pline("%s!", Tobjnam(obj, "misfire"));
else { else {
/* only slip if it's greased or meant to be thrown */ /* only slip if it's greased or meant to be thrown */
if (obj->greased || throwing_weapon(obj)) if (obj->greased || throwing_weapon(obj))
/* BUG: this message is grammatically incorrect if obj has /* BUG: this message is grammatically incorrect if obj has
a plural name; greased gloves or boots for instance. */ a plural name; greased gloves or boots for instance. */
pline("%s slips as you throw it!", The(xname(obj))); pline("%s as you throw it!", Tobjnam(obj, "slip"));
else slipok = FALSE; else slipok = FALSE;
} }
if (slipok) { if (slipok) {
@@ -864,8 +864,8 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
} else if(u.dz) { } else if(u.dz) {
if (u.dz < 0 && Role_if(PM_VALKYRIE) && if (u.dz < 0 && Role_if(PM_VALKYRIE) &&
obj->oartifact == ART_MJOLLNIR && !impaired) { obj->oartifact == ART_MJOLLNIR && !impaired) {
pline("%s hits the %s and returns to your hand!", pline("%s the %s and returns to your hand!",
The(xname(obj)), ceiling(u.ux,u.uy)); Tobjnam(obj, "hit"), ceiling(u.ux,u.uy));
obj = addinv(obj); obj = addinv(obj);
(void) encumber_msg(); (void) encumber_msg();
setuwep(obj); setuwep(obj);
@@ -975,7 +975,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
sho_obj_return_to_u(obj); /* display its flight */ sho_obj_return_to_u(obj); /* display its flight */
if (!impaired && rn2(100)) { if (!impaired && rn2(100)) {
pline("%s returns to your hand!", The(xname(obj))); pline("%s to your hand!", Tobjnam(obj, "return"));
obj = addinv(obj); obj = addinv(obj);
(void) encumber_msg(); (void) encumber_msg();
setuwep(obj); setuwep(obj);
@@ -985,11 +985,11 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
} else { } else {
int dmg = rnd(4); int dmg = rnd(4);
if (Blind) if (Blind)
pline("%s hits your %s!", pline("%s your %s!",
The(xname(obj)), body_part(ARM)); Tobjnam(obj, "hit"), body_part(ARM));
else else
pline("%s flies back toward you, hitting your %s!", pline("%s back toward you, hitting your %s!",
The(xname(obj)), body_part(ARM)); Tobjnam(obj, "fly"), body_part(ARM));
(void) artifact_hit((struct monst *) 0, &youmonst, (void) artifact_hit((struct monst *) 0, &youmonst,
obj, &dmg, 0); obj, &dmg, 0);
losehp(dmg, xname(obj), KILLED_BY); losehp(dmg, xname(obj), KILLED_BY);
@@ -1319,8 +1319,8 @@ register struct obj *obj;
} }
} }
} }
pline("%s vanishes into %s %s.", pline("%s into %s %s.",
The(xname(obj)), s_suffix(mon_nam(mon)), Tobjnam(obj, "vanish"), s_suffix(mon_nam(mon)),
is_animal(u.ustuck->data) ? "entrails" : "currents"); is_animal(u.ustuck->data) ? "entrails" : "currents");
} else { } else {
tmiss(obj, mon); tmiss(obj, mon);
+27 -26
View File
@@ -1654,7 +1654,7 @@ struct obj *otmp;
ability to detect food that is unfit for consumption ability to detect food that is unfit for consumption
or dangerous and avoid it. */ or dangerous and avoid it. */
char buf[BUFSZ], foodname[BUFSZ]; char buf[BUFSZ], foodsmell[BUFSZ];
char *eat_it_anyway = "Eat it anyway?"; char *eat_it_anyway = "Eat it anyway?";
boolean cadaver = (otmp->otyp == CORPSE); boolean cadaver = (otmp->otyp == CORPSE);
boolean stoneorslime = FALSE; boolean stoneorslime = FALSE;
@@ -1666,7 +1666,7 @@ struct obj *otmp;
mnum = 0; mnum = 0;
#endif #endif
Strcpy(foodname, The(xname(otmp))); Strcpy(foodsmell, Tobjnam(otmp, "smell"));
if (cadaver || otmp->otyp == EGG || otmp->otyp == TIN) { if (cadaver || otmp->otyp == EGG || otmp->otyp == TIN) {
mnum = otmp->corpsenm; mnum = otmp->corpsenm;
/* These checks must match those in eatcorpse() */ /* These checks must match those in eatcorpse() */
@@ -1697,48 +1697,48 @@ struct obj *otmp;
if (cadaver && mnum != PM_ACID_BLOB && rotted > 5L && !Sick_resistance) { if (cadaver && mnum != PM_ACID_BLOB && rotted > 5L && !Sick_resistance) {
/* Tainted meat */ /* Tainted meat */
Sprintf(buf, "%s smells like it could be tainted! %s", Sprintf(buf, "%s like it could be tainted! %s",
foodname, eat_it_anyway); foodsmell, eat_it_anyway);
if (yn_function(buf,ynchars,'n')=='n') return 1; if (yn_function(buf,ynchars,'n')=='n') return 1;
else return 2; else return 2;
} }
if (stoneorslime) { if (stoneorslime) {
Sprintf(buf, "%s smells like it could be something very dangerous! %s", Sprintf(buf, "%s like it could be something very dangerous! %s",
foodname, eat_it_anyway); foodsmell, eat_it_anyway);
if (yn_function(buf,ynchars,'n')=='n') return 1; if (yn_function(buf,ynchars,'n')=='n') return 1;
else return 2; else return 2;
} }
if (otmp->orotten || (cadaver && rotted > 3L)) { if (otmp->orotten || (cadaver && rotted > 3L)) {
/* Rotten */ /* Rotten */
Sprintf(buf, "%s smells like it could be rotten! %s", Sprintf(buf, "%s like it could be rotten! %s",
foodname, eat_it_anyway); foodsmell, eat_it_anyway);
if (yn_function(buf,ynchars,'n')=='n') return 1; if (yn_function(buf,ynchars,'n')=='n') return 1;
else return 2; else return 2;
} }
if (cadaver && poisonous(&mons[mnum]) && !Poison_resistance) { if (cadaver && poisonous(&mons[mnum]) && !Poison_resistance) {
/* poisonous */ /* poisonous */
Sprintf(buf, "%s smells like it might be poisonous! %s", Sprintf(buf, "%s like it might be poisonous! %s",
foodname, eat_it_anyway); foodsmell, eat_it_anyway);
if (yn_function(buf,ynchars,'n')=='n') return 1; if (yn_function(buf,ynchars,'n')=='n') return 1;
else return 2; else return 2;
} }
if (cadaver && !vegetarian(&mons[mnum]) && if (cadaver && !vegetarian(&mons[mnum]) &&
!u.uconduct.unvegetarian && Role_if(PM_MONK)) { !u.uconduct.unvegetarian && Role_if(PM_MONK)) {
Sprintf(buf, "%s smells unhealthy. %s", Sprintf(buf, "%s unhealthy. %s",
foodname, eat_it_anyway); foodsmell, eat_it_anyway);
if (yn_function(buf,ynchars,'n')=='n') return 1; if (yn_function(buf,ynchars,'n')=='n') return 1;
else return 2; else return 2;
} }
if (cadaver && acidic(&mons[mnum]) && !Acid_resistance) { if (cadaver && acidic(&mons[mnum]) && !Acid_resistance) {
Sprintf(buf, "%s smells rather acidic. %s", Sprintf(buf, "%s rather acidic. %s",
foodname, eat_it_anyway); foodsmell, eat_it_anyway);
if (yn_function(buf,ynchars,'n')=='n') return 1; if (yn_function(buf,ynchars,'n')=='n') return 1;
else return 2; else return 2;
} }
if (Upolyd && if (Upolyd &&
(u.umonnum == PM_RUST_MONSTER && is_metallic(otmp) && otmp->oerodeproof)) { (u.umonnum == PM_RUST_MONSTER && is_metallic(otmp) && otmp->oerodeproof)) {
Sprintf(buf, "%s smells disgusting to you right now. %s", Sprintf(buf, "%s disgusting to you right now. %s",
foodname, eat_it_anyway); foodsmell, eat_it_anyway);
if (yn_function(buf,ynchars,'n')=='n') return 1; if (yn_function(buf,ynchars,'n')=='n') return 1;
else return 2; else return 2;
} }
@@ -1751,24 +1751,24 @@ struct obj *otmp;
((material == LEATHER || material == BONE || ((material == LEATHER || material == BONE ||
material == DRAGON_HIDE || material == WAX) || material == DRAGON_HIDE || material == WAX) ||
(cadaver && !vegan(&mons[mnum])))) { (cadaver && !vegan(&mons[mnum])))) {
Sprintf(buf, "%s smells foul and unfamiliar to you. %s", Sprintf(buf, "%s foul and unfamiliar to you. %s",
foodname, eat_it_anyway); foodsmell, eat_it_anyway);
if (yn_function(buf,ynchars,'n')=='n') return 1; if (yn_function(buf,ynchars,'n')=='n') return 1;
else return 2; else return 2;
} }
if (!u.uconduct.unvegetarian && if (!u.uconduct.unvegetarian &&
((material == LEATHER || material == BONE || material == DRAGON_HIDE) || ((material == LEATHER || material == BONE || material == DRAGON_HIDE) ||
(cadaver && !vegetarian(&mons[mnum])))) { (cadaver && !vegetarian(&mons[mnum])))) {
Sprintf(buf, "%s smells unfamiliar to you. %s", Sprintf(buf, "%s unfamiliar to you. %s",
foodname, eat_it_anyway); foodsmell, eat_it_anyway);
if (yn_function(buf,ynchars,'n')=='n') return 1; if (yn_function(buf,ynchars,'n')=='n') return 1;
else return 2; else return 2;
} }
if (cadaver && mnum != PM_ACID_BLOB && rotted > 5L && Sick_resistance) { if (cadaver && mnum != PM_ACID_BLOB && rotted > 5L && Sick_resistance) {
/* Tainted meat with Sick_resistance */ /* Tainted meat with Sick_resistance */
Sprintf(buf, "%s smells like it could be tainted! %s", Sprintf(buf, "%s like it could be tainted! %s",
foodname, eat_it_anyway); foodsmell, eat_it_anyway);
if (yn_function(buf,ynchars,'n')=='n') return 1; if (yn_function(buf,ynchars,'n')=='n') return 1;
else return 2; else return 2;
} }
@@ -2254,10 +2254,11 @@ boolean incr;
"You still have the munchies." : "You still have the munchies." :
"The munchies are interfering with your motor capabilities."); "The munchies are interfering with your motor capabilities.");
else if (incr && else if (incr &&
(Role_if(PM_WIZARD) || Race_if(PM_ELF) || Role_if(PM_VALKYRIE))) (Role_if(PM_WIZARD) || Race_if(PM_ELF) ||
Role_if(PM_VALKYRIE)))
pline("%s needs food, badly!", pline("%s needs food, badly!",
(Role_if(PM_WIZARD) || Role_if(PM_VALKYRIE)) ? (Role_if(PM_WIZARD) || Role_if(PM_VALKYRIE)) ?
urole.name.m : "Elf"); urole.name.m : "Elf");
else else
You((!incr) ? "feel weak now." : You((!incr) ? "feel weak now." :
(u.uhunger < 45) ? "feel weak." : (u.uhunger < 45) ? "feel weak." :
@@ -2348,7 +2349,7 @@ floorfood(verb,corpsecheck) /* get food from floor or pack */
feeding ? (otmp->oclass != GOLD_CLASS && is_edible(otmp)) : feeding ? (otmp->oclass != GOLD_CLASS && is_edible(otmp)) :
otmp->oclass==FOOD_CLASS) { otmp->oclass==FOOD_CLASS) {
Sprintf(qbuf, "There %s %s here; %s %s?", Sprintf(qbuf, "There %s %s here; %s %s?",
(otmp->quan == 1L) ? "is" : "are", otense(otmp, "are"),
doname(otmp), verb, doname(otmp), verb,
(otmp->quan == 1L) ? "it" : "one"); (otmp->quan == 1L) ? "it" : "one");
if((c = yn_function(qbuf,ynqchars,'n')) == 'y') if((c = yn_function(qbuf,ynqchars,'n')) == 'y')
+1 -1
View File
@@ -898,7 +898,7 @@ boolean identified, all_containers;
if (all_containers) if (all_containers)
container_contents(box->cobj, identified, TRUE); container_contents(box->cobj, identified, TRUE);
} else { } else {
pline("%s is empty.", The(xname(box))); pline("%s empty.", Tobjnam(box, "are"));
display_nhwindow(WIN_MESSAGE, FALSE); display_nhwindow(WIN_MESSAGE, FALSE);
} }
} }
+7 -5
View File
@@ -785,15 +785,16 @@ doengrave()
if (!Blind) if (!Blind)
You("wipe out the message here."); You("wipe out the message here.");
else else
Your("%s gets %s.", xname(otmp), Your("%s %s %s.", xname(otmp),
is_ice(u.ux,u.uy) ? otense(otmp, "get"),
"frosty" : "dusty"); is_ice(u.ux,u.uy) ?
"frosty" : "dusty");
dengr = TRUE; dengr = TRUE;
} else } else
Your("%s can't wipe out this engraving.", Your("%s can't wipe out this engraving.",
xname(otmp)); xname(otmp));
else else
Your("%s gets %s.", xname(otmp), Your("%s %s %s.", xname(otmp), otense(otmp, "get"),
is_ice(u.ux,u.uy) ? "frosty" : "dusty"); is_ice(u.ux,u.uy) ? "frosty" : "dusty");
break; break;
default: default:
@@ -968,7 +969,8 @@ doengrave()
if (len == 0 || index(ebuf, '\033')) { if (len == 0 || index(ebuf, '\033')) {
if (zapwand) { if (zapwand) {
if (!Blind) if (!Blind)
pline("%s glows, then fades.", The(xname(otmp))); pline("%s, then %s.",
Tobjnam(otmp, "glow"), otense(otmp, "fade"));
return(1); return(1);
} else { } else {
pline(Never_mind); pline(Never_mind);
+5 -5
View File
@@ -284,9 +284,9 @@ int expltype;
int mdam = dam; int mdam = dam;
if (resist(mtmp, olet, 0, FALSE)) { if (resist(mtmp, olet, 0, FALSE)) {
if (cansee(i+x-1,j+y-1)) if (cansee(i+x-1,j+y-1))
pline("%s resists the %s!", Monnam(mtmp), str); pline("%s resists the %s!", Monnam(mtmp), str);
mdam = dam/2; mdam = dam/2;
} }
if (mtmp == u.ustuck) if (mtmp == u.ustuck)
mdam *= 2; mdam *= 2;
@@ -437,7 +437,7 @@ struct obj *obj; /* only scatter this obj */
&& ((otmp->otyp == BOULDER) || (otmp->otyp == STATUE)) && ((otmp->otyp == BOULDER) || (otmp->otyp == STATUE))
&& rn2(10)) { && rn2(10)) {
if (otmp->otyp == BOULDER) { if (otmp->otyp == BOULDER) {
pline("%s breaks apart.",The(xname(otmp))); pline("%s apart.", Tobjnam(otmp, "break"));
fracture_rock(otmp); fracture_rock(otmp);
place_object(otmp, sx, sy); /* put fragments on floor */ place_object(otmp, sx, sy); /* put fragments on floor */
if ((otmp = sobj_at(BOULDER, sx, sy)) != 0) { if ((otmp = sobj_at(BOULDER, sx, sy)) != 0) {
@@ -450,7 +450,7 @@ struct obj *obj; /* only scatter this obj */
if ((trap = t_at(sx,sy)) && trap->ttyp == STATUE_TRAP) if ((trap = t_at(sx,sy)) && trap->ttyp == STATUE_TRAP)
deltrap(trap); deltrap(trap);
pline("%s crumbles.",The(xname(otmp))); pline("%s.", Tobjnam(otmp, "crumble"));
(void) break_statue(otmp); (void) break_statue(otmp);
place_object(otmp, sx, sy); /* put fragments on floor */ place_object(otmp, sx, sy); /* put fragments on floor */
} }
+9 -7
View File
@@ -133,8 +133,8 @@ moverock()
switch(ttmp->ttyp) { switch(ttmp->ttyp) {
case LANDMINE: case LANDMINE:
if (rn2(10)) { if (rn2(10)) {
pline("KAABLAMM!!! %s triggers %s land mine.", pline("KAABLAMM!!! %s %s land mine.",
The(xname(otmp)), Tobjnam(otmp, "trigger"),
ttmp->madeby_u ? "your" : "a"); ttmp->madeby_u ? "your" : "a");
obj_extract_self(otmp); obj_extract_self(otmp);
place_object(otmp, rx, ry); place_object(otmp, rx, ry);
@@ -162,10 +162,12 @@ moverock()
if (Blind) if (Blind)
pline("Kerplunk! You no longer feel %s.", pline("Kerplunk! You no longer feel %s.",
the(xname(otmp))); the(xname(otmp)));
else else
pline("%s %s and plugs a %s in the %s!", pline("%s%s and %s a %s in the %s!",
The(xname(otmp)), Tobjnam(otmp,
(ttmp->ttyp == TRAPDOOR) ? "triggers" : "falls into", (ttmp->ttyp == TRAPDOOR) ? "trigger" : "fall"),
(ttmp->ttyp == TRAPDOOR) ? nul : " into",
otense(otmp, "plug"),
(ttmp->ttyp == TRAPDOOR) ? "trap door" : "hole", (ttmp->ttyp == TRAPDOOR) ? "trap door" : "hole",
surface(rx, ry)); surface(rx, ry));
deltrap(ttmp); deltrap(ttmp);
@@ -2078,7 +2080,7 @@ struct obj *otmp;
while(otmp) { while(otmp) {
/* Must change when silver & copper is implemented: */ /* Must change when silver & copper is implemented: */
if (otmp->oclass == GOLD_CLASS) return otmp->quan; if (otmp->oclass == GOLD_CLASS) return otmp->quan;
otmp = otmp->nobj; otmp = otmp->nobj;
} }
return 0; return 0;
} }
+4 -5
View File
@@ -343,7 +343,7 @@ mattacku(mtmp)
newsym(u.ux,u.uy); newsym(u.ux,u.uy);
} else { } else {
pline("%s is killed by a falling %s (you)!", pline("%s is killed by a falling %s (you)!",
Monnam(mtmp), youmonst.data->mname); Monnam(mtmp), youmonst.data->mname);
killed(mtmp); killed(mtmp);
newsym(u.ux,u.uy); newsym(u.ux,u.uy);
if (mtmp->mhp > 0) return 0; if (mtmp->mhp > 0) return 0;
@@ -1526,10 +1526,9 @@ gulpmu(mtmp, mattk) /* monster swallows you, or damage if u.uswallow */
i = number_leashed(); i = number_leashed();
if (i > 0) { if (i > 0) {
pline_The("leash%s snap%s loose.", char *s = (i > 1) ? "leashes" : "leash";
(i > 1) ? "es" : "", pline_The("%s %s loose.", s, vtense(s, "snap"));
(i > 1) ? "" : "s"); unleash_all();
unleash_all();
} }
if (touch_petrifies(youmonst.data) && !resists_ston(mtmp)) { if (touch_petrifies(youmonst.data) && !resists_ston(mtmp)) {
+2 -2
View File
@@ -294,8 +294,8 @@ m_throw(mon, x, y, dx, dy, range, obj)
if(is_ammo(singleobj)) if(is_ammo(singleobj))
pline("%s misfires!", Monnam(mon)); pline("%s misfires!", Monnam(mon));
else else
pline("%s slips as %s throws it!", pline("%s as %s throws it!",
The(xname(singleobj)), mon_nam(mon)); Tobjnam(singleobj, "slip"), mon_nam(mon));
} }
dx = rn2(3)-1; dx = rn2(3)-1;
dy = rn2(3)-1; dy = rn2(3)-1;
+1 -1
View File
@@ -1803,7 +1803,7 @@ skipmsg:
The_whip, the_weapon); The_whip, the_weapon);
if (welded(obj)) { if (welded(obj)) {
pline("%s welded to your %s%c", pline("%s welded to your %s%c",
(obj->quan == 1L) ? "It is" : "They are", is_plural(obj) ? "It is" : "They are",
hand, !obj->bknown ? '!' : '.'); hand, !obj->bknown ? '!' : '.');
/* obj->bknown = 1; */ /* welded() takes care of this */ /* obj->bknown = 1; */ /* welded() takes care of this */
where_to = 0; where_to = 0;
+3 -5
View File
@@ -392,8 +392,7 @@ struct obj *instr;
} /* else FALLTHRU */ } /* else FALLTHRU */
case WOODEN_FLUTE: /* May charm snakes */ case WOODEN_FLUTE: /* May charm snakes */
do_spec &= (rn2(ACURR(A_DEX)) + u.ulevel > 25); do_spec &= (rn2(ACURR(A_DEX)) + u.ulevel > 25);
pline("%s %s.", The(xname(instr)), pline("%s.", Tobjnam(instr, do_spec ? "trill" : "toot"));
do_spec ? "trills" : "toots");
if (do_spec) charm_snakes(u.ulevel * 3); if (do_spec) charm_snakes(u.ulevel * 3);
exercise(A_DEX, TRUE); exercise(A_DEX, TRUE);
break; break;
@@ -403,7 +402,7 @@ struct obj *instr;
check_unpaid(instr); check_unpaid(instr);
instr->spe--; instr->spe--;
if (!getdir((char *)0)) { if (!getdir((char *)0)) {
pline("%s vibrates.", The(xname(instr))); pline("%s.", Tobjnam(instr, "vibrate"));
break; break;
} else if (!u.dx && !u.dy && !u.dz) { } else if (!u.dx && !u.dy && !u.dz) {
if ((damage = zapyourself(instr, TRUE)) != 0) { if ((damage = zapyourself(instr, TRUE)) != 0) {
@@ -432,8 +431,7 @@ struct obj *instr;
if (do_spec && instr->spe > 0) { if (do_spec && instr->spe > 0) {
check_unpaid(instr); check_unpaid(instr);
instr->spe--; instr->spe--;
pline("%s produces very attractive music.", pline("%s very attractive music.", Tobjnam(instr, "produce"));
The(xname(instr)));
charm_monsters((u.ulevel - 1) / 3 + 1); charm_monsters((u.ulevel - 1) / 3 + 1);
exercise(A_DEX, TRUE); exercise(A_DEX, TRUE);
break; break;
+142 -43
View File
@@ -7,6 +7,7 @@
/* "an uncursed greased partly eaten guardian naga hatchling [corpse]" */ /* "an uncursed greased partly eaten guardian naga hatchling [corpse]" */
#define PREFIX 80 /* (56) */ #define PREFIX 80 /* (56) */
#define SCHAR_LIM 127 #define SCHAR_LIM 127
#define NUMOBUF 12
STATIC_DCL char *FDECL(strprepend,(char *,const char *)); STATIC_DCL char *FDECL(strprepend,(char *,const char *));
#ifdef OVL0 #ifdef OVL0
@@ -15,6 +16,7 @@ static boolean FDECL(the_unique_obj, (struct obj *obj));
#ifdef OVLB #ifdef OVLB
static boolean FDECL(wishymatch, (const char *,const char *,BOOLEAN_P)); static boolean FDECL(wishymatch, (const char *,const char *,BOOLEAN_P));
#endif #endif
static char *NDECL(nextobuf);
static void FDECL(add_erosion_words, (struct obj *, char *)); static void FDECL(add_erosion_words, (struct obj *, char *));
struct Jitem { struct Jitem {
@@ -78,22 +80,28 @@ register const char *pref;
#endif /* OVL1 */ #endif /* OVL1 */
#ifdef OVLB #ifdef OVLB
/* manage a pool of BUFSZ buffers, so callers don't have to */
static char *
nextobuf()
{
static char NEARDATA bufs[NUMOBUF][BUFSZ];
static int bufidx = 0;
bufidx = (bufidx + 1) % NUMOBUF;
return bufs[bufidx];
}
char * char *
obj_typename(otyp) obj_typename(otyp)
register int otyp; register int otyp;
{ {
#ifdef LINT /* static char buf[BUFSZ]; */ char *buf = nextobuf();
char buf[BUFSZ];
#else
static char NEARDATA buf[BUFSZ];
#endif
register struct objclass *ocl = &objects[otyp]; register struct objclass *ocl = &objects[otyp];
register const char *actualn = OBJ_NAME(*ocl); register const char *actualn = OBJ_NAME(*ocl);
register const char *dn = OBJ_DESCR(*ocl); register const char *dn = OBJ_DESCR(*ocl);
register const char *un = ocl->oc_uname; register const char *un = ocl->oc_uname;
register int nn = ocl->oc_name_known; register int nn = ocl->oc_name_known;
if (Role_if(PM_SAMURAI) && Japanese_item_name(otyp)) if (Role_if(PM_SAMURAI) && Japanese_item_name(otyp))
actualn = Japanese_item_name(otyp); actualn = Japanese_item_name(otyp);
switch(ocl->oc_class) { switch(ocl->oc_class) {
@@ -212,12 +220,7 @@ char *
xname(obj) xname(obj)
register struct obj *obj; register struct obj *obj;
{ {
#ifdef LINT /* lint may handle static decl poorly -- static char bufr[]; */ register char *buf;
char bufr[BUFSZ];
#else
static char bufr[BUFSZ];
#endif
register char *buf = &(bufr[PREFIX]); /* leave room for "17 -3 " */
register int typ = obj->otyp; register int typ = obj->otyp;
register struct objclass *ocl = &objects[typ]; register struct objclass *ocl = &objects[typ];
register int nn = ocl->oc_name_known; register int nn = ocl->oc_name_known;
@@ -225,6 +228,7 @@ register struct obj *obj;
register const char *dn = OBJ_DESCR(*ocl); register const char *dn = OBJ_DESCR(*ocl);
register const char *un = ocl->oc_uname; register const char *un = ocl->oc_uname;
buf = nextobuf() + PREFIX; /* leave room for "17 -3 " */
if (Role_if(PM_SAMURAI) && Japanese_item_name(typ)) if (Role_if(PM_SAMURAI) && Japanese_item_name(typ))
actualn = Japanese_item_name(typ); actualn = Japanese_item_name(typ);
@@ -797,17 +801,13 @@ register struct obj *otmp;
is_flammable(otmp)); is_flammable(otmp));
} }
/* The result is actually modifiable, but caller shouldn't rely on that char *
* due to the small buffer size.
*/
const char *
corpse_xname(otmp, ignore_oquan) corpse_xname(otmp, ignore_oquan)
struct obj *otmp; struct obj *otmp;
boolean ignore_oquan; /* to force singular */ boolean ignore_oquan; /* to force singular */
{ {
static char NEARDATA nambuf[40]; char *nambuf = nextobuf();
/* assert( strlen(mons[otmp->corpsenm].mname) <= 32 ); */
Sprintf(nambuf, "%s corpse", mons[otmp->corpsenm].mname); Sprintf(nambuf, "%s corpse", mons[otmp->corpsenm].mname);
if (ignore_oquan || otmp->quan < 2) if (ignore_oquan || otmp->quan < 2)
@@ -842,7 +842,7 @@ char *
an(str) an(str)
register const char *str; register const char *str;
{ {
static char NEARDATA buf[BUFSZ]; char *buf = nextobuf();
buf[0] = '\0'; buf[0] = '\0';
@@ -881,7 +881,7 @@ char *
the(str) the(str)
const char *str; const char *str;
{ {
static char NEARDATA buf[BUFSZ]; char *buf = nextobuf();
boolean insert_the = FALSE; boolean insert_the = FALSE;
if (!strncmpi(str, "the ", 4)) { if (!strncmpi(str, "the ", 4)) {
@@ -933,6 +933,7 @@ const char *str;
return tmp; return tmp;
} }
/* returns "count xname(otmp)" or just xname(otmp) if count == 1 */
char * char *
aobjnam(otmp,verb) aobjnam(otmp,verb)
register struct obj *otmp; register struct obj *otmp;
@@ -947,20 +948,122 @@ register const char *verb;
} }
if(verb) { if(verb) {
/* verb is given in plural (without trailing s) */ Strcat(bp, " ");
Strcat(bp, " "); Strcat(bp, otense(otmp, verb));
if(otmp->quan != 1L)
Strcat(bp, verb);
else if(!strcmp(verb, "are"))
Strcat(bp, "is");
else {
Strcat(bp, verb);
Strcat(bp, "s");
}
} }
return(bp); return(bp);
} }
/* like aobjnam, but prepend "The", not count */
char *
Tobjnam(otmp, verb)
register struct obj *otmp;
register const char *verb;
{
char *bp = The(xname(otmp));
if(verb) {
Strcat(bp, " ");
Strcat(bp, otense(otmp, verb));
}
return(bp);
}
/* return form of the verb (input plural) if xname(otmp) were the subject */
char *
otense(otmp, verb)
register struct obj *otmp;
register const char *verb;
{
char *buf;
/*
* verb is given in plural (without trailing s). Return as input
* if the result of xname(otmp) would be plural. Don't bother
* recomputing xname(otmp) at this time.
*/
if (!is_plural(otmp))
return vtense((char *)0, verb);
buf = nextobuf();
Strcpy(buf, verb);
return buf;
}
/* return form of the verb (input plural) for present tense 3rd person subj */
char *
vtense(subj, verb)
register const char *subj;
register const char *verb;
{
char *buf = nextobuf();
int len;
const char *spot;
const char *sp;
/*
* verb is given in plural (without trailing s). Return as input
* if subj appears to be plural. Add special cases as necessary.
* Many hard cases can already be handled by using otense() instead.
* If this gets much bigger, consider decomposing makeplural.
* Note: monster names are not expected here (except before corpse).
*
* special case: allow null sobj to get the singular 3rd person
* present tense form so we don't duplicate this code elsewhere.
*/
if (subj) {
spot = (const char *)0;
for (sp = subj; (sp = index(sp, ' ')) != 0; ++sp) {
if (!strncmp(sp, " of ", 4) ||
!strncmp(sp, " called ", 8) ||
!strncmp(sp, " named ", 7) ||
!strncmp(sp, " labeled ", 9)) {
if (sp != subj) spot = sp - 1;
break;
}
}
len = strlen(subj);
if (!spot) spot = subj + len - 1;
/*
* plural: anything that ends in 's', but not '*us'.
* Guess at a few other special cases that makeplural creates.
*/
if ((*spot == 's' && spot != subj && *(spot-1) != 'u') ||
((spot - subj) >= 4 && strncmp(spot-3, "eeth", 4)) ||
((spot - subj) >= 3 && strncmp(spot-3, "feet", 4)) ||
((spot - subj) >= 2 && strncmp(spot-1, "ia", 2)) ||
((spot - subj) >= 2 && strncmp(spot-1, "ae", 2))) {
Strcpy(buf, verb);
return buf;
}
}
len = strlen(verb);
spot = verb + len - 1;
if (!strcmp(verb, "are"))
Strcpy(buf, "is");
else if (!strcmp(verb, "have"))
Strcpy(buf, "has");
else if (index("zxs", *spot) ||
(len >= 2 && *spot=='h' && index("cs", *(spot-1))) ||
(len == 2 && *spot == 'o')) {
/* Ends in z, x, s, ch, sh; add an "es" */
Strcpy(buf, verb);
Strcat(buf, "es");
} else if (*spot == 'y' && (!index(vowels, *(spot-1)))) {
/* like "y" case in makeplural */
Strcpy(buf, verb);
Strcat(buf + len - 1, "ies");
} else {
Strcpy(buf, verb);
Strcat(buf, "s");
}
return buf;
}
/* capitalized variant of doname() */ /* capitalized variant of doname() */
char * char *
Doname2(obj) Doname2(obj)
@@ -977,9 +1080,9 @@ char *
yname(obj) yname(obj)
struct obj *obj; struct obj *obj;
{ {
static char outbuf[BUFSZ]; char *outbuf = nextobuf();
char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */ char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */
int space_left = sizeof outbuf - strlen(s) - sizeof " "; int space_left = BUFSZ - strlen(s) - sizeof " ";
return strncat(strcat(s, " "), xname(obj), space_left); return strncat(strcat(s, " "), xname(obj), space_left);
} }
@@ -1027,7 +1130,7 @@ const char *oldstr;
{ {
/* Note: cannot use strcmpi here -- it'd give MATZot, CAVEMeN,... */ /* Note: cannot use strcmpi here -- it'd give MATZot, CAVEMeN,... */
register char *spot; register char *spot;
static char NEARDATA str[BUFSZ]; char *str = nextobuf();
const char *excess = (char *)0; const char *excess = (char *)0;
int len; int len;
@@ -1040,14 +1143,11 @@ const char *oldstr;
Strcpy(str, oldstr); Strcpy(str, oldstr);
/* /*
Skip changing "pair of" to "pairs of". According to Webster, usual * Skip changing "pair of" to "pairs of". According to Webster, usual
English usage is use pairs for humans, e.g. 3 pairs of dancers, * English usage is use pairs for humans, e.g. 3 pairs of dancers,
and pair for objects and non-humans, e.g. 3 pair of boots. We don't * and pair for objects and non-humans, e.g. 3 pair of boots. We don't
refer to pairs of humans in this game so just skip to the bottom. * refer to pairs of humans in this game so just skip to the bottom.
*/
Actually, none of the "pair" objects -- gloves, boots, and lenses --
currently merge, so this isn't used.
*/
if (!strncmp(str, "pair of ", 8)) if (!strncmp(str, "pair of ", 8))
goto bottom; goto bottom;
@@ -1291,13 +1391,12 @@ STATIC_OVL NEARDATA const struct o_range o_ranges[] = {
* of readobjnam, and is also used in pager.c to singularize the string * of readobjnam, and is also used in pager.c to singularize the string
* for which help is sought. * for which help is sought.
*/ */
char * char *
makesingular(oldstr) makesingular(oldstr)
const char *oldstr; const char *oldstr;
{ {
register char *p, *bp; register char *p, *bp;
static char NEARDATA str[BUFSZ]; char *str = nextobuf();
if (!oldstr || !*oldstr) { if (!oldstr || !*oldstr) {
impossible("singular of null?"); impossible("singular of null?");
+13 -16
View File
@@ -1047,7 +1047,7 @@ int *wt_before, *wt_after;
suffx = ""; suffx = "";
} }
There("%s %s %s, but %s%s%s%s.", There("%s %s %s, but %s%s%s%s.",
(obj->quan == 1L) ? "is" : "are", obj_nambuf, where, otense(obj, "are"), obj_nambuf, where,
prefx1, prefx2, verb, suffx); prefx1, prefx2, verb, suffx);
/* *wt_after = iw; */ /* *wt_after = iw; */
@@ -1161,7 +1161,7 @@ boolean telekinesis; /* not picking it up directly by hand */
if (gold_capacity <= 0L) { if (gold_capacity <= 0L) {
pline( pline(
"There %s %ld gold piece%s %s, but you cannot carry any more.", "There %s %ld gold piece%s %s, but you cannot carry any more.",
(obj->quan == 1L) ? "is" : "are", otense(obj, "are"),
obj->quan, plur(obj->quan), where); obj->quan, plur(obj->quan), where);
return 0; return 0;
} else if (gold_capacity < count) { } else if (gold_capacity < count) {
@@ -1200,9 +1200,8 @@ boolean telekinesis; /* not picking it up directly by hand */
else { else {
char kbuf[BUFSZ]; char kbuf[BUFSZ];
pline("Touching %s corpse is a fatal mistake.", Strcpy(kbuf, an(corpse_xname(obj, TRUE)));
an(mons[obj->corpsenm].mname)); pline("Touching %s is a fatal mistake.", kbuf);
Sprintf(kbuf, "%s corpse", an(mons[obj->corpsenm].mname));
instapetrify(kbuf); instapetrify(kbuf);
return -1; return -1;
} }
@@ -1217,8 +1216,8 @@ boolean telekinesis; /* not picking it up directly by hand */
if (obj->blessed) obj->blessed = 0; if (obj->blessed) obj->blessed = 0;
else if (!obj->spe && !obj->cursed) obj->spe = 1; else if (!obj->spe && !obj->cursed) obj->spe = 1;
else { else {
pline_The("scroll%s turn%s to dust as you %s %s up.", pline_The("scroll%s %s to dust as you %s %s up.",
plur(obj->quan), (obj->quan == 1L) ? "s" : "", plur(obj->quan), otense(obj, "turn"),
telekinesis ? "raise" : "pick", telekinesis ? "raise" : "pick",
(obj->quan == 1L) ? "it" : "them"); (obj->quan == 1L) ? "it" : "them");
if (!(objects[SCR_SCARE_MONSTER].oc_name_known) && if (!(objects[SCR_SCARE_MONSTER].oc_name_known) &&
@@ -1685,7 +1684,7 @@ register struct obj *obj;
pline("%s cannot be confined in such trappings.", The(xname(obj))); pline("%s cannot be confined in such trappings.", The(xname(obj)));
return 0; return 0;
} else if (obj->otyp == LEASH && obj->leashmon != 0) { } else if (obj->otyp == LEASH && obj->leashmon != 0) {
pline("%s is attached to your pet.", The(xname(obj))); pline("%s attached to your pet.", Tobjnam(obj, "are"));
return 0; return 0;
} else if (obj == uwep) { } else if (obj == uwep) {
if (welded(obj)) { if (welded(obj)) {
@@ -1710,9 +1709,8 @@ register struct obj *obj;
else { else {
char kbuf[BUFSZ]; char kbuf[BUFSZ];
pline("Touching %s corpse is a fatal mistake.", Strcpy(kbuf, an(corpse_xname(obj, TRUE)));
an(mons[obj->corpsenm].mname)); pline("Touching %s is a fatal mistake.", kbuf);
Sprintf(kbuf, "%s corpse", an(mons[obj->corpsenm].mname));
instapetrify(kbuf); instapetrify(kbuf);
return -1; return -1;
} }
@@ -1827,9 +1825,8 @@ register struct obj *obj;
else { else {
char kbuf[BUFSZ]; char kbuf[BUFSZ];
pline("Touching %s corpse is a fatal mistake.", Strcpy(kbuf, an(corpse_xname(obj, TRUE)));
an(mons[obj->corpsenm].mname)); pline("Touching %s is a fatal mistake.", kbuf);
Sprintf(kbuf, "%s corpse", an(mons[obj->corpsenm].mname));
instapetrify(kbuf); instapetrify(kbuf);
return -1; return -1;
} }
@@ -1902,7 +1899,7 @@ register int held;
menu_on_request; menu_on_request;
if (obj->olocked) { if (obj->olocked) {
pline("%s seems to be locked.", The(xname(obj))); pline("%s to be locked.", Tobjnam(obj, "seem"));
if (held) You("must put it down to unlock."); if (held) You("must put it down to unlock.");
return 0; return 0;
} else if (obj->otrapped) { } else if (obj->otrapped) {
@@ -1989,7 +1986,7 @@ register int held;
obj->owt = weight(obj); obj->owt = weight(obj);
if (!cnt) { if (!cnt) {
pline("%s is empty.", Yname2(obj)); pline("%s %s empty.", Yname2(obj), otense(obj, "are"));
} else { } else {
Sprintf(qbuf, "Do you want to take %s out of %s?", Sprintf(qbuf, "Do you want to take %s out of %s?",
something, yname(obj)); something, yname(obj));
+12 -16
View File
@@ -973,7 +973,7 @@ boolean your_fault;
/* oil doesn't instantly evaporate */ /* oil doesn't instantly evaporate */
if (obj->otyp != POT_OIL && cansee(mon->mx,mon->my)) if (obj->otyp != POT_OIL && cansee(mon->mx,mon->my))
pline("%s evaporates.", The(xname(obj))); pline("%s.", Tobjnam(obj, "evaporate"));
if (isyou) { if (isyou) {
switch (obj->otyp) { switch (obj->otyp) {
@@ -1407,7 +1407,7 @@ register struct obj *obj;
if (snuff_lit(obj)) return(TRUE); if (snuff_lit(obj)) return(TRUE);
if (obj->greased) { if (obj->greased) {
grease_protect(obj,(char *)0,FALSE,&youmonst); grease_protect(obj,(char *)0,&youmonst);
return(FALSE); return(FALSE);
} }
(void) Shk_Your(Your_buf, obj); (void) Shk_Your(Your_buf, obj);
@@ -1459,9 +1459,8 @@ register struct obj *obj;
) { ) {
if (!Blind) { if (!Blind) {
boolean oq1 = obj->quan == 1L; boolean oq1 = obj->quan == 1L;
pline_The("scroll%s fade%s.", pline_The("scroll%s %s.",
oq1 ? "" : "s", oq1 ? "" : "s", otense(obj, "fade"));
oq1 ? "s" : "");
} }
if(obj->unpaid && costly_spot(u.ux, u.uy)) { if(obj->unpaid && costly_spot(u.ux, u.uy)) {
You("erase it, you pay for it."); You("erase it, you pay for it.");
@@ -1482,7 +1481,7 @@ register struct obj *obj;
if (!Blind) { if (!Blind) {
boolean oq1 = obj->quan == 1L; boolean oq1 = obj->quan == 1L;
pline_The("spellbook%s fade%s.", pline_The("spellbook%s fade%s.",
oq1 ? "" : "s", oq1 ? "s" : ""); oq1 ? "" : "s", otense(obj, "fade"));
} }
if(obj->unpaid && costly_spot(u.ux, u.uy)) { if(obj->unpaid && costly_spot(u.ux, u.uy)) {
You("erase it, you pay for it."); You("erase it, you pay for it.");
@@ -1736,9 +1735,8 @@ dodip()
if (obj->oerodeproof || obj_resists(obj, 5, 95) || if (obj->oerodeproof || obj_resists(obj, 5, 95) ||
/* `METAL' should not be confused with is_metallic() */ /* `METAL' should not be confused with is_metallic() */
omat == METAL || omat == MITHRIL || omat == BONE) { omat == METAL || omat == MITHRIL || omat == BONE) {
pline("%s seem%s to burn for a moment.", pline("%s %s to burn for a moment.",
Yname2(obj), Yname2(obj), otense(obj, "seem"));
(obj->quan > 1L) ? "" : "s");
} else { } else {
if (omat == PLASTIC) obj->oeroded = MAX_ERODE; if (omat == PLASTIC) obj->oeroded = MAX_ERODE;
pline_The("burning oil %s %s.", pline_The("burning oil %s %s.",
@@ -1763,15 +1761,13 @@ dodip()
* material, but dipping in oil shouldn't repair them. * material, but dipping in oil shouldn't repair them.
*/ */
} else if ((!is_rustprone(obj) && !is_corrodeable(obj)) || } else if ((!is_rustprone(obj) && !is_corrodeable(obj)) ||
is_ammo(obj) || (!obj->oeroded && !obj->oeroded2)) { is_ammo(obj) || (!obj->oeroded && !obj->oeroded2)) {
/* uses up potion, doesn't set obj->greased */ /* uses up potion, doesn't set obj->greased */
pline("%s gleam%s with an oily sheen.", pline("%s %s with an oily sheen.",
Yname2(obj), Yname2(obj), otense(obj, "gleam"));
(obj->quan > 1L) ? "" : "s");
} else { } else {
pline("%s %s less %s.", pline("%s %s less %s.",
Yname2(obj), Yname2(obj), otense(obj, "are"),
(obj->quan > 1L) ? "are" : "is",
(obj->oeroded && obj->oeroded2) ? "corroded and rusty" : (obj->oeroded && obj->oeroded2) ? "corroded and rusty" :
obj->oeroded ? "rusty" : "corroded"); obj->oeroded ? "rusty" : "corroded");
if (obj->oeroded > 0) obj->oeroded--; if (obj->oeroded > 0) obj->oeroded--;
@@ -1800,7 +1796,7 @@ dodip()
obj->age = 0; obj->age = 0;
} }
if (obj->age > 1000L) { if (obj->age > 1000L) {
pline("%s is full.", Yname2(obj)); pline("%s %s full.", Yname2(obj), otense(obj, "are"));
} else { } else {
You("fill %s with oil.", yname(obj)); You("fill %s with oil.", yname(obj));
check_unpaid(potion); /* Yendorian Fuel Tax */ check_unpaid(potion); /* Yendorian Fuel Tax */
+4 -4
View File
@@ -336,7 +336,7 @@ decurse:
if (!Blind) if (!Blind)
Your("%s %s.", Your("%s %s.",
what ? what : what ? what :
(const char *)aobjnam (otmp, "softly glow"), (const char *)aobjnam(otmp, "softly glow"),
hcolor(amber)); hcolor(amber));
break; break;
case TROUBLE_POISONED: case TROUBLE_POISONED:
@@ -546,11 +546,11 @@ at_your_feet(str)
if (Blind) str = Something; if (Blind) str = Something;
if (u.uswallow) { if (u.uswallow) {
/* barrier between you and the floor */ /* barrier between you and the floor */
pline("%s drops into %s %s.", str, pline("%s %s into %s %s.", str, vtense(str, "drop"),
s_suffix(mon_nam(u.ustuck)), mbodypart(u.ustuck, STOMACH)); s_suffix(mon_nam(u.ustuck)), mbodypart(u.ustuck, STOMACH));
} else { } else {
pline("%s %s %s your %s!", str, pline("%s %s %s your %s!", str,
Blind ? "lands" : "appears", Blind ? "lands" : vtense(str, "appear"),
Levitation ? "beneath" : "at", Levitation ? "beneath" : "at",
makeplural(body_part(FOOT))); makeplural(body_part(FOOT)));
} }
@@ -777,7 +777,7 @@ pleased(g_align)
*repair_buf = '\0'; *repair_buf = '\0';
if (uwep->oeroded || uwep->oeroded2) if (uwep->oeroded || uwep->oeroded2)
Sprintf(repair_buf, " and %s now as good as new", Sprintf(repair_buf, " and %s now as good as new",
uwep->quan == 1L ? "is" : "are"); otense(uwep, "are"));
if (uwep->cursed) { if (uwep->cursed) {
uncurse(uwep); uncurse(uwep);