Accessibility: Show a message when monster is spotted

Adds a new boolean option, spot_monsters.  If on, every time
the hero notices a monster which was out of sight before,
a message is given.  Combine with accessiblemsg to get the
monster location:

(3north): You see a newt.

Breaks saves and bones.
This commit is contained in:
Pasi Kallinen
2024-01-14 13:28:52 +02:00
parent 627b40fb57
commit 3160112ece
13 changed files with 119 additions and 1 deletions

View File

@@ -191,8 +191,20 @@ struct debug_flags {
struct accessibility_data {
boolean accessiblemsg; /* use msg_loc for plined messages */
coord msg_loc; /* accessiblemsg: location */
boolean mon_notices; /* msg when hero notices a monster */
int mon_notices_blocked; /* temp disable mon_notices */
};
/* Use notice_mon_off() / notice_mon_on() to temporarily disable
noticing the monsters in the vision code - perhaps the game
needs to output some other messages in between.
Call notice_all_mons() afterwards to catch up. */
#define notice_mon_off() do { a11y.mon_notices_blocked++; } while(0)
#define notice_mon_on() do { if (--a11y.mon_notices_blocked < 0) { \
impossible("mon_notices_blocked<0"); \
a11y.mon_notices_blocked = 0; \
} } while(0)
/*
* Stuff that really isn't option or platform related and does not
* get saved and restored. They are set and cleared during the game