]> granicus.if.org Git - nethack/commitdiff
filled trap doors on castle can be re-dug
authornethack.allison <nethack.allison>
Sat, 8 Jan 2005 14:37:36 +0000 (14:37 +0000)
committernethack.allison <nethack.allison>
Sat, 8 Jan 2005 14:37:36 +0000 (14:37 +0000)
doc/fixes35.0
include/rm.h
src/apply.c
src/dig.c
src/hack.c
src/muse.c
src/trap.c

index a2753c4416718942799be2b31648abfca0150fe7..def7cdfa6f3894df68ab640b45de91f0242accea 100644 (file)
@@ -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
index bd31ae3afef3c294b9cf478b94b45db3a839cb63..65e7253d945771044e73ed22335620d1f06242bb 100644 (file)
@@ -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 */
 };
 
 /*
index 950e0c2887d1c146648b1ce18d8f7fc053cf22c3..ad61a93fd99033aa1cdf58211b52de6ee9123ea7 100644 (file)
@@ -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;
index 2ac325b85fee6315d61a0a584c755b3fe534606e..407c77fb6508bd3adcc43c464a92a02d0d778055 100644 (file)
--- 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 &&
index 1806b37c7dab8cb061f3d5c04d03dcb0dffba919..fdc80e92bbac5c8c5d1621d69cbb561eadd55bbc 100644 (file)
@@ -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:
index 1f68a9c7c53c144908aa0a3efc62ada2d660559c..30bada89de543cccfe24314790bee939855393ea 100644 (file)
@@ -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));
index 3bb28a0152ae609041c8587ed0f8960bb5f1a08f..37bdb76ae7d4ec9c7d37e18e5f0e65b654e59d80 100644 (file)
@@ -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))