; check if dead
; if so set type to 0
call unit_cpu_check_dead
+ ldnull bc
ret z
+
; check if player has taken turn
; if not exit
ldnull bc
and a, GPF_PLAYER_TURN_TAKEN
ret z
+ ; attempt an attack
+ ; and jump to move made if attack was performed
+ call unit_cpu_attack_player
+ cp a, 0
+ jp nz, @move_made
+
; clear move made buffer
xor a, a
ld [MOVE_MADE], a
#undefine MOVE_MADE
+ ; performs an attack
+ ; in the direction of the player
+ ; checks if player is on tile next to current unit
+ ; inputs:
+ ; de: actors
+ ; returns:
+ ; a: 1 attack performed
+ ; a: 0 no attack
+unit_cpu_attack_player:
+ ld a, 0 ; no attack
+ ret
+
; moves actor into a random direction
; inputs:
; de: actor