From 43515851c1e930de21e64a6e59776e28fa529589 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Sun, 7 Jun 2026 21:35:34 -0500 Subject: [PATCH] orange potion --- LTTP_RND_GeneralBugfixes.asm | 1 + data/c2e3e.bin | Bin 2048 -> 2048 bytes data/c2e3e.gfx | Bin 1545 -> 1555 bytes data/customitems.4bpp | Bin 5120 -> 5120 bytes data/newitems.pal | Bin 768 -> 768 bytes events.asm | 72 ++++++++++++++++++----------------- fileselect.asm | 7 +++- gk/data/item_mapping.asm | 2 +- gk/data/junk_items.asm | 2 +- gk/orange_potion.asm | 34 +++++++++++++++++ hooks.asm | 16 ++++++++ itemdatatables.asm | 12 +++--- newitems.asm | 2 +- shopkeeper.asm | 1 + 14 files changed, 105 insertions(+), 44 deletions(-) create mode 100644 gk/orange_potion.asm diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 5d20f34..68f0030 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -206,6 +206,7 @@ warnpc $A38000 org $B98000 incsrc gk/crystalswitchbook.asm +incsrc gk/orange_potion.asm incsrc gk/mimicdash.asm incsrc gk/gloom.asm incsrc gk/special_weapons.asm diff --git a/data/c2e3e.bin b/data/c2e3e.bin index f6b100cea1c09cebbeb0f8d56e795e357956f662..2471c19d40b639cfec380dd88095b833d515c690 100644 GIT binary patch delta 28 kcmZn=Xb{+Nfr(%G`TqFt^55$Z)_<=T|NnpUeI`X#0Km8n;{X5v delta 16 XcmZn=Xb{+NfoXCBlj!EBOwz0XGam(q diff --git a/data/c2e3e.gfx b/data/c2e3e.gfx index a894e266bb69111a8c0e2cf930cfcc647b4731f0..0665d324bcb6005764e7c17c90340f0398434b65 100644 GIT binary patch delta 28 kcmeC=nas1nor%9ykCFYm{P+5U_227zV;DF4Fzsaq0G163T*hs1= zWbqMpZ5&i^3&9aA1{vl$pyz|HIK|;KS(Dv19b}MrJ1|biX`SH)4H;YKdu5F^P7sku zf|h2@2F1h8W&8HtlTvGA?0<+tV9*Ed%pr$S6owJ&_7fhlglGA1Btf}eJ8P)G#!|*A z%a{64Ep@l*d3Ji$nN4RaEz%jC(f|XD5YQ`u=!-t+94kD+11wAaLO}2tKc^OqTO)d< z1?|!WZQE<3HS&oAdC9oXz=sq3W3yc49p?M?{#Y0DV!p4mP#~bSKlaJ-Z65WO5}t5R J#GPP+;1{WEh714z delta 32 jcmZqBXwcZuz%#i~;QwR+UiZnzcy~eBj++ngJFox%*MJP6 diff --git a/data/newitems.pal b/data/newitems.pal index 4d2e0ec584595b0d1073209297bf8355b4b6b960..c549cf98abbf485c30f9c2a6d003b5cfad22e5d8 100644 GIT binary patch delta 39 xcmV+?0NDS427m^T*cgb2i2wip&M_EDlrfyvb15k)|JFIZj3JTXk+XpTe*u1k64(F$ delta 17 YcmZo*YhasjW8$a&NsLmP8yV{v0Yak&=>Px# diff --git a/events.asm b/events.asm index 5a7f974..9574667 100644 --- a/events.asm +++ b/events.asm @@ -1,14 +1,14 @@ OnPrepFileSelect: - LDA.b GameSubMode : CMP.b #$03 : BNE + - LDA.b #$06 : STA.b NMISTRIPES ; thing we wrote over - RTL - + - PHA : PHX - REP #$10 - JSL LoadAlphabetTilemap - JSL LoadFullItemTiles - SEP #$10 - PLX : PLA + LDA.b GameSubMode : CMP.b #$03 : BNE + + LDA.b #$06 : STA.b NMISTRIPES ; thing we wrote over + RTL + + + PHA : PHX + REP #$10 + JSL LoadAlphabetTilemap + JSL LoadFullItemTiles + SEP #$10 + PLX : PLA RTL ;-------------------------------------------------------------------------------- OnDrawHud: @@ -22,17 +22,17 @@ JML ReturnFromOnDrawHud ;-------------------------------------------------------------------------------- OnDungeonEntrance: STA.l PegColor ; thing we wrote over - JSL MaybeFlagDungeonTotalsEntrance - LDA.w #$0001 : STA.l UpdateHUDFlag - SEP #$30 - JSL DynamicDropGFXClear - REP #$30 + JSL MaybeFlagDungeonTotalsEntrance + LDA.w #$0001 : STA.l UpdateHUDFlag + SEP #$30 + JSL DynamicDropGFXClear + REP #$30 RTL ;-------------------------------------------------------------------------------- OnDungeonBossExit: - JSL StatTransitionCounter - JSL ClearMultiworldText - JSL DynamicDropGFXClear + JSL StatTransitionCounter + JSL ClearMultiworldText + JSL DynamicDropGFXClear RTL ;-------------------------------------------------------------------------------- OnPlayerDead: @@ -41,40 +41,44 @@ OnPlayerDead: JSL DynamicDropGFXClear JSL SetSilverBowMode JSL RefreshRainAmmo + LDA.b #$00 + STA.l InfiniteMagic PLA RTL ;-------------------------------------------------------------------------------- OnDungeonExit: - PHA : PHP - SEP #$20 ; set 8-bit accumulator - JSL SQEGFix - JSL DynamicDropGFXClear - PLP : PLA + PHA : PHP + SEP #$20 ; set 8-bit accumulator + JSL SQEGFix + JSL DynamicDropGFXClear + PLP : PLA - STA.w DungeonID : STZ.w Map16ChangeIndex ; thing we wrote over + STA.w DungeonID : STZ.w Map16ChangeIndex ; thing we wrote over - PHA : PHP - LDA.w #$0001 : STA.l UpdateHUDFlag - JSL HUD_RebuildLong - JSL FloodGateResetInner - JSL SetSilverBowMode - PLP : PLA + PHA : PHP + LDA.w #$0001 : STA.l UpdateHUDFlag + JSL HUD_RebuildLong + JSL FloodGateResetInner + JSL SetSilverBowMode + PLP : PLA RTL ;-------------------------------------------------------------------------------- OnSave: - LDA.b #$70 : PHA : PLB ; thing we wrote over - data bank change + LDA.b #$70 : PHA : PLB ; thing we wrote over - data bank change JSL DarkWorldSaveFix - JML MSUResumeReset + JML MSUResumeReset ;-------------------------------------------------------------------------------- OnQuit: JSL SQEGFix LDA.b #$00 : STA.l AltTextFlag ; bandaid patch bug with mirroring away from text LDA.b #$10 : STA.b MAINDESQ ; thing we wrote over + LDA.b #$00 + STA.l InfiniteMagic RTL ;-------------------------------------------------------------------------------- OnDeathNoSave: - JSL MSUResumeReset - LDA.b #$05 : STA.b $10 ; what we wrote over + JSL MSUResumeReset + LDA.b #$05 : STA.b $10 ; what we wrote over RTL ;-------------------------------------------------------------------------------- OnUncleItemGet: diff --git a/fileselect.asm b/fileselect.asm index 1931199..a85c2a9 100644 --- a/fileselect.asm +++ b/fileselect.asm @@ -82,7 +82,10 @@ DrawBottle: AND.w #$00FF : BNE + LDX.w #FileSelectItems_empty_bottle JMP DrawItemGray - + : DEC #2 : BNE + + + : DEC : BNE + + LDX.w #FileSelectItems_orange_potion + JMP DrawItem + + : DEC : BNE + LDX.w #FileSelectItems_empty_bottle JMP DrawItem + : DEC : BNE + @@ -619,6 +622,8 @@ FileSelectItems: dw #$0282|!FS_COLOR_GREEN, #$0282|!FS_COLOR_GREEN|!FS_HFLIP, #$0292|!FS_COLOR_GREEN, #$0284|!FS_COLOR_GREEN .blue_potion dw #$0282|!FS_COLOR_BLUE, #$0282|!FS_COLOR_BLUE|!FS_HFLIP, #$0292|!FS_COLOR_BLUE, #$0285|!FS_COLOR_BLUE + .orange_potion + dw #$0282|!FS_COLOR_BROWN, #$0282|!FS_COLOR_BROWN|!FS_HFLIP, #$0292|!FS_COLOR_BROWN, #$0286|!FS_COLOR_BROWN .fairy_bottle dw #$0287|!FS_COLOR_YELLOW|!FS_HFLIP, #$0287|!FS_COLOR_YELLOW, #$0296|!FS_COLOR_BLUE, #$0297|!FS_COLOR_BLUE .bee_bottle diff --git a/gk/data/item_mapping.asm b/gk/data/item_mapping.asm index 3e64912..bd1a61e 100644 --- a/gk/data/item_mapping.asm +++ b/gk/data/item_mapping.asm @@ -116,7 +116,7 @@ db !TIER_JUNK ; 62 - RNG pool item (single) db !TIER_JUNK ; 63 - RNG pool item (multi) db !TIER_MAJOR ; 64 - Progressive bow db !TIER_MAJOR ; 65 - Progressive bow -db !TIER_JUNK ; 66 - +db !TIER_HEALTH ; 66 - Potion refill (orange) db !TIER_JUNK ; 67 - db !TIER_JUNK ; 68 - db !TIER_JUNK ; 69 - diff --git a/gk/data/junk_items.asm b/gk/data/junk_items.asm index 87eb7df..56bc64e 100644 --- a/gk/data/junk_items.asm +++ b/gk/data/junk_items.asm @@ -101,7 +101,7 @@ db $00 ; 62 - RNG pool item (single) db $00 ; 63 - RNG pool item (multi) db $00 ; 64 - Progressive bow db $00 ; 65 - Progressive bow -db $00 ; 66 - +db $00 ; 66 - Potion refill (orange) db $00 ; 67 - db $00 ; 68 - db $00 ; 69 - diff --git a/gk/orange_potion.asm b/gk/orange_potion.asm new file mode 100644 index 0000000..4099811 --- /dev/null +++ b/gk/orange_potion.asm @@ -0,0 +1,34 @@ +CheckOrangePotion: + LDA.l BottleContents, X + CMP.b #$01 + BEQ .orange + + ; return to vanilla behavior + CMP.b #$00 + RTL + +.orange + LDA.l InfiniteMagic + BNE .nope + + LDA.b #$02 + STA.l BottleContents, X + + STZ.w $0301 + + LDA.b #$80 + STA.l MagicFiller + + LDA.b #$01 + STA.l InfiniteMagic + + JSL RebuildHUD_update_long + LDA.b #$00 + RTL + +.nope + JSL Sound_SetSfxPanWithPlayerCoords + ORA.b #$3C + STA.w SFX2 + LDA.b #$00 + RTL diff --git a/hooks.asm b/hooks.asm index 22a5ac9..66f8595 100755 --- a/hooks.asm +++ b/hooks.asm @@ -997,6 +997,12 @@ LDA.w BottleListExpanded, X org $89895C ; 4895C - ancilla_init.asm:1344 (LDA PotionList, X) LDA.w PotionListExpanded, X + +org $89895A +LDX.b #$06 + +org $89896A +ADC.b #$01 ;-------------------------------------------------------------------------------- org $86D1EB ; 351EB - sprite_absorbable.asm:364 (STA $7EF375) ; bugbug commented out until i figure out why it doesn't work JSL HandleBombAbsorbtion @@ -1029,6 +1035,7 @@ JSL RefillHealth ;-------------------------------------------------------------------------------- org $80F922 ; <- 7922 - Bank00.asm:8543 - (JSL HUD.RefillMagicPower : BCC .beta) JSL RefillMagic +;-------------------------------------------------------------------------------- ;================================================================================ ; Early Bottle Fix @@ -1165,6 +1172,8 @@ ORA.w #$8000 : STA.w $007E, Y ORA.w #$4000 : STA.w $0084, Y JSL AddYMarker : NOP #2 ;-------------------------------------------------------------------------------- +org $8DF779 ; <- 6F779 (not in disassembly) - mushroom bottle hud tile +dw $20D2, $60D2, $20E2, $202D ; (Orig: $2044, $2045, $2046, $2047) org $8DF789+6 ; <- 6F789+6 (not in disassembly) - red bottle hud tile, lower right dw $2413 ; (Orig: #$24E3) org $8DF789+6+8 ; green bottle hud tile, lower right @@ -2847,3 +2856,10 @@ org $8DFB63 ; bank_0D.asm@18092 (LDA.l $7EF33F, X : AND.w #$00FF) JSL CheckFluteInHUD NOP #3 ;-------------------------------------------------------------------------------- + +;================================================================================ +; Orange Potion (Chateau Romani) +;-------------------------------------------------------------------------------- +org $87A15C ; bank_07.asm@6963 (LDA.l $7EF35C, X) +JSL CheckOrangePotion +;-------------------------------------------------------------------------------- diff --git a/itemdatatables.asm b/itemdatatables.asm index db404d6..0ee9c7d 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -239,7 +239,7 @@ endmacro %ReceiptProps($63, -4, 0, $FF, $F36A, $FF, skip, rng_multi) ; 63 - RNG pool item (multi) %ReceiptProps($64, -4, 0, $FF, $F340, $FF, skip, progressive_bow) ; 64 - Progressive bow %ReceiptProps($65, -4, 0, $FF, $F340, $FF, skip, progressive_bow_2) ; 65 - Progressive bow -%ReceiptProps($66, -4, 0, $FF, $F36A, $FF, skip, skip) ; 66 - +%ReceiptProps($66, -4, 0, $51, $F36E, $FF, skip, skip) ; 66 - Potion refill (yellow) %ReceiptProps($67, -4, 0, $FF, $F36A, $FF, skip, skip) ; 67 - %ReceiptProps($68, -4, 0, $FF, $F36A, $FF, skip, skip) ; 68 - %ReceiptProps($69, -4, 0, $FF, $F36A, $FF, skip, skip) ; 69 - @@ -518,7 +518,7 @@ endmacro %SpriteProps($63, 2, 2, $FF, $FF, $0000) ; 63 - RNG pool item (multi) %SpriteProps($64, 2, 2, $FF, $FF, $0000) ; 64 - Progressive bow %SpriteProps($65, 2, 2, $FF, $FF, $0000) ; 65 - Progressive bow -%SpriteProps($66, 2, 2, $00, $00, $0000) ; 66 - +%SpriteProps($66, 2, 2, $02, $02, $0000) ; 66 - Potion refill (yellow) %SpriteProps($67, 2, 2, $00, $00, $0000) ; 67 - %SpriteProps($68, 2, 2, $00, $00, $0000) ; 68 - %SpriteProps($69, 2, 2, $00, $00, $0000) ; 69 - @@ -794,7 +794,7 @@ endmacro %InventoryItem($63, $0001, $0000, $0000) ; 63 - RNG pool item (multi) %InventoryItem($64, $00A5, $0000, $0000) ; 64 - Progressive bow %InventoryItem($65, $00A5, $0000, $0000) ; 65 - Progressive bow -%InventoryItem($66, $0001, $0000, $0000) ; 66 - +%InventoryItem($66, $0081, $0000, $0000) ; 66 - Potion refill (yellow) %InventoryItem($67, $0001, $0000, $0000) ; 67 - %InventoryItem($68, $0001, $0000, $0000) ; 68 - %InventoryItem($69, $0001, $0000, $0000) ; 69 - @@ -1054,7 +1054,7 @@ ItemReceiptGraphicsOffsets: dw $0 ; 63 - RNG pool item (multi) dw $0 ; 64 - Progressive bow dw $0 ; 65 - Progressive bow - dw $0 ; 66 - + dw $0CE0 ; 66 - Potion refill (yellow) dw $0 ; 67 - dw $0 ; 68 - dw $0 ; 69 - @@ -1324,7 +1324,7 @@ StandingItemGraphicsOffsets: dw $0 ; 63 - RNG pool item (multi) dw $0 ; 64 - Progressive bow dw $0 ; 65 - Progressive bow - dw $0 ; 66 - + dw $0CA0 ; 66 - Potion refill (yellow) dw $0 ; 67 - dw $0 ; 68 - dw $0 ; 69 - @@ -1590,7 +1590,7 @@ VRAMAddressOffset: dw $0024 ; 63 - RNG pool item (multi) dw $0024 ; 64 - Progressive bow dw $0024 ; 65 - Progressive bow - dw $0024 ; 66 - + dw $0024 ; 66 - Potion refill (yellow) dw $0024 ; 67 - dw $0024 ; 68 - dw $0024 ; 69 - diff --git a/newitems.asm b/newitems.asm index 697a845..c086428 100755 --- a/newitems.asm +++ b/newitems.asm @@ -935,7 +935,7 @@ BottleListExpanded: db $16, $2B, $2C, $2D, $3D, $3C, $48 PotionListExpanded: - db $2E, $2F, $30, $FF, $0E + db $66, $FF, $2E, $2F, $30, $FF, $0E ;-------------------------------------------------------------------------------- HandleBowTracking: ; In: A - Item Receipt ID diff --git a/shopkeeper.asm b/shopkeeper.asm index 05c4872..567a85c 100644 --- a/shopkeeper.asm +++ b/shopkeeper.asm @@ -433,6 +433,7 @@ Shopkeeper_BuyItem: CMP.b #$2E : BEQ .refill ; Red Potion Refill CMP.b #$2F : BEQ .refill ; Green Potion Refill CMP.b #$30 : BEQ .refill ; Blue Potion Refill + CMP.b #$66 : BEQ .refill ; Yellow Potion Refill CMP.b #$AF : BEQ .generic_key BRA + .refill