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
+2
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 when fire converts an ice location into a water location, dunk any monster on
that spot immediately instead of waiting until its next move that spot immediately instead of waiting until its next move
training riding skill had an off-by-one bug when counting turns riding 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 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
+44 -14
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) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */ /*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -944,7 +944,7 @@ register int after;
mmoved = 1; mmoved = 1;
goto postmov; goto postmov;
} }
not_special: not_special:
if (u.uswallow && !mtmp->mflee && u.ustuck != mtmp) if (u.uswallow && !mtmp->mflee && u.ustuck != mtmp)
return 1; return 1;
omx = mtmp->mx; omx = mtmp->mx;
@@ -1205,7 +1205,7 @@ not_special:
chi = i; chi = i;
mmoved = 1; mmoved = 1;
} }
nxti: nxti:
; ;
} }
} }
@@ -1249,6 +1249,7 @@ not_special:
if ((info[chi] & ALLOW_M) || (nix == mtmp->mux && niy == mtmp->muy)) { if ((info[chi] & ALLOW_M) || (nix == mtmp->mux && niy == mtmp->muy)) {
struct monst *mtmp2; struct monst *mtmp2;
int mstatus; int mstatus;
mtmp2 = m_at(nix, niy); mtmp2 = m_at(nix, niy);
g.notonhead = mtmp2 && (nix != mtmp2->mx || niy != mtmp2->my); g.notonhead = mtmp2 && (nix != mtmp2->mx || niy != mtmp2->my);
@@ -1272,6 +1273,7 @@ not_special:
if ((info[chi] & ALLOW_MDISP)) { if ((info[chi] & ALLOW_MDISP)) {
struct monst *mtmp2; struct monst *mtmp2;
int mstatus; int mstatus;
mtmp2 = m_at(nix, niy); mtmp2 = m_at(nix, niy);
mstatus = mdisplacem(mtmp, mtmp2, FALSE); mstatus = mdisplacem(mtmp, mtmp2, FALSE);
if ((mstatus & MM_AGR_DIED) || (mstatus & MM_DEF_DIED)) if ((mstatus & MM_AGR_DIED) || (mstatus & MM_DEF_DIED))
@@ -1283,6 +1285,7 @@ not_special:
if (!m_in_out_region(mtmp, nix, niy)) if (!m_in_out_region(mtmp, nix, niy))
return 3; return 3;
remove_monster(omx, omy); remove_monster(omx, omy);
place_monster(mtmp, nix, niy); place_monster(mtmp, nix, niy);
for (j = MTSZ - 1; j > 0; j--) for (j = MTSZ - 1; j > 0; j--)
@@ -1300,18 +1303,49 @@ not_special:
if (mtmp->wormno) if (mtmp->wormno)
worm_nomove(mtmp); worm_nomove(mtmp);
} }
postmov: postmov:
if (mmoved == 1 || mmoved == 3) { if (mmoved == 1 || mmoved == 3) {
boolean canseeit = cansee(mtmp->mx, mtmp->my); boolean canseeit = cansee(mtmp->mx, mtmp->my);
if (mmoved == 1) { 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 */ newsym(omx, omy); /* update the old position */
if (mintrap(mtmp) >= 2) { if (mintrap(mtmp) >= 2) {
if (mtmp->mx) if (mtmp->mx)
newsym(mtmp->mx, mtmp->my); newsym(mtmp->mx, mtmp->my);
return 2; /* it died */ 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 */ /* open a door, or crash through it, if 'mtmp' can */
if (IS_DOOR(levl[mtmp->mx][mtmp->my].typ) if (IS_DOOR(levl[mtmp->mx][mtmp->my].typ)
@@ -1332,18 +1366,11 @@ postmov:
btrapped = FALSE; btrapped = FALSE;
} }
if ((here->doormask & (D_LOCKED | D_CLOSED)) != 0 if ((here->doormask & (D_LOCKED | D_CLOSED)) != 0
&& (amorphous(ptr) && amorphous(ptr)) {
|| (can_fog(mtmp)
&& vamp_shift(mtmp, &mons[PM_FOG_CLOUD],
sawmon)))) {
/* update cached value for vamp_shift() case */
ptr = mtmp->data;
if (flags.verbose && canseemon(mtmp)) if (flags.verbose && canseemon(mtmp))
pline("%s %s under the door.", Monnam(mtmp), pline("%s %s under the door.", Monnam(mtmp),
(ptr == &mons[PM_FOG_CLOUD] (ptr == &mons[PM_FOG_CLOUD]
|| ptr->mlet == S_LIGHT) || ptr->mlet == S_LIGHT) ? "flows" : "oozes");
? "flows"
: "oozes");
} else if (here->doormask & D_LOCKED && can_unlock) { } else if (here->doormask & D_LOCKED && can_unlock) {
if (btrapped) { if (btrapped) {
here->doormask = D_NODOOR; here->doormask = D_NODOOR;
@@ -1732,6 +1759,9 @@ boolean domsg;
pline("You %s %s where %s was.", pline("You %s %s where %s was.",
!canseemon(mon) ? "now detect" : "observe", !canseemon(mon) ? "now detect" : "observe",
noname_monnam(mon, ARTICLE_A), oldmtype); 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; return reslt;