fix #H2259 - rising from dead message gives away info (trunk only)
From a bug report, receiving the
message "Your body rises from the dead as an <undead>..." gives away
the fact that bones are being created (and its absence when applicable
undead kills the hero gives away the fact that bones aren't being
created). Not very interesting for single player installations where
5-10 seconds later the player is going to check the playground for new
files, but matters on multi-user installations where players don't have
access to the directory and sometimes race each other to juicy bones,
such as nethack.alt.org.
At the end of disclosure, give the message whether bones are being
saved or not (for cases where it would have happened when bones are
created). Player won't know whether new bones are becoming available.
Also, prevent risen undead-from-hero from being given random monster
inventory, but explicitly give mummy-from-hero a mummy wrapping if the
hero isn't already carrying one. It will end up being worn; that's
the only armor mummies are allowed to put on.
This commit is contained in:
@@ -362,6 +362,8 @@ dying in lava and being life-saved or leaving bones would destroy ring of
|
|||||||
scrolls of fire and spellbook of fireball
|
scrolls of fire and spellbook of fireball
|
||||||
surviving in lava boils away carried potions, but dying in lava and being
|
surviving in lava boils away carried potions, but dying in lava and being
|
||||||
life-saved or leaving bones would keep them intact
|
life-saved or leaving bones would keep them intact
|
||||||
|
when applicable, give "your body rises from the dead as an <undead>..."
|
||||||
|
even when bones data isn't being saved
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
18
src/bones.c
18
src/bones.c
@@ -354,22 +354,24 @@ struct obj *corpse;
|
|||||||
(void) obj_attach_mid(corpse, mtmp->m_id);
|
(void) obj_attach_mid(corpse, mtmp->m_id);
|
||||||
} else {
|
} else {
|
||||||
/* give your possessions to the monster you become */
|
/* give your possessions to the monster you become */
|
||||||
in_mklev = TRUE;
|
in_mklev = TRUE; /* use <u.ux,u.uy> as-is */
|
||||||
mtmp = makemon(&mons[u.ugrave_arise], u.ux, u.uy, NO_MM_FLAGS);
|
mtmp = makemon(&mons[u.ugrave_arise], u.ux, u.uy, NO_MINVENT);
|
||||||
in_mklev = FALSE;
|
in_mklev = FALSE;
|
||||||
if (!mtmp) {
|
if (!mtmp) {
|
||||||
drop_upon_death((struct monst *)0, (struct obj *)0,
|
drop_upon_death((struct monst *)0, (struct obj *)0,
|
||||||
u.ux, u.uy);
|
u.ux, u.uy);
|
||||||
|
u.ugrave_arise = NON_PM; /* in case caller cares */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/* give mummy-from-hero a wrapping unless hero already
|
||||||
|
carries one; don't bother forcing it to become worn */
|
||||||
|
if (mtmp->data->mlet == S_MUMMY && !carrying(MUMMY_WRAPPING))
|
||||||
|
(void)mongets(mtmp, MUMMY_WRAPPING);
|
||||||
mtmp = christen_monst(mtmp, plname);
|
mtmp = christen_monst(mtmp, plname);
|
||||||
newsym(u.ux, u.uy);
|
newsym(u.ux, u.uy);
|
||||||
/* turning into slime isn't rising from the dead
|
/* ["Your body rises from the dead as an <mname>..." used
|
||||||
and has already given its own message */
|
to be given here, but it has been moved to done() so that
|
||||||
if (u.ugrave_arise != PM_GREEN_SLIME)
|
it gets delivered even when savebones() isn't called] */
|
||||||
Your("body rises from the dead as %s...",
|
|
||||||
an(mons[u.ugrave_arise].mname));
|
|
||||||
display_nhwindow(WIN_MESSAGE, FALSE);
|
|
||||||
drop_upon_death(mtmp, (struct obj *)0, u.ux, u.uy);
|
drop_upon_death(mtmp, (struct obj *)0, u.ux, u.uy);
|
||||||
m_dowear(mtmp, TRUE);
|
m_dowear(mtmp, TRUE);
|
||||||
}
|
}
|
||||||
|
|||||||
32
src/end.c
32
src/end.c
@@ -462,6 +462,8 @@ int how;
|
|||||||
u.ugrave_arise = PM_VAMPIRE;
|
u.ugrave_arise = PM_VAMPIRE;
|
||||||
else if (mptr == &mons[PM_GHOUL])
|
else if (mptr == &mons[PM_GHOUL])
|
||||||
u.ugrave_arise = PM_GHOUL;
|
u.ugrave_arise = PM_GHOUL;
|
||||||
|
/* this could happen if a high-end vampire kills the hero
|
||||||
|
when ordinary vampires are genocided; ditto for wraiths */
|
||||||
if (u.ugrave_arise >= LOW_PM &&
|
if (u.ugrave_arise >= LOW_PM &&
|
||||||
(mvitals[u.ugrave_arise].mvflags & G_GENOD))
|
(mvitals[u.ugrave_arise].mvflags & G_GENOD))
|
||||||
u.ugrave_arise = NON_PM;
|
u.ugrave_arise = NON_PM;
|
||||||
@@ -912,16 +914,16 @@ die:
|
|||||||
|
|
||||||
if (bones_ok && launch_in_progress()) force_launch_placement();
|
if (bones_ok && launch_in_progress()) force_launch_placement();
|
||||||
|
|
||||||
if (bones_ok && u.ugrave_arise < LOW_PM) {
|
/* maintain ugrave_arise even for !bones_ok */
|
||||||
/* corpse gets burnt up too */
|
if (how == BURNING || how == DISSOLVED) /* corpse gets burnt up too */
|
||||||
if (how == BURNING || how == DISSOLVED)
|
u.ugrave_arise = (NON_PM - 2); /* leave no corpse */
|
||||||
u.ugrave_arise = (NON_PM - 2); /* leave no corpse */
|
else if (how == STONING)
|
||||||
else if (how == STONING)
|
u.ugrave_arise = (NON_PM - 1); /* statue instead of corpse */
|
||||||
u.ugrave_arise = (NON_PM - 1); /* statue instead of corpse */
|
else if (how == TURNED_SLIME)
|
||||||
else if (how == TURNED_SLIME)
|
u.ugrave_arise = PM_GREEN_SLIME;
|
||||||
u.ugrave_arise = PM_GREEN_SLIME;
|
|
||||||
else if (u.ugrave_arise == NON_PM &&
|
if (bones_ok && u.ugrave_arise == NON_PM &&
|
||||||
!(mvitals[u.umonnum].mvflags & G_NOCORPSE)) {
|
!(mvitals[u.umonnum].mvflags & G_NOCORPSE)) {
|
||||||
int mnum = u.umonnum;
|
int mnum = u.umonnum;
|
||||||
|
|
||||||
if (!Upolyd) {
|
if (!Upolyd) {
|
||||||
@@ -940,7 +942,6 @@ die:
|
|||||||
killer.format == KILLED_BY_AN ? an(killer.name) :
|
killer.format == KILLED_BY_AN ? an(killer.name) :
|
||||||
killer.name);
|
killer.name);
|
||||||
make_grave(u.ux, u.uy, pbuf);
|
make_grave(u.ux, u.uy, pbuf);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* if pets will contribute to score, populate mydogs list now
|
/* if pets will contribute to score, populate mydogs list now
|
||||||
(bones creation isn't a factor, but pline() messaging is) */
|
(bones creation isn't a factor, but pline() messaging is) */
|
||||||
@@ -1006,6 +1007,15 @@ die:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (u.ugrave_arise >= LOW_PM && u.ugrave_arise != PM_GREEN_SLIME) {
|
||||||
|
/* give this feedback even if bones aren't going to be created,
|
||||||
|
so that its presence or absence doesn't tip off the player to
|
||||||
|
new bones or their lack; it might be a lie if makemon fails */
|
||||||
|
Your("body rises from the dead as %s...",
|
||||||
|
an(mons[u.ugrave_arise].mname));
|
||||||
|
display_nhwindow(WIN_MESSAGE, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
if (bones_ok) {
|
if (bones_ok) {
|
||||||
#ifdef WIZARD
|
#ifdef WIZARD
|
||||||
if (!wizard || yn("Save bones?") == 'y')
|
if (!wizard || yn("Save bones?") == 'y')
|
||||||
|
|||||||
Reference in New Issue
Block a user