#define TMP_ICON 0x37
#define TATK_ICON 0x3B
#define TDEF_ICON 0x3C
+
#define THP_BAR_START 0x34
+#define THP_BAR_SINGLE_EMPTY 0x3E
+#define THP_BAR_SINGLE_FULL 0x3D
+
; sets up static parts of the UI
; all other parts are drawin by ui_draw
ret
+ ; draw a single item only
+ ; inputs:
+ ; b: current bar value (either 1 or 0)
+ ; hl: screen location
+ui_draw_bar_single:
+ ld a, b ; b = current
+
+ cp a, 0
+ jp z, @draw_empty
+@draw_full:
+ ld a, THP_BAR_SINGLE_FULL
+ ld [hl+], a
+ ret
+@draw_empty:
+ ld a, THP_BAR_SINGLE_EMPTY
+ ld [hl+], a
+ ret
+
; draws a UI bar
; the bar will be filled up to hp/mp
; al others will be empty
; hl: screen location
; [de]: ptr to hp/mp where hp/mp max is [de+1]
ui_draw_bar:
+ ld a, [de] ; load non-max value
+ inc de ; move to max value
+ ld b, a ; b = current value
+ ; check if we only need a single obj
+ ld a, [de] ; a = max value
+
+ cp a, 1
+ jp c, ui_draw_bar_single
+ jp z, ui_draw_bar_single
+ ; first we draw the filled bar
ld a, THP_BAR_START
ld [hl+], a
inc a
#define PLAYER_DEFAULT_HP 3
#define PLAYER_DEFAULT_MP 3
-#define PLAYER_DEFAULT_DEF 1
+#define PLAYER_DEFAULT_DEF 0
#define PLAYER_DEFAULT_ATK 1
; struct player