Adjust sensitivity of ice block push

This commit is contained in:
scawful
2025-01-25 11:23:56 -05:00
parent 2303a450dc
commit af0d0e5b5e

View File

@@ -1,7 +1,7 @@
; Pushable Ice Block ; Pushable Ice Block
!SPRID = $D5; The sprite ID you are overwriting (HEX) !SPRID = $D5
!NbrTiles = 03 ; Number of tiles used in a frame !NbrTiles = 02
!Harmless = 01 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless !Harmless = 01 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is !HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
!Health = 00 ; Number of Health the sprite have !Health = 00 ; Number of Health the sprite have
@@ -11,7 +11,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 = 09 ; 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
@@ -33,11 +33,13 @@
Sprite_IceBlock_Long: Sprite_IceBlock_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
LDA.w SprMiscC, X : BEQ .not_being_pushed LDA.w SprMiscC, X : BEQ .not_being_pushed
STZ.w SprMiscC, X STZ.w SprMiscC, X
STZ.b LinkSpeedTbl STZ.b LinkSpeedTbl
STZ.b $48 ; Clear push actions bitfield STZ.b $48 ; Clear push actions bitfield
.not_being_pushed .not_being_pushed
LDA.w SprTimerA, X : BEQ .retain_momentum LDA.w SprTimerA, X : BEQ .retain_momentum
LDA.b #$01 : STA.w SprMiscC, X LDA.b #$01 : STA.w SprMiscC, X
LDA.b #$84 : STA.b $48 ; Set statue and push block actions LDA.b #$84 : STA.b $48 ; Set statue and push block actions
@@ -61,18 +63,13 @@ Sprite_IceBlock_Prep:
LDA.w SprXH, X : STA.w SprMiscF, X LDA.w SprXH, X : STA.w SprMiscF, X
LDA.w SprYH, X : STA.w SprMiscG, X LDA.w SprYH, X : STA.w SprMiscG, X
STZ.w SprDefl, X STZ.w SprDefl, X
LDA.w SprHitbox, X : ORA.b #$09 : STA.w SprHitbox, X
PLB PLB
RTL RTL
} }
Sprite_IceBlock_Main: Sprite_IceBlock_Main:
{ {
LDA.w SprAction, X
JSL JumpTableLocal
dw MovementHandler
MovementHandler:
{
%PlayAnimation(0, 0, 1) %PlayAnimation(0, 0, 1)
JSR Statue_BlockSprites JSR Statue_BlockSprites
@@ -82,6 +79,7 @@ Sprite_IceBlock_Main:
LDA.w SprMiscF, X : STA.w SprXH, X LDA.w SprMiscF, X : STA.w SprXH, X
LDA.w SprMiscG, X : STA.w SprYH, X LDA.w SprMiscG, X : STA.w SprYH, X
STZ.w SprXSpeed, X : STZ.w SprYSpeed, X STZ.w SprXSpeed, X : STZ.w SprYSpeed, X
STZ.w SprTimerA, X : STZ.w SprMiscA, X
.no_damage .no_damage
STZ.w $0642 STZ.w $0642
@@ -90,24 +88,22 @@ Sprite_IceBlock_Main:
LDA.b #$01 : STA.w $0642 LDA.b #$01 : STA.w $0642
.no_switch .no_switch
JSL Sprite_Move ; Sprite MoveXY JSL Sprite_Move
JSL Sprite_Get_16_bit_Coords ; Get 16bit coords JSL Sprite_Get_16_bit_Coords
JSL Sprite_CheckTileCollision ; Check Tile collision JSL Sprite_CheckTileCollision
; ----udlr , u = up, d = down, l = left, r = right ; ----udlr , u = up, d = down, l = left, r = right
LDA.w SprCollision, X : AND.b #$0F : BEQ + LDA.w SprCollision, X : AND.b #$0F : BEQ +
STZ.w SprMiscA, X STZ.w SprMiscA, X
+ +
; TODO: Update Link push collision reaction
; If link is in contact, register a push with the sprite ; If link is in contact, register a push with the sprite
; Run a timer briefly, and confirm the facing direction ; Run a timer briefly, and confirm the facing direction
; matches the push direction (cached) and then initiate ; matches the push direction (cached) and then initiate
; the speed changes if they agree ; the speed changes if they agree
JSL Sprite_CheckDamageToPlayerSameLayer : BCC .NotInContact JSL Sprite_CheckDamageToPlayerSameLayer : BCC .NotInContact
LDA.w SprMiscA, X : BNE .push_cached LDA.w SprMiscA, X : BNE .push_cached
LDA.b $26 : STA.w SprMiscA, X LDA.b $26 : STA.w SprMiscA, X
JSR ApplyPush JSR Sprite_ApplyPush
.push_cached .push_cached
LDA.b #$07 : STA.w SprTimerA, X LDA.b #$07 : STA.w SprTimerA, X
@@ -118,42 +114,42 @@ Sprite_IceBlock_Main:
LDA.w SprY, X : AND #$F8 : STA.w SprY, X LDA.w SprY, X : AND #$F8 : STA.w SprY, X
RTS RTS
.CancelHookshot: .CancelHookshot:
JSL $0FF540 JSL Sprite_CancelHookshot
RTS RTS
.NotInContact: .NotInContact:
LDA.w SprTimerA, X : BNE .delay_timer LDA.w SprTimerA, X : BNE .delay_timer
LDA.b #$0D : STA.w SprTimerB, X LDA.b #$0D : STA.w SprTimerB, X
.delay_timer .delay_timer
RTS RTS
} }
ApplyPush: Sprite_ApplyPush:
{ {
; Only apply the push if the facing direction ; Only apply the push if the facing direction
; and pushing direction agree with each other ; and pushing direction agree with each other
LDA.w SprMiscA, X : CMP.b $26 : BEQ .push
RTS
.push
LDA $26 : CMP.b #$01 : BEQ .push_right LDA $26 : CMP.b #$01 : BEQ .push_right
CMP.b #$02 : BEQ .push_left CMP.b #$02 : BEQ .push_left
CMP.b #$04 : BEQ .push_down CMP.b #$04 : BEQ .push_down
CMP.b #$08 : BEQ .push_up CMP.b #$08 : BEQ .push_up
.push_right .push_right
LDA #16 : STA.w SprXSpeed, X LDA #16 : STA.w SprXSpeed, X : STZ.w SprYSpeed, X
STZ.w SprYSpeed, X
JMP + JMP +
.push_left .push_left
LDA #-16 : STA.w SprXSpeed, X LDA #-16 : STA.w SprXSpeed, X : STZ.w SprYSpeed, X
STZ.w SprYSpeed, X
JMP + JMP +
.push_down .push_down
STZ.w SprXSpeed, X LDA #16 : STA.w SprYSpeed, X : STZ.w SprXSpeed, X
LDA #16 : STA.w SprYSpeed, X
JMP + JMP +
.push_up .push_up
STZ.w SprXSpeed, X LDA #-16 : STA.w SprYSpeed, X : STZ.w SprXSpeed, X
LDA #-16 : STA.w SprYSpeed, X
+ +
RTS RTS
}
} }
; Check if the tile beneath the sprite is the sliding ice ; Check if the tile beneath the sprite is the sliding ice
@@ -164,9 +160,9 @@ IceBlock_CheckForGround:
LDA.w SprYH, X : ADC.b #$00 : STA.b $01 LDA.w SprYH, X : ADC.b #$00 : STA.b $01
LDA.w SprX, X : STA.b $02 LDA.w SprX, X : STA.b $02
LDA.w SprXH, X : ADC.b #$00 : STA.b $03 LDA.w SprXH, X : ADC.b #$00 : STA.b $03
LDA.w $0F20, X LDA.w SprFloor, X
PHY PHY
JSL $06E87B ; GetTileType_long JSL Sprite_GetTileAttr
PLY PLY
LDA.w $0FA5 : CMP.b #$0E : BNE .stop LDA.w $0FA5 : CMP.b #$0E : BNE .stop
@@ -188,10 +184,10 @@ Sprite_IceBlock_CheckForSwitch:
LDA.w SprYH, X : ADC.b #$00 : STA.b $01 LDA.w SprYH, X : ADC.b #$00 : STA.b $01
LDA.w SprX, X : CLC : ADC.w .offset_x, Y : STA.b $02 LDA.w SprX, X : CLC : ADC.w .offset_x, Y : STA.b $02
LDA.w SprXH, X : ADC.b #$00 : STA.b $03 LDA.w SprXH, X : ADC.b #$00 : STA.b $03
LDA.w $0F20, X LDA.w SprFloor, X
PHY PHY
JSL $06E87B ; GetTileType_long JSL Sprite_GetTileAttr
PLY PLY
LDA.w $0FA5 LDA.w $0FA5
@@ -227,8 +223,8 @@ Statue_BlockSprites:
.next .next
; SPRITE 1C ; SPRITE 1C
LDA.w $0E20, Y : CMP.b #$1C : BEQ .skip LDA.w SprType, Y : CMP.b #$1C : BEQ .skip
CPY.w $0FA0 : BEQ .skip CPY.w SprSlot : BEQ .skip
TYA : EOR.b $1A : AND.b #$01 : BNE .skip TYA : EOR.b $1A : AND.b #$01 : BNE .skip
LDA.w SprState, Y : CMP.b #$09 : BCC .skip LDA.w SprState, Y : CMP.b #$09 : BCC .skip
@@ -239,11 +235,13 @@ Statue_BlockSprites:
REP #$20 REP #$20
LDA.w SprCachedX : SEC : SBC.b $04 : CLC : ADC.w #$000C LDA.w SprCachedX
CMP.w #$0018 : BCS .skip SEC : SBC.b $04
CLC : ADC.w #$000C : CMP.w #$0018 : BCS .skip
LDA.w SprCachedY : SEC : SBC.b $06 : CLC : ADC.w #$000C LDA.w SprCachedY
CMP.w #$0024 : BCS .skip SEC : SBC.b $06
CLC : ADC.w #$000C : CMP.w #$0024 : BCS .skip
SEP #$20 SEP #$20