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:
@@ -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
|
||||
|
||||
@@ -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 *
|
||||
|
||||
18
src/mhitu.c
18
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
|
||||
|
||||
Reference in New Issue
Block a user