Merge branch 'NetHack-3.6.0'

This commit is contained in:
keni
2016-07-19 14:35:13 -04:00
22 changed files with 140 additions and 63 deletions

View File

@@ -245,7 +245,8 @@ boolean thrown_weapon; /* thrown weapons are less deadly */
boolean plural = (reason[strlen(reason) - 1] == 's') ? 1 : 0;
/* avoid "The" Orcus's sting was poisoned... */
pline("%s%s %s poisoned!", isupper(*reason) ? "" : "The ", reason,
pline("%s%s %s poisoned!",
isupper((uchar) *reason) ? "" : "The ", reason,
plural ? "were" : "was");
}
if (Poison_resistance) {

View File

@@ -443,6 +443,8 @@ int spellnum;
pline("%s suddenly %s!", Monnam(mtmp),
!See_invisible ? "disappears" : "becomes transparent");
mon_set_minvis(mtmp);
if (cansee(mtmp->mx, mtmp->my) && !canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my);
dmg = 0;
} else
impossible("no reason for monster to cast disappear spell?");

View File

@@ -675,12 +675,26 @@ register struct attack *mattk;
return MM_MISS;
if (vis) {
/* [this two-part formatting dates back to when only one x_monnam
result could be included in an expression because the next one
would overwrite first's result -- that's no longer the case] */
Sprintf(buf, "%s swallows", Monnam(magr));
pline("%s %s.", buf, mon_nam(mdef));
}
for (obj = mdef->minvent; obj; obj = obj->nobj)
(void) snuff_lit(obj);
if (is_vampshifter(mdef)
&& newcham(mdef, &mons[mdef->cham], FALSE, FALSE)) {
if (vis) {
/* 'it' -- previous form is no longer available and
using that would be excessively verbose */
pline("%s expels it.", Monnam(magr));
pline("It turns into %s.", a_monnam(mdef));
}
return MM_HIT; /* bypass mdamagem() */
}
/*
* All of this manipulation is needed to keep the display correct.
* There is a flush at the next pline().

View File

@@ -2043,6 +2043,9 @@ struct monst *mdef;
xchar x = mdef->mx, y = mdef->my;
boolean wasinside = FALSE;
if (!vamp_stone(mdef)) /* vampshifter reverts to vampire */
return;
/* we have to make the statue before calling mondead, to be able to
* put inventory in it, and we have to check for lifesaving before
* making the statue....
@@ -2402,9 +2405,8 @@ struct monst *mtmp;
/* construct a format string before transformation */
Sprintf(buf, "The lapidifying %s %s %s",
x_monnam(mtmp, ARTICLE_NONE, (char *) 0,
SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION
| SUPPRESS_INVISIBLE | SUPPRESS_IT,
FALSE),
(SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION
| SUPPRESS_INVISIBLE | SUPPRESS_IT), FALSE),
amorphous(mtmp->data) ? "coalesces on the"
: is_flyer(mtmp->data) ? "drops to the"
: "writhes on the",
@@ -2434,8 +2436,8 @@ struct monst *mtmp;
else
mtmp->cham = mndx;
if (canspotmon(mtmp)) {
pline("%s rises from the %s with renewed agility!",
Amonnam(mtmp), surface(mtmp->mx, mtmp->my));
pline("%s rises from the %s with renewed agility!",
Amonnam(mtmp), surface(mtmp->mx, mtmp->my));
}
newsym(mtmp->mx, mtmp->my);
return FALSE; /* didn't petrify */

View File

