E char *FDECL(mshot_xname, (struct obj *));
E char *FDECL(doname, (struct obj *));
E boolean FDECL(not_fully_identified, (struct obj *));
-E const char *FDECL(corpse_xname, (struct obj *,BOOLEAN_P));
+E char *FDECL(corpse_xname, (struct obj *,BOOLEAN_P));
E const char *FDECL(singular, (struct obj *,char *(*)(OBJ_P)));
E char *FDECL(an, (const char *));
E char *FDECL(An, (const char *));
E char *FDECL(The, (const char *));
E char *FDECL(the, (const char *));
E char *FDECL(aobjnam, (struct obj *,const char *));
+E char *FDECL(Tobjnam, (struct obj *,const char *));
+E char *FDECL(otense, (struct obj *,const char *));
+E char *FDECL(vtense, (const char *,const char *));
E char *FDECL(Doname2, (struct obj *));
E char *FDECL(yname, (struct obj *));
E char *FDECL(Yname2, (struct obj *));
E boolean FDECL(burnarmor,(struct monst *));
E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P,struct monst *));
-E void FDECL(grease_protect, (struct obj *,const char *,BOOLEAN_P,struct monst *));
+E void FDECL(grease_protect, (struct obj *,const char *,struct monst *));
E struct trap *FDECL(maketrap, (int,int,int));
E void FDECL(fall_through, (BOOLEAN_P));
E struct monst *FDECL(animate_statue, (struct obj *,XCHAR_P,XCHAR_P,int,int *));
(obj)->otyp == FLINT || \
(obj)->otyp == TOUCHSTONE)
+/* helpers, simple enough to be macros */
+#define is_plural(o) ((o)->quan > 1 || \
+ (o)->oartifact == ART_EYES_OF_THE_OVERWORLD)
+
/* Flags for get_obj_location(). */
#define CONTAINED_TOO 0x1
#define BURIED_TOO 0x2
u.ux, u.uy, NO_MINVENT)) != 0) {
You("summon %s!", a_monnam(mtmp));
if (!obj_resists(obj, 93, 100)) {
- pline("%s has shattered!", The(xname(obj)));
+ pline("%s shattered!", Tobjnam(obj, "have"));
useup(obj);
} else switch (rn2(3)) {
default:
wakem = TRUE;
} else if (invoking) {
- pline("%s issues an unsettling shrill sound...",
- The(xname(obj)));
+ pline("%s an unsettling shrill sound...",
+ Tobjnam(obj, "issue"));
#ifdef AMIGA
amii_speaker( obj, "aefeaefeaefeaefeaefe", AMII_LOUDER_VOLUME );
#endif
use_candelabrum(obj)
register struct obj *obj;
{
+ char *s = obj->spe != 1 ? "candles" : "candle";
+
if(Underwater) {
You("cannot make fire under water.");
return;
}
if(obj->lamplit) {
- You("snuff the candle%s.", obj->spe > 1 ? "s" : "");
+ You("snuff the %s.", s);
end_burn(obj, TRUE);
return;
}
if(obj->spe <= 0) {
- pline("This %s has no candles.", xname(obj));
+ pline("This %s has no %s.", xname(obj), s);
return;
}
if(u.uswallow || obj->cursed) {
if (!Blind)
- pline_The("candle%s flicker%s for a moment, then die%s.",
- obj->spe > 1 ? "s" : "",
- obj->spe > 1 ? "" : "s",
- obj->spe > 1 ? "" : "s");
+ pline_The("%s %s for a moment, then %s.",
+ s, vtense(s, "flicker"), vtense(s, "die"));
return;
}
if(obj->spe < 7) {
- There("%s only %d candle%s in %s.",
- obj->spe == 1 ? "is" : "are",
- obj->spe,
- obj->spe > 1 ? "s" : "",
- the(xname(obj)));
+ There("%s only %d %s in %s.",
+ vtense(s, "are"), obj->spe, s, the(xname(obj)));
if (!Blind)
- pline("%s lit. %s shines dimly.",
- obj->spe == 1 ? "It is" : "They are", The(xname(obj)));
+ pline("%s lit. %s dimly.",
+ obj->spe == 1 ? "It is" : "They are",
+ Tobjnam(obj, "shine"));
} else {
- pline("%s's candles burn%s", The(xname(obj)),
+ pline("%s's %s burn%s", The(xname(obj)), s,
(Blind ? "." : " brightly!"));
}
if (!invocation_pos(u.ux, u.uy)) {
- pline_The("candle%s being rapidly consumed!",
- (obj->spe > 1 ? "s are" : " is"));
+ pline_The("%s %s being rapidly consumed!", s, vtense(s, "are"));
obj->age /= 2;
} else {
if(obj->spe == 7) {
if (Blind)
- pline("%s radiates a strange warmth!", The(xname(obj)));
+ pline("%s a strange warmth!", Tobjnam(obj, "radiate"));
else
- pline("%s glows with a strange light!", The(xname(obj)));
+ pline("%s with a strange light!", Tobjnam(obj, "glow"));
}
obj->known = 1;
}
register struct obj *obj;
{
register struct obj *otmp;
+ char *s = obj->quan != 1 ? "candles" : "candle";
char qbuf[QBUFSZ];
if(u.uswallow) {
} else {
if ((long)otmp->spe + obj->quan > 7L)
obj = splitobj(obj, 7L - (long)otmp->spe);
- You("attach %ld%s candle%s to %s.",
+ You("attach %ld%s %s to %s.",
obj->quan, !otmp->spe ? "" : " more",
- plur(obj->quan), the(xname(otmp)));
+ s, the(xname(otmp)));
if (!otmp->spe || otmp->age > obj->age)
otmp->age = obj->age;
otmp->spe += (int)obj->quan;
if (otmp->lamplit && !obj->lamplit)
- pline_The("new candle%s magically ignite%s!",
- plur(obj->quan),
- (obj->quan > 1L) ? "" : "s");
+ pline_The("new %s magically %s!", s, vtense(s, "ignite"));
else if (!otmp->lamplit && obj->lamplit)
pline("%s out.", (obj->quan > 1L) ? "They go" : "It goes");
if (obj->unpaid)
(obj->quan > 1L) ? "them" : "it",
(obj->quan > 1L) ? "them" : "it");
if (obj->quan < 7L && otmp->spe == 7)
- pline("%s now has seven%s candles attached.",
- The(xname(otmp)), otmp->lamplit ? " lit" : "");
+ pline("%s now has seven%s %s attached.",
+ The(xname(otmp)), otmp->lamplit ? " lit" : "", s);
/* candelabrum's light range might increase */
if (otmp->lamplit) obj_merge_light_sources(otmp, otmp);
/* candles are no longer a separate light source */
obj->otyp == BRASS_LANTERN || obj->otyp == POT_OIL) {
(void) get_obj_location(obj, &x, &y, 0);
if (obj->where == OBJ_MINVENT ? cansee(x,y) : !Blind)
- pline("%s goes out!", Yname2(obj));
+ pline("%s %s out!", Yname2(obj), otense(obj, "go"));
end_burn(obj, TRUE);
return TRUE;
}
if (!get_obj_location(obj, &x, &y, 0))
return FALSE;
if (obj->where == OBJ_MINVENT ? cansee(x,y) : !Blind)
- pline("%s catches light!", Yname2(obj));
+ pline("%s %s light!", Yname2(obj), otense(obj, "catch"));
begin_burn(obj, TRUE);
return TRUE;
}
return;
}
if (obj->cursed && !rn2(2)) {
- pline("%s flicker%s for a moment, then die%s.",
- The(xname(obj)),
- obj->quan > 1L ? "" : "s",
- obj->quan > 1L ? "" : "s");
+ pline("%s for a moment, then %s.",
+ Tobjnam(obj, "flicker"), otense(obj, "die"));
} else {
if(obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP ||
obj->otyp == BRASS_LANTERN) {
check_unpaid(obj);
pline("%s lamp is now on.", Shk_Your(buf, obj));
} else { /* candle(s) */
- pline("%s flame%s burn%s%s",
+ pline("%s flame%s %s%s",
s_suffix(Yname2(obj)),
- plur(obj->quan),
- obj->quan > 1L ? "" : "s",
+ plur(obj->quan), otense(obj, "burn"),
Blind ? "." : " brightly!");
if (obj->unpaid && costly_spot(u.ux, u.uy) &&
obj->age == 20L * (long)objects[obj->otyp].oc_cost) {
if (Glib) {
dropx(obj);
- pline("%s slips from your %s.", The(xname(obj)),
+ pline("%s from your %s.", Tobjnam(obj, "slip"),
makeplural(body_part(FINGER)));
return;
}
check_unpaid(obj);
obj->spe--;
dropx(obj);
- pline("%s slips from your %s.", The(xname(obj)),
+ pline("%s from your %s.", Tobjnam(obj, "slip"),
makeplural(body_part(FINGER)));
return;
}
makeplural(body_part(FINGER)));
}
} else {
- pline("%s %s empty.", The(xname(obj)),
- obj->known ? "is" : "seems to be");
+ if (obj->known)
+ pline("%s empty.", Tobjnam(obj, "are"));
+ else
+ pline("%s to be empty.", Tobjnam(obj, "seem"));
}
update_inventory();
}
if (material == LIQUID || material == WAX ||
material == CLOTH || material == WOOD) {
switch(material) {
- case LIQUID:
- if (!obj->known)
- You("must think this is a wetstone, do you?");
- else
- pline("%s is a little wetter now.", The(xname(otmp)));
- break;
- case WAX:
- color = "waxy";
- goto see_streaks; /* okay even if not touchstone */
- break;
- case CLOTH:
- pline_The("stone looks a little more polished now.");
- break;
- case WOOD:
- color = "wooden";
- goto see_streaks; /* okay even if not touchstone */
- break;
+ case LIQUID:
+ if (!obj->known)
+ You("must think this is a wetstone, do you?");
+ else
+ pline("%s a little wetter now.", Tobjnam(otmp, "are"));
+ break;
+ case WAX:
+ color = "waxy";
+ goto see_streaks; /* okay even if not touchstone */
+ break;
+ case CLOTH:
+ pline_The("stone looks a little more polished now.");
+ break;
+ case WOOD:
+ color = "wooden";
+ goto see_streaks; /* okay even if not touchstone */
+ break;
}
return;
}
-
+
if (otmp->otyp != TOUCHSTONE) {
pline(ambiguous);
return;
/* can pick it up unless you're totally non-synch'd with the artifact */
if (badclass && badalign && self_willed) {
- if (yours) pline("%s evades your grasp!", The(xname(obj)));
+ if (yours) pline("%s your grasp!", Tobjnam(obj, "evade"));
return 0;
}
if (attacks(AD_ELEC, otmp)) {
if (realizes_damage) {
if(youattack && otmp != uwep)
- pline("%s hits %s!", The(xname(otmp)), hittee);
+ pline("%s %s!", Tobjnam(otmp, "hit"), hittee);
pline("Lightning strikes %s!", hittee);
if (!rn2(5)) (void) destroy_mitem(mdef, RING_CLASS, AD_ELEC);
if (!rn2(5)) (void) destroy_mitem(mdef, WAND_CLASS, AD_ELEC);
if (attacks(AD_MAGM, otmp)) {
if (realizes_damage) {
if(youattack && otmp != uwep)
- pline("%s hits %s!", The(xname(otmp)), hittee);
+ pline("%s %s!", Tobjnam(otmp, "hit"), hittee);
pline("A hail of magic missiles strikes %s!", hittee);
return TRUE;
}
line = getrumor(bcsign(obj), buf, TRUE);
if (!*line)
line = "NetHack rumors file closed for renovation.";
- pline("%s whispers:", The(xname(obj)));
+ pline("%s:", Tobjnam(obj, "whisper"));
verbalize("%s", line);
return;
}
const char *verb;
{
static char wholebuf[80];
- char verbbuf[30];
Strcpy(wholebuf, is_u(etmp) ? "You" : Monnam(etmp->emon));
- if (!*verb)
- return(wholebuf);
+ if (!*verb) return(wholebuf);
Strcat(wholebuf, " ");
- verbbuf[0] = '\0';
if (is_u(etmp))
- Strcpy(verbbuf, verb);
- else {
- if (!strcmp(verb, "are"))
- Strcpy(verbbuf, "is");
- if (!strcmp(verb, "have"))
- Strcpy(verbbuf, "has");
- if (!verbbuf[0]) {
- Strcpy(verbbuf, verb);
- switch (verbbuf[strlen(verbbuf) - 1]) {
- case 'y':
- verbbuf[strlen(verbbuf) - 1] = '\0';
- Strcat(verbbuf, "ies");
- break;
- case 'h':
- case 'o':
- case 's':
- Strcat(verbbuf, "es");
- break;
- default:
- Strcat(verbbuf, "s");
- break;
- }
- }
- }
- Strcat(wholebuf, verbbuf);
+ Strcat(wholebuf, verb);
+ else
+ Strcat(wholebuf, vtense((char *)0, verb));
return(wholebuf);
}
{
char ch;
int oops;
- const char *bname = xname(obj);
if (Blind) {
- pline("Too bad you can't see %s", the(bname));
+ pline("Too bad you can't see %s", the(xname(obj)));
return;
}
oops = (rnd(20) > ACURR(A_INT) || obj->cursed);
if (oops && (obj->spe > 0)) {
switch (rnd(obj->oartifact ? 4 : 5)) {
- case 1 : pline("%s is too much to comprehend!", The(bname));
+ case 1 : pline("%s too much to comprehend!", Tobjnam(obj, "are"));
break;
- case 2 : pline("%s confuses you!", The(bname));
+ case 2 : pline("%s you!", Tobjnam(obj, "confuse"));
make_confused(HConfusion + rnd(100),FALSE);
break;
case 3 : if (!resists_blnd(&youmonst)) {
- pline("%s damages your vision!", The(bname));
+ pline("%s your vision!", Tobjnam(obj, "damage"));
make_blinded(Blinded + rnd(100),FALSE);
if (!Blind) Your(vision_clears);
} else {
- pline("%s assaults your vision.", The(bname));
+ pline("%s your vision.", Tobjnam(obj, "assault"));
You("are unaffected!");
}
break;
- case 4 : pline("%s zaps your mind!", The(bname));
+ case 4 : pline("%s your mind!", Tobjnam(obj, "zap"));
make_hallucinated(HHallucination + rnd(100),FALSE,0L);
break;
- case 5 : pline("%s explodes!", The(bname));
+ case 5 : pline("%s!", Tobjnam(obj, "explode"));
useup(obj);
losehp(rnd(30), "exploding crystal ball", KILLED_BY_AN);
break;
if (flags.verbose) pline(Never_mind);
return;
}
- You("peer into %s...", the(bname));
+ You("peer into %s...", the(xname(obj)));
nomul(-rnd(10));
nomovemsg = "";
if (obj->spe <= 0)
}
}
if(Fumbling && !rn2(3)) {
- switch(rn2(3)) {
- case 0: if(!welded(uwep)) {
- You("fumble and drop your %s.", xname(uwep));
- dropx(uwep);
- } else {
+ switch(rn2(3)) {
+ case 0:
+ if(!welded(uwep)) {
+ You("fumble and drop your %s.", xname(uwep));
+ dropx(uwep);
+ } else {
#ifdef STEED
- if (u.usteed)
- Your("%s bounces and hits %s!",
- xname(uwep), mon_nam(u.usteed));
- else
+ if (u.usteed)
+ Your("%s %s and %s %s!",
+ xname(uwep),
+ otense(uwep, "bounce"), otense(uwep, "hit"),
+ mon_nam(u.usteed));
+ else
#endif
- pline("Ouch! Your %s bounces and hits you!",
- xname(uwep));
- set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
- }
- break;
- case 1: pline("Bang! You hit with the broad side of %s!",
- the(xname(uwep)));
- break;
- default: Your("swing misses its mark.");
- break;
+ pline("Ouch! Your %s %s and %s you!",
+ xname(uwep),
+ otense(uwep, "bounce"), otense(uwep, "hit"));
+ set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
}
- return(0);
+ break;
+ case 1:
+ pline("Bang! You hit with the broad side of %s!",
+ the(xname(uwep)));
+ break;
+ default: Your("swing misses its mark.");
+ break;
+ }
+ return(0);
}
digging.effort += 10 + rn2(5) + abon() +
seetrap(trap);
There("is a spider web there!");
}
- Your("%s becomes entangled in the web.",
- aobjnam(obj, (char *)0));
+ Your("%s entangled in the web.",
+ aobjnam(obj, "become"));
/* you ought to be able to let go; tough luck */
/* (maybe `move_into_trap()' would be better) */
nomul(-d(2,2));
x = obj->ox;
y = obj->oy;
} else if (in_invent) {
- if (flags.verbose)
- Your("%s%s rot%s away%c",
- obj == uwep ? "wielded " : "", corpse_xname(obj, FALSE),
- obj->quan == 1L ? "s" : "", obj == uwep ? '!' : '.');
+ if (flags.verbose) {
+ char *cname = corpse_xname(obj, FALSE);
+ Your("%s%s %s away%c",
+ obj == uwep ? "wielded " : nul, cname,
+ vtense(cname, "rot"), obj == uwep ? '!' : '.');
+ }
if (obj == uwep) {
uwepgone(); /* now bare handed */
stop_occupation();
if (((mtmp = m_at(x, y)) && mtmp->mtrapped) ||
(u.utrap && u.ux == x && u.uy == y)) {
if (*verb)
- pline_The("boulder %ss into the pit%s.", verb,
+ pline_The("boulder %s into the pit%s.",
+ vtense((const char *)0, verb),
(mtmp) ? "" : " with you");
if (mtmp) {
if (!passes_walls(mtmp->data) &&
u.uconduct.gnostic++;
if (obj->blessed || obj->cursed) {
- There("is %s flash as %s hit%s the altar.",
+ There("is %s flash as %s %s the altar.",
an(hcolor(obj->blessed ? amber : Black)),
- doname(obj),
- (obj->quan == 1L) ? "s" : "");
+ doname(obj), otense(obj, "hit"));
if (!Hallucination) obj->bknown = 1;
} else {
- pline("%s land%s on the altar.", Doname2(obj),
- (obj->quan == 1L) ? "s" : "");
+ pline("%s %s on the altar.", Doname2(obj),
+ otense(obj, "land"));
obj->bknown = 1;
}
}
if (otmp != uball && otmp != uchain &&
!obj_resists(otmp, 1, 99)) {
if (!Blind) {
- pline("Suddenly, %s vanishes from the sink!",
- doname(otmp));
+ pline("Suddenly, %s %s from the sink!",
+ doname(otmp), otense(otmp, "vanish"));
ideed = TRUE;
}
delobj(otmp);
short objtyp;
Sprintf(qbuf, "What do you want to name %s %s?",
- (obj->quan > 1L) ? "these" : "this", xname(obj));
+ is_plural(obj) ? "these" : "this", xname(obj));
getlin(qbuf, buf);
if(!*buf || *buf == '\033') return;
/* strip leading and trailing spaces; unnames item if all spaces */