From e6993f2ef1236d4972cf482cb629a12a9256c7df Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 2 Nov 2023 19:17:11 +0200 Subject: [PATCH] Digging down on a magical trap causes it to explode --- doc/fixes3-7-0.txt | 1 + src/dig.c | 5 ++++- src/explode.c | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 8d1701bed..da7705be1 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1269,6 +1269,7 @@ separate level flags premapped and sokoban hero had worn amulet of magical breathing become unworn during theft by nymph, dropped it to be able to crawl out of water, so it wasn't there when game tried to transfer it to thief, triggering an "object lost" panic +digging down on a magical trap causes it to explode Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/dig.c b/src/dig.c index 04c1419a1..45e228676 100644 --- a/src/dig.c +++ b/src/dig.c @@ -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")); diff --git a/src/explode.c b/src/explode.c index 64de072e2..d87d9df36 100644 --- a/src/explode.c +++ b/src/explode.c @@ -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,