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:
@@ -4568,6 +4568,9 @@ Control what parts of the score list you are shown at the end (for example
|
|||||||
Only the first letter of each category (\(oqt\(cq, \(oqa\(cq, or \(oqo\(cq)
|
Only the first letter of each category (\(oqt\(cq, \(oqa\(cq, or \(oqo\(cq)
|
||||||
is necessary.
|
is necessary.
|
||||||
Persistent.
|
Persistent.
|
||||||
|
.lp showdamage
|
||||||
|
Whenever your character takes damage, show a message of the damage taken,
|
||||||
|
and the amount of hit points left.
|
||||||
.lp "showexp "
|
.lp "showexp "
|
||||||
Show your accumulated experience points on bottom line (default off).
|
Show your accumulated experience points on bottom line (default off).
|
||||||
Persistent.
|
Persistent.
|
||||||
@@ -5990,6 +5993,8 @@ of moving 8 units at a time.
|
|||||||
Prevent updates to the status lines at the bottom of the screen, if
|
Prevent updates to the status lines at the bottom of the screen, if
|
||||||
your screen-reader reads those lines. The same information can be
|
your screen-reader reads those lines. The same information can be
|
||||||
seen via the \(lq#attributes\(rq command.
|
seen via the \(lq#attributes\(rq command.
|
||||||
|
.lp showdamage
|
||||||
|
Give a message of damage taken and how many hit points are left.
|
||||||
.hn 2
|
.hn 2
|
||||||
Global Configuration for System Administrators
|
Global Configuration for System Administrators
|
||||||
.pg
|
.pg
|
||||||
|
|||||||
@@ -4999,6 +4999,10 @@ Control what parts of the score list you are shown at the end (for example,
|
|||||||
letter of each category (`{\tt t}', `{\tt a}' or `{\tt o}') is necessary.
|
letter of each category (`{\tt t}', `{\tt a}' or `{\tt o}') is necessary.
|
||||||
Persistent.
|
Persistent.
|
||||||
%.lp
|
%.lp
|
||||||
|
\item[\ib{showdamage}]
|
||||||
|
Whenever your character takes damage, show a message of the damage taken,
|
||||||
|
and the amount of hit points left.
|
||||||
|
%.lp
|
||||||
\item[\ib{showexp}]
|
\item[\ib{showexp}]
|
||||||
Show your accumulated experience points on bottom line (default off).
|
Show your accumulated experience points on bottom line (default off).
|
||||||
Persistent.
|
Persistent.
|
||||||
@@ -6609,6 +6613,9 @@ of moving 8 units at a time.
|
|||||||
Prevent updates to the status lines at the bottom of the screen, if
|
Prevent updates to the status lines at the bottom of the screen, if
|
||||||
your screen-reader reads those lines. The same information can be
|
your screen-reader reads those lines. The same information can be
|
||||||
seen via the {\tt \#attributes} command.
|
seen via the {\tt \#attributes} command.
|
||||||
|
%.lp
|
||||||
|
\item[\ib{showdamage}]
|
||||||
|
Give a message of damage taken and how many hit points are left.
|
||||||
\elist
|
\elist
|
||||||
|
|
||||||
%.hn2
|
%.hn2
|
||||||
|
|||||||
+1
-1
@@ -2493,7 +2493,7 @@ erinyes overhaul; they now attempt to punish heroes who have violated their
|
|||||||
alignment and get stronger with greater alignment abuse
|
alignment and get stronger with greater alignment abuse
|
||||||
accessibility options to tell where on map a message happened (accessiblemsg),
|
accessibility options to tell where on map a message happened (accessiblemsg),
|
||||||
to notify when a monster is spotted (spot_monsters), and when
|
to notify when a monster is spotted (spot_monsters), and when
|
||||||
a monster moved (mon_movement)
|
a monster moved (mon_movement), when hero takes damage (showdamage)
|
||||||
if hero is punished or tethered to a buried iron ball and has no inventory (or
|
if hero is punished or tethered to a buried iron ball and has no inventory (or
|
||||||
only carries gold or embedded dragon scales or both), a nymph might
|
only carries gold or embedded dragon scales or both), a nymph might
|
||||||
remove the chain when finding nothing else to steal
|
remove the chain when finding nothing else to steal
|
||||||
|
|||||||
@@ -1109,6 +1109,7 @@ extern void end_running(boolean);
|
|||||||
extern void nomul(int);
|
extern void nomul(int);
|
||||||
extern void unmul(const char *);
|
extern void unmul(const char *);
|
||||||
extern int saving_grace(int);
|
extern int saving_grace(int);
|
||||||
|
extern void showdamage(int);
|
||||||
extern void losehp(int, const char *, schar) ;
|
extern void losehp(int, const char *, schar) ;
|
||||||
extern int weight_cap(void);
|
extern int weight_cap(void);
|
||||||
extern int inv_weight(void);
|
extern int inv_weight(void);
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ struct accessibility_data {
|
|||||||
* and probably warrant a structure of their own elsewhere some day.
|
* and probably warrant a structure of their own elsewhere some day.
|
||||||
*/
|
*/
|
||||||
struct instance_flags {
|
struct instance_flags {
|
||||||
|
boolean showdamage;
|
||||||
boolean debug_fuzzer; /* fuzz testing */
|
boolean debug_fuzzer; /* fuzz testing */
|
||||||
boolean defer_plname; /* X11 hack: askname() might not set gp.plname */
|
boolean defer_plname; /* X11 hack: askname() might not set gp.plname */
|
||||||
boolean herecmd_menu; /* use menu when mouseclick on yourself */
|
boolean herecmd_menu; /* use menu when mouseclick on yourself */
|
||||||
|
|||||||
@@ -620,6 +620,9 @@ static int optfn_##a(int, int, boolean, char *, char *);
|
|||||||
NHOPTB(selectsaved, Advanced, 0, opt_out, set_in_config,
|
NHOPTB(selectsaved, Advanced, 0, opt_out, set_in_config,
|
||||||
On, Yes, No, No, NoAlias, &iflags.wc2_selectsaved, Term_False,
|
On, Yes, No, No, NoAlias, &iflags.wc2_selectsaved, Term_False,
|
||||||
(char *)0)
|
(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,
|
NHOPTB(showexp, Status, 0, opt_in, set_in_game,
|
||||||
Off, Yes, No, No, NoAlias, &flags.showexp, Term_False,
|
Off, Yes, No, No, NoAlias, &flags.showexp, Term_False,
|
||||||
"show experience points in status line")
|
"show experience points in status line")
|
||||||
|
|||||||
+12
@@ -3965,6 +3965,16 @@ saving_grace(int dmg)
|
|||||||
return dmg;
|
return dmg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* show a message how much damage you received */
|
||||||
|
void
|
||||||
|
showdamage(int dmg)
|
||||||
|
{
|
||||||
|
if (!iflags.showdamage)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pline("[HP %i, %i left]", -dmg, Upolyd ? u.mh : u.uhp);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
losehp(int n, const char *knam, schar k_format)
|
losehp(int n, const char *knam, schar k_format)
|
||||||
{
|
{
|
||||||
@@ -3979,6 +3989,7 @@ losehp(int n, const char *knam, schar k_format)
|
|||||||
end_running(TRUE);
|
end_running(TRUE);
|
||||||
if (Upolyd) {
|
if (Upolyd) {
|
||||||
u.mh -= n;
|
u.mh -= n;
|
||||||
|
showdamage(n);
|
||||||
if (u.mhmax < u.mh)
|
if (u.mhmax < u.mh)
|
||||||
u.mhmax = u.mh;
|
u.mhmax = u.mh;
|
||||||
if (u.mh < 1)
|
if (u.mh < 1)
|
||||||
@@ -3990,6 +4001,7 @@ losehp(int n, const char *knam, schar k_format)
|
|||||||
|
|
||||||
n = saving_grace(n);
|
n = saving_grace(n);
|
||||||
u.uhp -= n;
|
u.uhp -= n;
|
||||||
|
showdamage(n);
|
||||||
if (u.uhp > u.uhpmax)
|
if (u.uhp > u.uhpmax)
|
||||||
u.uhpmax = u.uhp; /* perhaps n was negative */
|
u.uhpmax = u.uhp; /* perhaps n was negative */
|
||||||
if (u.uhp < 1) {
|
if (u.uhp < 1) {
|
||||||
|
|||||||
@@ -1810,11 +1810,13 @@ mdamageu(struct monst *mtmp, int n)
|
|||||||
disp.botl = TRUE;
|
disp.botl = TRUE;
|
||||||
if (Upolyd) {
|
if (Upolyd) {
|
||||||
u.mh -= n;
|
u.mh -= n;
|
||||||
|
showdamage(n);
|
||||||
if (u.mh < 1)
|
if (u.mh < 1)
|
||||||
rehumanize();
|
rehumanize();
|
||||||
} else {
|
} else {
|
||||||
n = saving_grace(n);
|
n = saving_grace(n);
|
||||||
u.uhp -= n;
|
u.uhp -= n;
|
||||||
|
showdamage(n);
|
||||||
if (u.uhp < 1)
|
if (u.uhp < 1)
|
||||||
done_in_by(mtmp, DIED);
|
done_in_by(mtmp, DIED);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user