fix #H7065 - clairvoyance shows trap over monsters
and over the hero. 3.6.0's clairvoyance tried to show things in a non-standard sequence, which was intentional but had unintended side-effects like the disappearing monsters complained about in the report. To make it work as intended would have required --More-- whenever it kicked in, which is much too intrusive when it happens every N turns rather than when explicitly casting the spell. Redo it substantially, and give preference to monsters over objects, objects over traps, and traps over underlying terrain like normal vision-based display does. It now detects all monsters within its bounding box but shows ones which aren't directly in view as "unseen monster" unless via spell cast at skilled or expert, or at basic when also having intrinsic clairvoyance.
This commit is contained in:
11
src/pager.c
11
src/pager.c
@@ -895,12 +895,17 @@ struct permonst **for_supplement;
|
||||
}
|
||||
|
||||
if (sym == DEF_INVISIBLE) {
|
||||
extern const char altinvisexplain[]; /* drawing.c */
|
||||
/* for active clairvoyance, use alternate "unseen creature" */
|
||||
boolean usealt = (EDetect_monsters & I_SPECIAL) != 0L;
|
||||
const char *unseen_explain = !usealt ? invisexplain : altinvisexplain;
|
||||
|
||||
if (!found) {
|
||||
Sprintf(out_str, "%s%s", prefix, an(invisexplain));
|
||||
*firstmatch = invisexplain;
|
||||
Sprintf(out_str, "%s%s", prefix, an(unseen_explain));
|
||||
*firstmatch = unseen_explain;
|
||||
found++;
|
||||
} else {
|
||||
found += append_str(out_str, an(invisexplain));
|
||||
found += append_str(out_str, an(unseen_explain));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user