unit: dealy to active now automatically sets player turn done when the player is...
authorLukas Krickl <lukas@krickl.dev>
Thu, 28 Aug 2025 07:59:50 +0000 (09:59 +0200)
committerLukas Krickl <lukas@krickl.dev>
Thu, 28 Aug 2025 07:59:50 +0000 (09:59 +0200)
src/player.s
src/unit.s

index 2a67824bce29202673f54f76c8764dcd6754e6b8..52b016ac3af83bd941862e298d35c938963cd1fb 100644 (file)
@@ -323,7 +323,7 @@ unit_player_attack:
 unit_player:
   st_def 0x00, unit_player_init, st_unit_idle
   act_def ACT_T_DEMO_1, 0, 2, 2, 0
-  act_stat_def1 1, 1, 1, 1
+  act_stat_def1 1, 3, 1, 1
   act_stat_def2 1, 1, 90, 1 
   act_st_def st_unit_player_update, st_unit_idle
   act_def_meta player_draw, 0x8C, OAM_FPRIO, NULL
index 7e9307020382c0a5f4b7342420da388d11a1349e..6202662a65f24a36997bb513c8a6e0f2e805228c 100644 (file)
@@ -752,9 +752,22 @@ unit_sleep:
   ; this call also checks if the unit may need to 
   ; hand over control to a new unit
   ; this is done when moves are 0
+       ; if the player unit is here we set the turn as finished
   ; inputs:
   ;   de: unit
 unit_delay_to_active:
+       ; check if de is player
+       ; if so set turn as finished
+       ld a, player_unit LO
+       cp a, e 
+       jr nz, @not_player REL
+       ld a, player_unit HI
+       cp a, d 
+       jr nz, @not_player REL
+       
+       call unit_set_player_turn_taken
+
+@not_player:
        ; do not proceed if an attack animation is ongoing
        ld a, [gameplay_flags]
        and a, GPF_ATTACK_ONGOING