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