summarylogtreecommitdiffstats
path: root/hpmon.diff
blob: 6b14c825dfb6209a01627fd7485a17c34acb8d72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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);