@@ -338,10 +338,15 @@ boolean verbose; /* give message(s) even when you can't see what happened */
if (ismimic)
seemimic(mtmp);
mtmp->msleeping = 0;
if (vis)
hit(distant_name(otmp, mshot_xname), mtmp, exclam(damage));
else if (verbose && !target)
pline("%s is hit%s", Monnam(mtmp), exclam(damage));
if (vis) {
if (otmp->otyp == EGG)
pline("Splat! %s is hit with %s egg!", Monnam(mtmp),
otmp->known ? an(mons[otmp->corpsenm].mname) : "an");
else
hit(distant_name(otmp, mshot_xname), mtmp, exclam(damage));
} else if (verbose && !target)
pline("%s%s is hit%s", (otmp->otyp == EGG) ? "Splat! " : "",
Monnam(mtmp), exclam(damage));
if (otmp->opoisoned && is_poisonable(otmp)) {
if (resists_poison(mtmp)) {
@@ -369,7 +374,6 @@ boolean verbose; /* give message(s) even when you can't see what happened */
if (resists_acid(mtmp)) {
if (vis || (verbose && !target))
pline("%s is unaffected.", Monnam(mtmp));
damage = 0;
} else {
if (vis)
pline_The("%s burns %s!", hliquid("acid"), mon_nam(mtmp));
@@ -377,24 +381,36 @@ boolean verbose; /* give message(s) even when you can't see what happened */
pline("It is burned!");
}
}
mtmp->mhp -= damage;
if (mtmp->mhp < 1) {
if (vis || (verbose && !target))
pline("%s is %s!", Monnam(mtmp),
(nonliving(mtmp->data) || is_vampshifter(mtmp)
|| !canspotmon(mtmp)) ? "destroyed" : "killed");
/* don't blame hero for unknown rolling boulder trap */
if (!context.mon_moving
&& (otmp->otyp != BOULDER || range >= 0 || otmp->otrapped))
xkilled(mtmp, XKILL_NOMSG);
else
mondied(mtmp);
if (otmp->otyp == EGG && touch_petrifies(&mons[otmp->corpsenm])) {
if (!munstone(mtmp, TRUE))
minstapetrify(mtmp, TRUE);
if (resists_ston(mtmp))
damage = 0;
}
if (can_blnd((struct monst *) 0, mtmp,
(uchar) ((otmp->otyp == BLINDING_VENOM) ? AT_SPIT
: AT_WEAP),
otmp)) {
if (mtmp->mhp > 0) { /* might already be dead (if petrified) */
mtmp->mhp -= damage;
if (mtmp->mhp < 1) {
if (vis || (verbose && !target))
pline("%s is %s!", Monnam(mtmp),
(nonliving(mtmp->data) || is_vampshifter(mtmp)
|| !canspotmon(mtmp)) ? "destroyed" : "killed");
/* don't blame hero for unknown rolling boulder trap */
if (!context.mon_moving && (otmp->otyp != BOULDER
|| range >= 0 || otmp->otrapped))
xkilled(mtmp, XKILL_NOMSG);
else
mondied(mtmp);
}
}
/* blinding venom and cream pie do 0 damage, but verify
that the target is still alive anyway */
if (mtmp->mhp > 0
&& can_blnd((struct monst *) 0, mtmp,
(uchar) ((otmp->otyp == BLINDING_VENOM) ? AT_SPIT
: AT_WEAP),
otmp)) {
if (vis && mtmp->mcansee)
pline("%s is blinded by %s.", Monnam(mtmp), the(xname(otmp)));
mtmp->mcansee = 0;

View File

@@ -1207,8 +1207,8 @@ register struct monst *mtmp;
register struct obj *otmp;
{
int tmp;
boolean reveal_invis = FALSE;
if (mtmp != &youmonst) {
mtmp->msleeping = 0;
if (mtmp->m_ap_type)
@@ -1819,12 +1819,15 @@ struct monst *mtmp;
Strcpy(nambuf, mon_nam(mtmp));
mon_set_minvis(mtmp);
if (vismon && mtmp->minvis) { /* was seen, now invisible */
if (canspotmon(mtmp))
if (canspotmon(mtmp)) {
pline("%s body takes on a %s transparency.",
upstart(s_suffix(nambuf)),
Hallucination ? "normal" : "strange");
else
} else {
pline("Suddenly you cannot see %s.", nambuf);
if (vis)
map_invisible(mtmp->mx, mtmp->my);
}
if (oseen)
makeknown(otmp->otyp);
}

View File

@@ -1379,10 +1379,15 @@ boolean your_fault;
if (!resist(mon, POTION_CLASS, 0, NOTELL))
mon->mconf = TRUE;
break;
case POT_INVISIBILITY:
case POT_INVISIBILITY: {
boolean sawit = canspotmon(mon);
angermon = FALSE;
mon_set_minvis(mon);
if (sawit && !canspotmon(mon) && cansee(mon->mx, mon->my))
map_invisible(mon->mx, mon->my);
break;
}
case POT_SLEEPING:
/* wakeup() doesn't rouse victims of temporary sleep */
if (sleep_monst(mon, rnd(12), POTION_CLASS)) {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 read.c $NHDT-Date: 1457660917 2016/03/11 01:48:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.136 $ */
/* NetHack 3.6 read.c $NHDT-Date: 1467718299 2016/07/05 11:31:39 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.140 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1414,8 +1414,6 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
(void) create_critters(1, !scursed ? &mons[PM_YELLOW_LIGHT]
: &mons[PM_BLACK_LIGHT],
TRUE);
if (!objects[sobj->otyp].oc_uname)
docall(sobj);
}
break;
case SCR_TELEPORTATION:

View File

@@ -956,11 +956,9 @@ struct monst *mtmp;
*
* Pulls a monster from its current position and places a monster at
* a new x and y. If oldx is 0, then the monster was not in the
* levels.monsters
* array. However, if oldx is 0, oldy may still have a value because mtmp is
* a
* migrating_mon. Worm tails are always placed randomly around the head of
* the worm.
* levels.monsters array. However, if oldx is 0, oldy may still have
* a value because mtmp is a migrating_mon. Worm tails are always
* placed randomly around the head of the worm.
*/
void
rloc_to(mtmp, x, y)
@@ -974,15 +972,15 @@ register int x, y;
return;
if (oldx) { /* "pick up" monster */
if (mtmp->wormno)
if (mtmp->wormno) {
remove_worm(mtmp);
else {
} else {
remove_monster(oldx, oldy);
newsym(oldx, oldy); /* update old location */
}
}
memset(mtmp->mtrack, 0, sizeof(mtmp->mtrack));
memset(mtmp->mtrack, 0, sizeof mtmp->mtrack);
place_monster(mtmp, x, y); /* put monster down */
update_monster_region(mtmp);

View File

@@ -1894,6 +1894,18 @@ register struct attack *mattk;
for (otmp = mdef->minvent; otmp; otmp = otmp->nobj)
(void) snuff_lit(otmp);
/* force vampire in bat, cloud, or wolf form to revert back to
vampire form now instead of dealing with that when it dies */
if (is_vampshifter(mdef)
&& newcham(mdef, &mons[mdef->cham], FALSE, FALSE)) {
You("engulf it, then expel it.");
if (canspotmon(mdef))
pline("It turns into %s.", a_monnam(mdef));
else
map_invisible(mdef->mx, mdef->my);
return 1;
}
/* engulfing a cockatrice or digesting a Rider or Medusa */
fatal_gulp = (touch_petrifies(pd) && !Stone_resistance)
|| (mattk->adtyp == AD_DGST
@@ -1937,7 +1949,13 @@ register struct attack *mattk;
m_useup(mdef, otmp);
newuhs(FALSE);
xkilled(mdef, XKILL_NOMSG | XKILL_NOCORPSE);
/* start_engulf() issues "you engulf <mdef>" above; this
used to specify XKILL_NOMSG but we need "you kill <mdef>"
in case we're also going to get "welcome to level N+1";
"you totally digest <mdef>" will be coming soon (after
several turns) but the level-gain message seems out of
order if the kill message is left implicit */
xkilled(mdef, XKILL_GIVEMSG | XKILL_NOCORPSE);
if (mdef->mhp > 0) { /* monster lifesaved */
You("hurriedly regurgitate the sizzling in your %s.",
body_part(STOMACH));

View File

@@ -280,6 +280,7 @@ struct obj *otmp;
mon_set_minvis(mtmp);
if (!oldinvis && knowninvisible(mtmp)) {
pline("%s turns transparent!", nambuf);
reveal_invis = TRUE;
learn_it = TRUE;
}
break;