From 7de70f483c6a428986e6fde627f35ceb1975f656 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 5 Sep 2025 06:23:38 +0200 Subject: [PATCH] rest: Added healded for display --- src/action.s | 5 +++++ src/action_menu.s | 6 ++++++ src/stats.s | 6 ++++++ src/strings.s | 4 ++++ 4 files changed, 21 insertions(+) diff --git a/src/action.s b/src/action.s index 02fbf45..43ee5af 100644 --- a/src/action.s +++ b/src/action.s @@ -272,8 +272,13 @@ unit_action_attack_damage_calc: unit_action_rest: ld a, 1 call stat_heal_by + push af call ui_redraw_player call ui_request_redraw + + ld hl, STR_HEALDED_FOR + pop af + call ui_draw_status_stat ldnull bc ret diff --git a/src/action_menu.s b/src/action_menu.s index 494ca11..f4dc62a 100644 --- a/src/action_menu.s +++ b/src/action_menu.s @@ -8,17 +8,23 @@ str_am_eat: str_am_rest: .str "rest" +.db 0 + +str_am_pick_up: +.str "pick up" .db 0 ; label action_menu_str_table: dw str_am_attack + dw str_am_pick_up dw str_am_eat dw str_am_rest action_menu_str_table_end: ; map to actions action_menu_action_table: + dw st_action_attack_init dw st_action_attack_init dw st_action_attack_init dw st_action_rest diff --git a/src/stats.s b/src/stats.s index 7119d3c..fbf89d2 100644 --- a/src/stats.s +++ b/src/stats.s @@ -159,7 +159,10 @@ stat_calc_physical_damage_vs: ; inputs: ; de: actor ; a: amount + ; returns: + ; a: actual heal amount stat_heal_by: + push af ; push original a value ld b, a ; b = amount to heal by ld hl, act_hp add hl, de @@ -177,11 +180,14 @@ stat_heal_by: ; a > b? (max > new value) jr nc, @overheal REL ld [hl], a ; write new value + pop af ; return input value ret @overheal: ; set to max ld a, b ld [hl], a ; write max into hp + pop af + xor a, a ; no healing was done ret ; calculates the real speed state diff --git a/src/strings.s b/src/strings.s index 0b4bc2c..453ecae 100644 --- a/src/strings.s +++ b/src/strings.s @@ -75,6 +75,10 @@ STR_MISS: .str "miss" .db 0 +STR_HEALDED_FOR: +.str "healed for " +.db 0 + STR_SLASH: .str "/" .db 0 -- 2.30.2