From 25f97748d5e26f61e7f83f93bfc60f8d3acfcec3 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 7 Jul 2024 23:12:01 -0400 Subject: [PATCH] add heart ring, slowly regenerate health --- Items/magic_rings.asm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Items/magic_rings.asm b/Items/magic_rings.asm index f8fbc15..5905e51 100644 --- a/Items/magic_rings.asm +++ b/Items/magic_rings.asm @@ -65,4 +65,22 @@ org $06ECBF JSL MagicRing_CheckForBlast pullpc -; Heart - Slowly regenerate hearts \ No newline at end of file +; Heart - Slowly regenerate hearts +MagicRings_CheckForHeart: +{ + LDA.l MAGICRINGS : AND.b #$01 : BEQ ++ + LDA.l CURHP : CMP.l MAXHP : BCS ++ + LDA.l FrameCounter : LSR #2 : AND.b #$3F : BEQ + + JMP ++ + + + LDA.l CURHP : CLC : ADC.b #$01 : STA.l CURHP + ++ + LDA.b $F5 + AND.b #$80 + RTL +} + +pushpc +org $07810C + JSL MagicRings_CheckForHeart +pullpc \ No newline at end of file