-/* NetHack 3.6 botl.c $NHDT-Date: 1433097925 2015/05/31 18:45:25 $ $NHDT-Branch: status_hilite $:$NHDT-Revision: 1.57 $ */
+/* NetHack 3.6 botl.c $NHDT-Date: 1433099909 2015/05/31 19:18:29 $ $NHDT-Branch: status_hilite $:$NHDT-Revision: 1.58 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
const char *const enc_stat[] = { "", "Burdened", "Stressed",
"Strained", "Overtaxed", "Overloaded" };
-STATIC_OVL NEARDATA int mrank_sz =
- 0; /* loaded by max_rank_sz (from u_init) */
+STATIC_OVL NEARDATA int mrank_sz = 0; /* loaded by max_rank_sz (from u_init) */
STATIC_DCL const char *NDECL(rank);
#ifndef STATUS_VIA_WINDOWPORT
#ifdef STATUS_VIA_WINDOWPORT
/* =======================================================================*/
+STATIC_DCL void NDECL(init_blstats);
+STATIC_DCL char *FDECL(anything_to_s, (char *, anything *, int));
+STATIC_DCL void FDECL(s_to_anything, (anything *, char *, int));
+STATIC_OVL int FDECL(percentage, (struct istat_s *, struct istat_s *));
+STATIC_OVL int FDECL(compare_blstats, (struct istat_s *, struct istat_s *));
+
+#ifdef STATUS_HILITES
+STATIC_DCL boolean FDECL(assign_hilite, (char *, char *, char *, char *, BOOLEAN_P));
+STATIC_DCL const char *FDECL(clridx_to_s, (char *, int));
+#endif
+
+/* structure that tracks the status details in the core */
struct istat_s {
long time;
unsigned anytype;
anything a;
char *val;
int valwidth;
- int idxmax;
+ enum statusfields idxmax;
enum statusfields fld;
};
/* If entries are added to this, botl.h will require updating too */
-struct istat_s initblstats[MAXBLSTATS] = {
+STATIC_DCL struct istat_s initblstats[MAXBLSTATS] = {
{ 0L, ANY_STR, {(genericptr_t)0L}, (char *)0, 80, 0, BL_TITLE},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_STR},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_DX},
{ 0L, ANY_LONG, {(genericptr_t)0L}, (char *)0, 20, 0, BL_SCORE},
{ 0L, ANY_LONG, {(genericptr_t)0L}, (char *)0, 20, 0, BL_CAP},
{ 0L, ANY_LONG, {(genericptr_t)0L}, (char *)0, 30, 0, BL_GOLD},
- { 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_ENE},
+ { 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, BL_ENEMAX, BL_ENE},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_ENEMAX},
{ 0L, ANY_LONG, {(genericptr_t)0L}, (char *)0, 10, 0, BL_XP},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_AC},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_HD},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 20, 0, BL_TIME},
{ 0L, ANY_UINT, {(genericptr_t)0L}, (char *)0, 40, 0, BL_HUNGER},
- { 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_HP},
+ { 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, BL_HPMAX, BL_HP},
{ 0L, ANY_INT, {(genericptr_t)0L}, (char *)0, 10, 0, BL_HPMAX},
{ 0L, ANY_STR, {(genericptr_t)0L}, (char *)0, 80, 0, BL_LEVELDESC},
{ 0L, ANY_LONG, {(genericptr_t)0L}, (char *)0, 20, 0, BL_EXP},
{"condition", BL_CONDITION},
};
-
struct istat_s blstats[2][MAXBLSTATS];
-
static boolean blinit = FALSE, update_all = FALSE;
-STATIC_DCL void NDECL(init_blstats);
-STATIC_DCL char *FDECL(anything_to_s, (char *, anything *, int));
-STATIC_DCL void FDECL(s_to_anything, (anything *, char *, int));
-STATIC_OVL int FDECL(percentage, (struct istat_s *, struct istat_s *));
-STATIC_OVL int FDECL(compare_blstats, (struct istat_s *, struct istat_s *));
-
-#ifdef STATUS_HILITES
-STATIC_DCL boolean FDECL(assign_hilite, (char *, char *, char *, char *, BOOLEAN_P));
-STATIC_DCL const char *FDECL(clridx_to_s, (char *, int));
-#endif
-
void
bot()
{
* text display obliterates the status line.
*
* To work around it, we call status_update() with ficticious
- * index of BL_BOGUS (-1).
+ * index of BL_FLUSH (-1).
*/
if (context.botlx && !updated)
- status_update(BL_BOGUS, (genericptr_t) 0, 0, 0);
+ status_update(BL_FLUSH, (genericptr_t) 0, 0, 0);
context.botl = context.botlx = 0;
update_all = FALSE;
fieldname = "condition";
status_enablefield(fld, fieldname, fieldfmt, TRUE);
break;
- case BL_BOGUS:
+ case BL_FLUSH:
default:
break;
}
boolean normal[2] = { 0, 0 };
boolean percent = FALSE, down_up = FALSE, changed = FALSE;
anything threshold;
- enum statusfields fld = BL_BOGUS;
+ enum statusfields fld = BL_FLUSH;
threshold.a_void = 0;
/* Example:
-/* NetHack 3.6 windows.c $NHDT-Date: 1433087641 2015/05/31 15:54:01 $ $NHDT-Branch: status_hilite $:$NHDT-Revision: 1.30 $ */
+/* NetHack 3.6 windows.c $NHDT-Date: 1433099917 2015/05/31 19:18:37 $ $NHDT-Branch: status_hilite $:$NHDT-Revision: 1.31 $ */
/* Copyright (c) D. Cohrs, 1993. */
/* NetHack may be freely redistributed. See license for details. */
enum statusfields fieldorder[2][15] = {
{ BL_TITLE, BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, BL_ALIGN,
- BL_SCORE, BL_BOGUS, BL_BOGUS, BL_BOGUS, BL_BOGUS, BL_BOGUS, BL_BOGUS},
+ BL_SCORE, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH},
{ BL_LEVELDESC, BL_GOLD, BL_HP, BL_HPMAX, BL_ENE, BL_ENEMAX,
BL_AC, BL_XP, BL_EXP, BL_HD, BL_TIME, BL_HUNGER,
- BL_CAP, BL_CONDITION, BL_BOGUS}
+ BL_CAP, BL_CONDITION, BL_FLUSH}
};
- if (idx != BL_BOGUS) {
+ if (idx != BL_FLUSH) {
if (!activefields[idx])
return;
switch (idx) {
/* This genl version updates everything on the display, everytime */
newbot1[0] = '\0';
- for (i = 0; fieldorder[0][i] != BL_BOGUS; ++i) {
+ for (i = 0; fieldorder[0][i] != BL_FLUSH; ++i) {
int idx1 = fieldorder[0][i];
if (activefields[idx1])
Strcat(newbot1, vals[idx1]);
}
newbot2[0] = '\0';
- for (i = 0; fieldorder[1][i] != BL_BOGUS; ++i) {
+ for (i = 0; fieldorder[1][i] != BL_FLUSH; ++i) {
int idx2 = fieldorder[1][i];
if (activefields[idx2])
Strcat(newbot2, vals[idx2]);
-/* NetHack 3.6 wintty.c $NHDT-Date: 1433082408 2015/05/31 14:26:48 $ $NHDT-Branch: status_hilite $:$NHDT-Revision: 1.95 $ */
+/* NetHack 3.6 wintty.c $NHDT-Date: 1433099933 2015/05/31 19:18:53 $ $NHDT-Branch: status_hilite $:$NHDT-Revision: 1.96 $ */
/* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */
enum statusfields fieldorder[2][15] = {
{ BL_TITLE, BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, BL_ALIGN,
- BL_SCORE, BL_BOGUS, BL_BOGUS, BL_BOGUS, BL_BOGUS, BL_BOGUS, BL_BOGUS},
+ BL_SCORE, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH},
{ BL_LEVELDESC, BL_GOLD, BL_HP, BL_HPMAX, BL_ENE, BL_ENEMAX,
BL_AC, BL_XP, BL_EXP, BL_HD, BL_TIME, BL_HUNGER,
- BL_CAP, BL_CONDITION, BL_BOGUS}
+ BL_CAP, BL_CONDITION, BL_FLUSH}
};
- if (idx != BL_BOGUS) {
+ if (idx != BL_FLUSH) {
if (!activefields[idx])
return;
switch (idx) {
/* This genl version updates everything on the display, everytime */
newbot1[0] = '\0';
- for (i = 0; fieldorder[0][i] != BL_BOGUS; ++i) {
+ for (i = 0; fieldorder[0][i] != BL_FLUSH; ++i) {
int idx1 = fieldorder[0][i];
if (activefields[idx1])
Strcat(newbot1, vals[idx1]);
}
newbot2[0] = '\0';
- for (i = 0; fieldorder[1][i] != BL_BOGUS; ++i) {
+ for (i = 0; fieldorder[1][i] != BL_FLUSH; ++i) {
int idx2 = fieldorder[1][i];
if (activefields[idx2])
Strcat(newbot2, vals[idx2]);