From 34334bc30c0c46acfa73534e64f6fd22863dbdc0 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 30 Mar 2024 16:47:46 -0400 Subject: [PATCH] Prevent Link from taking spike floor damage while jumping --- Items/jump_feather.asm | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Items/jump_feather.asm b/Items/jump_feather.asm index e5ec7d0..ab752cf 100644 --- a/Items/jump_feather.asm +++ b/Items/jump_feather.asm @@ -12,7 +12,20 @@ org $07AFF8 ; LinkItem_BugCatchingNet RTS } -; ============================================================================= +; ========================================================= +; Prevent Link from taking damage while jumping spikes +; The game originally differentiates between your armor +; for the damage take, however the table has all the same +; values, so it's effectively useless. + +; TileDetect_MainHandler_no_moon_pearl +; org $07D23D +org $07D242 + JSL CheckIfJumpingForSpikeDamage + NOP #2 +warnpc $07D248 + +; ========================================================= org $2B8000 LinkItem_JumpFeather: @@ -59,5 +72,25 @@ LinkItem_JumpFeather: RTL } +; ========================================================= +; Y contains our armor value +; Currently requires a very close jump and will still +; damage the player midair if you jump from too far away. + +CheckIfJumpingForSpikeDamage: +{ + PHB : PHK : PLB + LDA $29 : BNE .airborne + LDA.w .spike_floor_damage, Y : STA.w $0373 + .airborne + PLB + RTL + + .spike_floor_damage + db $08 ; green + db $08 ; blue + db $04 ; red +} + print "End of Items/jump_feather.asm ", pc pushpc \ No newline at end of file