; when units want to draw
.de DRAWF_SKIP_UNIT_OBJS, 1
+
; gameplay flags
.se 1
; so that objects are behind the tile
.de CF_COVERED, 8
+ ; player special flags
+ ; set if player is currently on a covered tile.
+ ; this can be used for drawing units that
+ ; are inside
+.def int PLAYERSF_CF_COVERED = CF_COVERED
+
; cells struct
.se 0
.de c_tile, 1
or a, OAM_FXFLIP
ld [hl], a
pop de
+
+ ; check if the player is currently
+ ; on a convered tile or not
+ push de
+ call unit_get_pos
+ call map_get_tile
+ ; a = tile flags
+ and a, CF_COVERED
+ ld b, a
+ ld a, [player_rt_special_flags]
+ and a, (~CF_COVERED) & 0xFF
+ or a, b
+ ld [player_rt_special_flags], a
+ pop de
; check for exit flags
push de
draw_flags: .adv 1
gameplay_flags: .adv 1
+
+ ; special flags that are set by the player unit
+player_rt_special_flags: .adv 1
; shadow UI is a buffer for drawing the UI
; this UI is then re-drawn on request in vblank
player_unit: .adv 0
p0_units: .adv act_size * UNITS_MAX
+
; list of seeds used
; for the current maps
; fill using mapgen_seed