From: nethack.allison Date: Sat, 8 Jan 2005 14:37:36 +0000 (+0000) Subject: filled trap doors on castle can be re-dug X-Git-Tag: MOVE2GIT~1364 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a3022800b659ddccee28eb61b590c26e6720e41;p=nethack filled trap doors on castle can be re-dug --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index a2753c441..def7cdfa6 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -72,6 +72,7 @@ mimic should not mimic a boulder while on a pit or hole location reviving invisible troll could appear visible until it moves adjust some of the shop repair messages charge for reviving a shop owned corpse or reanimating a shop owned statue +filled trap doors on castle can be re-dug Platform- and/or Interface-Specific Fixes diff --git a/include/rm.h b/include/rm.h index bd31ae3af..65e7253d9 100644 --- a/include/rm.h +++ b/include/rm.h @@ -340,6 +340,7 @@ struct rm { Bitfield(waslit,1); /* remember if a location was lit */ Bitfield(roomno,6); /* room # for special rooms */ Bitfield(edge,1); /* marks boundaries for special rooms*/ + Bitfield(candig,1); /* Exception to Can_dig_down; was a trapdoor */ }; /* diff --git a/src/apply.c b/src/apply.c index 950e0c288..ad61a93fd 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2839,7 +2839,8 @@ do_break_wand(obj) fillmsg = TRUE; } else digactualhole(x, y, BY_OBJECT, - (rn2(obj->spe) < 3 || !Can_dig_down(&u.uz)) ? + (rn2(obj->spe) < 3 || + (!Can_dig_down(&u.uz) && !levl[x][y].candig)) ? PIT : HOLE); } continue; diff --git a/src/dig.c b/src/dig.c index 2ac325b85..407c77fb6 100644 --- a/src/dig.c +++ b/src/dig.c @@ -186,7 +186,8 @@ dig_check(madeby, verbose, x, y) } else if ((IS_ROCK(levl[x][y].typ) && levl[x][y].typ != SDOOR && (levl[x][y].wall_info & W_NONDIGGABLE) != 0) || (ttmp && - (ttmp->ttyp == MAGIC_PORTAL || !Can_dig_down(&u.uz)))) { + (ttmp->ttyp == MAGIC_PORTAL || + (!Can_dig_down(&u.uz) && !levl[x][y].candig)))) { if(verbose) pline_The("%s here is too hard to %s.", surface(x,y), verb); return(FALSE); @@ -513,7 +514,7 @@ int ttyp; return; } - if (ttyp != PIT && !Can_dig_down(&u.uz)) { + if (ttyp != PIT && (!Can_dig_down(&u.uz) && !lev->candig)) { impossible("digactualhole: can't dig %s on this level.", defsyms[trap_to_defsym(ttyp)].explanation); ttyp = PIT; @@ -676,7 +677,7 @@ boolean pit_only; struct rm *lev = &levl[u.ux][u.uy]; struct obj *boulder_here; schar typ; - boolean nohole = !Can_dig_down(&u.uz); + boolean nohole = (!Can_dig_down(&u.uz) && !lev->candig); if ((ttmp && (ttmp->ttyp == MAGIC_PORTAL || nohole)) || (IS_ROCK(lev->typ) && lev->typ != SDOOR && diff --git a/src/hack.c b/src/hack.c index 1806b37c7..fdc80e92b 100644 --- a/src/hack.c +++ b/src/hack.c @@ -174,6 +174,8 @@ moverock() deltrap(ttmp); delobj(otmp); bury_objs(rx, ry); + levl[rx][ry].wall_info &= ~W_NONDIGGABLE; + levl[rx][ry].candig = 1; if (cansee(rx,ry)) newsym(rx,ry); continue; case LEVEL_TELEP: diff --git a/src/muse.c b/src/muse.c index 1f68a9c7c..30bada89d 100644 --- a/src/muse.c +++ b/src/muse.c @@ -655,7 +655,7 @@ mon_tele: pline_The("digging ray is ineffective."); return 2; } - if (!Can_dig_down(&u.uz)) { + if (!Can_dig_down(&u.uz) && !levl[mtmp->mx][mtmp->my].candig) { if(canseemon(mtmp)) pline_The("%s here is too hard to dig in.", surface(mtmp->mx, mtmp->my)); diff --git a/src/trap.c b/src/trap.c index 3bb28a015..37bdb76ae 100644 --- a/src/trap.c +++ b/src/trap.c @@ -333,7 +333,8 @@ boolean td; /* td == TRUE : trap door or hole */ if (In_sokoban(&u.uz) && Can_fall_thru(&u.uz)) ; /* KMH -- You can't escape the Sokoban level traps */ - else if(Levitation || u.ustuck || !Can_fall_thru(&u.uz) + else if(Levitation || u.ustuck + || (!Can_fall_thru(&u.uz) && !levl[u.ux][u.uy].candig) || Flying || is_clinger(youmonst.data) || (Inhell && !u.uevent.invoked && newlevel == dunlevs_in_dungeon(&u.uz))