Bitflag to block silverless damage on phase 4 ganon

This commit is contained in:
2026-06-08 00:11:01 -05:00
parent 82ce1628e6
commit 99d426bc1e
6 changed files with 19 additions and 9 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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