Define engulfing_u, making clearer code

This commit is contained in:
Pasi Kallinen
2021-12-31 21:12:12 +02:00
parent 776064933a
commit 8db18275a6
16 changed files with 37 additions and 36 deletions

View File

@@ -2152,7 +2152,7 @@ drop_boulder_on_monster(int x, int y, boolean confused, boolean byu)
pline("%s is hit by %s!", Monnam(mtmp), doname(otmp2));
if (mtmp->minvis && !canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my);
} else if (u.uswallow && mtmp == u.ustuck)
} else if (engulfing_u(mtmp))
You_hear("something hit %s %s over your %s!",
s_suffix(mon_nam(mtmp)), mbodypart(mtmp, STOMACH),
body_part(HEAD));
@@ -2185,7 +2185,7 @@ drop_boulder_on_monster(int x, int y, boolean confused, boolean byu)
wakeup(mtmp, byu);
}
wake_nearto(x, y, 4 * 4);
} else if (u.uswallow && mtmp == u.ustuck) {
} else if (engulfing_u(mtmp)) {
obfree(otmp2, (struct obj *) 0);
/* fall through to player */
drop_boulder_on_player(confused, TRUE, FALSE, TRUE);