From: Pasi Kallinen Date: Tue, 22 Feb 2022 14:51:13 +0000 (+0200) Subject: Handle water and lava when hurtling a monster X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=462e13f07be8dda5c0c97c43545ae287719ef8ed;p=nethack Handle water and lava when hurtling a monster Also delay the output, showing the hurtle animation. --- diff --git a/src/dothrow.c b/src/dothrow.c index 6dff81980..f89124522 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -637,6 +637,8 @@ walk_path(coord *src_cc, coord *dest_cc, /* check for early exit condition */ if (!(keep_going = (*check_proc)(arg, x, y))) break; + flush_screen(1); + delay_output(); } } else { while (i++ < dx) { @@ -651,6 +653,8 @@ walk_path(coord *src_cc, coord *dest_cc, /* check for early exit condition */ if (!(keep_going = (*check_proc)(arg, x, y))) break; + flush_screen(1); + delay_output(); } } @@ -903,6 +907,17 @@ mhurtle_step(genericptr_t arg, int x, int y) struct monst *mon = (struct monst *) arg; struct monst *mtmp; + if (is_pool(x, y) || is_lava(x, y)) { + remove_monster(mon->mx, mon->my); + newsym(mon->mx, mon->my); + place_monster(mon, x, y); + newsym(mon->mx, mon->my); + set_apparxy(mon); + if (minliquid(mon)) + return FALSE; + return TRUE; + } + /* TODO: Treat walls, doors, iron bars, pools, lava, etc. specially * rather than just stopping before. */