Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2019-04-10 13:06:37 -04:00
7 changed files with 169 additions and 125 deletions

View File

@@ -1,4 +1,4 @@
.\" $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.303 $ $NHDT-Date: 1554134322 2019/04/01 15:58:42 $ .\" $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.304 $ $NHDT-Date: 1554849951 2019/04/09 22:45:51 $
.\" .\"
.\" This is an excerpt from the 'roff' man page from the 'groff' package. .\" This is an excerpt from the 'roff' man page from the 'groff' package.
.\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines. .\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines.
@@ -24,7 +24,7 @@
.ds vr "NetHack 3.6 .ds vr "NetHack 3.6
.ds f0 "\*(vr .ds f0 "\*(vr
.ds f1 .ds f1
.ds f2 "March 24, 2019 .ds f2 "April 9, 2019
. .
.\" A note on some special characters: .\" A note on some special characters:
.\" \(lq = left double quote .\" \(lq = left double quote
@@ -4112,9 +4112,12 @@ If no attribute is defined, no attribute is used.
The pattern should be a regular expression. The pattern should be a regular expression.
.lp "" .lp ""
Allowed colors are black, red, green, brown, blue, magenta, cyan, gray, Allowed colors are black, red, green, brown, blue, magenta, cyan, gray,
orange, lightgreen, yellow, lightblue, lightmagenta, lightcyan, and white. orange, light-green, yellow, light-blue, light-magenta, light-cyan, and white.
And \f(CRno-color\fP, the default foreground color, which isn't necessarily
the same as any of the other colors.
.lp "" .lp ""
Allowed attributes are none, bold, dim, underline, blink, and inverse. Allowed attributes are none, bold, dim, underline, blink, and inverse.
\(lqNormal\(rq is a synonym for \(lqnone\(rq.
Note that the platform used may interpret the attributes any way it Note that the platform used may interpret the attributes any way it
wants. wants.
.lp "" .lp ""
@@ -4179,36 +4182,62 @@ If so, you can customize your game display by setting thresholds to
change the color or appearance of fields in the status display. change the color or appearance of fields in the status display.
.pg .pg
The format for defining status colors is: The format for defining status colors is:
.si .SD n
.lp "OPTION=hilite_status: field-name/behavior/color&attributes" \f(CROPTION=hilite_status:\fIfield-name\fP/\fIbehavior\fP/\fIcolor\fP&\fIattributes\fP\fP
.ei .ED
.pg .pg
For example, the following line in your config file will cause For example, the following line in your configuration file will cause
the hitpoints field to display in the color red if your hitpoints the hitpoints field to display in the color red if your hitpoints
drop to or below a threshold of 30%: drop to or below a threshold of 30%:
.si .SD n
.lp "OPTION=hilite_status: hitpoints/<=30%/red/normal" \f(CROPTION=hilite_status:hitpoints/<=30%/red/normal\fP
.ei .ED
(That example is actually specifying \f(CRred&normal\fP for <=30%
and \f(CRno-color&normal\fP for >30%.)
.pg .pg
For another example, the following line in your config file will cause For another example, the following line in your configuration file will cause
wisdom to be displayed red if it drops and green if it rises. wisdom to be displayed red if it drops and green if it rises:
.si .SD n
.lp "OPTION=hilite_status: wisdom/down/red/up/green" \f(CROPTION=hilite_status:wisdom/down/red/up/green\fP
.ei .ED
.pg .pg
You can adjust the display of the following status fields: Allowed colors are black, red, green, brown, blue, magenta, cyan, gray,
orange, light-green, yellow, light-blue, light-magenta, light-cyan, and white.
And \(lqno-color\(rq, the default foreground color on the display, which
is not necessarily the same as black or white or any of the other colors.
.pg
Allowed attributes are none, bold, dim, underline, blink, and inverse.
\(lqNormal\(rq is a synonym for \(lqnone\(rq; they should not be used in
combination with any of the other attributes.
.pg
To specify both a color and an attribute, use \(oq&\(cq to combine them.
To specify multiple attributes, use \(oq\+\(cq to combine those.
For example: \(lqmagenta&inverse\+dim\(rq.
.pg
Note that the display may substitute or ignore particular attributes
depending upon its capabilities, and in general may interpret the
attributes any way it wants.
For example, on some display systems a request for bold might yield
blink or vice versa.
On others, issuing an attribute request while another is already
set up will replace the earlier attribute rather than combine with it.
Since NetHack issues attribute requests sequentially (at least with
the \f(CRtty\fP interface) rather than all at once, the only way a
situation like that can be controlled is to specify just one attribute.
.pg
You can adjust the appearance of the following status fields:
.TS S .TS S
center; center;
c c c. c c c.
.\"TABLE_START .\"TABLE_START
title strength dexterity title dungeon-level experience-level
constitution intelligence wisdom strength gold experience
charisma alignment score dexterity hitpoints HD
carrying-capacity gold power constitution hitpoints-max time
power-max experience-level armor-class intelligence power hunger
HD time hunger wisdom power-max carrying-capacity
hitpoints hitpoints-max dungeon-level charisma armor-class condition
experience condition alignment score
.\"TABLE_END Do not delete this line. .\"TABLE_END Do not delete this line.
.TE .TE
.lp "" .lp ""
@@ -4274,20 +4303,14 @@ and \(lqtitle\(rq.
For title, only the role's rank title For title, only the role's rank title
is tested; the character's name is ignored. is tested; the character's name is ignored.
.ei .ei
.lp "" .pg
Allowed colors are black, red, green, brown, blue, magenta, cyan, gray,
orange, lightgreen, yellow, lightblue, lightmagenta, lightcyan, and white.
.lp ""
Allowed attributes are bold, inverse, underline, blink, dim, and normal.
Note that the platform used may interpret the attributes any way it
wants.
.lp ""
The in-game options menu can help you determine the correct syntax for a The in-game options menu can help you determine the correct syntax for a
config file. config file.
.lp "" .pg
The whole feature can be disabled by setting option The whole feature can be disabled by setting option
statushilites to 0. .op statushilites
.lp "" to 0.
.pg
Example hilites: Example hilites:
.sd .sd
.si .si

View File

@@ -45,7 +45,7 @@
%.au %.au
\author{Original version - Eric S. Raymond\\ \author{Original version - Eric S. Raymond\\
(Edited and expanded for 3.6 by Mike Stephenson and others)} (Edited and expanded for 3.6 by Mike Stephenson and others)}
\date{March 24, 2019} \date{April 9, 2019}
\maketitle \maketitle
@@ -4582,12 +4582,15 @@ The pattern should be a regular expression.
%.lp "" %.lp ""
Allowed colors are {\it black}, {\it red}, {\it green}, {\it brown}, Allowed colors are {\it black}, {\it red}, {\it green}, {\it brown},
{\it blue}, {\it magenta}, {\it cyan}, {\it gray}, {\it orange}, {\it blue}, {\it magenta}, {\it cyan}, {\it gray}, {\it orange},
{\it lightgreen}, {\it yellow}, {\it lightblue}, {\it lightmagenta}, {\it light-green}, {\it yellow}, {\it light-blue}, {\it light-magenta},
{\it lightcyan}, and {\it white}. {\it light-cyan}, and {\it white}.
And {\itno-color}, the default foreground color, which isn't necessarily
the same as any of the other colors.
%.lp "" %.lp ""
Allowed attributes are {\it none}, {\it bold}, {\it dim}, {\it underline}, Allowed attributes are {\it none}, {\it bold}, {\it dim}, {\it underline},
{\it blink}, and {\it inverse}. {\it blink}, and {\it inverse}.
{\it Normal\/} is a synonym for {\it none}.
Note that the platform used may interpret the attributes any way it Note that the platform used may interpret the attributes any way it
wants. wants.
@@ -4657,40 +4660,68 @@ The pattern should be a regular expression.
\subsection*{Configuring Status Hilites} \subsection*{Configuring Status Hilites}
%.pg %.pg
Your copy of {\it NetHack\/} may have been compiled with support for {\it Status Hilites}. Your copy of {\it NetHack\/} may have been compiled with support
for {\it Status Hilites}.
If so, you can customize your game display by setting thresholds to If so, you can customize your game display by setting thresholds to
change the color or appearance of fields in the status display. change the color or appearance of fields in the status display.
%.pg
The format for defining status colors is: The format for defining status colors is:\\
\begin{verbatim} \begin{verbatim}
OPTION=hilite_status: field-name/behavior/color&attributes OPTION=hilite_status:field-name/behavior/color&attributes
\end{verbatim} \end{verbatim}
%.pg
For example, the following line in your config file will cause For example, the following line in your configuration file will cause
the hitpoints field to display in the color red if your hitpoints the hitpoints field to display in the color red if your hitpoints
drop to or below a threshold of 30%: drop to or below a threshold of 30%:\\
\begin{verbatim} \begin{verbatim}
OPTION=hilite_status: hitpoints/<=30%/red/normal OPTION=hilite_status:hitpoints/<=30%/red/normal
\end{verbatim} \end{verbatim}\\
%.pg (That example is actually specifying {\tt red\&normal} for <=30\%
For another example, the following line in your config file will cause and {\tt no-color\&normal} for >30\%.)\\
wisdom to be displayed red if it drops and green if it rises.
For another example, the following line in your configuration file will cause
wisdom to be displayed red if it drops and green if it rises:\\
\begin{verbatim} \begin{verbatim}
OPTION=hilite_status: wisdom/down/red/up/green OPTION=hilite_status:wisdom/down/red/up/green
\end{verbatim} \end{verbatim}
Allowed colors are black, red, green, brown, blue, magenta, cyan, gray,
orange, light-green, yellow, light-blue, light-magenta, light-cyan, and white.
And {\it no-color}, the default foreground color on the display, which
is not necessarily the same as black or white or any of the other colors.
Allowed attributes are none, bold, dim, underline, blink, and inverse.
``Normal'' is a synonym for ``none''; they should not be used in
combination with any of the other attributes.
To specify both a color and an attribute, use `\&' to combine them.
To specify multiple attributes, use `+' to combine those.
For example: {\tt magenta\&inverse+dim}.
Note that the display may substitute or ignore particular attributes
depending upon its capabilities, and in general may interpret the
attributes any way it wants.
For example, on some display systems a request for bold might yield
blink or vice versa.
On others, issuing an attribute request while another is already
set up will replace the earlier attribute rather than combine with it.
Since nethack issues attribute requests sequentially (at least with
the {\it tty} interface) rather than all at once, the only way a
situation like that can be controlled is to specify just one attribute.
You can adjust the display of the following status fields: You can adjust the display of the following status fields:
%.sd %.sd
\begin{center} \begin{center}
\begin{tabular}{lll} \begin{tabular}{lll}
%TABLE_START %TABLE_START
title & strength & dexterity\\ title & dungeon-level & experience-level\\
constitution & intelligence & wisdom\\ strength & gold & experience\\
charisma & alignment & score\\ dexterity & hitpoints & HD\\
carrying-capacity & gold & power\\ constitution & hitpoints-max & time\\
power-max & experience-level & armor-class\\ intelligence & power & hunger\\
HD & time & hunger\\ wisdom & power-max & carrying-capacity\\
hitpoints & hitpoints-max & dungeon-level\\ charisma & armor-class & condition\\
experience & condition\\ alignment & & score\\
%TABLE_END Do not delete this line. %TABLE_END Do not delete this line.
\end{tabular} \end{tabular}
\end{center} \end{center}
@@ -4764,26 +4795,11 @@ is tested; the character's name is ignored.
%.ei %.ei
\elist \elist
%.lp ""
Allowed colors are {\it black}, {\it red}, {\it green}, {\it brown},
{\it blue}, {\it magenta}, {\it cyan}, {\it gray}, {\it orange},
{\it lightgreen}, {\it yellow}, {\it lightblue}, {\it lightmagenta},
{\it lightcyan}, and {\it white}.
%.lp ""
Allowed attributes are {\it bold}, {\it inverse}, {\it underline},
{\it blink}, {\it dim}, and {\it normal}.
Note that the platform used may interpret the attributes any way it
wants.
%.lp ""
The in-game options menu can help you determine the correct syntax for a The in-game options menu can help you determine the correct syntax for a
config file. config file.
%.lp ""
The whole feature can be disable by setting option {\it statushilites} to 0. The whole feature can be disable by setting option {\it statushilites} to 0.
%.lp ""
Example hilites: Example hilites:
\begin{verbatim} \begin{verbatim}
OPTION=hilite_status: gold/up/yellow/down/brown OPTION=hilite_status: gold/up/yellow/down/brown

View File

@@ -642,7 +642,9 @@ struct instance_globals {
boolean blinit; boolean blinit;
boolean update_all; boolean update_all;
boolean valset[MAXBLSTATS]; boolean valset[MAXBLSTATS];
#ifdef STATUS_HILITES
long bl_hilite_moves; long bl_hilite_moves;
#endif
unsigned long cond_hilites[BL_ATTCLR_MAX]; unsigned long cond_hilites[BL_ATTCLR_MAX];
int now_or_before_idx; /* 0..1 for array[2][] first index */ int now_or_before_idx; /* 0..1 for array[2][] first index */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1554554180 2019/04/06 12:36:20 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.699 $ */ /* NetHack 3.6 extern.h $NHDT-Date: 1554857123 2019/04/10 00:45:23 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.700 $ */
/* Copyright (c) Steve Creps, 1988. */ /* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -160,13 +160,13 @@ E void NDECL(max_rank_sz);
E long NDECL(botl_score); E long NDECL(botl_score);
#endif #endif
E int FDECL(describe_level, (char *)); E int FDECL(describe_level, (char *));
E void NDECL(status_eval_next_unhilite);
E void FDECL(status_initialize, (BOOLEAN_P)); E void FDECL(status_initialize, (BOOLEAN_P));
E void NDECL(status_finish); E void NDECL(status_finish);
E int NDECL(stat_cap_indx); E int NDECL(stat_cap_indx);
E int NDECL(stat_hunger_indx); E int NDECL(stat_hunger_indx);
E const char *FDECL(bl_idx_to_fldname, (int)); E const char *FDECL(bl_idx_to_fldname, (int));
#ifdef STATUS_HILITES #ifdef STATUS_HILITES
E void NDECL(status_eval_next_unhilite);
E void NDECL(reset_status_hilites); E void NDECL(reset_status_hilites);
E boolean FDECL(parse_status_hl1, (char *op, BOOLEAN_P)); E boolean FDECL(parse_status_hl1, (char *op, BOOLEAN_P));
E void FDECL(status_notify_windowport, (BOOLEAN_P)); E void FDECL(status_notify_windowport, (BOOLEAN_P));

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 allmain.c $NHDT-Date: 1554591223 2019/04/06 22:53:43 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.97 $ */ /* NetHack 3.6 allmain.c $NHDT-Date: 1554895741 2019/04/10 11:29:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.99 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -325,7 +325,10 @@ boolean resuming;
/* once-per-hero-took-time things go here */ /* once-per-hero-took-time things go here */
/******************************************/ /******************************************/
status_eval_next_unhilite(); #ifdef STATUS_HILITES
if (iflags.hilite_delta)
status_eval_next_unhilite();
#endif
if (g.context.bypasses) if (g.context.bypasses)
clear_bypasses(); clear_bypasses();
if ((u.uhave.amulet || Clairvoyant) && !In_endgame(&u.uz) if ((u.uhave.amulet || Clairvoyant) && !In_endgame(&u.uz)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 botl.c $NHDT-Date: 1554591223 2019/04/06 22:53:43 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.143 $ */ /* NetHack 3.6 botl.c $NHDT-Date: 1554857126 2019/04/10 00:45:26 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.144 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */ /*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -505,6 +505,8 @@ STATIC_VAR struct istat_s initblstats[MAXBLSTATS] = {
#undef INIT_BLSTAT #undef INIT_BLSTAT
#undef INIT_THRESH #undef INIT_THRESH
#ifdef STATUS_HILITES
#endif
/* we don't put this next declaration in #ifdef STATUS_HILITES. /* we don't put this next declaration in #ifdef STATUS_HILITES.
* In the absence of STATUS_HILITES, each array * In the absence of STATUS_HILITES, each array
* element will be 0 however, and quite meaningless, * element will be 0 however, and quite meaningless,
@@ -860,51 +862,6 @@ boolean *valsetlist;
g.update_all = FALSE; g.update_all = FALSE;
} }
/* called from moveloop(); sets context.botl if temp hilites have timed out */
void
status_eval_next_unhilite()
{
int i;
struct istat_s *curr;
long next_unhilite, this_unhilite;
g.bl_hilite_moves = g.moves; /* simpllfied; used to try to encode fractional
* amounts for multiple moves within same turn */
/* figure out whether an unhilight needs to be performed now */
next_unhilite = 0L;
for (i = 0; i < MAXBLSTATS; ++i) {
curr = &g.blstats[0][i]; /* g.blstats[0][*].time == g.blstats[1][*].time */
if (curr->chg) {
struct istat_s *prev = &g.blstats[1][i];
#ifdef STATUS_HILITES
if (Is_Temp_Hilite(curr->hilite_rule))
curr->time = prev->time = (g.bl_hilite_moves
+ iflags.hilite_delta);
else
curr->time = prev->time = 0L;
#endif
curr->chg = prev->chg = FALSE;
g.context.botl = TRUE;
}
if (g.context.botl)
continue; /* just process other g.blstats[][].time and .chg */
this_unhilite = curr->time;
if (this_unhilite > 0L
&& (next_unhilite == 0L || this_unhilite < next_unhilite)
#ifdef STATUS_HILITES
&& hilite_reset_needed(curr, this_unhilite + 1L)
#endif
) {
next_unhilite = this_unhilite;
if (next_unhilite < g.bl_hilite_moves)
g.context.botl = TRUE;
}
}
}
void void
status_initialize(reassessment) status_initialize(reassessment)
boolean reassessment; /* TRUE: just recheck fields w/o other initialization */ boolean reassessment; /* TRUE: just recheck fields w/o other initialization */
@@ -1395,6 +1352,47 @@ long augmented_time;
return TRUE; return TRUE;
} }
/* called from moveloop(); sets context.botl if temp hilites have timed out */
void
status_eval_next_unhilite()
{
int i;
struct istat_s *curr;
long next_unhilite, this_unhilite;
g.bl_hilite_moves = g.moves; /* simpllfied; used to try to encode fractional
* amounts for multiple moves within same turn */
/* figure out whether an unhilight needs to be performed now */
next_unhilite = 0L;
for (i = 0; i < MAXBLSTATS; ++i) {
curr = &g.blstats[0][i]; /* g.blstats[0][*].time == g.blstats[1][*].time */
if (curr->chg) {
struct istat_s *prev = &g.blstats[1][i];
if (Is_Temp_Hilite(curr->hilite_rule))
curr->time = prev->time = (g.bl_hilite_moves
+ iflags.hilite_delta);
else
curr->time = prev->time = 0L;
curr->chg = prev->chg = FALSE;
g.context.botl = TRUE;
}
if (g.context.botl)
continue; /* just process other g.blstats[][].time and .chg */
this_unhilite = curr->time;
if (this_unhilite > 0L
&& (next_unhilite == 0L || this_unhilite < next_unhilite)
&& hilite_reset_needed(curr, this_unhilite + 1L)) {
next_unhilite = this_unhilite;
if (next_unhilite < g.bl_hilite_moves)
g.context.botl = TRUE;
}
}
}
/* called by options handling when 'statushilites' boolean is toggled */ /* called by options handling when 'statushilites' boolean is toggled */
void void
reset_status_hilites() reset_status_hilites()

View File

@@ -218,7 +218,9 @@ const struct instance_globals g_init = {
FALSE, /* blinit */ FALSE, /* blinit */
FALSE, /* update_all */ FALSE, /* update_all */
UNDEFINED_VALUES, /* valset */ UNDEFINED_VALUES, /* valset */
#ifdef STATUS_HILITES
0, /* bl_hilite_moves */ 0, /* bl_hilite_moves */
#endif
UNDEFINED_VALUES, /* cond_hilites */ UNDEFINED_VALUES, /* cond_hilites */
0, /* now_or_before_idx */ 0, /* now_or_before_idx */