From f500950e51793aaba1e1e5abb26e0afde50efcc8 Mon Sep 17 00:00:00 2001 From: Karkat Date: Sat, 6 Jan 2018 22:48:26 -0500 Subject: [PATCH] fairy revival counter --- hooks.asm | 3 +++ stats.asm | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/hooks.asm b/hooks.asm index adb661f..91821b5 100644 --- a/hooks.asm +++ b/hooks.asm @@ -106,6 +106,9 @@ JSL.l IncrementSmallKeys org $00F945 ; <- 7945 - Bank00.asm : 8557 (JSL SavePalaceDeaths) JSL.l StatTransitionCounter ; we're not bothering to restore the instruction we wrote over ;-------------------------------------------------------------------------------- +org $09F443 ; <- 4F443 - module_death.asm : 257 (STA $7EF35C, X) +JSL.l IncrementFairyRevivalCounter +;-------------------------------------------------------------------------------- org $02B6F3 ; <- 136F3 - Bank02.asm : 8600 (LDA.b #$0F : STA $10) JSL.l DungeonExitTransition ;-------------------------------------------------------------------------------- diff --git a/stats.asm b/stats.asm index d359700..f0ff4a7 100644 --- a/stats.asm +++ b/stats.asm @@ -115,7 +115,7 @@ ; s - swordless bosses ; c - capacity upgrades ;-------------------------------------------------------------------------------- -; $7EF453 - unused +; $7EF453 - fairy revival counter ;-------------------------------------------------------------------------------- ; $7EF454w[2] - challenge timer (low) ;-------------------------------------------------------------------------------- @@ -224,6 +224,18 @@ IncrementSmallKeys: PLX RTL ;-------------------------------------------------------------------------------- +IncrementSmallKeysNoPrimary: + STA $7EF36F ; thing we wrote over, write small key count + + PHX + LDA !LOCK_STATS : BNE + + JSL AddInventory_incrementKeyLong + + + JSL.l UpdateKeys + JSL.l HUD_RebuildLong + PLX +RTL +;-------------------------------------------------------------------------------- DecrementSmallKeys: STA $7EF36F ; thing we wrote over, write small key count JSL.l UpdateKeys @@ -248,6 +260,16 @@ IncrementDeathCounter: PLA RTL ;-------------------------------------------------------------------------------- +!FAIRY_COUNTER = "$7EF453" +IncrementFairyRevivalCounter: + STA $7EF35C, X ; thing we wrote over + PHA + LDA !LOCK_STATS : BNE + + LDA !FAIRY_COUNTER : INC : STA !FAIRY_COUNTER + + + PLA +RTL +;-------------------------------------------------------------------------------- !CHEST_COUNTER = "$7EF442" IncrementChestCounter: LDA.b #$01 : STA $02E9 ; thing we wrote over