Make Twinrova hitbox more consistent

This commit is contained in:
scawful
2024-11-16 12:31:36 -05:00
parent a75b775cc6
commit c5374768c4

View File

@@ -39,19 +39,16 @@
Sprite_Twinrova_Long: Sprite_Twinrova_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
JSR Sprite_Twinrova_Draw
JSL Sprite_DrawShadow
JSR Sprite_Twinrova_Draw JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSL Sprite_DrawShadow JSR Sprite_Twinrova_CheckIfDead
JSR Sprite_Twinrova_Main
JSL Sprite_CheckActive : BCC .SpriteIsNotActive .SpriteIsNotActive
PLB
JSR Sprite_Twinrova_CheckIfDead RTL
JSR Sprite_Twinrova_Main
.SpriteIsNotActive
PLB
RTL
} }
; ========================================================= ; =========================================================
@@ -159,6 +156,11 @@ Sprite_Twinrova_Main:
JSL Sprite_PlayerCantPassThrough JSL Sprite_PlayerCantPassThrough
JSL Sprite_DamageFlash_Long JSL Sprite_DamageFlash_Long
PHX
JSL Sprite_CheckDamageFromPlayer
%DoDamageToPlayerSameLayerOnContact()
PLX
LDA.w SprAction, X LDA.w SprAction, X
JSL UseImplicitRegIndexedLocalJumpTable JSL UseImplicitRegIndexedLocalJumpTable
@@ -194,15 +196,13 @@ Sprite_Twinrova_Main:
LDA.w SprHealth, X : CMP.b #$20 : BCS .phase_1 LDA.w SprHealth, X : CMP.b #$20 : BCS .phase_1
; ------------------------------------------- ; -------------------------------------------
; Phase 2 ; Phase 2
LDA.b #$70 : STA.w SprTimerD, X
LDA.w SprTimerE, X : BNE .kotake LDA.w SprTimerE, X : BNE .kotake
LDA #$70 : STA.w SprTimerD, X
%GotoAction(8) ; Koume Mode %GotoAction(8) ; Koume Mode
RTS RTS
.kotake .kotake
LDA #$70 : STA.w SprTimerD, X
%GotoAction(9) ; Kotake Mode %GotoAction(9) ; Kotake Mode
RTS RTS
; --------------------------------------------- ; ---------------------------------------------
.phase_1 .phase_1
LDA $0DA0 : BEQ .not_flashing LDA $0DA0 : BEQ .not_flashing
@@ -226,18 +226,18 @@ Sprite_Twinrova_Main:
++ ++
JSL GetRandomInt : AND.b #$0F : BEQ .random_strafe JSL GetRandomInt : AND.b #$0F : BEQ .random_strafe
JSL Sprite_IsBelowPlayer : TYA : BNE .MoveBackwards JSL Sprite_IsBelowPlayer : TYA : BNE .MoveBackwards
%GotoAction(2) ; Move Forwards %GotoAction(2) ; Move Forwards
RTS RTS
.random_strafe .random_strafe
JSL GetRandomInt : AND.b #$01 : BEQ .strafe_left JSL GetRandomInt : AND.b #$01 : BEQ .strafe_left
LDA #$10 : STA.w SprXSpeed, X LDA #$10 : STA.w SprXSpeed, X
%GotoAction(2) ; Move Forwards with strafe %GotoAction(2) ; Move Forwards with strafe
RTS RTS
.strafe_left .strafe_left
LDA #$F0 : STA.w SprXSpeed, X LDA #$F0 : STA.w SprXSpeed, X
%GotoAction(2) ; Move Forwards with strafe %GotoAction(2) ; Move Forwards with strafe
RTS RTS
.MoveBackwards .MoveBackwards
%GotoAction(3) ; MoveBackwards %GotoAction(3) ; MoveBackwards
@@ -249,17 +249,10 @@ Sprite_Twinrova_Main:
Twinrova_MoveForwards: Twinrova_MoveForwards:
{ {
%Twinrova_Front() %Twinrova_Front()
PHX
JSL Sprite_CheckDamageFromPlayer
%DoDamageToPlayerSameLayerOnContact()
PLX
LDA #$10 ; speed LDA #$10 ; speed
LDY #$10 ; height LDY #$10 ; height
JSL Sprite_FloatTowardPlayer JSL Sprite_FloatTowardPlayer
JSL Sprite_CheckTileCollision JSL Sprite_CheckTileCollision
%GotoAction(1) %GotoAction(1)
RTS RTS
} }
@@ -269,16 +262,9 @@ Sprite_Twinrova_Main:
Twinrova_MoveBackwards: Twinrova_MoveBackwards:
{ {
%Twinrova_Back() %Twinrova_Back()
PHX
JSL Sprite_CheckDamageFromPlayer
%DoDamageToPlayerSameLayerOnContact()
PLX
LDA #$20 : LDY #$10 LDA #$20 : LDY #$10
JSL Sprite_FloatTowardPlayer JSL Sprite_FloatTowardPlayer
JSL Sprite_CheckTileCollision JSL Sprite_CheckTileCollision
%GotoAction(1) %GotoAction(1)
RTS RTS
} }
@@ -287,22 +273,21 @@ Sprite_Twinrova_Main:
; 0x04 ; 0x04
Twinrova_PrepareAttack: Twinrova_PrepareAttack:
{ {
%StartOnFrame(7) %StartOnFrame(7)
%Twinrova_Attack() %Twinrova_Attack()
LDA #$01 : STA $0360 LDA #$01 : STA $0360
LDA $0CAA : AND.b #$03 : STA $0CAA
LDA $0CAA : AND.b #$03 : STA $0CAA LDA.w SprTimerD, X : BNE +
LDA.w SprTimerD, X : BNE + LDA $0CAA : ORA.b #$03 : STA $0CAA
LDA $0CAA : ORA.b #$03 : STA $0CAA LDA.b #$40 : STA.w SprTimerD, X
LDA.b #$40 : STA.w SprTimerD, X LDA $AC : BEQ .fire
LDA $AC : BEQ .fire %GotoAction(6) ; Ice Attack
%GotoAction(6) ; Ice Attack RTS
RTS
.fire .fire
%GotoAction(5) %GotoAction(5)
+ +
RTS RTS
} }
; ------------------------------------------------------- ; -------------------------------------------------------
@@ -357,40 +342,40 @@ Sprite_Twinrova_Main:
BRA .ResumeNormalState BRA .ResumeNormalState
.DodgeOrRetaliate .DodgeOrRetaliate
; Determine whether to dodge or retaliate ; Determine whether to dodge or retaliate
JSL GetRandomInt JSL GetRandomInt
AND.b #$01 AND.b #$01
BEQ .PerformDodge BEQ .PerformDodge
BRA .PerformRetaliate BRA .PerformRetaliate
.PerformDodge .PerformDodge
JSR DoRandomStrafe JSR DoRandomStrafe
LDA.b #$20 : STA.w SprTimerA, X ; Set timer for dodge duration LDA.b #$20 : STA.w SprTimerA, X ; Set timer for dodge duration
LDA.b #$02 : STA.w SprMiscA, X ; Set state to random strafe LDA.b #$02 : STA.w SprMiscA, X ; Set state to random strafe
RTS RTS
.PerformRetaliate .PerformRetaliate
; Immediate retaliation with fire or ice attack ; Immediate retaliation with fire or ice attack
JSL GetRandomInt JSL GetRandomInt
AND.b #$01 AND.b #$01
BEQ .FireAttack BEQ .FireAttack
BRA .IceAttack BRA .IceAttack
.FireAttack .FireAttack
LDA.b #$20 : STA.w SprTimerD, X LDA.b #$20 : STA.w SprTimerD, X
STZ $AC ; Set fire attack STZ $AC ; Set fire attack
%GotoAction(4) ; Prepare Attack %GotoAction(4) ; Prepare Attack
RTS RTS
.IceAttack .IceAttack
LDA.b #$20 : STA.w SprTimerD, X LDA.b #$20 : STA.w SprTimerD, X
LDA.b #$01 : STA $AC ; Set ice attack LDA.b #$01 : STA $AC ; Set ice attack
%GotoAction(4) ; Prepare Attack %GotoAction(4) ; Prepare Attack
RTS RTS
.ResumeNormalState .ResumeNormalState
%GotoAction(1) ; Resume normal movement state %GotoAction(1) ; Resume normal movement state
RTS RTS
.HurtAnimation .HurtAnimation
RTS RTS
@@ -403,11 +388,6 @@ Sprite_Twinrova_Main:
%StartOnFrame(8) %StartOnFrame(8)
%Show_Koume() %Show_Koume()
PHX
JSL Sprite_CheckDamageFromPlayer
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL GetRandomInt : AND.b #$3F : BNE ++ JSL GetRandomInt : AND.b #$3F : BNE ++
JSR AddPitHazard JSR AddPitHazard
JSR Ganon_SpawnFallingTilesOverlord JSR Ganon_SpawnFallingTilesOverlord
@@ -435,11 +415,6 @@ Sprite_Twinrova_Main:
%StartOnFrame(9) %StartOnFrame(9)
%Show_Kotake() %Show_Kotake()
PHX
JSL Sprite_CheckDamageFromPlayer
%DoDamageToPlayerSameLayerOnContact()
PLX
JSL Sprite_IsBelowPlayer JSL Sprite_IsBelowPlayer
CPY #$01 : BEQ .not_below CPY #$01 : BEQ .not_below
JSL GetRandomInt : AND.b #$3F : BNE ++ JSL GetRandomInt : AND.b #$3F : BNE ++
@@ -474,7 +449,6 @@ Sprite_Twinrova_Main:
; ========================================================= ; =========================================================
; Handles dynamic floaty movement for Twinrova ; Handles dynamic floaty movement for Twinrova
; =========================================================
RageModeMove: RageModeMove:
{ {