From 99d426bc1e86adbca74501d614a5c1b04b7ef5de Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Mon, 8 Jun 2026 00:11:01 -0500 Subject: [PATCH] Bitflag to block silverless damage on phase 4 ganon --- dialog.asm | 2 +- gk/special_weapons.asm | 2 +- gk/variable_ganon_vulnerability.asm | 15 +++++++++------ goalitem.asm | 3 +++ swordswap.asm | 2 +- tables.asm | 4 ++++ 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/dialog.asm b/dialog.asm index 8625c85..c536740 100644 --- a/dialog.asm +++ b/dialog.asm @@ -304,7 +304,7 @@ DialogGanon2: BCS + LDA.w #$018D : JMP .done + - LDA.l GanonVulnerabilityItem : AND.w #$00FF + LDA.l GanonVulnerabilityItem : AND.w #$007F BEQ .silver_arrows CMP.w #$0001 : BEQ .silver_arrows CMP.w #$0004 : BEQ .bombs diff --git a/gk/special_weapons.asm b/gk/special_weapons.asm index da1847a..22c5d25 100644 --- a/gk/special_weapons.asm +++ b/gk/special_weapons.asm @@ -1,6 +1,6 @@ DamageClassCalc: PHA - LDA.l GanonVulnerabilityItem : BEQ + + LDA.l GanonVulnerabilityItem : AND.b #$7F : BEQ + LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE + PLA JSL Ganon_CheckAncillaVulnerability diff --git a/gk/variable_ganon_vulnerability.asm b/gk/variable_ganon_vulnerability.asm index 20acb5d..ef9b688 100644 --- a/gk/variable_ganon_vulnerability.asm +++ b/gk/variable_ganon_vulnerability.asm @@ -4,12 +4,14 @@ Ganon_CheckAncillaVulnerability: PLA PHX : PHA LDA.l GanonVulnerabilityItem - BMI .no_weakness + BVS .no_weakness + AND.b #$7F TAX : PLA CMP.l Ganon_CheckByAncilla, X : BNE + PLX : BRA .vulnerable + PLX : PHA LDA.l GanonVulnerabilityItem + AND.b #$7F BEQ .silver_arrows CMP.b #$01 : BEQ .silver_arrows CMP.b #$11 : BEQ .somaria @@ -34,6 +36,7 @@ Ganon_CheckAncillaVulnerability: .vulnerable PHX LDA.l GanonVulnerabilityItem + AND.b #$7F TAX LDA.l Ganon_IFrameDuration, X PLX @@ -52,7 +55,7 @@ Ganon_CheckAncillaVulnerability: RTL ;-------------------------------------------------------------------------------- Ganon_CheckPowderVulnerability: - LDA.l GanonVulnerabilityItem : CMP.b #$05 : BNE .normal + LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$05 : BNE .normal LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE .normal LDA.w $0EE0, X : BNE .normal ; ganon has i-frames LDA.l Ganon_IFrameDuration+$05 @@ -69,7 +72,7 @@ Ganon_CheckPowderVulnerability: Ganon_CheckBeeVulnerability: ; X is bee sprite index ; Y is target sprite index - LDA.l GanonVulnerabilityItem : CMP.b #$10 : BNE .normal + LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$10 : BNE .normal LDA.w SpriteTypeTable, Y : CMP.b #$D7 : BNE .normal LDA.w $0EE0, Y : BNE .normal ; ganon has i-frames LDA.l Ganon_IFrameDuration+$10 @@ -88,14 +91,14 @@ Ganon_CheckInvincible: LDA.w $04C5 : CMP.b #$02 : BEQ .not_transparent LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE .transparent ; non-stunned ganon LDA.w UseY1 : AND.b #$0A : BEQ .transparent ; normal behavior if not hammering - LDA.l GanonVulnerabilityItem : CMP.b #$0C : BNE .transparent + LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$0C : BNE .transparent .not_transparent LDA.b #$00 : RTL .transparent LDA.b #$01 : RTL ;-------------------------------------------------------------------------------- Ganon_CheckHammerVulnerability: - LDA.l GanonVulnerabilityItem : CMP.b #$0C : BNE .normal + LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$0C : BNE .normal LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE .normal LDA.w $0EE0, X : BNE .normal ; ganon has i-frames LDA.l Ganon_IFrameDuration+$0C @@ -108,7 +111,7 @@ Ganon_CheckHammerVulnerability: ;-------------------------------------------------------------------------------- CheckBeeBoss: ; Y is sprite index - LDA.l GanonVulnerabilityItem : CMP.b #$10 : BNE .normal + LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$10 : BNE .normal LDA.w SpriteTypeTable, Y : CMP.b #$D7 : BNE .normal LDA.b #$00 : RTL .normal diff --git a/goalitem.asm b/goalitem.asm index f5318f9..3223c15 100644 --- a/goalitem.asm +++ b/goalitem.asm @@ -1,5 +1,8 @@ GoalItemGanonCheck: LDA.w SpriteTypeTable, X : CMP.b #$D6 : BNE .success ; skip if not ganon + LDA.l GanonVulnerabilityItem : BPL + + LDA.w SpriteActivity, X : CMP.b #$12 : BEQ .fail + + LDA.b #$01 : JSL CheckConditionPass BCS .success diff --git a/swordswap.asm b/swordswap.asm index 144c891..e62b5bd 100644 --- a/swordswap.asm +++ b/swordswap.asm @@ -101,7 +101,7 @@ CheckGanonHammerDamage: LDA.w SpriteTypeTable, X : CMP.b #$D8 ; original behavior except ganon RTL + - LDA.l GanonVulnerabilityItem : CMP.b #$0C : BEQ .hammer_silvers + LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$0C : BEQ .hammer_silvers LDA.w SpriteTypeTable, X : CMP.b #$D6 ; original behavior RTL diff --git a/tables.asm b/tables.asm index f0c2197..66f3a18 100644 --- a/tables.asm +++ b/tables.asm @@ -105,6 +105,10 @@ db $00 ;-------------------------------------------------------------------------------- org $B0802E GanonVulnerabilityItem: +; sn-i iiii +; s - immune to sword spins in phase 4 +; n - immune to all items +; i - index of item vulnerability db $00 ; $00 = default behavior (silver arrows) ;-------------------------------------------------------------------------------- org $B0902F