Add Minish form, handle Zora dive doors and holes

This commit is contained in:
scawful
2023-05-16 01:37:54 -05:00
parent 5987e0658f
commit 2026c0f2e1
3 changed files with 58 additions and 4 deletions

View File

@@ -43,11 +43,11 @@ org $1BEE1B
org $398000
Palette_ArmorAndGloves:
{
LDA $02B2 : CMP #$01 : BEQ .deku_mask
CMP.b #$02 : BEQ .zora_mask
CMP.b #$03 : BEQ .wolf_mask
CMP.b #$04 : BEQ .bunny_hood
CMP.b #$05 : BEQ .minish_form
JMP .original_sprite
.deku_mask
@@ -68,6 +68,11 @@ Palette_ArmorAndGloves:
JSL $37F000
RTL
.minish_form
LDA.b #$3A : STA $BC ; Load Minish Form Location
JMP .original_palette
RTL
.original_sprite
LDA.b #$10 : STA $BC ; Load Original Sprite Location
@@ -140,7 +145,6 @@ Overworld_CgramAuxToMain_Override:
LDA $7EC400, X : STA $7EC600, X
LDA $7EC440, X : STA $7EC640, X
LDA $7EC480, X : STA $7EC680, X
LDA $02B2 : BNE .has_mask_palette
LDA $7EC4C0, X : STA $7EC6C0, X
.has_mask_palette
@@ -170,7 +174,9 @@ org $0DEE24
; extra free space in bank07 for longs (no longer used)
org $07F89D
incsrc "minish_form.asm"
print "==> End of Minish Form insert", pc
; 07FB8F
org $07F8A6
org $07F8AE
@@ -183,7 +189,10 @@ org $07F8C9
; =============================================================================
org $07FA41
; TODO: Make this so it does not cancel if $0202 is still the same mask
; corresponding to the form the player is in.
; Also, prevent this from canceling minish form.
org $07FA55
LinkState_ResetMaskAnimated:
{
LDA $02B2 : BEQ .no_mask
@@ -205,5 +214,6 @@ LinkState_ResetMaskAnimated:
.no_mask
RTL
}
print "End of LinkState_ResetMaskAnimated", pc
; =============================================================================

38
Masks/minish_form.asm Normal file
View File

@@ -0,0 +1,38 @@
; =============================================================================
; Minish Form Link
;
; =============================================================================
LinkState_CheckForMinishForm:
{
SEP #$30
LDY.b #$04 : LDA.b #$23
JSL AddTransformationCloud
LDA.b #$14 : JSR Player_DoSfx2
LDA $02B2 : CMP.b #$05 : BEQ .already_minish
LDA #$3A : STA $BC ; change link's sprite
LDA #$05 : STA $02B2 ; Set the current mask form
REP #$30
RTS
.already_minish
LDA #$10 : STA $BC : STZ $02B2
REP #$30
RTS
}
org $07DA2A
TileDetection_OverworldAttributeJumpTable:
; Tile ID 64
org $07DAF2
dw $F89D
org $3A8000
incbin gfx/minish_link.4bpp

View File

@@ -179,6 +179,10 @@ LinkState_UsingZoraMask:
; Check if the player is actually diving
LDA $0AAB : BEQ .return_default
LDA $0114 : CMP #$85 : BEQ .return_default
LDA $0114 : CMP #$09 : BEQ .return_default
LDA $5B : CMP #$02 : BEQ .player_is_falling
; Check if the ground level is safe
; Otherwise, eject the player back to the surface
LDA $0114 : BNE .remove_dive : CLC
@@ -191,6 +195,7 @@ LinkState_UsingZoraMask:
LDA.b #$15 : LDY.b #$00 : JSL AddTransitionSplash
.remove_dive
LDA #$04 : STA $5D ; Set Link to Swimming State
.player_is_falling
LDA #$01 : STA $EE ; Set Link to upper level
STA $0345 ; Set deep water flag
@@ -221,6 +226,7 @@ LinkState_UsingZoraMask:
LDA #$06 : STA $5D ; Set Link to Recoil State
RTS
}
print "End of Zora Mask Dive Code ", pc
; =============================================================================