Cleanup Kydreeok and Kydreeok Head

This commit is contained in:
scawful
2024-10-06 23:38:43 -04:00
parent 80828790c9
commit 8060b82251
2 changed files with 235 additions and 267 deletions

View File

@@ -29,27 +29,23 @@
!ImperviousArrow = 00 ; 01 = Impervious to arrows
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
!Boss = 01 ; 00 = normal sprite, 01 = sprite is a boss
%Set_Sprite_Properties(Sprite_Kydreeok_Prep, Sprite_Kydreeok_Long);
; =========================================================
%Set_Sprite_Properties(Sprite_Kydreeok_Prep, Sprite_Kydreeok_Long)
Sprite_Kydreeok_Long:
{
PHB : PHK : PLB
JSR Sprite_Kydreeok_Draw
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSR Sprite_Kydreeok_Main
JSR Sprite_Kydreeok_CheckIfDead
JSR MaybeRespawnHead
.SpriteIsNotActive
LDA.w SprState, X : BNE .not_inactive
JSR ApplyEndPalette
.not_inactive
PLB ; Get back the databank we stored previously
RTL ; Go back to original code
PLB
RTL
}
; =========================================================
@@ -57,7 +53,6 @@ Sprite_Kydreeok_Long:
Sprite_Kydreeok_Prep:
{
PHB : PHK : PLB
LDA #$40 : STA.w SprTimerA, X
LDA.b #$08 : STA $36 ; Stores initial movement speeds
LDA.b #$06 : STA $0428 ; Allows BG1 to move
@@ -274,7 +269,6 @@ Sprite_Kydreeok_Main:
Kydreeok_Dead:
{
LDA $1C : ORA.b #$01 : STA $1C ;turn on BG2 (Body)
; Flicker the body every other frame using the timer
LDA.w SprTimerA, X : AND.b #$01 : BEQ .flicker
@@ -282,10 +276,8 @@ Sprite_Kydreeok_Main:
.flicker
; Spawn the explosion
LDA.b #$00 ; SPRITE 00
JSL Sprite_SpawnDynamically
BMI .no_space
LDA.b #$00
JSL Sprite_SpawnDynamically : BMI .no_space
LDA.b #$0B : STA.w $0AAA
LDA.b #$04 : STA.w $0DD0,Y
LDA.b #$03 : STA.w $0E40,Y
@@ -294,21 +286,14 @@ Sprite_Kydreeok_Main:
LDA.w $0FD9 : STA.w SprXH,Y
LDA.w $0FDA : STA.w SprY,Y
LDA.w $0FDB : STA.w SprYH,Y
LDA.b #$1F
STA.w $0DF0,Y
STA.w $0D90,Y
LDA.b #$1F : STA.w $0DF0,Y : STA.w $0D90,Y
LDA.b #$02 : STA.w $0F20,Y
.no_space
LDA.w SprTimerA, X : BNE .continue
STZ.w $0422
STZ.w $0424
LDA $1C : ORA.b #$01 : STA $1C ;turn on BG2 (Body)
STZ.w $0DD0, X ; GG
.continue
RTS
}
@@ -333,7 +318,6 @@ Sprite_Kydreeok_Main:
%GotoAction(2)
.continue
RTS
}
}
@@ -367,12 +351,10 @@ Offspring3_Neck3_Y = $1A7D
SpawnLeftHead:
{
LDA #$CF
JSL Sprite_SpawnDynamically : BMI .return
TYA : STA.w Offspring1_Id
;store the sub-type
LDA.b #$00 : STA $0E30, Y
PHX
; code that controls where to spawn the offspring.
REP #$20
@@ -395,7 +377,6 @@ SpawnLeftHead:
STZ.w SprYRound, X
STZ.w SprXRound, X
PLX
.return
RTS
}
@@ -676,7 +657,6 @@ Sprite_Kydreeok_Draw:
.next_tile
PHX ; Save current Tile Index?
TXA : CLC : ADC $06 ; Add Animation Index Offset
PHA ; Keep the value with animation index offset?
@@ -704,13 +684,9 @@ Sprite_Kydreeok_Draw:
LDA .properties, X : STA ($90), Y
PHY
TYA : LSR #2 : TAY
LDA.b #$02 : ORA $0F : STA ($92), Y ; store size in oam buffer
PLY : INY
PLX : DEX : BPL .next_tile
PLX

View File

@@ -30,9 +30,7 @@
!ImperviousArrow = 00 ; 01 = Impervious to arrows
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
!Boss = 00 ; 00 = normal sprite, 01 = sprite is a boss
%Set_Sprite_Properties(Sprite_KydreeokHead_Prep, Sprite_KydreeokHead_Long);
; =========================================================
%Set_Sprite_Properties(Sprite_KydreeokHead_Prep, Sprite_KydreeokHead_Long)
Sprite_KydreeokHead_Long:
{
@@ -241,7 +239,6 @@ KydreeokHead_RotationMove:
; LDA.b #$01 : STA.w SprMiscE, X
; LDA.b #$10 : STA.w SprTimerE, X
; .no_independent
RTS
}
@@ -251,7 +248,6 @@ Sprite_KydreeokHead_Damage_Flash:
; Change the palette to the next in the cycle
LDA.w $0EB0, X : INC : CMP.b #$08 : BNE .dontReset
LDA.b #$00
.dontReset
STA.w $0EB0, X
BRA .flash
@@ -308,7 +304,6 @@ RotateHeadUsingSpeedValues:
.not_full
STY.w Neck_Index
JSL Sprite_MoveLong
RTS
}
@@ -384,7 +379,6 @@ MoveWithBody:
; STA.w SprX, X
LDA.w SprY, Y : SEC : SBC #$0F
; STA.w SprY, X
STA.w SprMiscB, X
STA.w $19F1
@@ -699,7 +693,6 @@ Sprite_KydreeokHead_Draw:
.next_tile
PHX ; Save current Tile Index?
; Add Animation Index Offset
TXA : CLC : ADC $06
@@ -724,7 +717,6 @@ Sprite_KydreeokHead_Draw:
LDA .properties, X : ORA $08 : STA ($90), Y
PHY
TYA : LSR #2 : TAY
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
PLY : INY