From: Lukas Krickl Date: Sun, 17 Aug 2025 12:54:42 +0000 (+0200) Subject: action: Added delay to active after picking an attack direction X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=363d8c74df9e797952c5dd744a191844c46c554a;p=gbrg%2F.git action: Added delay to active after picking an attack direction --- diff --git a/src/action.s b/src/action.s index c16c81d..4ac3b49 100644 --- a/src/action.s +++ b/src/action.s @@ -120,7 +120,8 @@ unit_action_pick_direction: ; returns: ; bc: next action unit_action_attack: - jp unit_switch_to_active + call ui_status_line_clear + ld bc, st_unit_delay_to_active_template ret ; default attack state diff --git a/src/defs.s b/src/defs.s index 723d9e7..bf8d2d6 100644 --- a/src/defs.s +++ b/src/defs.s @@ -364,4 +364,9 @@ #define DISTANCE_BGTA 1 #define DISTANCE_AGTB 0 - + + ; alias for directions +.def int DIRUP = BTNUP +.def int DIRDOWN = BTNDOWN +.def int DIRLEFT = BTNLEFT +.def int DIRRIGHT = BTNRIGHT diff --git a/src/strings.s b/src/strings.s index 830996d..8fc0da3 100644 --- a/src/strings.s +++ b/src/strings.s @@ -54,6 +54,10 @@ STR_DELETE: STR_ATTACK_DIRECTION: .str "attack direction?" +.db 0 + +STR_STATUS_CLEAR: +.str " " .db 0 ; print a 0-terminated string to the screen diff --git a/src/ui.s b/src/ui.s index 617a608..8805fe5 100644 --- a/src/ui.s +++ b/src/ui.s @@ -25,9 +25,15 @@ ui_redraw_hp: ld hl, STR_TEST ld de, shadow_ui + 34 call puts - ret - + + ; clears the status line + ; and requests a UI redraw +ui_status_line_clear: + ld hl, STR_STATUS_CLEAR + ld de, UI_STATUS_LINE + call puts + jp ui_request_redraw ; requests a redraw ; this will set up redraw_bg