Accessibility: showdamage option

Add a new boolean option showdamage, if on, outputs a message
like "[HP -2, 14 left]" - several variants have something similar,
but I chose the message based on how eSpeak said it, while keeping
it short.
This commit is contained in:
Pasi Kallinen
2024-02-24 17:05:17 +02:00
parent 9927e264b5
commit dd37c5326a
8 changed files with 32 additions and 1 deletions

View File

@@ -1109,6 +1109,7 @@ extern void end_running(boolean);
extern void nomul(int);
extern void unmul(const char *);
extern int saving_grace(int);
extern void showdamage(int);
extern void losehp(int, const char *, schar) ;
extern int weight_cap(void);
extern int inv_weight(void);

View File

@@ -213,6 +213,7 @@ struct accessibility_data {
* and probably warrant a structure of their own elsewhere some day.
*/
struct instance_flags {
boolean showdamage;
boolean debug_fuzzer; /* fuzz testing */
boolean defer_plname; /* X11 hack: askname() might not set gp.plname */
boolean herecmd_menu; /* use menu when mouseclick on yourself */

View File

@@ -620,6 +620,9 @@ static int optfn_##a(int, int, boolean, char *, char *);
NHOPTB(selectsaved, Advanced, 0, opt_out, set_in_config,
On, Yes, No, No, NoAlias, &iflags.wc2_selectsaved, Term_False,
(char *)0)
NHOPTB(showdamage, Status, 0, opt_in, set_in_game,
Off, Yes, No, No, NoAlias, &iflags.showdamage, Term_False,
"show damage hero takes in message line")
NHOPTB(showexp, Status, 0, opt_in, set_in_game,
Off, Yes, No, No, NoAlias, &flags.showexp, Term_False,
"show experience points in status line")