SpriteSetupHitbox and LinkSetupHitbox long, disable deku mask hover (for now)

This commit is contained in:
scawful
2024-05-30 15:06:56 -04:00
parent 736b8c1cdc
commit a8c3c783e6
6 changed files with 62 additions and 22 deletions

View File

@@ -332,26 +332,66 @@ org $0DA3FD
pullpc pullpc
CheckDekuFlowerPresence:
{
PHX
CLC ; Assume sprite ID $B0 is not present
LDX.b #$10
.x_loop
DEX
LDY.b #$04
.y_loop
DEY
LDA $0E20, X : CMP.b #$C0 : BEQ .set_flag
BRA .not_b0
.set_flag
SEC ; Set flag indicating sprite ID $B0 is present
STX.w $02
BRA .done
.not_b0
CPY.b #$00 : BNE .y_loop
CPX.b #$00 : BNE .x_loop
.done
PLX
RTS
}
; Based on LinkItem_Quake.allow_quake ; Based on LinkItem_Quake.allow_quake
PrepareQuakeSpell: PrepareQuakeSpell:
{ {
; TODO: Set a check for the Deku Flower sprite before activating this ability. ; TODO: Set a check for the Deku Flower sprite before activating this ability.
; Find out if the sprite $C0 is in the room
JSR CheckDekuFlowerPresence : BCC .no_c0
LDA.b #$0A : STA.b $5D ; Set Link to the hover state PHX : LDA $02 : TAX
LDA.b #$00 : STA.b $3D ; Clear the animation timer JSL Link_SetupHitBox
LDA #$00 : STA.w $031C ; Clear the spin animation gfx ; X is now the ID of the sprite $B0
STZ.w $031D ; Clear the spin animation step JSL Sprite_SetupHitBox
STZ.w $0324 ; Prevent multiple ancillae from being added PLX
STZ.b $46 ; Clear the link damage timer
; Set low and high of HOPVZ2 JSL CheckIfHitBoxesOverlap : BCC .no_c0
; Usually used as the hopping speed for diagonal jumps
LDA.b #$28 : STA.w $0362 : STA.w $0363
STZ.w $0364 ; Clear Z-coordinate for the jump
STZ $70 ; Clear bomb drop check flag LDA.b #$0A : STA.b $5D ; Set Link to the hover state
LDA.b #$00 : STA.b $3D ; Clear the animation timer
LDA #$00 : STA.w $031C ; Clear the spin animation gfx
STZ.w $031D ; Clear the spin animation step
STZ.w $0324 ; Prevent multiple ancillae from being added
STZ.b $46 ; Clear the link damage timer
; Set low and high of HOPVZ2
; Usually used as the hopping speed for diagonal jumps
LDA.b #$28 : STA.w $0362 : STA.w $0363
STZ.w $0364 ; Clear Z-coordinate for the jump
STZ $70 ; Clear bomb drop check flag
.no_c0
RTL RTL
} }

View File

@@ -144,7 +144,7 @@ Sprite_DekuScrubEnemy_Main:
PHX PHX
LDA Offspring1_Id : TAX LDA Offspring1_Id : TAX
JSR Sprite_SetupHitBox JSL Sprite_SetupHitBox
PLX PLX
JSL CheckIfHitBoxesOverlap : BCC .no_dano JSL CheckIfHitBoxesOverlap : BCC .no_dano
@@ -157,7 +157,7 @@ Sprite_DekuScrubEnemy_Main:
; We will go to recoil ; We will go to recoil
PHX PHX
LDA Offspring1_Id : TAX LDA Offspring1_Id : TAX
JSR Sprite_SetupHitBox JSL Sprite_SetupHitBox
PLX PLX
JSL CheckIfHitBoxesOverlap : BCC .not_done2 JSL CheckIfHitBoxesOverlap : BCC .not_done2
%GotoAction(4) %GotoAction(4)

View File

@@ -12,7 +12,7 @@
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow !SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
!Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow !Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow
!Palette = 00 ; Unused in this template (can be 0 to 7) !Palette = 00 ; Unused in this template (can be 0 to 7)
!Hitbox = 00 ; 00 to 31, can be viewed in sprite draw tool !Hitbox = $0D ; 00 to 31, can be viewed in sprite draw tool
!Persist = 00 ; 01 = your sprite continue to live offscreen !Persist = 00 ; 01 = your sprite continue to live offscreen
!Statis = 00 ; 00 = is sprite is alive?, (kill all enemies room) !Statis = 00 ; 00 = is sprite is alive?, (kill all enemies room)
!CollisionLayer = 00 ; 01 = will check both layer for collision !CollisionLayer = 00 ; 01 = will check both layer for collision

View File

@@ -614,10 +614,10 @@ HandleDynamicSwitchTileDirections:
JSR CheckSpritePresence : BCC .no_b0 JSR CheckSpritePresence : BCC .no_b0
PHX : LDA $02 : TAX PHX : LDA $02 : TAX
JSR Link_SetupHitBox JSL Link_SetupHitBox
; X is now the ID of the sprite $B0 ; X is now the ID of the sprite $B0
JSR Sprite_SetupHitBox JSL Sprite_SetupHitBox
PLX PLX
JSL CheckIfHitBoxesOverlap : BCC .no_b0 JSL CheckIfHitBoxesOverlap : BCC .no_b0

View File

@@ -141,7 +141,7 @@ Sprite_Portal_Main:
LDA SprTimerD, X : BNE .NoOverlap LDA SprTimerD, X : BNE .NoOverlap
JSR Link_SetupHitBox JSL Link_SetupHitBox
JSL $0683EA ; Sprite_SetupHitbox_long JSL $0683EA ; Sprite_SetupHitbox_long
JSL CheckIfHitBoxesOverlap : BCC .NoOverlap JSL CheckIfHitBoxesOverlap : BCC .NoOverlap
@@ -172,7 +172,7 @@ Sprite_Portal_Main:
CLC CLC
LDA SprTimerD, X : BNE .NoOverlap LDA SprTimerD, X : BNE .NoOverlap
JSR Link_SetupHitBox JSL Link_SetupHitBox
JSL $0683EA ; Sprite_SetupHitbox_long JSL $0683EA ; Sprite_SetupHitbox_long
JSL CheckIfHitBoxesOverlap : BCC .NoOverlap JSL CheckIfHitBoxesOverlap : BCC .NoOverlap

View File

@@ -443,7 +443,7 @@ Link_SetupHitBox:
LDA $20 : ADC.b #$08 : STA $01 LDA $20 : ADC.b #$08 : STA $01
LDA $21 : ADC.b #$00 : STA $09 LDA $21 : ADC.b #$00 : STA $09
RTS RTL
} }
@@ -490,7 +490,7 @@ Sprite_SetupHitBox:
#_06F82F: PLY #_06F82F: PLY
#_06F830: RTS #_06F830: RTL
; --------------------------------------------------------- ; ---------------------------------------------------------
@@ -498,7 +498,7 @@ Sprite_SetupHitBox:
#_06F831: LDA.b #$80 #_06F831: LDA.b #$80
#_06F833: STA.b $0A #_06F833: STA.b $0A
#_06F835: RTS #_06F835: RTL
.offset_x_low .offset_x_low
#_06F72F: db 2 ; 0x00 #_06F72F: db 2 ; 0x00