From 1df8fd8b3bc3c393bba83e7f8aed3589986ca3b2 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 20 Mar 2025 16:09:15 -0700 Subject: [PATCH] cutting down closed doors Most things that can be dug or chopped can only have that done by one of the two types of digging/chopping tools: pick-axe or axe. Since closed door can be broken open via either type, mention the type of implement in the final "you break through the door" message by adding "with your ." --- src/dig.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/dig.c b/src/dig.c index fabafac7b..e8a89888f 100644 --- a/src/dig.c +++ b/src/dig.c @@ -438,6 +438,7 @@ dig(void) } if (svc.context.digging.effort > 100) { + char digbuf[BUFSZ]; const char *digtxt, *dmgtxt = (const char *) 0; struct obj *obj, *bobj; boolean shopedge = *in_rooms(dpx, dpy, SHOPBASE); @@ -504,7 +505,9 @@ dig(void) if (!(lev->doormask & D_TRAPPED)) lev->doormask = D_BROKEN; } else if (closed_door(dpx, dpy)) { - digtxt = "You break through the door."; + Sprintf(digbuf, "You break through the door with your %s.", + simpleonames(uwep)); + digtxt = digbuf; if (shopedge) { add_damage(dpx, dpy, SHOP_DOOR_COST); dmgtxt = "break"; @@ -523,18 +526,9 @@ dig(void) pay_for_damage(dmgtxt, FALSE); if (Is_earthlevel(&u.uz) && !rn2(3)) { - struct monst *mtmp; + int mndx = rn2(2) ? PM_EARTH_ELEMENTAL : PM_XORN; - switch (rn2(2)) { - case 0: - mtmp = makemon(&mons[PM_EARTH_ELEMENTAL], dpx, dpy, - MM_NOMSG); - break; - default: - mtmp = makemon(&mons[PM_XORN], dpx, dpy, MM_NOMSG); - break; - } - if (mtmp) + if (makemon(&mons[mndx], dpx, dpy, MM_NOMSG)) pline_The("debris from your digging comes to life!"); } if (IS_DOOR(lev->typ) && (lev->doormask & D_TRAPPED)) {