summarylogtreecommitdiffstats
path: root/hpmon.diff
diff options
context:
space:
mode:
Diffstat (limited to 'hpmon.diff')
-rw-r--r--hpmon.diff81
1 files changed, 81 insertions, 0 deletions
diff --git a/hpmon.diff b/hpmon.diff
new file mode 100644
index 000000000000..6b14c825dfb6
--- /dev/null
+++ b/hpmon.diff
@@ -0,0 +1,81 @@
+diff -urd nethack-3.4.3/src/botl.c nh343hpm/src/botl.c
+--- nethack-3.4.3/src/botl.c 2003-12-08 01:39:13.000000000 +0200
++++ nh343hpm/src/botl.c 2004-07-13 17:19:08.163414760 +0300
+@@ -3,6 +3,11 @@
+ /* NetHack may be freely redistributed. See license for details. */
+
+ #include "hack.h"
++#if defined(HPMON) && defined(TEXTCOLOR)
++# ifndef WINTTY_H
++# include "wintty.h"
++# endif
++#endif
+
+ #ifdef OVL0
+ extern const char *hu_stat[]; /* defined in eat.c */
+@@ -248,6 +253,9 @@
+ char newbot2[MAXCO];
+ register char *nb;
+ int hp, hpmax;
++#ifdef HPMON
++ int hpcolor, hpattr;
++#endif
+ int cap = near_capacity();
+
+ hp = Upolyd ? u.mh : u.uhp;
+@@ -256,6 +264,15 @@
+ if(hp < 0) hp = 0;
+ (void) describe_level(newbot2);
+ Sprintf(nb = eos(newbot2),
++#ifdef HPMON
++ "%c:%-2ld HP:", oc_syms[COIN_CLASS],
++#ifndef GOLDOBJ
++ u.ugold
++#else
++ money_cnt(invent)
++#endif
++ );
++#else /* HPMON */
+ "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[COIN_CLASS],
+ #ifndef GOLDOBJ
+ u.ugold,
+@@ -263,6 +280,39 @@
+ money_cnt(invent),
+ #endif
+ hp, hpmax, u.uen, u.uenmax, u.uac);
++#endif /* HPMON */
++#ifdef HPMON
++ curs(WIN_STATUS, 1, 1);
++ putstr(WIN_STATUS, 0, newbot2);
++
++ Sprintf(nb = eos(newbot2), "%d(%d)", hp, hpmax);
++#ifdef TEXTCOLOR
++ if (iflags.use_color) {
++ curs(WIN_STATUS, 1, 1);
++ hpattr = ATR_NONE;
++ if(hp == hpmax){
++ hpcolor = NO_COLOR;
++ } else if(hp > (hpmax*2/3)) {
++ hpcolor = CLR_GREEN;
++ } else if(hp <= (hpmax/3)) {
++ hpcolor = CLR_RED;
++ if(hp<=(hpmax/10))
++ hpattr = ATR_BLINK;
++ } else {
++ hpcolor = CLR_YELLOW;
++ }
++ if (hpcolor != NO_COLOR)
++ term_start_color(hpcolor);
++ if(hpattr!=ATR_NONE)term_start_attr(hpattr);
++ putstr(WIN_STATUS, hpattr, newbot2);
++ if(hpattr!=ATR_NONE)term_end_attr(hpattr);
++ if (hpcolor != NO_COLOR)
++ term_end_color();
++ }
++#endif /* TEXTCOLOR */
++ Sprintf(nb = eos(newbot2), " Pw:%d(%d) AC:%-2d",
++ u.uen, u.uenmax, u.uac);
++#endif /* HPMON */
+
+ if (Upolyd)
+ Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel);