pop hl
ret
+
+
+ ; draws the last d16 result
+ ; at a tile position for n frames
+ ; inputs:
+ ; b/c: y/x tile
+ ; a: dice display flags/0
+ ; d16: roll to display
+dice_display_set:
+ ; set flags
+ ld a, [dd_flags]
+
+ ; set timer
+ ld a, DD_TIME
+ ld [dd_timer], a
+
+ ; set position
+ ld a, b
+ ld [dd_y], a
+ ld a, c
+ ld [dd_x], a
+
+ ld b, DD_D0_TILE
+ ld a, [d16]
+ add a, b ; d0 + roll value of d16
+ ld a, [dd_d16] ; tile to display
+
+
+ ret
+
+ ; updates dice display if the timer is not 0
+dice_display_update:
+ ld a, [dd_timer]
+ cp a, 0
+ ret z
+
+ dec a ; timer--
+ ld [dd_timer], a
+
+
+
+ ret
; status text buffer
status_text: .adv 32
+; dice display
+; display the last d16 result
+; at tile y/x for time frames
+dd_d16: .adv 1
+dd_flags: .adv 1
+dd_y: .adv 1
+dd_x: .adv 1
+dd_timer: .adv 1
+
; current best init found in units_next
unit_next_best_init: .adv 1
unit_next_best_act_ptr: .adv 2