]> granicus.if.org Git - nethack/commitdiff
U761 - Sitting as a hider and other related is_hider behavior
authorcohrs <cohrs>
Thu, 27 Nov 2003 07:03:56 +0000 (07:03 +0000)
committercohrs <cohrs>
Thu, 27 Nov 2003 07:03:56 +0000 (07:03 +0000)
While looking at the behavior of sitting hiders, I noticed other related
odd behavior.
- player hiding while poly'd as a hider that hangs on the ceiling now drops to
  the floor before sitting (similar to the behavior of movement commands).
- trappers, as per data.base, don't hang on the ceiling.  Changed the
  mattacku case dealing with hiders to not treat trappers as ceiling hiders.
- updated can_reach_floor to also exclude ceiling hiders.  This covers a
  bunch of cases, such as pickup, look-here-while-blind, and so on.  Another
  alternative would have been to automatically unhide for all such cases.
trunk only, it's a minor bug IMO and we appear to be close to a release.

doc/fixes35.0
src/engrave.c
src/mhitu.c
src/sit.c

index 14ba01d0ceccc52b9b61806c0e402e2b9469a736..22592a597cdda6c1cc8e542fe679cb70f8a60a20 100644 (file)
@@ -51,6 +51,9 @@ update display if bestowed a spellbook while unable to see invisible self
 use small pool of static buffers for mon_nam() and Monnam()
 Acknowledge Schroedinger's cat at end of game
 grammar fixes for applying stethoscope to corpses and statues
+player polymorphed as a ceiling hider cannot reach the floor, but
+       automatically unhide on #sit
+trappers do not hide on the ceiling
 
 
 Platform- and/or Interface-Specific Fixes
index 058e2c504a2e7609db41a023fe84efb958b9a732..080dc1d8572c3b8da18b7f5ca02c2b4a9d63a177 100644 (file)
@@ -138,7 +138,9 @@ can_reach_floor()
                        !(u.usteed && P_SKILL(P_RIDING) < P_BASIC) &&
 #endif
                         (!Levitation ||
-                         Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)));
+                         Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) &&
+                        (!u.uundetected || !is_hider(youmonst.data) ||
+                         u.umonnum == PM_TRAPPER));
 }
 
 const char *
index 9d01adc7f01bef9feb8c77c22e14967f2b8904c0..5a7c6c4c8b6ef18f95f209763f336cfba39bf749 100644 (file)
@@ -341,7 +341,7 @@ mattacku(mtmp)
 
        if (u.uundetected && !range2 && foundyou && !u.uswallow) {
                u.uundetected = 0;
-               if (is_hider(youmonst.data)) {
+               if (is_hider(youmonst.data) && u.umonnum != PM_TRAPPER) {
                    coord cc; /* maybe we need a unexto() function? */
                    struct obj *obj;
 
@@ -355,15 +355,18 @@ mattacku(mtmp)
                        set_apparxy(mtmp);
                        newsym(u.ux,u.uy);
                    } else {
-                       pline("%s is killed by a falling %s (you)!",
-                                       Monnam(mtmp), youmonst.data->mname);
-                       killed(mtmp);
+                       const char *verb =
+                           nonliving(mtmp->data) ? "destroyed" : "killed";
+                       
+                       pline("%s is %s by a falling %s (you)!",
+                             Monnam(mtmp), verb, youmonst.data->mname);
+                       xkilled(mtmp, 0);
                        newsym(u.ux,u.uy);
                        if (mtmp->mhp > 0) return 0;
                        else return 1;
                    }
                    if (youmonst.data->mlet != S_PIERCER)
-                       return(0);      /* trappers don't attack */
+                       return(0);      /* lurkers don't attack */
 
                    obj = which_armor(mtmp, WORN_HELMET);
                    if (obj && is_metallic(obj)) {
@@ -391,14 +394,15 @@ mattacku(mtmp)
                         */
                        struct obj *obj = level.objects[u.ux][u.uy];
 
-                       if (obj ||
+                       if (obj || u.umonnum == PM_TRAPPER ||
                              (youmonst.data->mlet == S_EEL && is_pool(u.ux, u.uy))) {
                            int save_spe = 0; /* suppress warning */
                            if (obj) {
                                save_spe = obj->spe;
                                if (obj->otyp == EGG) obj->spe = 0;
                            }
-                           if (youmonst.data->mlet == S_EEL)
+                           if (youmonst.data->mlet == S_EEL ||
+                               u.umonnum == PM_TRAPPER)
                pline("Wait, %s!  There's a hidden %s named %s there!",
                                m_monnam(mtmp), youmonst.data->mname, plname);
                            else
index 4104fb6c7665e9dbb4e192df8b8a34f5a53b6029..22f6227183ae18154501a1f0165b9f77d30064bd 100644 (file)
--- a/src/sit.c
+++ b/src/sit.c
@@ -50,7 +50,10 @@ dosit()
        }
 #endif
 
-       if(!can_reach_floor())  {
+       if (u.uundetected && is_hider(youmonst.data) && u.umonnum != PM_TRAPPER)
+           u.uundetected = 0;          /* no longer on the ceiling */
+
+       if (!can_reach_floor()) {
            if (Levitation)
                You("tumble in place.");
            else