From e0b55d6e8f73833ff35d517404133e20c32f8110 Mon Sep 17 00:00:00 2001 From: Karkat Date: Tue, 27 Feb 2018 00:22:59 -0500 Subject: [PATCH] let's dev 2/27/18 updates to floodgate softlock protection nerfed byrna invulnerability for hard modes add uncle refill switches for standard+random swords --- LTTP_RND_GeneralBugfixes.asm | 2 +- events.asm | 24 ++++++++++++++++++++++-- floodgatesoftlock.asm | 11 ++++++----- hardmode.asm | 18 ++++++++++++++++++ hooks.asm | 3 +++ tables.asm | 14 +++++++++++++- 6 files changed, 63 insertions(+), 9 deletions(-) diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 2408628..040fa16 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -26,7 +26,7 @@ org $3FFFFF ; <- 1FFFFF db #$00 ; expand file to 2mb org $1FFFF8 ; <- FFFF8 timestamp rom -db #$20, #$18, #$02, #$23 ; year/month/day +db #$20, #$18, #$02, #$27 ; year/month/day ;================================================================================ diff --git a/events.asm b/events.asm index 12b17e1..6e99e6a 100644 --- a/events.asm +++ b/events.asm @@ -20,18 +20,24 @@ RTL ;-------------------------------------------------------------------------------- OnDungeonExit: STA $040C : STZ $04AC ; thing we wrote over - + PHA : PHP JSL.l HUD_RebuildLong + JSL.l FloodGateResetInner PLP : PLA RTL ;-------------------------------------------------------------------------------- OnUncleItemGet: JSL Link_ReceiveItem + LDA.l EscapeAssist BIT.b #$04 : BEQ + : STA !INFINITE_MAGIC : + BIT.b #$02 : BEQ + : STA !INFINITE_BOMBS : + - AND.b #$01 : STA !INFINITE_ARROWS + BIT.b #$01 : BEQ + : STA !INFINITE_ARROWS : + + + LDA.l UncleRefill : BIT.b #$04 : BEQ + : LDA.b #$80 : STA $7EF373 : + ; refill magic + LDA.l UncleRefill : BIT.b #$02 : BEQ + : LDA.b #50 : STA $7EF375 : + ; refill bombs + LDA.l UncleRefill : BIT.b #$01 : BEQ + : LDA.b #70 : STA $7EF376 : + ; refill arrows RTL ;-------------------------------------------------------------------------------- OnAga2Defeated: @@ -53,6 +59,20 @@ OnFileLoad: LDA.l GenericKeys : BEQ + LDA $7EF38B : STA $7EF36F ; copy generic keys to key counter + + + STA $FFFFFF + LDA $7EF3C5 : CMP.b #$01 : BNE .notrain ; check if we're in rain state + .rain + LDA.l EscapeAssist + BIT.b #$04 : BEQ + : STA !INFINITE_MAGIC : + + BIT.b #$02 : BEQ + : STA !INFINITE_BOMBS : + + BIT.b #$01 : BEQ + : STA !INFINITE_ARROWS : + + BRA ++ + .notrain + LDA.l EscapeAssist : BIT.b #$04 : BEQ + : LDA.b #$00 : STA !INFINITE_MAGIC : + + LDA.l EscapeAssist : BIT.b #$02 : BEQ + : LDA.b #$00 : STA !INFINITE_BOMBS : + + LDA.l EscapeAssist : BIT.b #$01 : BEQ + : LDA.b #$00 : STA !INFINITE_ARROWS : + + ++ RTL ;-------------------------------------------------------------------------------- !RNG_ITEM_LOCK_IN = "$7F5090" diff --git a/floodgatesoftlock.asm b/floodgatesoftlock.asm index fed7e1f..be3a06b 100644 --- a/floodgatesoftlock.asm +++ b/floodgatesoftlock.asm @@ -4,15 +4,16 @@ FloodGateAndMasterSwordFollowerReset: JSL.l MasterSwordFollowerClear FloodGateReset: - LDA.l Bugfix_SwampWaterLevel : BEQ + - LDA $7EF06E : AND.b #$7F : STA $7EF06E ; clear water room 55 - LDA $7EF06A : AND.b #$7F : STA $7EF06A ; clear water room 53 - + LDA.l PersistentFloodgate : BNE + LDA $7EF2BB : AND.b #$DF : STA $7EF2BB ; reset water outside floodgate LDA $7EF2FB : AND.b #$DF : STA $7EF2FB ; reset water outside swamp palace LDA $7EF216 : AND.b #$7F : STA $7EF216 ; clear water inside floodgate - LDA $7EF051 : AND.b #$FE : STA $7EF051 ; clear water room 40 + LDA $7EF051 : AND.b #$FE : STA $7EF051 ; clear water front room (room 40) + + +FloodGateResetInner: + LDA.l Bugfix_SwampWaterLevel : BEQ + + ; LDA $7EF06E : AND.b #$7F : STA $7EF06E ; clear water room 55 - outer room you shouldn't be able to softlock except in major glitches + LDA $7EF06A : AND.b #$7F : STA $7EF06A ; clear water room 53 - inner room with the easy key flood softlock + RTL ;================================================================================ \ No newline at end of file diff --git a/hardmode.asm b/hardmode.asm index 02a62c5..18c5531 100644 --- a/hardmode.asm +++ b/hardmode.asm @@ -54,3 +54,21 @@ CalculateCapeUsage: LDA $7EF36E ; thing we wrote over RTL ;-------------------------------------------------------------------------------- +ActivateInvulnerabilityOrDont: + LDA $1B : BEQ .nowhere_special + REP #$20 ; set 16-bit accumulator + LDA $A0 ; these are all decimal because i got them that way + CMP.w #95 : BEQ .somewhere_cool ; Ice Palace Spike Room + CMP.w #179 : BEQ .somewhere_cool ; Room in Misery Mire + CMP.w #213 : BEQ .somewhere_cool ; Laser Bridge + CMP.w #279 : BEQ .somewhere_cool ; Spike Cave + + SEP #$20 ; set 8-bit accumulator + BRA .nowhere_special + .somewhere_cool + SEP #$20 ; set 8-bit accumulator + LDA.b #$01 : STA $037B : RTL + .nowhere_special + LDA.l ByrnaInvulnerability : STA $037B +RTL +;-------------------------------------------------------------------------------- diff --git a/hooks.asm b/hooks.asm index d1d0ed7..b2d057d 100644 --- a/hooks.asm +++ b/hooks.asm @@ -277,6 +277,9 @@ JSL.l CalculateCapeUsage org $07AE98 ; <- 3AE98 - Bank07.asm : 7380 (LDA $7EF36E) JSL.l CalculateCapeUsage ;-------------------------------------------------------------------------------- +org $08DCA7 ; <- 45CA7 - ancilla_cane_spark.asm : 256 (LDA.b #$01 : STA $037B) +JSL.l ActivateInvulnerabilityOrDont : NOP +;-------------------------------------------------------------------------------- ;================================================================================ ; Misc Stats diff --git a/tables.asm b/tables.asm index 3acb355..4e24ffc 100644 --- a/tables.asm +++ b/tables.asm @@ -206,13 +206,25 @@ SmithTravelsFreely: db #$00 ; #$00 = Off (default) - #$01 = On (frog/smith can enter multi-entrance doors) ;-------------------------------------------------------------------------------- org $30804D ; PC 0x18004D -EscapeAssist: +EscapeAssist: ; ScrubMode: db #$00 ;---- -mba ;m - Infinite Magic ;b - Infinite Bombs ;a - Infinite Arrows ;-------------------------------------------------------------------------------- +org $30804E ; PC 0x18004E +UncleRefill: +db #$00 +;---- -mba +;m - Refill Magic +;b - Refill Bombs +;a - Refill Arrows +;-------------------------------------------------------------------------------- +org $30804F ; PC 0x18004F +ByrnaInvulnerability: +db #$00 ; #$00 = Off - #$01 = On (default) +;-------------------------------------------------------------------------------- org $308080 ; PC 0x180080 Upgrade5BombsRefill: db #$00