]> granicus.if.org Git - nethack/commitdiff
U846 - xorns and pits
authorcohrs <cohrs>
Tue, 27 Jan 2004 19:35:09 +0000 (19:35 +0000)
committercohrs <cohrs>
Tue, 27 Jan 2004 19:35:09 +0000 (19:35 +0000)
Change pit behavior to always mark a non-flying poly'd player as trapped in
a pit, even when Passes_walls is set.  This allows players polymorphed into
xorns to descend into pits and pick things up.  In this case, any attempt
to move out of the pit now takes a turn but always succeeds.  Also fixed
a related bug (w/o ID) that a player could become trapped as if in a pit
when leaving xorn form because u.utrap wasn't checked, and simplified the
code since the extra Passes_walls checks are no longer needed.  Also
updated code in sit.c that duplicated uteetering_at_seen_pit.

doc/fixes34.4
src/dig.c
src/dokick.c
src/hack.c
src/polyself.c
src/sit.c
src/trap.c

index a4ccd1680aa3ba435b76e89cd317e7d3969ba55d..a0c46469ee47c343db9d42ac6d43e2c74f8f2252 100644 (file)
@@ -16,6 +16,7 @@ some actions such as eating corpses off the floor didn't check whether hero
 usmellmon() instead of "It turns into it" during monster polymorph
 grammar of messages regarding eating artifacts
 avoid a message about an invisible monster looking much better
+player polymorphed as a xorn could not pick up items in pits
 
 
 Platform- and/or Interface-Specific Fixes
index 54357a2772153021f5348306708ce828fea1fe08..56c36dfc515e1d87cee794963ee5ee409e6f3d99 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -546,8 +546,7 @@ int ttyp;
 
            if(at_u) {
                if (!wont_fall) {
-                   if (!Passes_walls)
-                       u.utrap = rn1(4,2);
+                   u.utrap = rn1(4,2);
                    u.utraptype = TT_PIT;
                    vision_full_recalc = 1;     /* vision limits change */
                } else
index 7787138b53755013153761086eef5f8f5c5e4e91..3beb64c4a03b19b3489cd5c78906369ee523c54e 100644 (file)
@@ -663,9 +663,12 @@ dokick()
                Your("slow motion kick doesn't hit anything.");
                no_kick = TRUE;
        } else if (u.utrap) {
+               no_kick = TRUE;
                switch (u.utraptype) {
                    case TT_PIT:
-                       pline("There's not enough room to kick down here.");
+                       if (!Passes_walls)
+                           pline("There's not enough room to kick down here.");
+                       else no_kick = FALSE;
                        break;
                    case TT_WEB:
                    case TT_BEARTRAP:
@@ -674,7 +677,6 @@ dokick()
                    default:
                        break;
                }
-               no_kick = TRUE;
        }
 
        if (no_kick) {
@@ -706,6 +708,10 @@ dokick()
                default: Your("feeble kick has no effect."); break;
                }
                return(1);
+       } else if(u.utrap && u.utraptype == TT_PIT) {
+           /* must be Passes_walls */
+           You("kick at the side of the pit.");
+           return 1;
        }
        if (Levitation) {
                int xx, yy;
index 0e809d911bba3bc582b45f19174a6c420ab4be92..95ece8025bc5103c625e95f9e3576016a1db58b4 100644 (file)
@@ -1169,7 +1169,13 @@ domove()
        }
        if(u.utrap) {
                if(u.utraptype == TT_PIT) {
-                   if (!rn2(2) && sobj_at(BOULDER, u.ux, u.uy)) {
+                   if (Passes_walls) {
+                       /* marked as trapped so they can pick things up */
+                       You("ascend from the pit.");
+                       u.utrap = 0;
+                       fill_pit(u.ux, u.uy);
+                       vision_full_recalc = 1; /* vision limits change */
+                   } else if (!rn2(2) && sobj_at(BOULDER, u.ux, u.uy)) {
                        Your("%s gets stuck in a crevice.", body_part(LEG));
                        display_nhwindow(WIN_MESSAGE, FALSE);
                        clear_nhwindow(WIN_MESSAGE);
index d807d8c843387a1e08df18dff347d42b511db7da..210eded106e22daa272b695205a6c2d5cd55b68d 100644 (file)
@@ -36,7 +36,6 @@ const char *fmt, *arg;
 {
        boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow,
                was_mimicking = (youmonst.m_ap_type == M_AP_OBJECT);
-       boolean could_pass_walls = Passes_walls;
        boolean was_blind = !!Blind;
 
        if (Upolyd) {
@@ -86,10 +85,8 @@ const char *fmt, *arg;
        if (u.twoweap && !could_twoweap(youmonst.data))
            untwoweapon();
 
-       if (u.utraptype == TT_PIT) {
-           if (could_pass_walls) {     /* player forms cannot pass walls */
-               u.utrap = rn1(6,2);
-           }
+       if (u.utraptype == TT_PIT && u.utrap) {
+           u.utrap = rn1(6,2);         /* time to escape resets */
        }
        if (was_blind && !Blind) {      /* reverting from eyeless */
            Blinded = 1L;
@@ -340,7 +337,6 @@ int mntmp;
 {
        boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow,
                was_blind = !!Blind, dochange = FALSE;
-       boolean could_pass_walls = Passes_walls;
        int mlvl;
 
        if (mvitals[mntmp].mvflags & G_GENOD) { /* allow G_EXTINCT */
@@ -464,12 +460,8 @@ int        mntmp;
        drop_weapon(1);
        (void) hideunder(&youmonst);
 
-       if (u.utraptype == TT_PIT) {
-           if (could_pass_walls && !Passes_walls) {
-               u.utrap = rn1(6,2);
-           } else if (!could_pass_walls && Passes_walls) {
-               u.utrap = 0;
-           }
+       if (u.utraptype == TT_PIT && u.utrap) {
+           u.utrap = rn1(6,2);         /* time to escape resets */
        }
        if (was_blind && !Blind) {      /* previous form was eyeless */
            Blinded = 1L;
index 4280136b94521c40634bb1b8e6cae299b638b062..9846f4e50de55f1df5e89fbf7e78b4252a297788 100644 (file)
--- a/src/sit.c
+++ b/src/sit.c
@@ -65,9 +65,7 @@ dosit()
 
        if (OBJ_AT(u.ux, u.uy) && 
           /* ensure we're not standing on the precipice */
-          !((!u.utrap || u.utraptype != TT_PIT) &&
-            (trap && trap->tseen &&
-            (trap->ttyp==PIT || trap->ttyp==SPIKED_PIT)))) {
+          !uteetering_at_seen_pit(trap)) {
            register struct obj *obj;
 
            obj = level.objects[u.ux][u.uy];
index 2a68a2e1a0e667d34131e77a816b479b7458152e..8d0c0b4ac4929656c3b6cc483ed67d03ea0f5d81 100644 (file)
@@ -908,8 +908,7 @@ glovecheck:         (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst);
 #endif
                    You("land %s!", predicament);
                }
-               if (!Passes_walls)
-                   u.utrap = rn1(6,2);
+               u.utrap = rn1(6,2);
                u.utraptype = TT_PIT;
 #ifdef STEED
                if (!steedintrap(trap, (struct obj *)0)) {