From: Lukas Krickl Date: Mon, 18 Nov 2024 17:04:04 +0000 (+0100) Subject: Added who_next call X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=f6c19cf0ae20dc7b8d701e5c87f9cbd2960e5ecc;p=gbrg%2F.git Added who_next call --- diff --git a/src/actor.s b/src/actor.s index b617ffc..806cfbe 100644 --- a/src/actor.s +++ b/src/actor.s @@ -128,3 +128,18 @@ anim_move: ld a, b ret + + ; advance to the next actor + ; effectively ending the current actor's turn +who_next: + ld a, [who] + inc a ; who++ + + ; if who > actor_max + ; go to player + cp a, ACTORS_MAX + jr z, @no_player REL + ld a, WHO_PLAYER +@no_player: + ld [who], a + ret