From 1b36e7672ef95c39d5046018dc840603927a8a69 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Sun, 19 Mar 2023 03:07:47 -0500 Subject: [PATCH] Randomize Ganon items --- data/damage_table.bin | Bin 2048 -> 2048 bytes data/i18n_en.bin | Bin 29524 -> 29525 bytes dialog.asm | 2 +- hooks.asm | 8 ++++++ ram.asm | 2 +- tables.asm | 2 +- variable_ganon_vulnerability.asm | 47 +++++++++++++++++++++++++++++++ 7 files changed, 58 insertions(+), 3 deletions(-) diff --git a/data/damage_table.bin b/data/damage_table.bin index 1fd15f2184cb741f4a9f5ad0b2118e722346e88d..557656e43d58d9acefdf29c32228e617030a9cc8 100644 GIT binary patch delta 14 VcmZn=Xb{-2hmDbC^IkS*MgSva1X2J1 delta 14 VcmZn=Xb{-2hmDbG^IkS*MgSvO1W*6~ diff --git a/data/i18n_en.bin b/data/i18n_en.bin index 15372367277e1fd8761b123147b8e5ddd198f447..bb23181506d25210420e403dae90330ebde92fc4 100644 GIT binary patch delta 114 zcmXBM!41MN5JXX>ELVdNCDFw?USeaMfwcjp2GT;Bm;*TCG}3?4e70fThUwr=HQion z^gvOQd13@|jc7d;&pY0s^Cg*n4S{L=?~bU{7P~&4l9f?Pzo1uTMG;Fvzt}9i9^Kjf E02-4~P5=M^ delta 18 acmccmjPc4d#tre7n-5t|ww(OHG6?`)Hwj1p diff --git a/dialog.asm b/dialog.asm index e268b8a..3a88e38 100644 --- a/dialog.asm +++ b/dialog.asm @@ -252,8 +252,8 @@ DialogGanon2: LDA.w #$018D : JMP .done + JSL CheckMushroom - LDA.w #$0198 : JMP .done BCC + + LDA.w #$0198 : JMP .done + LDA.l GanonVulnerabilityItem : AND #$00FF : BNE .special_item LDA.l SpecialWeapons : AND.w #$00FF diff --git a/hooks.asm b/hooks.asm index 6c5f106..f3a1b5e 100644 --- a/hooks.asm +++ b/hooks.asm @@ -2694,3 +2694,11 @@ db $00, $EE, $DE, $D4, $D0, $D4, $DE, $EE org $05A4BD JSL SetLanmolaVelocity BRA + : NOP #4 : + + +; ganon - silvers just don't work like they used to +org $0DB93D +db $08 + +; ganon - randomize vulnerability when stunned +org $1D9010 +JSL StunGanon : NOP diff --git a/ram.asm b/ram.asm index 0b75f5f..1b2c57e 100644 --- a/ram.asm +++ b/ram.asm @@ -525,7 +525,7 @@ OHKOFlag: skip 1 ; Any non-zero write sets OHKO mode SpriteSwapper: skip 1 ; Loads new link sprite and glove/armor palette. No gfx or ; code currently in base ROM for this. BootsModifier: skip 1 ; $01 = Give dash ability -skip 1 ; Unused +GanonVulnerabilityItem: skip 1 ; Item Ganon is vulnerable to while stunned ; Crypto Block ($7F50D0 - $7F51FF) KeyBase: skip $10 ; y: skip 4 ; diff --git a/tables.asm b/tables.asm index 4280a19..c39b7b6 100644 --- a/tables.asm +++ b/tables.asm @@ -105,7 +105,7 @@ ChallengeModes: db #$00 ; #$00 = Default behavior; ;-------------------------------------------------------------------------------- org $30802E ; PC 0x18003E -GanonVulnerabilityItem: +DONOTUSE__GanonVulnerabilityItem: db #$00 ; #$00 = Default behavior (silver arrows) ;-------------------------------------------------------------------------------- org $30802F ; PC 0x18003F diff --git a/variable_ganon_vulnerability.asm b/variable_ganon_vulnerability.asm index 4ff68e3..438f65e 100644 --- a/variable_ganon_vulnerability.asm +++ b/variable_ganon_vulnerability.asm @@ -126,6 +126,53 @@ CheckBeeBoss: RTL ; return non-zero A if entity is a boss (and bee should not attack) ;-------------------------------------------------------------------------------- +StunGanon: + JSL GetRandomInt + BIT.b #$30 + BEQ .non_magic +.magic + AND.b #$0E + LSR + BRA .chosen +.non_magic + AND.b #$0C + LSR #2 + ORA.b #$08 +.chosen + PHX + TAX + LDA.l Ganon_RandomizeItem, X + STA.l GanonVulnerabilityItem + PLX + JSL DialogItem + LDA.b #$D7 + STA.w $0E20, X + RTL +;-------------------------------------------------------------------------------- +DialogItem: + PHX : PHY + LDA.l GanonVulnerabilityItem + ASL + TAX + LDA.l Ganon_TextBox+1, X + TAY + LDA.l Ganon_TextBox, X + JSL Sprite_ShowMessageUnconditional + PLY : PLX + RTL +;-------------------------------------------------------------------------------- +Ganon_RandomizeItem: +db #$05, #$06, #$07, #$08 +db #$09, #$0A, #$11, #$12 +db #$01, #$02, #$03, #$0C +;-------------------------------------------------------------------------------- +Ganon_TextBox: +dw #$0000 ; default behavior--assume silvers +dw #$0199, #$019A, #$019B, #$019C, #$019D +dw #$019E, #$019F, #$01A0, #$01A1, #$01A2 +dw #$0000, #$01A3, #$0000, #$0000, #$0000 +dw #$01A4, #$01A5, #$01A6, #$0000, #$0000 +;-------------------------------------------------------------------------------- Ganon_CheckByAncilla: db #$00 ; default behavior--we shouldn't be checking the table here anyway db #$00, #$05, #$1F, #$07, #$00