yet more boulders: allow m<dir> to not push them
Allow a hero polymorphed into a giant to move to a boulder's spot via m<dir> no-pickup move, instead of having to push it until the way is blocked by something and then having push failure move hero to the spot. Also change m<dir> when not a giant to no longer push the boulder. No time will elapse when not moving unless hero who didn't know that there was a boulder there learns that one is. Since no actual push attempt gets performed, player doesn't learn whether there is anything beyond the boulder that inhibits it from being pushed.
This commit is contained in:
36
src/hack.c
36
src/hack.c
@@ -123,7 +123,40 @@ moverock(void)
|
||||
rx = u.ux + 2 * u.dx; /* boulder destination position */
|
||||
ry = u.uy + 2 * u.dy;
|
||||
nomul(0);
|
||||
|
||||
/* using m<dir> towards an adjacent boulder steps over/onto it
|
||||
if poly'd into a giant but is a no-op in other circumstances
|
||||
unless the move attempt reveals an unseen boulder or lack of
|
||||
remembered, unseen monster */
|
||||
if (g.context.nopick) {
|
||||
if (throws_rocks(g.youmonst.data)) {
|
||||
/* player has used 'm<dir>' to move, so step to boulder's
|
||||
spot without pushing it; hero is poly'd into a giant,
|
||||
so exotic forms of locomotion are out, but might be
|
||||
levitating (ring, potion, spell) or flying (amulet) */
|
||||
You("%s over a boulder here.",
|
||||
Levitation ? "float" : Flying ? "fly" : "step");
|
||||
/* ["over" seems weird on air level but what else to say?] */
|
||||
sokoban_guilt();
|
||||
res = 0; /* move to <sx,sy> */
|
||||
} else {
|
||||
int oldglyph = glyph_at(sx, sy);
|
||||
|
||||
feel_location(sx, sy);
|
||||
There("is a boulder in your way.");
|
||||
/* use a move if hero learns something; see test_move() for
|
||||
how/why 'context.door_opened' is being dragged into this */
|
||||
if (glyph_at(sx, sy) != oldglyph)
|
||||
g.context.door_opened = g.context.move = TRUE;
|
||||
res = -1; /* don't move to <sx,sy>, so no soko guilt */
|
||||
}
|
||||
goto moverock_done; /* stop further push attempts */
|
||||
}
|
||||
if (Levitation || Is_airlevel(&u.uz)) {
|
||||
/* FIXME? behavior in an air bubble on the water level should
|
||||
be similar to being on the air level; both cases probably
|
||||
ought to let push attempt proceed when flying (which implies
|
||||
not levitating) */
|
||||
if (Blind)
|
||||
feel_location(sx, sy);
|
||||
You("don't have enough leverage to push %s.", the(xname(otmp)));
|
||||
@@ -864,8 +897,7 @@ test_move(int ux, int uy, int dx, int dy, int mode)
|
||||
we haven't opened a door but we're going to
|
||||
return False and without having 'door_opened'
|
||||
set, 'move' would get reset by caller */
|
||||
g.context.door_opened
|
||||
= g.context.move = TRUE;
|
||||
g.context.door_opened = g.context.move = TRUE;
|
||||
/* since we've just lied about successfully
|
||||
moving, we need to manually stop running */
|
||||
nomul(0);
|
||||
|
||||
Reference in New Issue
Block a user