status_hilite for Xp and Exp by percent rules
Extend support for highlight rules that specify percentages from HP and spell power to experience level and experience points. For both of those, the percentage is based on progress from the start of the current Xp level to the start of the next Xp level. 100% isn't possible so is used to enable highlighting a special case: 1 point shy of next level, most likely to occur after losing a level. This is something I had in mind a long time ago and then forgot all about until fiddling with the final disclosure of experience points recently. It turned out to be trickier than expected because it needs to check whether Xp should have a status update when it hasn't changed but Exp has gone up. The latter might hit a percentage threshold that switches to another highlight rule. Fortunately changes to Exp, at least that aren't part of level gain or loss (which always trigger status updating), are all funnelled through a single place (I hope).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1560161804 2019/06/10 10:16:44 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.714 $ */
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1562114349 2019/07/03 00:39:09 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.715 $ */
|
||||
/* Copyright (c) Steve Creps, 1988. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -177,6 +177,7 @@ E long NDECL(botl_score);
|
||||
E int FDECL(describe_level, (char *));
|
||||
E void FDECL(status_initialize, (BOOLEAN_P));
|
||||
E void NDECL(status_finish);
|
||||
E boolean NDECL(exp_percent_changing);
|
||||
E int NDECL(stat_cap_indx);
|
||||
E int NDECL(stat_hunger_indx);
|
||||
E const char *FDECL(bl_idx_to_fldname, (int));
|
||||
|
||||
Reference in New Issue
Block a user