From: cohrs Date: Thu, 27 Nov 2003 07:03:56 +0000 (+0000) Subject: U761 - Sitting as a hider and other related is_hider behavior X-Git-Tag: MOVE2GIT~1554 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70e25fa154716bee958419ce8d4ae48f4353601d;p=nethack U761 - Sitting as a hider and other related is_hider behavior 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. --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 14ba01d0c..22592a597 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -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 diff --git a/src/engrave.c b/src/engrave.c index 058e2c504..080dc1d85 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -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 * diff --git a/src/mhitu.c b/src/mhitu.c index 9d01adc7f..5a7c6c4c8 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -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 diff --git a/src/sit.c b/src/sit.c index 4104fb6c7..22f622718 100644 --- 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