Use grounded macro
This commit is contained in:
@@ -695,8 +695,7 @@ digactualhole(int x, int y, struct monst *madeby, int ttyp)
|
|||||||
impact_drop((struct obj *) 0, x, y, 0);
|
impact_drop((struct obj *) 0, x, y, 0);
|
||||||
if (mtmp) {
|
if (mtmp) {
|
||||||
/*[don't we need special sokoban handling here?]*/
|
/*[don't we need special sokoban handling here?]*/
|
||||||
if (is_flyer(mtmp->data) || is_floater(mtmp->data)
|
if (!grounded(mtmp->data)
|
||||||
|| mtmp->data == &mons[PM_WUMPUS]
|
|
||||||
|| (mtmp->wormno && count_wsegs(mtmp) > 5)
|
|| (mtmp->wormno && count_wsegs(mtmp) > 5)
|
||||||
|| mtmp->data->msize >= MZ_HUGE)
|
|| mtmp->data->msize >= MZ_HUGE)
|
||||||
return;
|
return;
|
||||||
|
|||||||
+1
-3
@@ -2436,9 +2436,7 @@ pooleffects(boolean newspot) /* true if called by spoteffects */
|
|||||||
|
|
||||||
/* check for entering water or lava */
|
/* check for entering water or lava */
|
||||||
if (!u.ustuck && !Levitation && !Flying && is_pool_or_lava(u.ux, u.uy)) {
|
if (!u.ustuck && !Levitation && !Flying && is_pool_or_lava(u.ux, u.uy)) {
|
||||||
if (u.usteed
|
if (u.usteed && !grounded(u.usteed->data)) {
|
||||||
&& (is_flyer(u.usteed->data) || is_floater(u.usteed->data)
|
|
||||||
|| is_clinger(u.usteed->data))) {
|
|
||||||
/* floating or clinging steed keeps hero safe (is_flyer() test
|
/* floating or clinging steed keeps hero safe (is_flyer() test
|
||||||
is redundant; it can't be true since Flying yielded false) */
|
is redundant; it can't be true since Flying yielded false) */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
@@ -1780,12 +1780,11 @@ mfndpos(
|
|||||||
nodiag = NODIAG(mdat - mons);
|
nodiag = NODIAG(mdat - mons);
|
||||||
wantpool = (mdat->mlet == S_EEL);
|
wantpool = (mdat->mlet == S_EEL);
|
||||||
poolok = ((!Is_waterlevel(&u.uz) && !(nowtyp != WATER)
|
poolok = ((!Is_waterlevel(&u.uz) && !(nowtyp != WATER)
|
||||||
&& (is_flyer(mdat) || is_floater(mdat) || is_clinger(mdat)))
|
&& !grounded(mdat))
|
||||||
|| (is_swimmer(mdat) && !wantpool));
|
|| (is_swimmer(mdat) && !wantpool));
|
||||||
/* note: floating eye is the only is_floater() so this could be
|
/* note: floating eye is the only is_floater() so this could be
|
||||||
simplified, but then adding another floater would be error prone */
|
simplified, but then adding another floater would be error prone */
|
||||||
lavaok = (is_flyer(mdat) || is_floater(mdat) || is_clinger(mdat)
|
lavaok = (!grounded(mdat) || likes_lava(mdat));
|
||||||
|| likes_lava(mdat));
|
|
||||||
if (mdat == &mons[PM_FLOATING_EYE]) /* prefers to avoid heat */
|
if (mdat == &mons[PM_FLOATING_EYE]) /* prefers to avoid heat */
|
||||||
lavaok = FALSE;
|
lavaok = FALSE;
|
||||||
thrudoor = ((flag & (ALLOW_WALL | BUSTDOOR)) != 0L);
|
thrudoor = ((flag & (ALLOW_WALL | BUSTDOOR)) != 0L);
|
||||||
|
|||||||
+1
-1
@@ -613,7 +613,7 @@ dismount_steed(
|
|||||||
struct permonst *mdat = mtmp->data;
|
struct permonst *mdat = mtmp->data;
|
||||||
|
|
||||||
/* The steed may drop into water/lava */
|
/* The steed may drop into water/lava */
|
||||||
if (!is_flyer(mdat) && !is_floater(mdat) && !is_clinger(mdat)) {
|
if (grounded(mdat)) {
|
||||||
if (is_pool(u.ux, u.uy)) {
|
if (is_pool(u.ux, u.uy)) {
|
||||||
if (!Underwater)
|
if (!Underwater)
|
||||||
pline("%s falls into the %s!", Monnam(mtmp),
|
pline("%s falls into the %s!", Monnam(mtmp),
|
||||||
|
|||||||
+1
-2
@@ -91,8 +91,7 @@ goodpos(int x, int y, struct monst* mtmp, long gpflags)
|
|||||||
return (is_swimmer(mdat)
|
return (is_swimmer(mdat)
|
||||||
|| (!Is_waterlevel(&u.uz)
|
|| (!Is_waterlevel(&u.uz)
|
||||||
&& !(levl[x][y].typ == WATER)
|
&& !(levl[x][y].typ == WATER)
|
||||||
&& (is_floater(mdat) || is_flyer(mdat)
|
&& !grounded(mdat)));
|
||||||
|| is_clinger(mdat))));
|
|
||||||
} else if (mdat->mlet == S_EEL && rn2(13) && !ignorewater) {
|
} else if (mdat->mlet == S_EEL && rn2(13) && !ignorewater) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else if (is_lava(x, y)) {
|
} else if (is_lava(x, y)) {
|
||||||
|
|||||||
+2
-5
@@ -1641,9 +1641,7 @@ trapeffect_pit(
|
|||||||
const char *fallverb;
|
const char *fallverb;
|
||||||
|
|
||||||
fallverb = "falls";
|
fallverb = "falls";
|
||||||
if (is_flyer(mptr) || is_floater(mptr)
|
if (!grounded(mptr) || (mtmp->wormno && count_wsegs(mtmp) > 5)) {
|
||||||
|| (mtmp->wormno && count_wsegs(mtmp) > 5)
|
|
||||||
|| is_clinger(mptr)) {
|
|
||||||
if (g.force_mintrap && !Sokoban) {
|
if (g.force_mintrap && !Sokoban) {
|
||||||
/* openfallingtrap; not inescapable here */
|
/* openfallingtrap; not inescapable here */
|
||||||
if (in_sight) {
|
if (in_sight) {
|
||||||
@@ -1703,8 +1701,7 @@ trapeffect_hole(
|
|||||||
trapname(tt, TRUE));
|
trapname(tt, TRUE));
|
||||||
return Trap_Effect_Finished; /* don't activate it after all */
|
return Trap_Effect_Finished; /* don't activate it after all */
|
||||||
}
|
}
|
||||||
if (is_flyer(mptr) || is_floater(mptr) || mptr == &mons[PM_WUMPUS]
|
if (!grounded(mptr) || (mtmp->wormno && count_wsegs(mtmp) > 5)
|
||||||
|| (mtmp->wormno && count_wsegs(mtmp) > 5)
|
|
||||||
|| mptr->msize >= MZ_HUGE) {
|
|| mptr->msize >= MZ_HUGE) {
|
||||||
if (g.force_mintrap && !Sokoban) {
|
if (g.force_mintrap && !Sokoban) {
|
||||||
/* openfallingtrap; not inescapable here */
|
/* openfallingtrap; not inescapable here */
|
||||||
|
|||||||
Reference in New Issue
Block a user