"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

View File

@@ -271,8 +271,8 @@ register int trouble;
int i;
struct obj *otmp = 0;
const char *what = (const char *)0;
static NEARDATA const char leftglow[] = "left ring softly glows",
rightglow[] = "right ring softly glows";
static NEARDATA const char leftglow[] = "Your left ring softly glows",
rightglow[] = "Your right ring softly glows";
switch (trouble) {
case TROUBLE_STONED:
@@ -400,9 +400,9 @@ decurse:
}
uncurse(otmp);
if (!Blind) {
Your("%s %s.", what ? what :
(const char *)aobjnam(otmp, "softly glow"),
hcolor(NH_AMBER));
pline("%s %s.", what ? what :
(const char *)Yobjnam2(otmp, "softly glow"),
hcolor(NH_AMBER));
otmp->bknown = TRUE;
}
update_inventory();
@@ -450,9 +450,7 @@ decurse:
otmp = which_armor(u.usteed, W_SADDLE);
uncurse(otmp);
if (!Blind) {
pline("%s %s %s.",
s_suffix(upstart(y_monnam(u.usteed))),
aobjnam(otmp, "softly glow"),
pline("%s %s.", Yobjnam2(otmp, "softly glow"),
hcolor(NH_AMBER));
otmp->bknown = TRUE;
}
@@ -870,20 +868,20 @@ pleased(g_align)
uncurse(uwep);
uwep->bknown = TRUE;
if (!Blind)
Your("%s %s%s.", aobjnam(uwep, "softly glow"),
hcolor(NH_AMBER), repair_buf);
else You_feel("the power of %s over your %s.",
u_gname(), xname(uwep));
pline("%s %s%s.", Yobjnam2(uwep, "softly glow"),
hcolor(NH_AMBER), repair_buf);
else You_feel("the power of %s over %s.",
u_gname(), yname(uwep));
*repair_buf = '\0';
} else if (!uwep->blessed) {
bless(uwep);
uwep->bknown = TRUE;
if (!Blind)
Your("%s with %s aura%s.",
aobjnam(uwep, "softly glow"),
an(hcolor(NH_LIGHT_BLUE)), repair_buf);
else You_feel("the blessing of %s over your %s.",
u_gname(), xname(uwep));
pline("%s with %s aura%s.",
Yobjnam2(uwep, "softly glow"),
an(hcolor(NH_LIGHT_BLUE)), repair_buf);
else You_feel("the blessing of %s over %s.",
u_gname(), yname(uwep));
*repair_buf = '\0';
}
@@ -894,8 +892,8 @@ pleased(g_align)
/* only give this message if we didn't just bless
or uncurse (which has already given a message) */
if (*repair_buf)
Your("%s as good as new!",
aobjnam(uwep, Blind ? "feel" : "look"));
pline("%s as good as new!",
Yobjnam2(uwep, Blind ? "feel" : "look"));
}
update_inventory();
}
@@ -951,8 +949,8 @@ pleased(g_align)
if (otmp->cursed) {
uncurse(otmp);
if (!Blind) {
Your("%s %s.", aobjnam(otmp, "softly glow"),
hcolor(NH_AMBER));
pline("%s %s.", Yobjnam2(otmp, "softly glow"),
hcolor(NH_AMBER));
otmp->bknown = TRUE;
++any;
}