hurtling into unseen monsters

Expand "You bump into it." into something more comprehensive when
encountering an unseen monster while hurtling.  Tested with jumping
but other forms of hurtling should behave the same.
This commit is contained in:
PatR
2017-10-09 17:34:02 -07:00
parent 9b3d358989
commit 19663e157f

View File

@@ -625,8 +625,8 @@ int x, y;
}
if ((u.ux - x) && (u.uy - y) && bad_rock(youmonst.data, u.ux, y)
&& bad_rock(youmonst.data, x, u.uy)) {
boolean too_much =
(invent && (inv_weight() + weight_cap() > 600));
boolean too_much = (invent && (inv_weight() + weight_cap() > 600));
/* Move at a diagonal. */
if (bigmonst(youmonst.data) || too_much) {
You("%sget forcefully wedged into a crevice.",
@@ -640,14 +640,43 @@ int x, y;
}
}
if ((mon = m_at(x, y)) != 0) {
You("bump into %s.", a_monnam(mon));
if ((mon = m_at(x, y)) != 0
#if 0 /* we can't include these two exceptions unless we know we're
* going to end up past the current spot rather than on it;
* for that, we need to know that the range is not exhausted
* and also that the next spot doesn't contain an obstacle */
&& !(mon->mundetected && hides_under(mon) && (Flying || Levitation))
&& !(mon->mundetected && mon->data->mlet == S_EEL
&& (Flying || Levitation || Wwalking))
#endif
) {
const char *mnam, *pronoun;
int glyph = glyph_at(x, y);
mon->mundetected = 0; /* wakeup() will handle mimic */
mnam = a_monnam(mon); /* after unhiding */
pronoun = mhim(mon);
if (!strcmp(mnam, "it")) {
/* mhim() uses pronoun_gender() which forces neuter if monster
can't be seen; we want him/her for humanoid sensed by touch */
if (!strcmp(pronoun, "it") && humanoid(mon->data))
pronoun = genders[mon->female].him;
mnam = !strcmp(pronoun, "it") ? "something" : "someone";
}
if (!glyph_is_monster(glyph) && !glyph_is_invisible(glyph))
You("find %s by bumping into %s.", mnam, pronoun);
else
You("bump into %s.", mnam);
wakeup(mon, FALSE);
if (!canspotmon(mon))
map_invisible(mon->mx, mon->my);
setmangry(mon, FALSE);
wake_nearto(x,y, 10);
wake_nearto(x, y, 10);
return FALSE;
}
if ((u.ux - x) && (u.uy - y) && bad_rock(youmonst.data, u.ux, y)
if ((u.ux - x) && (u.uy - y)
&& bad_rock(youmonst.data, u.ux, y)
&& bad_rock(youmonst.data, x, u.uy)) {
/* Move at a diagonal. */
if (Sokoban) {