Digging down on a magical trap causes it to explode

This commit is contained in:
Pasi Kallinen
2023-11-02 19:17:11 +02:00
parent c1045cc18a
commit e6993f2ef1
3 changed files with 10 additions and 1 deletions

View File

@@ -802,7 +802,10 @@ dighole(boolean pit_only, boolean by_magic, coord *cc)
&& (lev->wall_info & W_NONDIGGABLE) != 0)) {
pline_The("%s %shere is too hard to dig in.", surface(dig_x, dig_y),
(dig_x != u.ux || dig_y != u.uy) ? "t" : "");
} else if (ttmp && is_magical_trap(ttmp->ttyp)) {
explode(dig_x, dig_y, 0, 20 + d(3, 6), TRAP_EXPLODE, EXPL_MAGICAL);
deltrap(ttmp);
newsym(dig_x, dig_y);
} else if (is_pool_or_lava(dig_x, dig_y)) {
pline_The("%s sloshes furiously for a moment, then subsides.",
hliquid(is_lava(dig_x, dig_y) ? "lava" : "water"));

View File

@@ -649,6 +649,11 @@ explode(
else if (str != gk.killer.name && str != hallu_buf)
Strcpy(gk.killer.name, str);
gk.killer.format = KILLED_BY_AN;
} else if (olet == TRAP_EXPLODE) {
gk.killer.format = NO_KILLER_PREFIX;
Snprintf(gk.killer.name, sizeof gk.killer.name,
"caught %sself in a %s", uhim(),
str);
} else if (type >= 0 && olet != SCROLL_CLASS) {
gk.killer.format = NO_KILLER_PREFIX;
Snprintf(gk.killer.name, sizeof gk.killer.name,