Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-12-22 20:16:32 -05:00
2 changed files with 46 additions and 14 deletions

View File

@@ -300,6 +300,8 @@ identifying or forgetting gem types now adjusts prices for gems already on
when fire converts an ice location into a water location, dunk any monster on
that spot immediately instead of waiting until its next move
training riding skill had an off-by-one bug when counting turns riding
message sequencing when vampire shifts to fog cloud to pass under closed door:
when in sight, give form change message before moving to door spot
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 monmove.c $NHDT-Date: 1545439153 2018/12/22 00:39:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.110 $ */
/* NetHack 3.6 monmove.c $NHDT-Date: 1545525307 2018/12/23 00:35:07 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.110 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -944,7 +944,7 @@ register int after;
mmoved = 1;
goto postmov;
}
not_special:
not_special:
if (u.uswallow && !mtmp->mflee && u.ustuck != mtmp)
return 1;
omx = mtmp->mx;
@@ -1205,7 +1205,7 @@ not_special:
chi = i;
mmoved = 1;
}
nxti:
nxti:
;
}
}
@@ -1249,6 +1249,7 @@ not_special:
if ((info[chi] & ALLOW_M) || (nix == mtmp->mux && niy == mtmp->muy)) {
struct monst *mtmp2;
int mstatus;
mtmp2 = m_at(nix, niy);
g.notonhead = mtmp2 && (nix != mtmp2->mx || niy != mtmp2->my);
@@ -1272,6 +1273,7 @@ not_special:
if ((info[chi] & ALLOW_MDISP)) {
struct monst *mtmp2;
int mstatus;
mtmp2 = m_at(nix, niy);
mstatus = mdisplacem(mtmp, mtmp2, FALSE);
if ((mstatus & MM_AGR_DIED) || (mstatus & MM_DEF_DIED))
@@ -1283,6 +1285,7 @@ not_special:
if (!m_in_out_region(mtmp, nix, niy))
return 3;
remove_monster(omx, omy);
place_monster(mtmp, nix, niy);
for (j = MTSZ - 1; j > 0; j--)
@@ -1300,18 +1303,49 @@ not_special:
if (mtmp->wormno)
worm_nomove(mtmp);
}
postmov:
postmov:
if (mmoved == 1 || mmoved == 3) {
boolean canseeit = cansee(mtmp->mx, mtmp->my);
if (mmoved == 1) {
/* normal monster move will already have <nix,niy>,
but pet dog_move() with 'goto postmov' won't */
nix = mtmp->mx, niy = mtmp->my;
/* sequencing issue: when monster movement decides that a
monster can move to a door location, it moves the monster
there before dealing with the door rather than after;
so a vampire/bat that is going to shift to fog cloud and
pass under the door is already there but transformation
into fog form--and its message, when in sight--has not
happened yet; we have to move monster back to previous
location before performing the vamp_shift() to make the
message happen at right time, then back to the door again
[if we did the shift above, before moving the monster,
we would need to duplicate it in dog_move()...] */
if (is_vampshifter(mtmp) && !amorphous(mtmp->data)
&& IS_DOOR(levl[nix][niy].typ)
&& ((levl[nix][niy].doormask & (D_LOCKED | D_CLOSED)) != 0)
&& can_fog(mtmp)) {
if (sawmon) {
remove_monster(nix, niy), place_monster(mtmp, omx, omy);
newsym(nix, niy), newsym(omx, omy);
}
if (vamp_shift(mtmp, &mons[PM_FOG_CLOUD], sawmon)) {
ptr = mtmp->data; /* update cached value */
}
if (sawmon) {
remove_monster(omx, omy), place_monster(mtmp, nix, niy);
newsym(omx, omy), newsym(nix, niy);
}
}
newsym(omx, omy); /* update the old position */
if (mintrap(mtmp) >= 2) {
if (mtmp->mx)
newsym(mtmp->mx, mtmp->my);
return 2; /* it died */
}
ptr = mtmp->data;
ptr = mtmp->data; /* in case mintrap() caused polymorph */
/* open a door, or crash through it, if 'mtmp' can */
if (IS_DOOR(levl[mtmp->mx][mtmp->my].typ)
@@ -1332,18 +1366,11 @@ postmov:
btrapped = FALSE;
}
if ((here->doormask & (D_LOCKED | D_CLOSED)) != 0
&& (amorphous(ptr)
|| (can_fog(mtmp)
&& vamp_shift(mtmp, &mons[PM_FOG_CLOUD],
sawmon)))) {
/* update cached value for vamp_shift() case */
ptr = mtmp->data;
&& amorphous(ptr)) {
if (flags.verbose && canseemon(mtmp))
pline("%s %s under the door.", Monnam(mtmp),
(ptr == &mons[PM_FOG_CLOUD]
|| ptr->mlet == S_LIGHT)
? "flows"
: "oozes");
|| ptr->mlet == S_LIGHT) ? "flows" : "oozes");
} else if (here->doormask & D_LOCKED && can_unlock) {
if (btrapped) {
here->doormask = D_NODOOR;
@@ -1732,6 +1759,9 @@ boolean domsg;
pline("You %s %s where %s was.",
!canseemon(mon) ? "now detect" : "observe",
noname_monnam(mon, ARTICLE_A), oldmtype);
/* this message is given when it turns into a fog cloud
in order to move under a closed door */
display_nhwindow(WIN_MESSAGE, FALSE);
}
return reslt;