Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-09-14 18:27:53 -04:00
9 changed files with 88 additions and 40 deletions

View File

@@ -571,7 +571,7 @@ int x, y;
int ox, oy, *range = (int *) arg;
struct obj *obj;
struct monst *mon;
boolean may_pass = TRUE;
boolean may_pass = TRUE, via_jumping, stopping_short;
struct trap *ttmp;
int dmg = 0;
@@ -583,6 +583,8 @@ int x, y;
} else if (*range == 0) {
return FALSE; /* previous step wants to stop now */
}
via_jumping = (EWwalking & I_SPECIAL) != 0L;
stopping_short = (via_jumping && *range < 2);
if (!Passes_walls || !(may_pass = may_passwall(x, y))) {
boolean odoor_diag = (IS_DOOR(levl[x][y].typ)
@@ -710,12 +712,17 @@ int x, y;
vision_recalc(1); /* update for new position */
flush_screen(1);
if (is_pool(x, y) && !u.uinwater
&& ((Is_waterlevel(&u.uz) && levl[x][y].typ == WATER)
|| !(Levitation || Flying || Wwalking))) {
multi = 0; /* can move, so drown() allows crawling out of water */
(void) drown();
return FALSE;
if (is_pool(x, y) && !u.uinwater) {
if ((Is_waterlevel(&u.uz) && levl[x][y].typ == WATER)
|| !(Levitation || Flying || Wwalking)) {
multi = 0; /* can move, so drown() allows crawling out of water */
(void) drown();
return FALSE;
} else if (!Is_waterlevel(&u.uz) && !stopping_short) {
Norep("You move over %s.", an(is_moat(x, y) ? "moat" : "pool"));
}
} else if (is_lava(x, y) && !stopping_short) {
Norep("You move over some lava.");
}
/* FIXME:
@@ -727,7 +734,9 @@ int x, y;
* ones that we have not yet tested.
*/
if ((ttmp = t_at(x, y)) != 0) {
if (ttmp->ttyp == MAGIC_PORTAL) {
if (stopping_short) {
; /* see the comment above hurtle_jump() */
} else if (ttmp->ttyp == MAGIC_PORTAL) {
dotrap(ttmp, 0);
return FALSE;
} else if (ttmp->ttyp == VIBRATING_SQUARE) {
@@ -738,8 +747,10 @@ int x, y;
} else if ((ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT
|| ttmp->ttyp == HOLE || ttmp->ttyp == TRAPDOOR)
&& Sokoban) {
/* Air currents overcome the recoil */
dotrap(ttmp, 0);
/* air currents overcome the recoil in Sokoban;
when jumping, caller performs last step and enters trap */
if (!via_jumping)
dotrap(ttmp, 0);
*range = 0;
return TRUE;
} else {

View File

@@ -2127,16 +2127,12 @@ register struct monst *mtmp;
appear = Is_rogue_level(&u.uz) ? S_hwall : S_hcdoor;
else
appear = Is_rogue_level(&u.uz) ? S_vwall : S_vcdoor;
if (!mtmp->minvis || See_invisible)
block_point(mx, my); /* vision */
} else if (level.flags.is_maze_lev && !In_sokoban(&u.uz) && rn2(2)) {
ap_type = M_AP_OBJECT;
appear = STATUE;
} else if (roomno < 0 && !t_at(mx, my)) {
ap_type = M_AP_OBJECT;
appear = BOULDER;
if (!mtmp->minvis || See_invisible)
block_point(mx, my); /* vision */
} else if (rt == ZOO || rt == VAULT) {
ap_type = M_AP_OBJECT;
appear = GOLD_PIECE;
@@ -2194,6 +2190,9 @@ register struct monst *mtmp;
if (appear == EGG && !can_be_hatched(MCORPSENM(mtmp)))
MCORPSENM(mtmp) = NON_PM; /* revert to generic egg */
}
if (does_block(mx, my, &levl[mx][my]))
block_point(mx, my);
}
/* release monster from bag of tricks; return number of monsters created */

View File

@@ -1736,6 +1736,7 @@ int dist;
struct obj *otmp;
boolean make_rocks;
register struct rm *lev = &levl[x][y];
struct monst *mon;
/* clip at existing map borders if necessary */
if (!within_bounded_area(x, y, x_maze_min + 1, y_maze_min + 1,
@@ -1762,7 +1763,6 @@ int dist;
obfree(otmp, (struct obj *) 0);
}
}
unblock_point(x, y); /* make sure vision knows this location is open */
/* fake out saved state */
lev->seenv = 0;
@@ -1799,6 +1799,20 @@ int dist;
break;
}
if ((mon = m_at(x, y)) != 0) {
/* wake up mimics, don't want to deal with them blocking vision */
if (mon->m_ap_type)
seemimic(mon);
if ((ttmp = t_at(x, y)) != 0)
(void) mintrap(mon);
else
(void) minliquid(mon);
}
if (!does_block(x, y, lev))
unblock_point(x, y); /* make sure vision knows this location is open */
/* display new value of position; could have a monster/object on it */
newsym(x, y);
}

View File

@@ -2550,8 +2550,14 @@ struct _create_particular_data *d;
put_saddle_on_mon(otmp, mtmp);
}
if (d->invisible)
if (d->invisible) {
int mx = mtmp->mx, my = mtmp->my;
mon_set_minvis(mtmp);
if (does_block(mx, my, &levl[mx][my]))
block_point(mx, my);
else
unblock_point(mx, my);
}
if (d->sleeping)
mtmp->msleeping = 1;
madeany = TRUE;