Falling through a hole or trap door will cause damage
This commit is contained in:
12
src/do.c
12
src/do.c
@@ -1302,6 +1302,8 @@ goto_level(
|
||||
struct monst *mtmp;
|
||||
char whynot[BUFSZ];
|
||||
char *annotation;
|
||||
int dist = newlevel->dlevel - dunlev(&u.uz);
|
||||
boolean do_fall_dmg = FALSE;
|
||||
|
||||
if (dunlev(newlevel) > dunlevs_in_dungeon(newlevel))
|
||||
newlevel->dlevel = dunlevs_in_dungeon(newlevel);
|
||||
@@ -1617,6 +1619,7 @@ goto_level(
|
||||
if (Punished)
|
||||
ballfall();
|
||||
selftouch("Falling, you");
|
||||
do_fall_dmg = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1782,6 +1785,15 @@ goto_level(
|
||||
|
||||
/* assume this will always return TRUE when changing level */
|
||||
(void) in_out_region(u.ux, u.uy);
|
||||
|
||||
/* fall damage? */
|
||||
if (do_fall_dmg) {
|
||||
int dmg = d(dist, 6);
|
||||
|
||||
dmg = Maybe_Half_Phys(dmg);
|
||||
losehp(dmg, "falling down a mine shaft", KILLED_BY);
|
||||
}
|
||||
|
||||
(void) pickup(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user