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
; 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
; 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