update kydreeok formatting

This commit is contained in:
scawful
2024-06-07 23:16:51 -04:00
parent 9a6917304f
commit 8cc0442cdd

View File

@@ -95,131 +95,128 @@ Sprite_Kydreeok_Main:
; 0x00 ; 0x00
Kydreeok_Start: Kydreeok_Start:
{ {
%StartOnFrame(0) %StartOnFrame(0)
%PlayAnimation(0, 2, 10) %PlayAnimation(0, 2, 10)
JSR ApplyPalette JSR ApplyPalette
JSL Sprite_PlayerCantPassThrough JSL Sprite_PlayerCantPassThrough
LDA SprTimerA, X : BNE .continue LDA SprTimerA, X : BNE .continue
TXA : STA Kydreeok_Id TXA : STA Kydreeok_Id
LDA #$40 : STA.w SprTimerA, X LDA #$40 : STA.w SprTimerA, X
%GotoAction(1) %GotoAction(1)
.continue .continue
RTS RTS
} }
; ------------------------------------------------------- ; -------------------------------------------------------
; 0x01 ; 0x01
Kydreeok_StageControl: Kydreeok_StageControl:
{ {
%StartOnFrame(0) %StartOnFrame(0)
%PlayAnimation(0, 2, 10) %PlayAnimation(0, 2, 10)
PHX PHX
STZ.w SprYSpeed : STZ.w SprXSpeed ;set velocitys to 0 STZ.w SprYSpeed : STZ.w SprXSpeed ;set velocitys to 0
JSR MoveBody JSR MoveBody
JSR StopIfOutOfBounds JSR StopIfOutOfBounds
LDA SprTimerA, X : BNE .continue LDA SprTimerA, X : BNE .continue
%GotoAction(2) %GotoAction(2)
.continue .continue
PLX PLX
RTS RTS
} }
; ------------------------------------------------------- ; -------------------------------------------------------
; 0x02 ; 0x02
Kydreeok_MoveXandY: Kydreeok_MoveXandY:
{ {
%StartOnFrame(0) %StartOnFrame(0)
%PlayAnimation(0, 2, 10) %PlayAnimation(0, 2, 10)
PHX ;saves X so we can use it later PHX ;saves X so we can use it later
LDA $36 LDA $36
JSL Sprite_ApplySpeedTowardsPlayer JSL Sprite_ApplySpeedTowardsPlayer
JSR StopIfOutOfBounds JSR StopIfOutOfBounds
JSR MoveBody JSR MoveBody
JSL Sprite_CheckDamageFromPlayerLong JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact() %DoDamageToPlayerSameLayerOnContact()
PLX ;restores X PLX ;restores X
%GotoAction(4) %GotoAction(4)
RTS RTS
} }
; ------------------------------------------------------- ; -------------------------------------------------------
; 0x03 ; 0x03
Kydreeok_MoveXorY: Kydreeok_MoveXorY:
{ {
%StartOnFrame(0) %StartOnFrame(0)
%PlayAnimation(0, 2, 10) %PlayAnimation(0, 2, 10)
PHX PHX
LDA $36 : STA $00 LDA $36 : STA $00
JSR Sprite_ApplySpeedTowardsPlayerXOrY JSR Sprite_ApplySpeedTowardsPlayerXOrY
JSR StopIfOutOfBounds JSR StopIfOutOfBounds
JSR MoveBody JSR MoveBody
JSL Sprite_CheckDamageFromPlayerLong JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact() %DoDamageToPlayerSameLayerOnContact()
PLX PLX
%GotoAction(4) %GotoAction(4)
RTS RTS
} }
; ------------------------------------------------------- ; -------------------------------------------------------
; 0x04 ; 0x04
Kydreeok_KeepWalking: Kydreeok_KeepWalking:
{ {
%StartOnFrame(0) %StartOnFrame(0)
%PlayAnimation(0, 2, 10) %PlayAnimation(0, 2, 10)
PHX PHX
REP #$20 REP #$20
; Use a range of + 0x05 because being exact equal didnt trigger consistently
LDA $20 : SBC SprCachedY : CMP.w #$FFFB : BCC .notEqualY
SEP #$20
%GotoAction(2) ; Kydreeok_MoveXandY
BRA .notEqualX
; Use a range of + 0x05 because being exact equal didnt trigger consistently
LDA $20 : SBC SprCachedY : CMP.w #$FFFB : BCC .notEqualY
SEP #$20
%GotoAction(2) ; Kydreeok_MoveXandY
BRA .notEqualX
.notEqualY .notEqualY
; Use a range of + 0x05 because being exact equal didnt trigger consistently ; Use a range of + 0x05 because being exact equal didnt trigger consistently
LDA $22 : SBC SprCachedX : CMP.w #$FFFB : BCC .notEqualX LDA $22 : SBC SprCachedX : CMP.w #$FFFB : BCC .notEqualX
SEP #$20
%GotoAction(2) ; Kydreeok_MoveXandY
.notEqualX
SEP #$20 SEP #$20
JSR StopIfOutOfBounds %GotoAction(2) ; Kydreeok_MoveXandY
.notEqualX
;if both velocities are 0 go back to the Stalk_Player_XORY to re-set the course SEP #$20
LDA.w SprYSpeed : BNE .notZero JSR StopIfOutOfBounds
;if both velocities are 0 go back to the Stalk_Player_XORY to re-set the course
LDA.w SprYSpeed : BNE .notZero
LDA.w SprXSpeed : BNE .notZero LDA.w SprXSpeed : BNE .notZero
%GotoAction(3) ; Kydreeok_MoveXorY %GotoAction(3) ; Kydreeok_MoveXorY
.notZero .notZero
JSR MoveBody JSR MoveBody
JSL Sprite_CheckDamageFromPlayerLong JSL Sprite_CheckDamageFromPlayerLong
%DoDamageToPlayerSameLayerOnContact() %DoDamageToPlayerSameLayerOnContact()
PLX ;restores X PLX ;restores X
RTS RTS
} }
} }
@@ -252,9 +249,9 @@ Offspring3_Neck3_Y = $1A7D
SpawnLeftHead: SpawnLeftHead:
{ {
LDA #$CF LDA #$CF
JSL Sprite_SpawnDynamically : BMI .return JSL Sprite_SpawnDynamically : BMI .return
TYA : STA Offspring1_Id TYA : STA Offspring1_Id
;store the sub-type ;store the sub-type
LDA.b #$00 : STA $0E30, Y LDA.b #$00 : STA $0E30, Y
@@ -283,16 +280,16 @@ SpawnLeftHead:
PLX PLX
.return .return
RTS RTS
} }
; ========================================================= ; =========================================================
SpawnCenterHead: SpawnCenterHead:
{ {
LDA #$CF LDA #$CF
JSL Sprite_SpawnDynamically : BMI .return JSL Sprite_SpawnDynamically : BMI .return
TYA : STA Offspring3_Id TYA : STA Offspring3_Id
;store the sub-type ;store the sub-type
@@ -322,22 +319,19 @@ SpawnCenterHead:
PLX PLX
.return .return
RTS RTS
} }
; ========================================================= ; =========================================================
SpawnRightHead: SpawnRightHead:
{ {
LDA #$CF LDA #$CF
JSL Sprite_SpawnDynamically : BMI .return
JSL Sprite_SpawnDynamically : BMI .return
TYA : STA Offspring2_Id TYA : STA Offspring2_Id
;store the sub-type ;store the sub-type
LDA.b #$01 : STA $0E30, Y LDA.b #$01 : STA $0E30, Y
PHX PHX
; code that controls where to spawn the offspring. ; code that controls where to spawn the offspring.
REP #$20 REP #$20
@@ -360,9 +354,8 @@ SpawnRightHead:
STZ.w SprYRound, X STZ.w SprYRound, X
STZ.w SprXRound, X STZ.w SprXRound, X
PLX PLX
.return .return
RTS RTS
} }
; ========================================================= ; =========================================================
@@ -370,59 +363,59 @@ SpawnRightHead:
MoveBody: MoveBody:
{ {
; Handle the shell bg movement ; Handle the shell bg movement
; Trinexx_MoveBody ; Trinexx_MoveBody
LDA.w SprX, X : PHA LDA.w SprX, X : PHA
LDA.w SprY, X : PHA LDA.w SprY, X : PHA
JSL Sprite_Move JSL Sprite_Move
PLA PLA
LDY.b #$00 : SEC : SBC.w SprY, X : STA.w $0310 LDY.b #$00 : SEC : SBC.w SprY, X : STA.w $0310
BPL .pos_y_low BPL .pos_y_low
DEY DEY
.pos_y_low .pos_y_low
STY.w $0311 STY.w $0311
; ----------------------------------------------------- ; -----------------------------------------------------
PLA PLA
LDY.b #$00 : SEC : SBC.w SprX, X : STA.w $0312 LDY.b #$00 : SEC : SBC.w SprX, X : STA.w $0312
BPL .pos_x_low BPL .pos_x_low
DEY DEY
.pos_x_low .pos_x_low
STY.w $0313 STY.w $0313
; ----------------------------------------------------- ; -----------------------------------------------------
LDA.b #$01 : STA.w $0428 LDA.b #$01 : STA.w $0428
LDA.w SprY, X : SEC : SBC.b #$0C : STA.w $0DB0, X LDA.w SprY, X : SEC : SBC.b #$0C : STA.w $0DB0, X
LDA.w $0B08 : SEC : SBC.w SprX, X LDA.w $0B08 : SEC : SBC.w SprX, X
CLC : ADC.b #$02 CLC : ADC.b #$02
CMP.b #$04 : BCS .not_at_target CMP.b #$04 : BCS .not_at_target
LDA.w $0B09 : SEC : SBC.w SprY, X LDA.w $0B09 : SEC : SBC.w SprY, X
CLC : ADC.b #$02 CLC : ADC.b #$02
CMP.b #$04 : BCS .not_at_target CMP.b #$04 : BCS .not_at_target
.adjust_phase ; Unused? .adjust_phase ; Unused?
STZ.w $0D80, X STZ.w $0D80, X
LDA.b #$30 : STA.w $0DF0, X LDA.b #$30 : STA.w $0DF0, X
.not_at_target .not_at_target
; LayerEffect_Trinexx $0AFEF0 ; LayerEffect_Trinexx $0AFEF0
REP #$20 REP #$20
LDA.w $0422 : CLC : ADC.w $0312 : STA.w $0422 LDA.w $0422 : CLC : ADC.w $0312 : STA.w $0422
LDA.w $0424 : CLC : ADC.w $0310 : STA.w $0424 LDA.w $0424 : CLC : ADC.w $0310 : STA.w $0424
STZ.w $0312 : STZ.w $0310 STZ.w $0312 : STZ.w $0310
SEP #$20 SEP #$20
RTS RTS
} }
; ========================================================= ; =========================================================