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.
This commit is contained in:
cohrs
2003-11-27 07:03:56 +00:00
parent cfa72fcee1
commit 70e25fa154
4 changed files with 21 additions and 9 deletions
+3
View 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() use small pool of static buffers for mon_nam() and Monnam()
Acknowledge Schroedinger's cat at end of game Acknowledge Schroedinger's cat at end of game
grammar fixes for applying stethoscope to corpses and statues 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 Platform- and/or Interface-Specific Fixes
+3 -1
View File
@@ -138,7 +138,9 @@ can_reach_floor()
!(u.usteed && P_SKILL(P_RIDING) < P_BASIC) && !(u.usteed && P_SKILL(P_RIDING) < P_BASIC) &&
#endif #endif
(!Levitation || (!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 * const char *
+11 -7
View File
@@ -341,7 +341,7 @@ mattacku(mtmp)
if (u.uundetected && !range2 && foundyou && !u.uswallow) { if (u.uundetected && !range2 && foundyou && !u.uswallow) {
u.uundetected = 0; 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? */ coord cc; /* maybe we need a unexto() function? */
struct obj *obj; struct obj *obj;
@@ -355,15 +355,18 @@ mattacku(mtmp)
set_apparxy(mtmp); set_apparxy(mtmp);
newsym(u.ux,u.uy); newsym(u.ux,u.uy);
} else { } else {
pline("%s is killed by a falling %s (you)!", const char *verb =
Monnam(mtmp), youmonst.data->mname); nonliving(mtmp->data) ? "destroyed" : "killed";
killed(mtmp);
pline("%s is %s by a falling %s (you)!",
Monnam(mtmp), verb, youmonst.data->mname);
xkilled(mtmp, 0);
newsym(u.ux,u.uy); newsym(u.ux,u.uy);
if (mtmp->mhp > 0) return 0; if (mtmp->mhp > 0) return 0;
else return 1; else return 1;
} }
if (youmonst.data->mlet != S_PIERCER) if (youmonst.data->mlet != S_PIERCER)
return(0); /* trappers don't attack */ return(0); /* lurkers don't attack */
obj = which_armor(mtmp, WORN_HELMET); obj = which_armor(mtmp, WORN_HELMET);
if (obj && is_metallic(obj)) { if (obj && is_metallic(obj)) {
@@ -391,14 +394,15 @@ mattacku(mtmp)
*/ */
struct obj *obj = level.objects[u.ux][u.uy]; 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))) { (youmonst.data->mlet == S_EEL && is_pool(u.ux, u.uy))) {
int save_spe = 0; /* suppress warning */ int save_spe = 0; /* suppress warning */
if (obj) { if (obj) {
save_spe = obj->spe; save_spe = obj->spe;
if (obj->otyp == EGG) obj->spe = 0; 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!", pline("Wait, %s! There's a hidden %s named %s there!",
m_monnam(mtmp), youmonst.data->mname, plname); m_monnam(mtmp), youmonst.data->mname, plname);
else else
+4 -1
View File
@@ -50,7 +50,10 @@ dosit()
} }
#endif #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) if (Levitation)
You("tumble in place."); You("tumble in place.");
else else