more silver bow restriction checks

This commit is contained in:
Karkat
2018-03-16 14:16:11 -04:00
parent 42ba3cf7dc
commit 641973b24c
3 changed files with 17 additions and 8 deletions

View File

@@ -39,7 +39,6 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SetDeathWorldChecked: SetDeathWorldChecked:
PHA
LDA $1B : BEQ + ; skip this for indoors LDA $1B : BEQ + ; skip this for indoors
LDA $040C : CMP #$FF : BNE .done ; unless it's a cave LDA $040C : CMP #$FF : BNE .done ; unless it's a cave
@@ -52,12 +51,10 @@ SetDeathWorldChecked:
LDA.b #$00 : STA $7EF3CA : STA $7E0FFF ; set the world to the light world if he's still alive LDA.b #$00 : STA $7EF3CA : STA $7E0FFF ; set the world to the light world if he's still alive
LDA $7EF3CC : CMP #$07 : BNE .done : LDA.b #$08 : STA $7EF3CC ; convert frog to dwarf LDA $7EF3CC : CMP #$07 : BNE .done : LDA.b #$08 : STA $7EF3CC ; convert frog to dwarf
.done .done
PLA
RTL RTL
.pyramid .pyramid
LDA #$40 : STA $7EF3CA ; set flag to dark world LDA #$40 : STA $7EF3CA ; set flag to dark world
LDA $7EF3CC : CMP #$08 : BNE + : LDA.b #$07 : STA $7EF3CC : + ; convert dwarf to frog LDA $7EF3CC : CMP #$08 : BNE + : LDA.b #$07 : STA $7EF3CC : + ; convert dwarf to frog
PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FakeWorldFix: FakeWorldFix:
@@ -80,4 +77,11 @@ FixAgahnimFollowers:
LDA.b #$00 : STA $7EF3CC ; clear follower LDA.b #$00 : STA $7EF3CC ; clear follower
JSL PrepDungeonExit ; thing we wrote over JSL PrepDungeonExit ; thing we wrote over
RTL RTL
;--------------------------------------------------------------------------------
SetSilverBowMode:
LDA SilverArrowsUseRestriction : BEQ + ; fix bow type for restricted arrow mode
LDA $7EF340 : CMP.b #$3 : !BLT +
!SUB.b #$02 : STA $7EF340
+
RTL
;================================================================================ ;================================================================================

View File

@@ -17,12 +17,20 @@ RTL
; STA $7EC172 ; thing we wrote over ; STA $7EC172 ; thing we wrote over
;RTL ;RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnPlayerDead:
PHA
JSL.l SetDeathWorldChecked
JSL.l SetSilverBowMode
PLA
RTL
;--------------------------------------------------------------------------------
OnDungeonExit: OnDungeonExit:
STA $040C : STZ $04AC ; thing we wrote over STA $040C : STZ $04AC ; thing we wrote over
PHA : PHP PHA : PHP
JSL.l HUD_RebuildLong JSL.l HUD_RebuildLong
JSL.l FloodGateResetInner JSL.l FloodGateResetInner
JSL.l SetSilverBowMode
PLP : PLA PLP : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -67,10 +75,7 @@ OnFileLoad:
LDA $7EF38B : STA $7EF36F ; copy generic keys to key counter LDA $7EF38B : STA $7EF36F ; copy generic keys to key counter
+ +
LDA SilverArrowsUseRestriction : BEQ + ; fix bow type for restricted arrow mode JSL.l SetSilverBowMode
LDA $7EF340 : CMP.b #$3 : !BLT +
!SUB.b #$02 : STA $7EF340
+
LDA $7EF3C5 : CMP.b #$01 : BNE .notrain ; check if we're in rain state LDA $7EF3C5 : CMP.b #$01 : BNE .notrain ; check if we're in rain state
.rain .rain

View File

@@ -1747,7 +1747,7 @@ JSL.l DarkWorldLoadFix
NOP #7 NOP #7
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $09F520 ; <- 4F520 - module_death.asm : 401 (LDA $7EF3C5 : CMP.b #$03 : BCS BRANCH_THETA) org $09F520 ; <- 4F520 - module_death.asm : 401 (LDA $7EF3C5 : CMP.b #$03 : BCS BRANCH_THETA)
JSL.l SetDeathWorldChecked JSL.l OnPlayerDead
JSL.l IncrementDeathCounter JSL.l IncrementDeathCounter
NOP #6 NOP #6
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------