"your" artifacts

This patch introduces a change to yname() and Yname2() that avoids the
possessive "your" for the hero's normal, fully identified artifacts.
Quest artifacts still get the possessive, as do all other objects and all
objects not in the hero's possession.  shk_your()/Shk_Your() are used in
many places with a specific, generalized name for the object, so I didn't
introduce the artifact behavior there, although I did change them to append
a space, which simplified some other code.  Through added use of yname(),
there may be some places that used to just say "corpse" that will now be more
descriptive via yname()'s use of cxname().  I'm sure <Someone> will point
out any such places that are too onerous, although nothing obviously is.

I took the opportunity to inspect many uses of "your" and even Your().  Two
new functions are also introduced, yobjnam() and Yobjnam2(), which work
like aobjnam() and yname() combined, because I found that many uses of
aobjnam() were preceeded by "your" and I couldn't generally provide the
desired behavior for artifacts (or future artifacts) without a combined
function.  In some cases, this change allowed better sharing of code.

rust_dmg() still takes a string as input which is sometimes initialized
from xname() and often prepends "your" to it.  Currently, this isn't a
problem since there currently are no normal, armor artifacts.  If/when any
are introduced, rust_dmg() will need to be addressed.

The patch is for the trunk only.  A lot of research was required and I
didn't feel the upside was there for repeating it in the 3.4.3 branch.
This commit is contained in:
cohrs
2003-09-18 02:52:40 +00:00
parent 9402d6dc54
commit 5e443536d8
28 changed files with 274 additions and 285 deletions
+2
View File
@@ -1367,6 +1367,8 @@ E char *FDECL(An, (const char *));
E char *FDECL(The, (const char *)); E char *FDECL(The, (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(aobjnam, (struct obj *,const char *));
E char *FDECL(yobjnam, (struct obj *,const char *));
E char *FDECL(Yobjnam2, (struct obj *,const char *));
E char *FDECL(Tobjnam, (struct obj *,const char *)); E char *FDECL(Tobjnam, (struct obj *,const char *));
E char *FDECL(otense, (struct obj *,const char *)); E char *FDECL(otense, (struct obj *,const char *));
E char *FDECL(vtense, (const char *,const char *)); E char *FDECL(vtense, (const char *,const char *));
+20 -22
View File
@@ -982,7 +982,7 @@ register struct obj *otmp;
(void) get_obj_location(otmp, &x, &y, 0); (void) get_obj_location(otmp, &x, &y, 0);
if (otmp->where == OBJ_MINVENT ? cansee(x,y) : !Blind) if (otmp->where == OBJ_MINVENT ? cansee(x,y) : !Blind)
pline("%s %scandle%s flame%s extinguished.", pline("%s%scandle%s flame%s extinguished.",
Shk_Your(buf, otmp), Shk_Your(buf, otmp),
(candle ? "" : "candelabrum's "), (candle ? "" : "candelabrum's "),
(many ? "s'" : "'s"), (many ? "s are" : " is")); (many ? "s'" : "'s"), (many ? "s are" : " is"));
@@ -1066,7 +1066,7 @@ struct obj *obj;
if(obj->lamplit) { if(obj->lamplit) {
if(obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP || if(obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP ||
obj->otyp == BRASS_LANTERN) obj->otyp == BRASS_LANTERN)
pline("%s lamp is now off.", Shk_Your(buf, obj)); pline("%slamp is now off.", Shk_Your(buf, obj));
else else
You("snuff out %s.", yname(obj)); You("snuff out %s.", yname(obj));
end_burn(obj, TRUE); end_burn(obj, TRUE);
@@ -1087,7 +1087,7 @@ struct obj *obj;
if(obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP || if(obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP ||
obj->otyp == BRASS_LANTERN) { obj->otyp == BRASS_LANTERN) {
check_unpaid(obj); check_unpaid(obj);
pline("%s lamp is now on.", Shk_Your(buf, obj)); pline("%slamp is now on.", Shk_Your(buf, obj));
} else { /* candle(s) */ } else { /* candle(s) */
pline("%s flame%s %s%s", pline("%s flame%s %s%s",
s_suffix(Yname2(obj)), s_suffix(Yname2(obj)),
@@ -1131,7 +1131,7 @@ light_cocktail(obj)
return; return;
} }
You("light %s potion.%s", shk_your(buf, obj), You("light %spotion.%s", shk_your(buf, obj),
Blind ? "" : " It gives off a dim light."); Blind ? "" : " It gives off a dim light.");
if (obj->unpaid && costly_spot(u.ux, u.uy)) { if (obj->unpaid && costly_spot(u.ux, u.uy)) {
/* Normally, we shouldn't both partially and fully charge /* Normally, we shouldn't both partially and fully charge
@@ -1752,7 +1752,7 @@ struct obj **optr;
static NEARDATA const char lubricables[] = { ALL_CLASSES, ALLOW_NONE, 0 }; static NEARDATA const char lubricables[] = { ALL_CLASSES, ALLOW_NONE, 0 };
static NEARDATA const char need_to_remove_outer_armor[] = static NEARDATA const char need_to_remove_outer_armor[] =
"need to remove your %s to grease your %s."; "need to remove %s to grease %s.";
STATIC_OVL void STATIC_OVL void
use_grease(obj) use_grease(obj)
@@ -1780,16 +1780,17 @@ struct obj *obj;
otmp = getobj(lubricables, "grease"); otmp = getobj(lubricables, "grease");
if (!otmp) return; if (!otmp) return;
if ((otmp->owornmask & WORN_ARMOR) && uarmc) { if ((otmp->owornmask & WORN_ARMOR) && uarmc) {
Strcpy(buf, xname(uarmc)); Strcpy(buf, yname(uarmc));
You(need_to_remove_outer_armor, buf, xname(otmp)); You(need_to_remove_outer_armor, buf, yname(otmp));
return; return;
} }
#ifdef TOURIST #ifdef TOURIST
if ((otmp->owornmask & WORN_SHIRT) && (uarmc || uarm)) { if ((otmp->owornmask & WORN_SHIRT) && (uarmc || uarm)) {
Strcpy(buf, uarmc ? xname(uarmc) : ""); Strcpy(buf, uarmc ? yname(uarmc) : "");
if (uarmc && uarm) Strcat(buf, " and "); if (uarmc && uarm)
Strcat(buf, uarm ? xname(uarm) : ""); Strcat(strcat(buf, " and "), xname(uarm));
You(need_to_remove_outer_armor, buf, xname(otmp)); else Strcat(buf, uarm ? yname(uarm) : "");
You(need_to_remove_outer_armor, buf, yname(otmp));
return; return;
} }
#endif #endif
@@ -2011,7 +2012,7 @@ struct obj *otmp;
ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP; ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP;
if (otmp == trapinfo.tobj && if (otmp == trapinfo.tobj &&
u.ux == trapinfo.tx && u.uy == trapinfo.ty) { u.ux == trapinfo.tx && u.uy == trapinfo.ty) {
You("resume setting %s %s.", You("resume setting %s%s.",
shk_your(buf, otmp), shk_your(buf, otmp),
defsyms[trap_to_defsym(what_trap(ttyp))].explanation); defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
set_occupation(set_trap, occutext, 0); set_occupation(set_trap, occutext, 0);
@@ -2059,7 +2060,7 @@ struct obj *otmp;
} }
} }
#endif #endif
You("begin setting %s %s.", You("begin setting %s%s.",
shk_your(buf, otmp), shk_your(buf, otmp),
defsyms[trap_to_defsym(what_trap(ttyp))].explanation); defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
set_occupation(set_trap, occutext, 0); set_occupation(set_trap, occutext, 0);
@@ -2260,8 +2261,7 @@ struct obj *obj;
} else } else
mon_hand = 0; /* lint suppression */ mon_hand = 0; /* lint suppression */
You("wrap your bullwhip around %s %s.", You("wrap your bullwhip around %s.", yname(otmp));
s_suffix(mon_nam(mtmp)), onambuf);
if (gotit && otmp->cursed) { if (gotit && otmp->cursed) {
pline("%s welded to %s %s%c", pline("%s welded to %s %s%c",
(otmp->quan == 1L) ? "It is" : "They are", (otmp->quan == 1L) ? "It is" : "They are",
@@ -2278,8 +2278,8 @@ struct obj *obj;
switch (rn2(proficient + 1)) { switch (rn2(proficient + 1)) {
case 2: case 2:
/* to floor near you */ /* to floor near you */
You("yank %s %s to the %s!", s_suffix(mon_nam(mtmp)), You("yank %s to the %s!",
onambuf, surface(u.ux, u.uy)); yname(otmp), surface(u.ux, u.uy));
place_object(otmp, u.ux, u.uy); place_object(otmp, u.ux, u.uy);
stackobj(otmp); stackobj(otmp);
break; break;
@@ -2305,7 +2305,7 @@ struct obj *obj;
} }
#endif /* 0 */ #endif /* 0 */
/* right into your inventory */ /* right into your inventory */
You("snatch %s %s!", s_suffix(mon_nam(mtmp)), onambuf); You("snatch %s!", yname(otmp));
if (otmp->otyp == CORPSE && if (otmp->otyp == CORPSE &&
touch_petrifies(&mons[otmp->corpsenm]) && touch_petrifies(&mons[otmp->corpsenm]) &&
!uarmg && !Stone_resistance && !uarmg && !Stone_resistance &&
@@ -2868,10 +2868,8 @@ doapply()
/* sometimes the blessing will be worn off */ /* sometimes the blessing will be worn off */
if (!rn2(49)) { if (!rn2(49)) {
if (!Blind) { if (!Blind) {
char buf[BUFSZ]; pline("%s %s.",
Yobjnam2(obj, "glow"), hcolor("brown"));
pline("%s %s %s.", Shk_Your(buf, obj),
aobjnam(obj, "glow"), hcolor("brown"));
obj->bknown = 1; obj->bknown = 1;
} }
unbless(obj); unbless(obj);
+3 -3
View File
@@ -36,7 +36,7 @@ ballfall()
pline("Fortunately, you are wearing a hard helmet."); pline("Fortunately, you are wearing a hard helmet.");
dmg = 3; dmg = 3;
} else if (flags.verbose) } else if (flags.verbose)
Your("%s does not protect you.", xname(uarmh)); pline("%s does not protect you.", Yname2(uarmh));
} }
losehp(dmg, "crunched in the head by an iron ball", losehp(dmg, "crunched in the head by an iron ball",
NO_KILLER_PREFIX); NO_KILLER_PREFIX);
@@ -734,8 +734,8 @@ litter()
nextobj = otmp->nobj; nextobj = otmp->nobj;
if ((otmp != uball) && (rnd(capacity) <= (int)otmp->owt)) { if ((otmp != uball) && (rnd(capacity) <= (int)otmp->owt)) {
if (canletgo(otmp, "")) { if (canletgo(otmp, "")) {
Your("%s you down the stairs.", pline("%s you down the stairs.",
aobjnam(otmp, "follow")); Yobjnam2(otmp, "follow"));
dropx(otmp); dropx(otmp);
} }
} }
+13 -15
View File
@@ -240,20 +240,18 @@ dig()
switch(rn2(3)) { switch(rn2(3)) {
case 0: case 0:
if(!welded(uwep)) { if(!welded(uwep)) {
You("fumble and drop your %s.", xname(uwep)); You("fumble and drop %s.", yname(uwep));
dropx(uwep); dropx(uwep);
} else { } else {
#ifdef STEED #ifdef STEED
if (u.usteed) if (u.usteed)
Your("%s %s and %s %s!", pline("%s and %s %s!",
xname(uwep), Yobjnam2(uwep, "bounce"), otense(uwep, "hit"),
otense(uwep, "bounce"), otense(uwep, "hit"), mon_nam(u.usteed));
mon_nam(u.usteed));
else else
#endif #endif
pline("Ouch! Your %s %s and %s you!", pline("Ouch! %s and %s you!",
xname(uwep), Yobjnam2(uwep, "bounce"), otense(uwep, "hit"));
otense(uwep, "bounce"), otense(uwep, "hit"));
set_wounded_legs(RIGHT_SIDE, 5 + rnd(5)); set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
} }
break; break;
@@ -913,8 +911,8 @@ struct obj *obj;
seetrap(trap); seetrap(trap);
There("is a spider web there!"); There("is a spider web there!");
} }
Your("%s entangled in the web.", pline("%s entangled in the web.",
aobjnam(obj, "become")); Yobjnam2(obj, "become"));
/* you ought to be able to let go; tough luck */ /* you ought to be able to let go; tough luck */
/* (maybe `move_into_trap()' would be better) */ /* (maybe `move_into_trap()' would be better) */
nomul(-d(2,2)); nomul(-d(2,2));
@@ -935,8 +933,8 @@ struct obj *obj;
if (vibrate) losehp(2, "axing a hard object", KILLED_BY); if (vibrate) losehp(2, "axing a hard object", KILLED_BY);
} }
else else
You("swing your %s through thin air.", You("swing %s through thin air.",
aobjnam(obj, (char *)0)); yobjnam(obj, (char *)0));
} else { } else {
static const char * const d_action[6] = { static const char * const d_action[6] = {
"swinging", "swinging",
@@ -977,7 +975,7 @@ struct obj *obj;
} }
} else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) { } else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) {
/* it must be air -- water checked above */ /* it must be air -- water checked above */
You("swing your %s through thin air.", aobjnam(obj, (char *)0)); You("swing %s through thin air.", yobjnam(obj, (char *)0));
} else if (!can_reach_floor()) { } else if (!can_reach_floor()) {
You_cant("reach the %s.", surface(u.ux,u.uy)); You_cant("reach the %s.", surface(u.ux,u.uy));
} else if (is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) { } else if (is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) {
@@ -985,8 +983,8 @@ struct obj *obj;
You("cannot stay under%s long enough.", You("cannot stay under%s long enough.",
is_pool(u.ux, u.uy) ? "water" : " the lava"); is_pool(u.ux, u.uy) ? "water" : " the lava");
} else if (!ispick) { } else if (!ispick) {
Your("%s merely scratches the %s.", pline("%s merely scratches the %s.",
aobjnam(obj, (char *)0), surface(u.ux,u.uy)); Yobjnam2(obj, (char *)0), surface(u.ux,u.uy));
u_wipe_engr(3); u_wipe_engr(3);
} else { } else {
if (digging.pos.x != u.ux || digging.pos.y != u.uy || if (digging.pos.x != u.ux || digging.pos.y != u.uy ||
+4 -6
View File
@@ -252,8 +252,8 @@ register struct obj *obj;
obj->in_use = TRUE; /* block free identification via interrupt */ obj->in_use = TRUE; /* block free identification via interrupt */
switch(obj->otyp) { /* effects that can be noticed without eyes */ switch(obj->otyp) { /* effects that can be noticed without eyes */
case RIN_SEARCHING: case RIN_SEARCHING:
You("thought your %s got lost in the sink, but there it is!", You("thought %s got lost in the sink, but there it is!",
xname(obj)); yname(obj));
goto giveback; goto giveback;
case RIN_SLOW_DIGESTION: case RIN_SLOW_DIGESTION:
pline_The("ring is regurgitated!"); pline_The("ring is regurgitated!");
@@ -1506,10 +1506,8 @@ struct obj *corpse;
case OBJ_CONTAINED: case OBJ_CONTAINED:
if (container_where == OBJ_MINVENT && cansee(mtmp->mx, mtmp->my) && if (container_where == OBJ_MINVENT && cansee(mtmp->mx, mtmp->my) &&
mcarry && canseemon(mcarry) && container) { mcarry && canseemon(mcarry) && container) {
char sackname[BUFSZ]; pline("%s writhes out of %s!",
Sprintf(sackname, "%s %s", s_suffix(mon_nam(mcarry)), Amonnam(mtmp), yname(container));
xname(container));
pline("%s writhes out of %s!", Amonnam(mtmp), sackname);
} else if (container_where == OBJ_INVENT && container) { } else if (container_where == OBJ_INVENT && container) {
char sackname[BUFSZ]; char sackname[BUFSZ];
Strcpy(sackname, an(xname(container))); Strcpy(sackname, an(xname(container)));
+1 -1
View File
@@ -796,7 +796,7 @@ boolean hitsroof;
pline("Fortunately, you are wearing a hard helmet."); pline("Fortunately, you are wearing a hard helmet.");
} else if (flags.verbose && } else if (flags.verbose &&
!(obj->otyp == CORPSE && touch_petrifies(&mons[obj->corpsenm]))) !(obj->otyp == CORPSE && touch_petrifies(&mons[obj->corpsenm])))
Your("%s does not protect you.", xname(uarmh)); pline("%s does not protect you.", Yname2(uarmh));
} else if (obj->otyp == CORPSE && touch_petrifies(&mons[obj->corpsenm])) { } else if (obj->otyp == CORPSE && touch_petrifies(&mons[obj->corpsenm])) {
if (!Stone_resistance && if (!Stone_resistance &&
!(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) { !(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) {
+2 -2
View File
@@ -1129,8 +1129,8 @@ start_tin(otmp) /* called when starting to open a tin */
default: default:
goto no_opener; goto no_opener;
} }
pline("Using your %s you try to open the tin.", pline("Using %s you try to open the tin.",
aobjnam(uwep, (char *)0)); yobjnam(uwep, (char *)0));
} else { } else {
no_opener: no_opener:
pline("It is not so easy to open this tin."); pline("It is not so easy to open this tin.");
+17 -14
View File
@@ -432,6 +432,7 @@ doengrave()
xchar type = DUST; /* Type of engraving made */ xchar type = DUST; /* Type of engraving made */
char buf[BUFSZ]; /* Buffer for final/poly engraving text */ char buf[BUFSZ]; /* Buffer for final/poly engraving text */
char ebuf[BUFSZ]; /* Buffer for initial engraving text */ char ebuf[BUFSZ]; /* Buffer for initial engraving text */
char fbuf[BUFSZ]; /* Buffer for "your fingers" */
char qbuf[QBUFSZ]; /* Buffer for query text */ char qbuf[QBUFSZ]; /* Buffer for query text */
char post_engr_text[BUFSZ]; /* Text displayed after engraving prompt */ char post_engr_text[BUFSZ]; /* Text displayed after engraving prompt */
const char *everb; /* Present tense of engraving type */ const char *everb; /* Present tense of engraving type */
@@ -489,8 +490,10 @@ doengrave()
otmp = getobj(styluses, "write with"); otmp = getobj(styluses, "write with");
if(!otmp) return(0); /* otmp == zeroobj if fingers */ if(!otmp) return(0); /* otmp == zeroobj if fingers */
if (otmp == &zeroobj) writer = makeplural(body_part(FINGER)); if (otmp == &zeroobj) {
else writer = xname(otmp); Strcat(strcpy(fbuf, "your "), makeplural(body_part(FINGER)));
writer = fbuf;
} else writer = yname(otmp);
/* There's no reason you should be able to write with a wand /* There's no reason you should be able to write with a wand
* while both your hands are tied up. * while both your hands are tied up.
@@ -501,7 +504,7 @@ doengrave()
} }
if (jello) { if (jello) {
You("tickle %s with your %s.", mon_nam(u.ustuck), writer); You("tickle %s with %s.", mon_nam(u.ustuck), writer);
Your("message dissolves..."); Your("message dissolves...");
return(0); return(0);
} }
@@ -510,7 +513,7 @@ doengrave()
return(0); return(0);
} }
if (IS_ALTAR(levl[u.ux][u.uy].typ)) { if (IS_ALTAR(levl[u.ux][u.uy].typ)) {
You("make a motion towards the altar with your %s.", writer); You("make a motion towards the altar with %s.", writer);
altar_wrath(u.ux, u.uy); altar_wrath(u.ux, u.uy);
return(0); return(0);
} }
@@ -565,7 +568,7 @@ doengrave()
case FOOD_CLASS: case FOOD_CLASS:
case SCROLL_CLASS: case SCROLL_CLASS:
case SPBOOK_CLASS: case SPBOOK_CLASS:
Your("%s would get %s.", xname(otmp), pline("%s would get %s.", Yname2(otmp),
is_ice(u.ux,u.uy) ? "all frosty" : "too dirty"); is_ice(u.ux,u.uy) ? "all frosty" : "too dirty");
ptext = FALSE; ptext = FALSE;
break; break;
@@ -749,7 +752,8 @@ doengrave()
if ((int)otmp->spe > -3) if ((int)otmp->spe > -3)
type = ENGRAVE; type = ENGRAVE;
else else
Your("%s too dull for engraving.", aobjnam(otmp,"are")); pline("%s too dull for engraving.",
Yobjnam2(otmp, "are"));
} }
break; break;
@@ -776,16 +780,15 @@ doengrave()
if (!Blind) if (!Blind)
You("wipe out the message here."); You("wipe out the message here.");
else else
Your("%s %s %s.", xname(otmp), pline("%s %s.", Yobjnam2(otmp, "get"),
otense(otmp, "get"), is_ice(u.ux,u.uy) ?
is_ice(u.ux,u.uy) ? "frosty" : "dusty");
"frosty" : "dusty");
dengr = TRUE; dengr = TRUE;
} else } else
Your("%s can't wipe out this engraving.", pline("%s can't wipe out this engraving.",
xname(otmp)); Yname2(otmp));
else else
Your("%s %s %s.", xname(otmp), otense(otmp, "get"), pline("%s %s.", Yobjnam2(otmp, "get"),
is_ice(u.ux,u.uy) ? "frosty" : "dusty"); is_ice(u.ux,u.uy) ? "frosty" : "dusty");
break; break;
default: default:
@@ -1019,7 +1022,7 @@ doengrave()
* However, you could now engrave "Elb", then * However, you could now engrave "Elb", then
* "ere", then "th". * "ere", then "th".
*/ */
Your("%s dull.", aobjnam(otmp, "get")); pline("%s dull.", Yobjnam2(otmp, "get"));
if (otmp->unpaid) { if (otmp->unpaid) {
struct monst *shkp = shop_keeper(*u.ushops); struct monst *shkp = shop_keeper(*u.ushops);
if (shkp) { if (shkp) {
+5 -5
View File
@@ -276,8 +276,7 @@ pick_lock(pick) /* pick a lock with a given object */
Levitation ? "here" : "there"); Levitation ? "here" : "there");
return 0; return 0;
} else if (is_lava(u.ux, u.uy)) { } else if (is_lava(u.ux, u.uy)) {
pline("Doing that would probably melt your %s.", pline("Doing that would probably melt %s.", yname(pick));
xname(pick));
return 0; return 0;
} else if (is_pool(u.ux, u.uy) && !Underwater) { } else if (is_pool(u.ux, u.uy) && !Underwater) {
pline_The("water has no lock."); pline_The("water has no lock.");
@@ -314,7 +313,8 @@ pick_lock(pick) /* pick a lock with a given object */
#ifdef TOURIST #ifdef TOURIST
else if (picktyp == CREDIT_CARD && !otmp->olocked) { else if (picktyp == CREDIT_CARD && !otmp->olocked) {
/* credit cards are only good for unlocking */ /* credit cards are only good for unlocking */
You_cant("do that with %s.", doname(pick)); You_cant("do that with %s.",
an(simple_typename(picktyp)));
return 0; return 0;
} }
#endif #endif
@@ -473,9 +473,9 @@ doforce() /* try to force a chest with your weapon */
if(c == 'n') continue; if(c == 'n') continue;
if(picktyp) if(picktyp)
You("force your %s into a crack and pry.", xname(uwep)); You("force %s into a crack and pry.", yname(uwep));
else else
You("start bashing it with your %s.", xname(uwep)); You("start bashing it with %s.", yname(uwep));
xlock.box = otmp; xlock.box = otmp;
xlock.chance = objects[uwep->otyp].oc_wldam * 2; xlock.chance = objects[uwep->otyp].oc_wldam * 2;
xlock.picktyp = picktyp; xlock.picktyp = picktyp;
+2 -2
View File
@@ -1220,8 +1220,8 @@ register struct obj *obj;
if (obj->greased && !rn2(2)) obj->greased = 0; if (obj->greased && !rn2(2)) obj->greased = 0;
} else { } else {
if (cansee(mdef->mx, mdef->my)) { if (cansee(mdef->mx, mdef->my)) {
pline("%s %s%s!", s_suffix(Monnam(magr)), pline("%s%s!",
aobjnam(obj, (is_acid ? "corrode" : "rust")), Yobjnam2(obj, (is_acid ? "corrode" : "rust")),
(is_acid ? obj->oeroded2 : obj->oeroded) (is_acid ? obj->oeroded2 : obj->oeroded)
? " further" : ""); ? " further" : "");
} }
+11 -16
View File
@@ -1499,7 +1499,7 @@ dopois:
struct obj *obj = some_armor(&youmonst); struct obj *obj = some_armor(&youmonst);
if (drain_item(obj)) { if (drain_item(obj)) {
Your("%s less effective.", aobjnam(obj, "seem")); pline("%s less effective.", Yobjnam2(obj, "seem"));
} }
} }
break; break;
@@ -2040,9 +2040,8 @@ register struct obj *obj;
if (obj->greased && !rn2(2)) obj->greased = 0; if (obj->greased && !rn2(2)) obj->greased = 0;
} else { } else {
if (vis) if (vis)
pline("%s %s%s!", pline("%s%s!",
s_suffix(Monnam(mon)), Yobjnam2(obj, (is_acid ? "corrode" : "rust")),
aobjnam(obj, (is_acid ? "corrode" : "rust")),
(is_acid ? obj->oeroded2 : obj->oeroded) (is_acid ? obj->oeroded2 : obj->oeroded)
? " further" : ""); ? " further" : "");
if (is_acid) obj->oeroded2++; if (is_acid) obj->oeroded2++;
@@ -2138,8 +2137,8 @@ register struct monst *mon;
xname(ring), simple_typename(ring->otyp), "ring")); xname(ring), simple_typename(ring->otyp), "ring"));
makeknown(RIN_ADORNMENT); makeknown(RIN_ADORNMENT);
if (yn(qbuf) == 'n') continue; if (yn(qbuf) == 'n') continue;
} else pline("%s decides she'd like your %s, and takes it.", } else pline("%s decides she'd like %s, and takes it.",
Blind ? "She" : Monnam(mon), xname(ring)); Blind ? "She" : Monnam(mon), yname(ring));
makeknown(RIN_ADORNMENT); makeknown(RIN_ADORNMENT);
if (ring==uleft || ring==uright) Ring_gone(ring); if (ring==uleft || ring==uright) Ring_gone(ring);
if (ring==uwep) setuwep((struct obj *)0); if (ring==uwep) setuwep((struct obj *)0);
@@ -2148,8 +2147,6 @@ register struct monst *mon;
freeinv(ring); freeinv(ring);
(void) mpickobj(mon,ring); (void) mpickobj(mon,ring);
} else { } else {
char buf[BUFSZ];
if (uleft && uright && uleft->otyp == RIN_ADORNMENT if (uleft && uright && uleft->otyp == RIN_ADORNMENT
&& uright->otyp==RIN_ADORNMENT) && uright->otyp==RIN_ADORNMENT)
break; break;
@@ -2162,8 +2159,8 @@ register struct monst *mon;
makeknown(RIN_ADORNMENT); makeknown(RIN_ADORNMENT);
if (yn(qbuf) == 'n') continue; if (yn(qbuf) == 'n') continue;
} else { } else {
pline("%s decides you'd look prettier wearing your %s,", pline("%s decides you'd look prettier wearing %s,",
Blind ? "He" : Monnam(mon), xname(ring)); Blind ? "He" : Monnam(mon), yname(ring));
pline("and puts it on your finger."); pline("and puts it on your finger.");
} }
makeknown(RIN_ADORNMENT); makeknown(RIN_ADORNMENT);
@@ -2176,15 +2173,13 @@ register struct monst *mon;
Blind ? "He" : Monnam(mon), the(xname(ring)), body_part(HAND)); Blind ? "He" : Monnam(mon), the(xname(ring)), body_part(HAND));
setworn(ring, LEFT_RING); setworn(ring, LEFT_RING);
} else if (uright && uright->otyp != RIN_ADORNMENT) { } else if (uright && uright->otyp != RIN_ADORNMENT) {
Strcpy(buf, xname(uright)); pline("%s replaces %s with %s.",
pline("%s replaces your %s with your %s.", Blind ? "He" : Monnam(mon), yname(uright), yname(ring));
Blind ? "He" : Monnam(mon), buf, xname(ring));
Ring_gone(uright); Ring_gone(uright);
setworn(ring, RIGHT_RING); setworn(ring, RIGHT_RING);
} else if (uleft && uleft->otyp != RIN_ADORNMENT) { } else if (uleft && uleft->otyp != RIN_ADORNMENT) {
Strcpy(buf, xname(uleft)); pline("%s replaces %s with %s.",
pline("%s replaces your %s with your %s.", Blind ? "He" : Monnam(mon), yname(uleft), yname(ring));
Blind ? "He" : Monnam(mon), buf, xname(ring));
Ring_gone(uleft); Ring_gone(uleft);
setworn(ring, LEFT_RING); setworn(ring, LEFT_RING);
} else impossible("ring replacement"); } else impossible("ring replacement");
+1 -2
View File
@@ -316,8 +316,7 @@ warn_effects()
if (warnlevel == 100) { if (warnlevel == 100) {
if(!Blind && uwep && if(!Blind && uwep &&
(warnlevel > lastwarnlev || moves > lastwarntime + warnDelay)) { (warnlevel > lastwarnlev || moves > lastwarntime + warnDelay)) {
Your("%s %s!", aobjnam(uwep, "glow"), pline("%s %s!", Yobjnam2(uwep, "glow"), hcolor(NH_LIGHT_BLUE));
hcolor(NH_LIGHT_BLUE));
lastwarnlev = warnlevel; lastwarnlev = warnlevel;
lastwarntime = moves; lastwarntime = moves;
} }
+2 -2
View File
@@ -1424,8 +1424,8 @@ struct monst *mtmp;
pline("Fortunately, you are wearing a hard helmet."); pline("Fortunately, you are wearing a hard helmet.");
if (dmg > 2) dmg = 2; if (dmg > 2) dmg = 2;
} else if (flags.verbose) { } else if (flags.verbose) {
Your("%s does not protect you.", pline("%s does not protect you.",
xname(uarmh)); Yname2(uarmh));
} }
} }
} else } else
+48 -7
View File
@@ -1011,6 +1011,39 @@ register const char *verb;
return(bp); return(bp);
} }
/* combine yname and aobjnam eg "your count cxname(otmp)" */
char *
yobjnam(obj,verb)
struct obj *obj;
const char *verb;
{
char *s = aobjnam(obj, verb);
/* leave off "your" for most of your artifacts, but prepend
* "your" for unique objects and "foo of bar" quest artifacts */
if (!carried(obj) || !obj_is_pname(obj) ||
obj->oartifact >= ART_ORB_OF_DETECTION) {
char *outbuf = shk_your(nextobuf(), obj);
int space_left = BUFSZ - 1 - strlen(outbuf);
s = strncat(outbuf, s, space_left);
}
return s;
}
/* combine Yname2 and aobjnam eg "Your count cxname(otmp)" */
char *
Yobjnam2(obj,verb)
struct obj *obj;
const char *verb;
{
register char *s = yobjnam(obj,verb);
*s = highc(*s);
return(s);
}
/* like aobjnam, but prepend "The", not count, and use xname */ /* like aobjnam, but prepend "The", not count, and use xname */
char * char *
Tobjnam(otmp, verb) Tobjnam(otmp, verb)
@@ -1166,16 +1199,24 @@ register struct obj *obj;
return(s); return(s);
} }
/* returns "your xname(obj)" or "Foobar's xname(obj)" or "the xname(obj)" */ /* returns "[your ]xname(obj)" or "Foobar's xname(obj)" or "the xname(obj)" */
char * char *
yname(obj) yname(obj)
struct obj *obj; struct obj *obj;
{ {
char *outbuf = nextobuf(); char *s = cxname(obj);
char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */
int space_left = BUFSZ - strlen(s) - sizeof " ";
return strncat(strcat(s, " "), cxname(obj), space_left); /* leave off "your" for most of your artifacts, but prepend
* "your" for unique objects and "foo of bar" quest artifacts */
if (!carried(obj) || !obj_is_pname(obj) ||
obj->oartifact >= ART_ORB_OF_DETECTION) {
char *outbuf = shk_your(nextobuf(), obj);
int space_left = BUFSZ - 1 - strlen(outbuf);
s = strncat(outbuf, s, space_left);
}
return s;
} }
/* capitalized variant of yname() */ /* capitalized variant of yname() */
@@ -1199,9 +1240,9 @@ struct obj *obj;
{ {
char *outbuf = nextobuf(); char *outbuf = nextobuf();
char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */ char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */
int space_left = BUFSZ - strlen(s) - sizeof " "; int space_left = BUFSZ - 1 - strlen(s);
return strncat(strcat(s, " "), simple_typename(obj->otyp), space_left); return strncat(s, simple_typename(obj->otyp), space_left);
} }
/* capitalized variant of ysimple_name() */ /* capitalized variant of ysimple_name() */
+1 -1
View File
@@ -2500,7 +2500,7 @@ struct obj *box; /* or bag */
observe_quantum_cat(box); observe_quantum_cat(box);
if (!Has_contents(box)) /* evidently a live cat came out */ if (!Has_contents(box)) /* evidently a live cat came out */
/* container type of "large box" is inferred */ /* container type of "large box" is inferred */
pline("%s box is now empty.", Shk_Your(yourbuf, box)); pline("%sbox is now empty.", Shk_Your(yourbuf, box));
else /* holds cat corpse or other random stuff */ else /* holds cat corpse or other random stuff */
empty_it = TRUE; empty_it = TRUE;
} else if (!Has_contents(box)) { } else if (!Has_contents(box)) {
+3 -3
View File
@@ -629,12 +629,12 @@ break_armor()
if (has_horns(youmonst.data)) { if (has_horns(youmonst.data)) {
if ((otmp = uarmh) != 0) { if ((otmp = uarmh) != 0) {
if (is_flimsy(otmp) && !donning(otmp)) { if (is_flimsy(otmp) && !donning(otmp)) {
char hornbuf[BUFSZ], yourbuf[BUFSZ]; char hornbuf[BUFSZ];
/* Future possiblities: This could damage/destroy helmet */ /* Future possiblities: This could damage/destroy helmet */
Sprintf(hornbuf, "horn%s", plur(num_horns(youmonst.data))); Sprintf(hornbuf, "horn%s", plur(num_horns(youmonst.data)));
Your("%s %s through %s %s.", hornbuf, vtense(hornbuf, "pierce"), Your("%s %s through %s.",
shk_your(yourbuf, otmp), xname(otmp)); hornbuf, vtense(hornbuf, "pierce"), yname(otmp));
} else { } else {
if (donning(otmp)) cancel_don(); if (donning(otmp)) cancel_don();
Your("helmet falls to the %s!", surface(u.ux, u.uy)); Your("helmet falls to the %s!", surface(u.ux, u.uy));
+16 -23
View File
@@ -530,7 +530,7 @@ peffects(otmp)
case SPE_INVISIBILITY: case SPE_INVISIBILITY:
/* spell cannot penetrate mummy wrapping */ /* spell cannot penetrate mummy wrapping */
if (BInvis && uarmc->otyp == MUMMY_WRAPPING) { if (BInvis && uarmc->otyp == MUMMY_WRAPPING) {
You_feel("rather itchy under your %s.", xname(uarmc)); You_feel("rather itchy under %s.", yname(uarmc));
break; break;
} }
/* FALLTHRU */ /* FALLTHRU */
@@ -1423,22 +1423,20 @@ get_wet(obj)
register struct obj *obj; register struct obj *obj;
/* returns TRUE if something happened (potion should be used up) */ /* returns TRUE if something happened (potion should be used up) */
{ {
char Your_buf[BUFSZ];
if (snuff_lit(obj)) return(TRUE); if (snuff_lit(obj)) return(TRUE);
if (obj->greased) { if (obj->greased) {
grease_protect(obj,(char *)0,&youmonst); grease_protect(obj,(char *)0,&youmonst);
return(FALSE); return(FALSE);
} }
(void) Shk_Your(Your_buf, obj);
/* (Rusting shop goods ought to be charged for.) */ /* (Rusting shop goods ought to be charged for.) */
switch (obj->oclass) { switch (obj->oclass) {
case WEAPON_CLASS: case WEAPON_CLASS:
if (!obj->oerodeproof && is_rustprone(obj) && if (!obj->oerodeproof && is_rustprone(obj) &&
(obj->oeroded < MAX_ERODE) && !rn2(2)) { (obj->oeroded < MAX_ERODE) && !rn2(2)) {
pline("%s %s some%s.", pline("%s some%s.",
Your_buf, aobjnam(obj, "rust"), Yobjnam2(obj, "rust"),
obj->oeroded ? " more" : "what"); obj->oeroded ? " more" : "what");
obj->oeroded++; obj->oeroded++;
update_inventory(); update_inventory();
@@ -1455,7 +1453,7 @@ register struct obj *obj;
update_inventory(); update_inventory();
return (TRUE); return (TRUE);
} }
pline("%s %s%s.", Your_buf, aobjnam(obj,"dilute"), pline("%s%s.", Yobjnam2(obj,"dilute"),
obj->odiluted ? " further" : ""); obj->odiluted ? " further" : "");
if(obj->unpaid && costly_spot(u.ux, u.uy)) { if(obj->unpaid && costly_spot(u.ux, u.uy)) {
You("dilute it, you pay for it."); You("dilute it, you pay for it.");
@@ -1515,7 +1513,7 @@ register struct obj *obj;
return TRUE; return TRUE;
} }
} }
pline("%s %s wet.", Your_buf, aobjnam(obj,"get")); pline("%s wet.", Yobjnam2(obj, "get"));
return FALSE; return FALSE;
} }
@@ -1528,7 +1526,7 @@ dodip()
uchar here; uchar here;
char allowall[2]; char allowall[2];
short mixture; short mixture;
char qbuf[QBUFSZ], Your_buf[BUFSZ]; char qbuf[QBUFSZ];
allowall[0] = ALL_CLASSES; allowall[1] = '\0'; allowall[0] = ALL_CLASSES; allowall[1] = '\0';
if(!(obj = getobj(allowall, "dip"))) if(!(obj = getobj(allowall, "dip")))
@@ -1569,13 +1567,11 @@ dodip()
potion->in_use = TRUE; /* assume it will be used up */ potion->in_use = TRUE; /* assume it will be used up */
if(potion->otyp == POT_WATER) { if(potion->otyp == POT_WATER) {
boolean useeit = !Blind; boolean useeit = !Blind;
if (useeit) (void) Shk_Your(Your_buf, obj);
if (potion->blessed) { if (potion->blessed) {
if (obj->cursed) { if (obj->cursed) {
if (useeit) if (useeit)
pline("%s %s %s.", pline("%s %s.",
Your_buf, Yobjnam2(obj, "softly glow"),
aobjnam(obj, "softly glow"),
hcolor(NH_AMBER)); hcolor(NH_AMBER));
uncurse(obj); uncurse(obj);
obj->bknown=1; obj->bknown=1;
@@ -1588,9 +1584,8 @@ dodip()
} else if(!obj->blessed) { } else if(!obj->blessed) {
if (useeit) { if (useeit) {
tmp = hcolor(NH_LIGHT_BLUE); tmp = hcolor(NH_LIGHT_BLUE);
pline("%s %s with a%s %s aura.", pline("%s with a%s %s aura.",
Your_buf, Yobjnam2(obj, "softly glow"),
aobjnam(obj, "softly glow"),
index(vowels, *tmp) ? "n" : "", tmp); index(vowels, *tmp) ? "n" : "", tmp);
} }
bless(obj); bless(obj);
@@ -1600,9 +1595,8 @@ dodip()
} else if (potion->cursed) { } else if (potion->cursed) {
if (obj->blessed) { if (obj->blessed) {
if (useeit) if (useeit)
pline("%s %s %s.", pline("%s %s.",
Your_buf, Yobjnam2(obj, "glow"),
aobjnam(obj, "glow"),
hcolor((const char *)"brown")); hcolor((const char *)"brown"));
unbless(obj); unbless(obj);
obj->bknown=1; obj->bknown=1;
@@ -1610,9 +1604,8 @@ dodip()
} else if(!obj->cursed) { } else if(!obj->cursed) {
if (useeit) { if (useeit) {
tmp = hcolor(NH_BLACK); tmp = hcolor(NH_BLACK);
pline("%s %s with a%s %s aura.", pline("%s with a%s %s aura.",
Your_buf, Yobjnam2(obj, "glow"),
aobjnam(obj, "glow"),
index(vowels, *tmp) ? "n" : "", tmp); index(vowels, *tmp) ? "n" : "", tmp);
} }
curse(obj); curse(obj);
@@ -1982,7 +1975,7 @@ struct monst *mon, /* monster being split */
reason[0] = '\0'; reason[0] = '\0';
if (mtmp) Sprintf(reason, " from %s heat", if (mtmp) Sprintf(reason, " from %s heat",
(mtmp == &youmonst) ? (const char *)"your" : (mtmp == &youmonst) ? the_your[1] :
(const char *)s_suffix(mon_nam(mtmp))); (const char *)s_suffix(mon_nam(mtmp)));
if (mon == &youmonst) { if (mon == &youmonst) {
+19 -21
View File
@@ -271,8 +271,8 @@ register int trouble;
int i; int i;
struct obj *otmp = 0; struct obj *otmp = 0;
const char *what = (const char *)0; const char *what = (const char *)0;
static NEARDATA const char leftglow[] = "left ring softly glows", static NEARDATA const char leftglow[] = "Your left ring softly glows",
rightglow[] = "right ring softly glows"; rightglow[] = "Your right ring softly glows";
switch (trouble) { switch (trouble) {
case TROUBLE_STONED: case TROUBLE_STONED:
@@ -400,9 +400,9 @@ decurse:
} }
uncurse(otmp); uncurse(otmp);
if (!Blind) { if (!Blind) {
Your("%s %s.", what ? what : pline("%s %s.", what ? what :
(const char *)aobjnam(otmp, "softly glow"), (const char *)Yobjnam2(otmp, "softly glow"),
hcolor(NH_AMBER)); hcolor(NH_AMBER));
otmp->bknown = TRUE; otmp->bknown = TRUE;
} }
update_inventory(); update_inventory();
@@ -450,9 +450,7 @@ decurse:
otmp = which_armor(u.usteed, W_SADDLE); otmp = which_armor(u.usteed, W_SADDLE);
uncurse(otmp); uncurse(otmp);
if (!Blind) { if (!Blind) {
pline("%s %s %s.", pline("%s %s.", Yobjnam2(otmp, "softly glow"),
s_suffix(upstart(y_monnam(u.usteed))),
aobjnam(otmp, "softly glow"),
hcolor(NH_AMBER)); hcolor(NH_AMBER));
otmp->bknown = TRUE; otmp->bknown = TRUE;
} }
@@ -870,20 +868,20 @@ pleased(g_align)
uncurse(uwep); uncurse(uwep);
uwep->bknown = TRUE; uwep->bknown = TRUE;
if (!Blind) if (!Blind)
Your("%s %s%s.", aobjnam(uwep, "softly glow"), pline("%s %s%s.", Yobjnam2(uwep, "softly glow"),
hcolor(NH_AMBER), repair_buf); hcolor(NH_AMBER), repair_buf);
else You_feel("the power of %s over your %s.", else You_feel("the power of %s over %s.",
u_gname(), xname(uwep)); u_gname(), yname(uwep));
*repair_buf = '\0'; *repair_buf = '\0';
} else if (!uwep->blessed) { } else if (!uwep->blessed) {
bless(uwep); bless(uwep);
uwep->bknown = TRUE; uwep->bknown = TRUE;
if (!Blind) if (!Blind)
Your("%s with %s aura%s.", pline("%s with %s aura%s.",
aobjnam(uwep, "softly glow"), Yobjnam2(uwep, "softly glow"),
an(hcolor(NH_LIGHT_BLUE)), repair_buf); an(hcolor(NH_LIGHT_BLUE)), repair_buf);
else You_feel("the blessing of %s over your %s.", else You_feel("the blessing of %s over %s.",
u_gname(), xname(uwep)); u_gname(), yname(uwep));
*repair_buf = '\0'; *repair_buf = '\0';
} }
@@ -894,8 +892,8 @@ pleased(g_align)
/* only give this message if we didn't just bless /* only give this message if we didn't just bless
or uncurse (which has already given a message) */ or uncurse (which has already given a message) */
if (*repair_buf) if (*repair_buf)
Your("%s as good as new!", pline("%s as good as new!",
aobjnam(uwep, Blind ? "feel" : "look")); Yobjnam2(uwep, Blind ? "feel" : "look"));
} }
update_inventory(); update_inventory();
} }
@@ -951,8 +949,8 @@ pleased(g_align)
if (otmp->cursed) { if (otmp->cursed) {
uncurse(otmp); uncurse(otmp);
if (!Blind) { if (!Blind) {
Your("%s %s.", aobjnam(otmp, "softly glow"), pline("%s %s.", Yobjnam2(otmp, "softly glow"),
hcolor(NH_AMBER)); hcolor(NH_AMBER));
otmp->bknown = TRUE; otmp->bknown = TRUE;
++any; ++any;
} }
+37 -37
View File
@@ -149,35 +149,36 @@ doread()
} }
return(1); return(1);
} }
STATIC_OVL void STATIC_OVL void
stripspe(obj) stripspe(obj)
register struct obj *obj; register struct obj *obj;
{ {
if (obj->blessed) pline(nothing_happens); if (obj->blessed) pline(nothing_happens);
else { else {
if (obj->spe > 0) { if (obj->spe > 0) {
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 %s briefly.",xname(obj), otense(obj, "vibrate")); pline("%s briefly.", Yobjnam2(obj, "vibrate"));
} else pline(nothing_happens); } else pline(nothing_happens);
} }
} }
STATIC_OVL void STATIC_OVL void
p_glow1(otmp) p_glow1(otmp)
register struct obj *otmp; register struct obj *otmp;
{ {
Your("%s %s briefly.", xname(otmp), pline("%s briefly.", Yobjnam2(otmp, Blind ? "vibrate" : "glow"));
otense(otmp, Blind ? "vibrate" : "glow"));
} }
STATIC_OVL void STATIC_OVL void
p_glow2(otmp,color) p_glow2(otmp,color)
register struct obj *otmp; register struct obj *otmp;
register const char *color; register const char *color;
{ {
Your("%s %s%s%s for a moment.", pline("%s%s%s for a moment.",
xname(otmp), Yobjnam2(otmp, Blind ? "vibrate" : "glow"),
otense(otmp, Blind ? "vibrate" : "glow"),
Blind ? "" : " ", Blind ? "" : " ",
Blind ? nul : hcolor(color)); Blind ? nul : hcolor(color));
} }
@@ -270,8 +271,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 %s momentarily, then %s!", pline("%s momentarily, then %s!",
xname(obj), otense(obj,"pulsate"), otense(obj,"explode")); Yobjnam2(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);
@@ -279,8 +280,8 @@ int curse_bless;
} else { } else {
long mask = is_on ? (obj == uleft ? LEFT_RING : long mask = is_on ? (obj == uleft ? LEFT_RING :
RIGHT_RING) : 0L; RIGHT_RING) : 0L;
Your("%s spins %sclockwise for a moment.", pline("%s spins %sclockwise for a moment.",
xname(obj), s < 0 ? "counter" : ""); Yname2(obj), s < 0 ? "counter" : "");
/* cause attributes and/or properties to be updated */ /* cause attributes and/or properties to be updated */
if (is_on) Ring_off(obj); if (is_on) Ring_off(obj);
obj->spe += s; /* update the ring while it's off */ obj->spe += s; /* update the ring while it's off */
@@ -679,12 +680,12 @@ register struct obj *sobj;
otmp->oerodeproof = !(sobj->cursed); otmp->oerodeproof = !(sobj->cursed);
if(Blind) { if(Blind) {
otmp->rknown = FALSE; otmp->rknown = FALSE;
Your("%s %s warm for a moment.", pline("%s warm for a moment.",
xname(otmp), otense(otmp, "feel")); Yobjnam2(otmp, "feel"));
} else { } else {
otmp->rknown = TRUE; otmp->rknown = TRUE;
Your("%s %s covered by a %s %s %s!", pline("%s covered by a %s %s %s!",
xname(otmp), otense(otmp, "are"), Yobjnam2(otmp, "are"),
sobj->cursed ? "mottled" : "shimmering", sobj->cursed ? "mottled" : "shimmering",
hcolor(sobj->cursed ? NH_BLACK : NH_GOLDEN), hcolor(sobj->cursed ? NH_BLACK : NH_GOLDEN),
sobj->cursed ? "glow" : sobj->cursed ? "glow" :
@@ -693,9 +694,8 @@ register struct obj *sobj;
if (otmp->oerodeproof && if (otmp->oerodeproof &&
(otmp->oeroded || otmp->oeroded2)) { (otmp->oeroded || otmp->oeroded2)) {
otmp->oeroded = otmp->oeroded2 = 0; otmp->oeroded = otmp->oeroded2 = 0;
Your("%s %s as good as new!", pline("%s as good as new!",
xname(otmp), Yobjnam2(otmp, Blind ? "feel" : "look"));
otense(otmp, Blind ? "feel" : "look"));
} }
break; break;
} }
@@ -716,8 +716,8 @@ 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 %s.", pline("%s violently %s%s%s for a while, then %s.",
xname(otmp), Yname2(otmp),
otense(otmp, Blind ? "vibrate" : "glow"), otense(otmp, Blind ? "vibrate" : "glow"),
(!Blind && !same_color) ? " " : nul, (!Blind && !same_color) ? " " : nul,
(Blind || same_color) ? nul : (Blind || same_color) ? nul :
@@ -738,7 +738,7 @@ register struct obj *sobj;
if (s >= 0 && otmp->otyp >= GRAY_DRAGON_SCALES && if (s >= 0 && otmp->otyp >= GRAY_DRAGON_SCALES &&
otmp->otyp <= YELLOW_DRAGON_SCALES) { otmp->otyp <= YELLOW_DRAGON_SCALES) {
/* dragon scales get turned into dragon scale mail */ /* dragon scales get turned into dragon scale mail */
Your("%s merges and hardens!", xname(otmp)); pline("%s merges and hardens!", Yname2(otmp));
setworn((struct obj *)0, W_ARM); setworn((struct obj *)0, W_ARM);
/* assumes same order */ /* assumes same order */
otmp->otyp = GRAY_DRAGON_SCALE_MAIL + otmp->otyp = GRAY_DRAGON_SCALE_MAIL +
@@ -752,8 +752,8 @@ register struct obj *sobj;
setworn(otmp, W_ARM); setworn(otmp, W_ARM);
break; break;
} }
Your("%s %s%s%s%s for a %s.", pline("%s %s%s%s%s for a %s.",
xname(otmp), Yname2(otmp),
s == 0 ? "violently " : nul, s == 0 ? "violently " : nul,
otense(otmp, Blind ? "vibrate" : "glow"), otense(otmp, Blind ? "vibrate" : "glow"),
(!Blind && !same_color) ? " " : nul, (!Blind && !same_color) ? " " : nul,
@@ -770,8 +770,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 %s %s.", pline("%s %s.",
xname(otmp), otense(otmp, "vibrate"), Yobjnam2(otmp, "suddenly vibrate"),
Blind ? "again" : "unexpectedly"); Blind ? "again" : "unexpectedly");
break; break;
} }
@@ -798,7 +798,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 %s.", xname(otmp), otense(otmp, "vibrate")); pline("%s.", Yobjnam2(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);
} }
@@ -967,16 +967,16 @@ register struct obj *sobj;
Your("weapon feels warm for a moment."); Your("weapon feels warm for a moment.");
} else { } else {
uwep->rknown = TRUE; uwep->rknown = TRUE;
Your("%s covered by a %s %s %s!", pline("%s covered by a %s %s %s!",
aobjnam(uwep, "are"), Yobjnam2(uwep, "are"),
sobj->cursed ? "mottled" : "shimmering", sobj->cursed ? "mottled" : "shimmering",
hcolor(sobj->cursed ? NH_PURPLE : NH_GOLDEN), hcolor(sobj->cursed ? NH_PURPLE : NH_GOLDEN),
sobj->cursed ? "glow" : "shield"); sobj->cursed ? "glow" : "shield");
} }
if (uwep->oerodeproof && (uwep->oeroded || uwep->oeroded2)) { if (uwep->oerodeproof && (uwep->oeroded || uwep->oeroded2)) {
uwep->oeroded = uwep->oeroded2 = 0; uwep->oeroded = uwep->oeroded2 = 0;
Your("%s as good as new!", pline("%s as good as new!",
aobjnam(uwep, Blind ? "feel" : "look")); Yobjnam2(uwep, Blind ? "feel" : "look"));
} }
} else return !chwepon(sobj, } else return !chwepon(sobj,
sobj->cursed ? -1 : sobj->cursed ? -1 :
@@ -1256,8 +1256,8 @@ register struct obj *sobj;
pline("Fortunately, you are wearing a hard helmet."); pline("Fortunately, you are wearing a hard helmet.");
if (dmg > 2) dmg = 2; if (dmg > 2) dmg = 2;
} else if (flags.verbose) { } else if (flags.verbose) {
Your("%s does not protect you.", pline("%s does not protect you.",
xname(uarmh)); Yname2(uarmh));
} }
} }
} else } else
@@ -1311,7 +1311,7 @@ wand_explode(obj)
register struct obj *obj; register struct obj *obj;
{ {
obj->in_use = TRUE; /* in case losehp() is fatal */ obj->in_use = TRUE; /* in case losehp() is fatal */
Your("%s vibrates violently, and explodes!",xname(obj)); pline("%s vibrates violently, and explodes!", Yname2(obj));
nhbell(); nhbell();
losehp(rnd(2*(u.uhpmax+1)/3), "exploding wand", KILLED_BY_AN); losehp(rnd(2*(u.uhpmax+1)/3), "exploding wand", KILLED_BY_AN);
useup(obj); useup(obj);
+5 -4
View File
@@ -3964,14 +3964,15 @@ register xchar x, y;
return(FALSE); return(FALSE);
} }
/* "your " or "Foobar's " (note the trailing space) */
char * char *
shk_your(buf, obj) shk_your(buf, obj)
char *buf; char *buf;
struct obj *obj; struct obj *obj;
{ {
if (!shk_owns(buf, obj) && !mon_owns(buf, obj)) if (!shk_owns(buf, obj) && !mon_owns(buf, obj))
Strcpy(buf, carried(obj) ? "your" : "the"); Strcpy(buf, the_your[carried(obj) ? 1 : 0]);
return buf; return strcat(buf, " ");
} }
char * char *
@@ -3996,7 +3997,7 @@ struct obj *obj;
(obj->unpaid || (obj->unpaid ||
(obj->where==OBJ_FLOOR && !obj->no_charge && costly_spot(x,y)))) { (obj->where==OBJ_FLOOR && !obj->no_charge && costly_spot(x,y)))) {
shkp = shop_keeper(inside_shop(x, y)); shkp = shop_keeper(inside_shop(x, y));
return strcpy(buf, shkp ? s_suffix(shkname(shkp)) : "the"); return strcpy(buf, shkp ? s_suffix(shkname(shkp)) : the_your[0]);
} }
return (char *)0; return (char *)0;
} }
@@ -4007,7 +4008,7 @@ char *buf;
struct obj *obj; struct obj *obj;
{ {
if (obj->where == OBJ_MINVENT) if (obj->where == OBJ_MINVENT)
return strcpy(buf, s_suffix(mon_nam(obj->ocarry))); return strcpy(buf, s_suffix(y_monnam(obj->ocarry)));
return (char *)0; return (char *)0;
} }
+2 -3
View File
@@ -372,9 +372,8 @@ rndcurse() /* curse a few inventory items at random! */
else else
curse(otmp); curse(otmp);
if (!Blind) { if (!Blind) {
pline("%s %s %s.", pline("%s %s.",
s_suffix(upstart(y_monnam(u.usteed))), Yobjnam2(otmp, "glow"),
aobjnam(otmp, "glow"),
hcolor(otmp->cursed ? NH_BLACK : (const char *)"brown")); hcolor(otmp->cursed ? NH_BLACK : (const char *)"brown"));
otmp->bknown = TRUE; otmp->bknown = TRUE;
} }
+3 -2
View File
@@ -314,10 +314,11 @@ gotobj:
if (ostuck || !can_carry(mtmp, otmp)) { if (ostuck || !can_carry(mtmp, otmp)) {
static const char * const how[] = { "steal","snatch","grab","take" }; static const char * const how[] = { "steal","snatch","grab","take" };
cant_take: cant_take:
pline("%s tries to %s your %s but gives up.", pline("%s tries to %s %s%s but gives up.",
Monnam(mtmp), how[rn2(SIZE(how))], Monnam(mtmp), how[rn2(SIZE(how))],
(otmp->owornmask & W_ARMOR) ? "your " : "",
(otmp->owornmask & W_ARMOR) ? equipname(otmp) : (otmp->owornmask & W_ARMOR) ? equipname(otmp) :
cxname(otmp)); yname(otmp));
/* the fewer items you have, the less likely the thief /* the fewer items you have, the less likely the thief
is going to stick around to try again (0) instead of is going to stick around to try again (0) instead of
running away (1) */ running away (1) */
+12 -15
View File
@@ -777,7 +777,7 @@ long timeout;
/* only interested in INVENT, FLOOR, and MINVENT */ /* only interested in INVENT, FLOOR, and MINVENT */
if (get_obj_location(obj, &x, &y, 0)) { if (get_obj_location(obj, &x, &y, 0)) {
canseeit = !Blind && cansee(x, y); canseeit = !Blind && cansee(x, y);
/* set up `whose[]' to be "Your" or "Fred's" or "The goblin's" */ /* set `whose[]' to be "Your " or "Fred's " or "The goblin's " */
(void) Shk_Your(whose, obj); (void) Shk_Your(whose, obj);
} else { } else {
canseeit = FALSE; canseeit = FALSE;
@@ -792,7 +792,7 @@ long timeout;
switch (obj->where) { switch (obj->where) {
case OBJ_INVENT: case OBJ_INVENT:
case OBJ_MINVENT: case OBJ_MINVENT:
pline("%s potion of oil has burnt away.", pline("%spotion of oil has burnt away.",
whose); whose);
break; break;
case OBJ_FLOOR: case OBJ_FLOOR:
@@ -830,8 +830,8 @@ long timeout;
switch (obj->where) { switch (obj->where) {
case OBJ_INVENT: case OBJ_INVENT:
case OBJ_MINVENT: case OBJ_MINVENT:
pline("%s %s seems about to go out.", pline("%s seems about to go out.",
whose, xname(obj)); Yname2(obj));
break; break;
case OBJ_FLOOR: case OBJ_FLOOR:
You("see %s about to go out.", You("see %s about to go out.",
@@ -849,11 +849,10 @@ long timeout;
case OBJ_INVENT: case OBJ_INVENT:
case OBJ_MINVENT: case OBJ_MINVENT:
if (obj->otyp == BRASS_LANTERN) if (obj->otyp == BRASS_LANTERN)
pline("%s lantern has run out of power.", pline("%slantern has run out of power.",
whose); whose);
else else
pline("%s %s has gone out.", pline("%s has gone out.", Yname2(obj));
whose, xname(obj));
break; break;
case OBJ_FLOOR: case OBJ_FLOOR:
if (obj->otyp == BRASS_LANTERN) if (obj->otyp == BRASS_LANTERN)
@@ -890,7 +889,7 @@ long timeout;
switch (obj->where) { switch (obj->where) {
case OBJ_INVENT: case OBJ_INVENT:
case OBJ_MINVENT: case OBJ_MINVENT:
pline("%s %scandle%s getting short.", pline("%s%scandle%s getting short.",
whose, whose,
menorah ? "candelabrum's " : "", menorah ? "candelabrum's " : "",
many ? "s are" : " is"); many ? "s are" : " is");
@@ -910,7 +909,7 @@ long timeout;
case OBJ_INVENT: case OBJ_INVENT:
case OBJ_MINVENT: case OBJ_MINVENT:
pline( pline(
"%s %scandle%s flame%s flicker%s low!", "%s%scandle%s flame%s flicker%s low!",
whose, whose,
menorah ? "candelabrum's " : "", menorah ? "candelabrum's " : "",
many ? "s'" : "'s", many ? "s'" : "'s",
@@ -934,9 +933,8 @@ long timeout;
switch (obj->where) { switch (obj->where) {
case OBJ_INVENT: case OBJ_INVENT:
case OBJ_MINVENT: case OBJ_MINVENT:
pline("%s candelabrum's flame%s.", pline("%scandelabrum's flame%s.",
whose, whose, many ? "s die" : " dies");
many ? "s die" : " dies");
break; break;
case OBJ_FLOOR: case OBJ_FLOOR:
You("see a candelabrum's flame%s die.", You("see a candelabrum's flame%s die.",
@@ -947,9 +945,8 @@ long timeout;
switch (obj->where) { switch (obj->where) {
case OBJ_INVENT: case OBJ_INVENT:
case OBJ_MINVENT: case OBJ_MINVENT:
pline("%s %s %s consumed!", pline("%s %s consumed!",
whose, Yname2(obj),
xname(obj),
many ? "are" : "is"); many ? "are" : "is");
break; break;
case OBJ_FLOOR: case OBJ_FLOOR:
+5 -8
View File
@@ -202,11 +202,8 @@ struct monst *victim;
else if (vismon) else if (vismon)
pline("%s's %s %s %s", Monnam(victim), pline("%s's %s %s %s", Monnam(victim),
ostr, vtense(ostr, "are"), txt); ostr, vtense(ostr, "are"), txt);
} else { } else if ((victim == &youmonst) || vismon) {
if (victim == &youmonst) pline("%s %s", Yobjnam2(otmp, "are"), txt);
Your("%s %s",aobjnam(otmp,"are"), txt);
else if (vismon)
pline("%s's %s %s", Monnam(victim), aobjnam(otmp,"are"), txt);
} }
if (!rn2(2)) { if (!rn2(2)) {
otmp->greased = 0; otmp->greased = 0;
@@ -697,7 +694,7 @@ unsigned trflags;
pline("Fortunately, you are wearing a hard helmet."); pline("Fortunately, you are wearing a hard helmet.");
dmg = 2; dmg = 2;
} else if (flags.verbose) { } else if (flags.verbose) {
Your("%s does not protect you.", xname(uarmh)); pline("%s does not protect you.", Yname2(uarmh));
} }
} }
@@ -3895,7 +3892,7 @@ lava_effects()
if(is_organic(obj) && !obj->oerodeproof) { if(is_organic(obj) && !obj->oerodeproof) {
if(obj->owornmask) { if(obj->owornmask) {
if (usurvive) if (usurvive)
Your("%s into flame!", aobjnam(obj, "burst")); pline("%s into flame!", Yobjnam2(obj, "burst"));
if(obj == uarm) (void) Armor_gone(); if(obj == uarm) (void) Armor_gone();
else if(obj == uarmc) (void) Cloak_off(); else if(obj == uarmc) (void) Cloak_off();
@@ -3945,7 +3942,7 @@ burn_stuff:
if(uarmf && !uarmf->oerodeproof && is_organic(uarmf)) { if(uarmf && !uarmf->oerodeproof && is_organic(uarmf)) {
/* save uarmf value because Boots_off() sets uarmf to null */ /* save uarmf value because Boots_off() sets uarmf to null */
obj = uarmf; obj = uarmf;
Your("%s bursts into flame!", xname(obj)); pline("%s into flame!", Yobjnam2(obj, "burst"));
(void) Boots_off(); (void) Boots_off();
useup(obj); useup(obj);
} }
+11 -13
View File
@@ -379,8 +379,8 @@ register struct monst *mtmp;
unweapon = FALSE; unweapon = FALSE;
if(flags.verbose) { if(flags.verbose) {
if(uwep) if(uwep)
You("begin bashing monsters with your %s.", You("begin bashing monsters with %s.",
aobjnam(uwep, (char *)0)); yobjnam(uwep, (char *)0));
else if (!cantwield(youmonst.data)) else if (!cantwield(youmonst.data))
You("begin %sing monsters with your %s %s.", You("begin %sing monsters with your %s %s.",
Role_if(PM_MONK) ? "strik" : "bash", Role_if(PM_MONK) ? "strik" : "bash",
@@ -607,9 +607,9 @@ int thrown;
rnl(4) == 4-1) { rnl(4) == 4-1) {
boolean more_than_1 = (obj->quan > 1L); boolean more_than_1 = (obj->quan > 1L);
pline("As you hit %s, %s%s %s breaks into splinters.", pline("As you hit %s, %s%s breaks into splinters.",
mon_nam(mon), more_than_1 ? "one of " : "", mon_nam(mon), more_than_1 ? "one of " : "",
shk_your(yourbuf, obj), xname(obj)); yname(obj));
if (!more_than_1) uwepgone(); /* set unweapon */ if (!more_than_1) uwepgone(); /* set unweapon */
useup(obj); useup(obj);
if (!more_than_1) obj = (struct obj *) 0; if (!more_than_1) obj = (struct obj *) 0;
@@ -647,9 +647,8 @@ 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 %s from the force of your blow!", pline("%s from the force of your blow!",
s_suffix(Monnam(mon)), xname(monwep), Yobjnam2(monwep, "shatter"));
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)) {
@@ -718,7 +717,7 @@ int thrown;
break; break;
case MIRROR: case MIRROR:
if (breaktest(obj)) { if (breaktest(obj)) {
You("break %s mirror. That's bad luck!", You("break %smirror. That's bad luck!",
shk_your(yourbuf, obj)); shk_your(yourbuf, obj));
change_luck(-2); change_luck(-2);
useup(obj); useup(obj);
@@ -731,7 +730,7 @@ int thrown;
break; break;
#ifdef TOURIST #ifdef TOURIST
case EXPENSIVE_CAMERA: case EXPENSIVE_CAMERA:
You("succeed in destroying %s camera. Congratulations!", You("succeed in destroying %scamera. Congratulations!",
shk_your(yourbuf, obj)); shk_your(yourbuf, obj));
useup(obj); useup(obj);
return(TRUE); return(TRUE);
@@ -927,8 +926,7 @@ int thrown;
} }
if (obj && !rn2(nopoison)) { if (obj && !rn2(nopoison)) {
obj->opoisoned = FALSE; obj->opoisoned = FALSE;
Your("%s %s no longer poisoned.", xname(obj), pline("%s no longer poisoned.", Yobjnam2(obj, "are"));
otense(obj, "are"));
} }
if (resists_poison(mon)) if (resists_poison(mon))
needpoismsg = TRUE; needpoismsg = TRUE;
@@ -959,7 +957,7 @@ int thrown;
You("joust %s%s", You("joust %s%s",
mon_nam(mon), canseemon(mon) ? exclam(tmp) : "."); mon_nam(mon), canseemon(mon) ? exclam(tmp) : ".");
if (jousting < 0) { if (jousting < 0) {
Your("%s shatters on impact!", xname(obj)); pline("%s shatters on impact!", Yname2(obj));
/* (must be either primary or secondary weapon to get here) */ /* (must be either primary or secondary weapon to get here) */
u.twoweap = FALSE; /* untwoweapon() is too verbose here */ u.twoweap = FALSE; /* untwoweapon() is too verbose here */
if (obj == uwep) uwepgone(); /* set unweapon */ if (obj == uwep) uwepgone(); /* set unweapon */
@@ -2392,7 +2390,7 @@ struct attack *mattk; /* null means we find one internally */
if (!mon->mcan) { if (!mon->mcan) {
if (drain_item(obj) && carried(obj) && if (drain_item(obj) && carried(obj) &&
(obj->known || obj->oclass == ARMOR_CLASS)) { (obj->known || obj->oclass == ARMOR_CLASS)) {
Your("%s less effective.", aobjnam(obj, "seem")); pline("%s less effective.", Yobjnam2(obj, "seem"));
} }
break; break;
} }
+1 -3
View File
@@ -630,9 +630,7 @@ register struct monst *mon;
} else { } else {
pline("%s tries to wield %s.", Monnam(mon), pline("%s tries to wield %s.", Monnam(mon),
doname(obj)); doname(obj));
pline("%s %s %s!", pline("%s %s!", yname(mw_tmp), welded_buf);
s_suffix(Monnam(mon)),
xname(mw_tmp), welded_buf);
} }
mw_tmp->bknown = 1; mw_tmp->bknown = 1;
} }
+26 -52
View File
@@ -423,11 +423,8 @@ const char *verb; /* "rub",&c */
strstri(what, "s of ") != 0); strstri(what, "s of ") != 0);
if (obj->owornmask & (W_ARMOR|W_RING|W_AMUL|W_TOOL)) { if (obj->owornmask & (W_ARMOR|W_RING|W_AMUL|W_TOOL)) {
char yourbuf[BUFSZ]; You_cant("%s %s while wearing %s.",
verb, yname(obj), more_than_1 ? "them" : "it");
You_cant("%s %s %s while wearing %s.",
verb, shk_your(yourbuf, obj), what,
more_than_1 ? "them" : "it");
return FALSE; return FALSE;
} }
if (welded(uwep)) { if (welded(uwep)) {
@@ -498,8 +495,8 @@ can_twoweapon()
} 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 %s being held second to another weapon!", pline("%s being held second to another weapon!",
Yname2(uswapwep), otense(uswapwep, "resist")); Yobjnam2(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];
@@ -525,7 +522,7 @@ drop_uswapwep()
/* Avoid trashing makeplural's static buffer */ /* Avoid trashing makeplural's static buffer */
Strcpy(str, makeplural(body_part(HAND))); Strcpy(str, makeplural(body_part(HAND)));
Your("%s from your %s!", aobjnam(obj, "slip"), str); pline("%s from your %s!", Yobjnam2(obj, "slip"), str);
dropx(obj); dropx(obj);
} }
@@ -631,13 +628,8 @@ boolean fade_scrolls;
) )
{ {
if (!Blind) { if (!Blind) {
if (victim == &youmonst) if ((victim == &youmonst) || vismon || visobj)
Your("%s.", aobjnam(target, "fade")); pline("%s.", Yobjnam2(target, "fade"));
else if (vismon)
pline("%s's %s.", Monnam(victim),
aobjnam(target, "fade"));
else if (visobj)
pline_The("%s.", aobjnam(target, "fade"));
} }
target->otyp = SCR_BLANK_PAPER; target->otyp = SCR_BLANK_PAPER;
target->spe = 0; target->spe = 0;
@@ -645,27 +637,14 @@ boolean fade_scrolls;
} else if (target->oerodeproof || } else if (target->oerodeproof ||
(acid_dmg ? !is_corrodeable(target) : !is_rustprone(target))) { (acid_dmg ? !is_corrodeable(target) : !is_rustprone(target))) {
if (flags.verbose || !(target->oerodeproof && target->rknown)) { if (flags.verbose || !(target->oerodeproof && target->rknown)) {
if (victim == &youmonst) if ((victim == &youmonst) || vismon)
Your("%s not affected.", aobjnam(target, "are")); pline("%s not affected.", Yobjnam2(target, "are"));
else if (vismon)
pline("%s's %s not affected.", Monnam(victim),
aobjnam(target, "are"));
/* no message if not carried */ /* no message if not carried */
} }
if (target->oerodeproof) target->rknown = TRUE; if (target->oerodeproof) target->rknown = TRUE;
} else if (erosion < MAX_ERODE) { } else if (erosion < MAX_ERODE) {
if (victim == &youmonst) if ((victim == &youmonst) || vismon || visobj)
Your("%s%s!", aobjnam(target, acid_dmg ? "corrode" : "rust"), pline("%s%s!", Yobjnam2(target, acid_dmg ? "corrode" : "rust"),
erosion+1 == MAX_ERODE ? " completely" :
erosion ? " further" : "");
else if (vismon)
pline("%s's %s%s!", Monnam(victim),
aobjnam(target, acid_dmg ? "corrode" : "rust"),
erosion+1 == MAX_ERODE ? " completely" :
erosion ? " further" : "");
else if (visobj)
pline_The("%s%s!",
aobjnam(target, acid_dmg ? "corrode" : "rust"),
erosion+1 == MAX_ERODE ? " completely" : erosion+1 == MAX_ERODE ? " completely" :
erosion ? " further" : ""); erosion ? " further" : "");
if (acid_dmg) if (acid_dmg)
@@ -675,16 +654,12 @@ boolean fade_scrolls;
} else { } else {
if (flags.verbose) { if (flags.verbose) {
if (victim == &youmonst) if (victim == &youmonst)
Your("%s completely %s.", pline("%s completely %s.",
aobjnam(target, Blind ? "feel" : "look"), Yobjnam2(target, Blind ? "feel" : "look"),
acid_dmg ? "corroded" : "rusty"); acid_dmg ? "corroded" : "rusty");
else if (vismon) else if (vismon || visobj)
pline("%s's %s completely %s.", Monnam(victim), pline("%s completely %s.",
aobjnam(target, "look"), Yobjnam2(target, "look"),
acid_dmg ? "corroded" : "rusty");
else if (visobj)
pline_The("%s completely %s.",
aobjnam(target, "look"),
acid_dmg ? "corroded" : "rusty"); acid_dmg ? "corroded" : "rusty");
} }
} }
@@ -730,27 +705,27 @@ register int amount;
if (amount < 0 && uwep->oartifact && restrict_name(uwep, ONAME(uwep))) { if (amount < 0 && uwep->oartifact && restrict_name(uwep, ONAME(uwep))) {
if (!Blind) if (!Blind)
Your("%s %s.", aobjnam(uwep, "faintly glow"), color); pline("%s %s.", Yobjnam2(uwep, "faintly glow"), color);
return(1); return(1);
} }
/* there is a (soft) upper and lower limit to uwep->spe */ /* there is a (soft) upper and lower limit to uwep->spe */
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 %s.", pline("%s %s for a while and then %s.",
aobjnam(uwep, "violently glow"), color, Yobjnam2(uwep, "violently glow"), color,
otense(uwep, "evaporate")); otense(uwep, "evaporate"));
else else
Your("%s.", aobjnam(uwep, "evaporate")); pline("%s.", Yobjnam2(uwep, "evaporate"));
useupall(uwep); /* let all of them disappear */ useupall(uwep); /* let all of them disappear */
return(1); return(1);
} }
if (!Blind) { if (!Blind) {
xtime = (amount*amount == 1) ? "moment" : "while"; xtime = (amount*amount == 1) ? "moment" : "while";
Your("%s %s for a %s.", pline("%s %s for a %s.",
aobjnam(uwep, amount == 0 ? "violently glow" : "glow"), Yobjnam2(uwep, amount == 0 ? "violently glow" : "glow"),
color, xtime); color, xtime);
if (otyp != STRANGE_OBJECT && uwep->known && if (otyp != STRANGE_OBJECT && uwep->known &&
(amount > 0 || (amount < 0 && otmp->bknown))) (amount > 0 || (amount < 0 && otmp->bknown)))
makeknown(otyp); makeknown(otyp);
@@ -773,8 +748,7 @@ register int amount;
/* elven weapons vibrate warningly when enchanted beyond a limit */ /* elven weapons vibrate warningly when enchanted beyond a limit */
if ((uwep->spe > 5) if ((uwep->spe > 5)
&& (is_elven_weapon(uwep) || uwep->oartifact || !rn2(7))) && (is_elven_weapon(uwep) || uwep->oartifact || !rn2(7)))
Your("%s unexpectedly.", pline("%s unexpectedly.", Yobjnam2(uwep, "suddenly vibrate"));
aobjnam(uwep, "suddenly vibrate"));
return(1); return(1);
} }
@@ -797,8 +771,8 @@ register struct obj *obj;
long savewornmask; long savewornmask;
savewornmask = obj->owornmask; savewornmask = obj->owornmask;
Your("%s %s welded to your %s!", pline("%s welded to your %s!",
xname(obj), otense(obj, "are"), Yobjnam2(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;
+2 -3
View File
@@ -1959,7 +1959,7 @@ boolean ordinary;
if (BInvis && uarmc->otyp == MUMMY_WRAPPING) { if (BInvis && uarmc->otyp == MUMMY_WRAPPING) {
/* A mummy wrapping absorbs it and protects you */ /* A mummy wrapping absorbs it and protects you */
You_feel("rather itchy under your %s.", xname(uarmc)); You_feel("rather itchy under %s.", yname(uarmc));
break; break;
} }
if (ordinary || !rn2(10)) { /* permanent */ if (ordinary || !rn2(10)) { /* permanent */
@@ -3980,8 +3980,7 @@ int osym, dmgtyp;
if(!rn2(3)) cnt++; if(!rn2(3)) cnt++;
if(!cnt) continue; if(!cnt) continue;
if (vis) pline("%s %s %s!", if (vis) pline("%s %s!", yname(obj),
s_suffix(Monnam(mtmp)), xname(obj),
(cnt > 1L) ? destroy_strings[dindx*3 + 1] (cnt > 1L) ? destroy_strings[dindx*3 + 1]
: destroy_strings[dindx*3]); : destroy_strings[dindx*3]);
for(i = 0; i < cnt; i++) m_useup(mtmp, obj); for(i = 0; i < cnt; i++) m_useup(mtmp, obj);