USE_OLDARGS update (2 of 2)
Files modified: include/extern.h src/pline.c, priest.c, potion.c, mkobj.c A bunch of calls to pline() in pline.c started triggering warnings either as-is or possibly after the changes to tradstdc.h. Fixing them in place would include intrusive VA_PASSx() like in lev_main.c. Moving them to other files is much simpler (and they didn't particularly belong in pline.c in the first place, although I didn't actually find any better place for them....). The probing/stethoscope feedback went to priest.c, where there's a comment stating that it should move to wherever englightenment ends up once that is moved out of its completely inappropriate current home in cmd.c. (Holdover from when ^X was wizard-mode only but even the other wizard mode commands don't really belong with the command processing code.)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1496959470 2017/06/08 22:04:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.591 $ */
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1501725402 2017/08/03 01:56:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.598 $ */
|
||||
/* Copyright (c) Steve Creps, 1988. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1309,6 +1309,7 @@ E struct obj *FDECL(obj_nexto, (struct obj *));
|
||||
E struct obj *FDECL(obj_nexto_xy, (struct obj *, int, int, BOOLEAN_P));
|
||||
E struct obj *FDECL(obj_absorb, (struct obj **, struct obj **));
|
||||
E struct obj *FDECL(obj_meld, (struct obj **, struct obj **));
|
||||
E void FDECL(pudding_merge_message, (struct obj *, struct obj *));
|
||||
|
||||
/* ### mkroom.c ### */
|
||||
|
||||
@@ -1833,12 +1834,6 @@ E void VDECL(There, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void VDECL(verbalize, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void VDECL(raw_printf, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void VDECL(impossible, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E const char *FDECL(align_str, (ALIGNTYP_P));
|
||||
E void FDECL(mstatusline, (struct monst *));
|
||||
E void NDECL(ustatusline);
|
||||
E void NDECL(self_invis_message);
|
||||
E char *FDECL(piousness, (BOOLEAN_P, const char *));
|
||||
E void FDECL(pudding_merge_message, (struct obj *, struct obj *));
|
||||
|
||||
/* ### polyself.c ### */
|
||||
|
||||
@@ -1876,6 +1871,7 @@ E void FDECL(make_stoned, (long, const char *, int, const char *));
|
||||
E void FDECL(make_vomiting, (long, BOOLEAN_P));
|
||||
E boolean FDECL(make_hallucinated, (long, BOOLEAN_P, long));
|
||||
E void FDECL(make_deaf, (long, BOOLEAN_P));
|
||||
E void NDECL(self_invis_message);
|
||||
E int NDECL(dodrink);
|
||||
E int FDECL(dopotion, (struct obj *));
|
||||
E int FDECL(peffects, (struct obj *));
|
||||
@@ -1932,6 +1928,10 @@ E void NDECL(clearpriests);
|
||||
E void FDECL(restpriest, (struct monst *, BOOLEAN_P));
|
||||
E void FDECL(newepri, (struct monst *));
|
||||
E void FDECL(free_epri, (struct monst *));
|
||||
E const char *FDECL(align_str, (ALIGNTYP_P));
|
||||
E char *FDECL(piousness, (BOOLEAN_P, const char *));
|
||||
E void FDECL(mstatusline, (struct monst *));
|
||||
E void NDECL(ustatusline);
|
||||
|
||||
/* ### quest.c ### */
|
||||
|
||||
|
||||
33
src/mkobj.c
33
src/mkobj.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mkobj.c $NHDT-Date: 1462067745 2016/05/01 01:55:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.122 $ */
|
||||
/* NetHack 3.6 mkobj.c $NHDT-Date: 1501725405 2017/08/03 01:56:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.124 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -2720,4 +2720,35 @@ struct obj **obj1, **obj2;
|
||||
return (struct obj *) 0;
|
||||
}
|
||||
|
||||
/* give a message if hero notices two globs merging [used to be in pline.c] */
|
||||
void
|
||||
pudding_merge_message(otmp, otmp2)
|
||||
struct obj *otmp;
|
||||
struct obj *otmp2;
|
||||
{
|
||||
boolean visible = (cansee(otmp->ox, otmp->oy)
|
||||
|| cansee(otmp2->ox, otmp2->oy)),
|
||||
onfloor = (otmp->where == OBJ_FLOOR || otmp2->where == OBJ_FLOOR),
|
||||
inpack = (carried(otmp) || carried(otmp2));
|
||||
|
||||
/* the player will know something happened inside his own inventory */
|
||||
if ((!Blind && visible) || inpack) {
|
||||
if (Hallucination) {
|
||||
if (onfloor) {
|
||||
You_see("parts of the floor melting!");
|
||||
} else if (inpack) {
|
||||
Your("pack reaches out and grabs something!");
|
||||
}
|
||||
/* even though we can see where they should be,
|
||||
* they'll be out of our view (minvent or container)
|
||||
* so don't actually show anything */
|
||||
} else if (onfloor || inpack) {
|
||||
pline("The %s coalesce%s.", makeplural(obj_typename(otmp->otyp)),
|
||||
inpack ? " inside your pack" : "");
|
||||
}
|
||||
} else {
|
||||
You_hear("a faint sloshing sound.");
|
||||
}
|
||||
}
|
||||
|
||||
/*mkobj.c*/
|
||||
|
||||
280
src/pline.c
280
src/pline.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 pline.c $NHDT-Date: 1490908465 2017/03/30 21:14:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.58 $ */
|
||||
/* NetHack 3.6 pline.c $NHDT-Date: 1501725406 2017/08/03 01:56:46 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.60 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -435,276 +435,22 @@ VA_DECL(const char *, s)
|
||||
Vsprintf(pbuf, s, VA_ARGS);
|
||||
pbuf[BUFSZ - 1] = '\0'; /* sanity */
|
||||
paniclog("impossible", pbuf);
|
||||
pline("%s", pbuf);
|
||||
pline("Program in disorder - perhaps you'd better #quit.");
|
||||
#ifndef USE_OLDARGS
|
||||
#define DUMMY_PLINE_ARGS /*empty*/
|
||||
#else /* needed because we follow the definition of pline() itself;
|
||||
* passing 1 arg, pline takes 9 (for USE_OLDARGS) so add 8 dummies */
|
||||
#define DUMMY_PLINE_ARGS , (vA) 0, (vA) 0, (vA) 0, (vA) 0, \
|
||||
(vA) 0, (vA) 0, (vA) 0, (vA) 0
|
||||
#endif
|
||||
pline("%s", pbuf /* no comma here; when needed, it's in DUMMY_ARGS */
|
||||
DUMMY_PLINE_ARGS);
|
||||
pline("%s", "Program in disorder - perhaps you'd better #quit."
|
||||
DUMMY_PLINE_ARGS);
|
||||
#undef DUMMY_PLINE_ARGS
|
||||
program_state.in_impossible = 0;
|
||||
VA_END();
|
||||
}
|
||||
|
||||
const char *
|
||||
align_str(alignment)
|
||||
aligntyp alignment;
|
||||
{
|
||||
switch ((int) alignment) {
|
||||
case A_CHAOTIC:
|
||||
return "chaotic";
|
||||
case A_NEUTRAL:
|
||||
return "neutral";
|
||||
case A_LAWFUL:
|
||||
return "lawful";
|
||||
case A_NONE:
|
||||
return "unaligned";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
void
|
||||
mstatusline(mtmp)
|
||||
register struct monst *mtmp;
|
||||
{
|
||||
aligntyp alignment = mon_aligntyp(mtmp);
|
||||
char info[BUFSZ], monnambuf[BUFSZ];
|
||||
|
||||
info[0] = 0;
|
||||
if (mtmp->mtame) {
|
||||
Strcat(info, ", tame");
|
||||
if (wizard) {
|
||||
Sprintf(eos(info), " (%d", mtmp->mtame);
|
||||
if (!mtmp->isminion)
|
||||
Sprintf(eos(info), "; hungry %ld; apport %d",
|
||||
EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport);
|
||||
Strcat(info, ")");
|
||||
}
|
||||
} else if (mtmp->mpeaceful)
|
||||
Strcat(info, ", peaceful");
|
||||
|
||||
if (mtmp->data == &mons[PM_LONG_WORM]) {
|
||||
int segndx, nsegs = count_wsegs(mtmp);
|
||||
|
||||
/* the worm code internals don't consider the head of be one of
|
||||
the worm's segments, but we count it as such when presenting
|
||||
worm feedback to the player */
|
||||
if (!nsegs) {
|
||||
Strcat(info, ", single segment");
|
||||
} else {
|
||||
++nsegs; /* include head in the segment count */
|
||||
segndx = wseg_at(mtmp, bhitpos.x, bhitpos.y);
|
||||
Sprintf(eos(info), ", %d%s of %d segments",
|
||||
segndx, ordin(segndx), nsegs);
|
||||
}
|
||||
}
|
||||
if (mtmp->cham >= LOW_PM && mtmp->data != &mons[mtmp->cham])
|
||||
/* don't reveal the innate form (chameleon, vampire, &c),
|
||||
just expose the fact that this current form isn't it */
|
||||
Strcat(info, ", shapechanger");
|
||||
/* pets eating mimic corpses mimic while eating, so this comes first */
|
||||
if (mtmp->meating)
|
||||
Strcat(info, ", eating");
|
||||
/* a stethoscope exposes mimic before getting here so this
|
||||
won't be relevant for it, but wand of probing doesn't */
|
||||
if (mtmp->mundetected || mtmp->m_ap_type)
|
||||
mhidden_description(mtmp, TRUE, eos(info));
|
||||
if (mtmp->mcan)
|
||||
Strcat(info, ", cancelled");
|
||||
if (mtmp->mconf)
|
||||
Strcat(info, ", confused");
|
||||
if (mtmp->mblinded || !mtmp->mcansee)
|
||||
Strcat(info, ", blind");
|
||||
if (mtmp->mstun)
|
||||
Strcat(info, ", stunned");
|
||||
if (mtmp->msleeping)
|
||||
Strcat(info, ", asleep");
|
||||
#if 0 /* unfortunately mfrozen covers temporary sleep and being busy \
|
||||
(donning armor, for instance) as well as paralysis */
|
||||
else if (mtmp->mfrozen)
|
||||
Strcat(info, ", paralyzed");
|
||||
#else
|
||||
else if (mtmp->mfrozen || !mtmp->mcanmove)
|
||||
Strcat(info, ", can't move");
|
||||
#endif
|
||||
/* [arbitrary reason why it isn't moving] */
|
||||
else if (mtmp->mstrategy & STRAT_WAITMASK)
|
||||
Strcat(info, ", meditating");
|
||||
if (mtmp->mflee)
|
||||
Strcat(info, ", scared");
|
||||
if (mtmp->mtrapped)
|
||||
Strcat(info, ", trapped");
|
||||
if (mtmp->mspeed)
|
||||
Strcat(info, mtmp->mspeed == MFAST ? ", fast" : mtmp->mspeed == MSLOW
|
||||
? ", slow"
|
||||
: ", ???? speed");
|
||||
if (mtmp->minvis)
|
||||
Strcat(info, ", invisible");
|
||||
if (mtmp == u.ustuck)
|
||||
Strcat(info, sticks(youmonst.data)
|
||||
? ", held by you"
|
||||
: !u.uswallow ? ", holding you"
|
||||
: attacktype_fordmg(u.ustuck->data,
|
||||
AT_ENGL, AD_DGST)
|
||||
? ", digesting you"
|
||||
: is_animal(u.ustuck->data)
|
||||
? ", swallowing you"
|
||||
: ", engulfing you");
|
||||
if (mtmp == u.usteed)
|
||||
Strcat(info, ", carrying you");
|
||||
|
||||
/* avoid "Status of the invisible newt ..., invisible" */
|
||||
/* and unlike a normal mon_nam, use "saddled" even if it has a name */
|
||||
Strcpy(monnambuf, x_monnam(mtmp, ARTICLE_THE, (char *) 0,
|
||||
(SUPPRESS_IT | SUPPRESS_INVISIBLE), FALSE));
|
||||
|
||||
pline("Status of %s (%s): Level %d HP %d(%d) AC %d%s.", monnambuf,
|
||||
align_str(alignment), mtmp->m_lev, mtmp->mhp, mtmp->mhpmax,
|
||||
find_mac(mtmp), info);
|
||||
}
|
||||
|
||||
void
|
||||
ustatusline()
|
||||
{
|
||||
char info[BUFSZ];
|
||||
|
||||
info[0] = '\0';
|
||||
if (Sick) {
|
||||
Strcat(info, ", dying from");
|
||||
if (u.usick_type & SICK_VOMITABLE)
|
||||
Strcat(info, " food poisoning");
|
||||
if (u.usick_type & SICK_NONVOMITABLE) {
|
||||
if (u.usick_type & SICK_VOMITABLE)
|
||||
Strcat(info, " and");
|
||||
Strcat(info, " illness");
|
||||
}
|
||||
}
|
||||
if (Stoned)
|
||||
Strcat(info, ", solidifying");
|
||||
if (Slimed)
|
||||
Strcat(info, ", becoming slimy");
|
||||
if (Strangled)
|
||||
Strcat(info, ", being strangled");
|
||||
if (Vomiting)
|
||||
Strcat(info, ", nauseated"); /* !"nauseous" */
|
||||
if (Confusion)
|
||||
Strcat(info, ", confused");
|
||||
if (Blind) {
|
||||
Strcat(info, ", blind");
|
||||
if (u.ucreamed) {
|
||||
if ((long) u.ucreamed < Blinded || Blindfolded
|
||||
|| !haseyes(youmonst.data))
|
||||
Strcat(info, ", cover");
|
||||
Strcat(info, "ed by sticky goop");
|
||||
} /* note: "goop" == "glop"; variation is intentional */
|
||||
}
|
||||
if (Stunned)
|
||||
Strcat(info, ", stunned");
|
||||
if (!u.usteed && Wounded_legs) {
|
||||
const char *what = body_part(LEG);
|
||||
if ((Wounded_legs & BOTH_SIDES) == BOTH_SIDES)
|
||||
what = makeplural(what);
|
||||
Sprintf(eos(info), ", injured %s", what);
|
||||
}
|
||||
if (Glib)
|
||||
Sprintf(eos(info), ", slippery %s", makeplural(body_part(HAND)));
|
||||
if (u.utrap)
|
||||
Strcat(info, ", trapped");
|
||||
if (Fast)
|
||||
Strcat(info, Very_fast ? ", very fast" : ", fast");
|
||||
if (u.uundetected)
|
||||
Strcat(info, ", concealed");
|
||||
if (Invis)
|
||||
Strcat(info, ", invisible");
|
||||
if (u.ustuck) {
|
||||
if (sticks(youmonst.data))
|
||||
Strcat(info, ", holding ");
|
||||
else
|
||||
Strcat(info, ", held by ");
|
||||
Strcat(info, mon_nam(u.ustuck));
|
||||
}
|
||||
|
||||
pline("Status of %s (%s): Level %d HP %d(%d) AC %d%s.", plname,
|
||||
piousness(FALSE, align_str(u.ualign.type)),
|
||||
Upolyd ? mons[u.umonnum].mlevel : u.ulevel, Upolyd ? u.mh : u.uhp,
|
||||
Upolyd ? u.mhmax : u.uhpmax, u.uac, info);
|
||||
}
|
||||
|
||||
void
|
||||
self_invis_message()
|
||||
{
|
||||
pline("%s %s.",
|
||||
Hallucination ? "Far out, man! You" : "Gee! All of a sudden, you",
|
||||
See_invisible ? "can see right through yourself"
|
||||
: "can't see yourself");
|
||||
}
|
||||
|
||||
char *
|
||||
piousness(showneg, suffix)
|
||||
boolean showneg;
|
||||
const char *suffix;
|
||||
{
|
||||
static char buf[32]; /* bigger than "insufficiently neutral" */
|
||||
const char *pio;
|
||||
|
||||
/* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */
|
||||
if (u.ualign.record >= 20)
|
||||
pio = "piously";
|
||||
else if (u.ualign.record > 13)
|
||||
pio = "devoutly";
|
||||
else if (u.ualign.record > 8)
|
||||
pio = "fervently";
|
||||
else if (u.ualign.record > 3)
|
||||
pio = "stridently";
|
||||
else if (u.ualign.record == 3)
|
||||
pio = "";
|
||||
else if (u.ualign.record > 0)
|
||||
pio = "haltingly";
|
||||
else if (u.ualign.record == 0)
|
||||
pio = "nominally";
|
||||
else if (!showneg)
|
||||
pio = "insufficiently";
|
||||
else if (u.ualign.record >= -3)
|
||||
pio = "strayed";
|
||||
else if (u.ualign.record >= -8)
|
||||
pio = "sinned";
|
||||
else
|
||||
pio = "transgressed";
|
||||
|
||||
Sprintf(buf, "%s", pio);
|
||||
if (suffix && (!showneg || u.ualign.record >= 0)) {
|
||||
if (u.ualign.record != 3)
|
||||
Strcat(buf, " ");
|
||||
Strcat(buf, suffix);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
void
|
||||
pudding_merge_message(otmp, otmp2)
|
||||
struct obj *otmp;
|
||||
struct obj *otmp2;
|
||||
{
|
||||
boolean visible =
|
||||
cansee(otmp->ox, otmp->oy) || cansee(otmp2->ox, otmp2->oy);
|
||||
boolean onfloor = otmp->where == OBJ_FLOOR || otmp2->where == OBJ_FLOOR;
|
||||
boolean inpack = carried(otmp) || carried(otmp2);
|
||||
|
||||
/* the player will know something happened inside his own inventory */
|
||||
if ((!Blind && visible) || inpack) {
|
||||
if (Hallucination) {
|
||||
if (onfloor) {
|
||||
You_see("parts of the floor melting!");
|
||||
} else if (inpack) {
|
||||
Your("pack reaches out and grabs something!");
|
||||
}
|
||||
/* even though we can see where they should be,
|
||||
* they'll be out of our view (minvent or container)
|
||||
* so don't actually show anything */
|
||||
} else if (onfloor || inpack) {
|
||||
pline("The %s coalesce%s.", makeplural(obj_typename(otmp->otyp)),
|
||||
inpack ? " inside your pack" : "");
|
||||
}
|
||||
} else {
|
||||
You_hear("a faint sloshing sound.");
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(MSGHANDLER) && (defined(POSIX_TYPES) || defined(__GNUC__))
|
||||
static boolean use_pline_handler = TRUE;
|
||||
static void
|
||||
|
||||
12
src/potion.c
12
src/potion.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 potion.c $NHDT-Date: 1455407631 2016/02/13 23:53:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.129 $ */
|
||||
/* NetHack 3.6 potion.c $NHDT-Date: 1501725406 2017/08/03 01:56:46 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.137 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -408,6 +408,16 @@ boolean talk;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
self_invis_message()
|
||||
{
|
||||
pline("%s %s.",
|
||||
Hallucination ? "Far out, man! You"
|
||||
: "Gee! All of a sudden, you",
|
||||
See_invisible ? "can see right through yourself"
|
||||
: "can't see yourself");
|
||||
}
|
||||
|
||||
STATIC_OVL void
|
||||
ghost_from_bottle()
|
||||
{
|
||||
|
||||
240
src/priest.c
240
src/priest.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 priest.c $NHDT-Date: 1446892452 2015/11/07 10:34:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.41 $ */
|
||||
/* NetHack 3.6 priest.c $NHDT-Date: 1501725407 2017/08/03 01:56:47 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.44 $ */
|
||||
/* Copyright (c) Izchak Miller, Steve Linhart, 1989. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -852,4 +852,242 @@ boolean ghostly;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* align_str(), piousness(), mstatusline() and ustatusline() used to be
|
||||
* in pline.c, presumeably because the latter two generate one line of
|
||||
* output. The USE_OLDARGS config gets warnings from 2016ish-vintage
|
||||
* gcc (for -Wint-to-pointer-cast, activated by -Wall or -W) when they
|
||||
* follow pline() itself. Fixing up the variadic calls like is done for
|
||||
* lev_comp would be needlessly messy there.
|
||||
*
|
||||
* They don't belong here. If/when enlightenment ever gets split off
|
||||
* from cmd.c (which definitely doesn't belong there), they should go
|
||||
* with it.
|
||||
*/
|
||||
|
||||
const char *
|
||||
align_str(alignment)
|
||||
aligntyp alignment;
|
||||
{
|
||||
switch ((int) alignment) {
|
||||
case A_CHAOTIC:
|
||||
return "chaotic";
|
||||
case A_NEUTRAL:
|
||||
return "neutral";
|
||||
case A_LAWFUL:
|
||||
return "lawful";
|
||||
case A_NONE:
|
||||
return "unaligned";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
/* used for self-probing */
|
||||
char *
|
||||
piousness(showneg, suffix)
|
||||
boolean showneg;
|
||||
const char *suffix;
|
||||
{
|
||||
static char buf[32]; /* bigger than "insufficiently neutral" */
|
||||
const char *pio;
|
||||
|
||||
/* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */
|
||||
if (u.ualign.record >= 20)
|
||||
pio = "piously";
|
||||
else if (u.ualign.record > 13)
|
||||
pio = "devoutly";
|
||||
else if (u.ualign.record > 8)
|
||||
pio = "fervently";
|
||||
else if (u.ualign.record > 3)
|
||||
pio = "stridently";
|
||||
else if (u.ualign.record == 3)
|
||||
pio = "";
|
||||
else if (u.ualign.record > 0)
|
||||
pio = "haltingly";
|
||||
else if (u.ualign.record == 0)
|
||||
pio = "nominally";
|
||||
else if (!showneg)
|
||||
pio = "insufficiently";
|
||||
else if (u.ualign.record >= -3)
|
||||
pio = "strayed";
|
||||
else if (u.ualign.record >= -8)
|
||||
pio = "sinned";
|
||||
else
|
||||
pio = "transgressed";
|
||||
|
||||
Sprintf(buf, "%s", pio);
|
||||
if (suffix && (!showneg || u.ualign.record >= 0)) {
|
||||
if (u.ualign.record != 3)
|
||||
Strcat(buf, " ");
|
||||
Strcat(buf, suffix);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* stethoscope or probing applied to monster -- one-line feedback */
|
||||
void
|
||||
mstatusline(mtmp)
|
||||
struct monst *mtmp;
|
||||
{
|
||||
aligntyp alignment = mon_aligntyp(mtmp);
|
||||
char info[BUFSZ], monnambuf[BUFSZ];
|
||||
|
||||
info[0] = 0;
|
||||
if (mtmp->mtame) {
|
||||
Strcat(info, ", tame");
|
||||
if (wizard) {
|
||||
Sprintf(eos(info), " (%d", mtmp->mtame);
|
||||
if (!mtmp->isminion)
|
||||
Sprintf(eos(info), "; hungry %ld; apport %d",
|
||||
EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport);
|
||||
Strcat(info, ")");
|
||||
}
|
||||
} else if (mtmp->mpeaceful)
|
||||
Strcat(info, ", peaceful");
|
||||
|
||||
if (mtmp->data == &mons[PM_LONG_WORM]) {
|
||||
int segndx, nsegs = count_wsegs(mtmp);
|
||||
|
||||
/* the worm code internals don't consider the head of be one of
|
||||
the worm's segments, but we count it as such when presenting
|
||||
worm feedback to the player */
|
||||
if (!nsegs) {
|
||||
Strcat(info, ", single segment");
|
||||
} else {
|
||||
++nsegs; /* include head in the segment count */
|
||||
segndx = wseg_at(mtmp, bhitpos.x, bhitpos.y);
|
||||
Sprintf(eos(info), ", %d%s of %d segments",
|
||||
segndx, ordin(segndx), nsegs);
|
||||
}
|
||||
}
|
||||
if (mtmp->cham >= LOW_PM && mtmp->data != &mons[mtmp->cham])
|
||||
/* don't reveal the innate form (chameleon, vampire, &c),
|
||||
just expose the fact that this current form isn't it */
|
||||
Strcat(info, ", shapechanger");
|
||||
/* pets eating mimic corpses mimic while eating, so this comes first */
|
||||
if (mtmp->meating)
|
||||
Strcat(info, ", eating");
|
||||
/* a stethoscope exposes mimic before getting here so this
|
||||
won't be relevant for it, but wand of probing doesn't */
|
||||
if (mtmp->mundetected || mtmp->m_ap_type)
|
||||
mhidden_description(mtmp, TRUE, eos(info));
|
||||
if (mtmp->mcan)
|
||||
Strcat(info, ", cancelled");
|
||||
if (mtmp->mconf)
|
||||
Strcat(info, ", confused");
|
||||
if (mtmp->mblinded || !mtmp->mcansee)
|
||||
Strcat(info, ", blind");
|
||||
if (mtmp->mstun)
|
||||
Strcat(info, ", stunned");
|
||||
if (mtmp->msleeping)
|
||||
Strcat(info, ", asleep");
|
||||
#if 0 /* unfortunately mfrozen covers temporary sleep and being busy \
|
||||
(donning armor, for instance) as well as paralysis */
|
||||
else if (mtmp->mfrozen)
|
||||
Strcat(info, ", paralyzed");
|
||||
#else
|
||||
else if (mtmp->mfrozen || !mtmp->mcanmove)
|
||||
Strcat(info, ", can't move");
|
||||
#endif
|
||||
/* [arbitrary reason why it isn't moving] */
|
||||
else if (mtmp->mstrategy & STRAT_WAITMASK)
|
||||
Strcat(info, ", meditating");
|
||||
if (mtmp->mflee)
|
||||
Strcat(info, ", scared");
|
||||
if (mtmp->mtrapped)
|
||||
Strcat(info, ", trapped");
|
||||
if (mtmp->mspeed)
|
||||
Strcat(info, (mtmp->mspeed == MFAST) ? ", fast"
|
||||
: (mtmp->mspeed == MSLOW) ? ", slow"
|
||||
: ", [? speed]");
|
||||
if (mtmp->minvis)
|
||||
Strcat(info, ", invisible");
|
||||
if (mtmp == u.ustuck)
|
||||
Strcat(info, sticks(youmonst.data) ? ", held by you"
|
||||
: !u.uswallow ? ", holding you"
|
||||
: attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_DGST)
|
||||
? ", digesting you"
|
||||
: is_animal(u.ustuck->data) ? ", swallowing you"
|
||||
: ", engulfing you");
|
||||
if (mtmp == u.usteed)
|
||||
Strcat(info, ", carrying you");
|
||||
|
||||
/* avoid "Status of the invisible newt ..., invisible" */
|
||||
/* and unlike a normal mon_nam, use "saddled" even if it has a name */
|
||||
Strcpy(monnambuf, x_monnam(mtmp, ARTICLE_THE, (char *) 0,
|
||||
(SUPPRESS_IT | SUPPRESS_INVISIBLE), FALSE));
|
||||
|
||||
pline("Status of %s (%s): Level %d HP %d(%d) AC %d%s.", monnambuf,
|
||||
align_str(alignment), mtmp->m_lev, mtmp->mhp, mtmp->mhpmax,
|
||||
find_mac(mtmp), info);
|
||||
}
|
||||
|
||||
/* stethoscope or probing applied to hero -- one-line feedback */
|
||||
void
|
||||
ustatusline()
|
||||
{
|
||||
char info[BUFSZ];
|
||||
|
||||
info[0] = '\0';
|
||||
if (Sick) {
|
||||
Strcat(info, ", dying from");
|
||||
if (u.usick_type & SICK_VOMITABLE)
|
||||
Strcat(info, " food poisoning");
|
||||
if (u.usick_type & SICK_NONVOMITABLE) {
|
||||
if (u.usick_type & SICK_VOMITABLE)
|
||||
Strcat(info, " and");
|
||||
Strcat(info, " illness");
|
||||
}
|
||||
}
|
||||
if (Stoned)
|
||||
Strcat(info, ", solidifying");
|
||||
if (Slimed)
|
||||
Strcat(info, ", becoming slimy");
|
||||
if (Strangled)
|
||||
Strcat(info, ", being strangled");
|
||||
if (Vomiting)
|
||||
Strcat(info, ", nauseated"); /* !"nauseous" */
|
||||
if (Confusion)
|
||||
Strcat(info, ", confused");
|
||||
if (Blind) {
|
||||
Strcat(info, ", blind");
|
||||
if (u.ucreamed) {
|
||||
if ((long) u.ucreamed < Blinded || Blindfolded
|
||||
|| !haseyes(youmonst.data))
|
||||
Strcat(info, ", cover");
|
||||
Strcat(info, "ed by sticky goop");
|
||||
} /* note: "goop" == "glop"; variation is intentional */
|
||||
}
|
||||
if (Stunned)
|
||||
Strcat(info, ", stunned");
|
||||
if (!u.usteed && Wounded_legs) {
|
||||
const char *what = body_part(LEG);
|
||||
if ((Wounded_legs & BOTH_SIDES) == BOTH_SIDES)
|
||||
what = makeplural(what);
|
||||
Sprintf(eos(info), ", injured %s", what);
|
||||
}
|
||||
if (Glib)
|
||||
Sprintf(eos(info), ", slippery %s", makeplural(body_part(HAND)));
|
||||
if (u.utrap)
|
||||
Strcat(info, ", trapped");
|
||||
if (Fast)
|
||||
Strcat(info, Very_fast ? ", very fast" : ", fast");
|
||||
if (u.uundetected)
|
||||
Strcat(info, ", concealed");
|
||||
if (Invis)
|
||||
Strcat(info, ", invisible");
|
||||
if (u.ustuck) {
|
||||
if (sticks(youmonst.data))
|
||||
Strcat(info, ", holding ");
|
||||
else
|
||||
Strcat(info, ", held by ");
|
||||
Strcat(info, mon_nam(u.ustuck));
|
||||
}
|
||||
|
||||
pline("Status of %s (%s): Level %d HP %d(%d) AC %d%s.", plname,
|
||||
piousness(FALSE, align_str(u.ualign.type)),
|
||||
Upolyd ? mons[u.umonnum].mlevel : u.ulevel, Upolyd ? u.mh : u.uhp,
|
||||
Upolyd ? u.mhmax : u.uhpmax, u.uac, info);
|
||||
}
|
||||
|
||||
/*priest.c*/
|
||||
|
||||
Reference in New Issue
Block a user