From: cohrs Date: Mon, 30 Jun 2003 06:08:06 +0000 (+0000) Subject: U491: xorns, digging and pits X-Git-Tag: MOVE2GIT~1914 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=669633eb21476fd433d64200fdbc5ac23bf8dda9;p=nethack U491: xorns, digging and pits Digging a pit while a xorn set the trap time, but falling into a pit did not. While lookin at this, it occurred to me that the same inconsistency might occur while polymorhing from/to a xorn, and there was. --- diff --git a/doc/fixes34.2 b/doc/fixes34.2 index d126cd472..036ca72ed 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -97,6 +97,7 @@ don't allow polymorphed player to web over the stairs geographical shopkeeper updates stethoscope use should be free the first time it's use per player move travel command caches last position to make non-mouse less painful +update pit trapped time when polymorphing to or from a monster that passes_walls Platform- and/or Interface-Specific Fixes diff --git a/src/dig.c b/src/dig.c index 18e4d096e..62127500e 100644 --- a/src/dig.c +++ b/src/dig.c @@ -549,11 +549,12 @@ int ttyp; if(at_u) { if (!wont_fall) { + if (!Passes_walls) u.utrap = rn1(4,2); - u.utraptype = TT_PIT; - vision_full_recalc = 1; /* vision limits change */ + u.utraptype = TT_PIT; + vision_full_recalc = 1; /* vision limits change */ } else - u.utrap = 0; + u.utrap = 0; if (oldobjs != newobjs) /* something unearthed */ (void) pickup(1); /* detects pit */ } else if(mtmp) { diff --git a/src/polyself.c b/src/polyself.c index 4590fe7a7..d73aefc6b 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -34,7 +34,7 @@ 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) { @@ -87,6 +87,11 @@ 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 (was_blind && !Blind) { /* reverting from eyeless */ Blinded = 1L; make_blinded(0L, TRUE); /* remove blindness */ @@ -331,6 +336,7 @@ 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 */ @@ -462,6 +468,13 @@ int mntmp; else u.uundetected = 0; + 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 (was_blind && !Blind) { /* previous form was eyeless */ Blinded = 1L; make_blinded(0L, TRUE); /* remove blindness */