Add GetNumberSpawnStalfos to KydrogBoss

This commit is contained in:
scawful
2024-02-16 17:03:38 -05:00
parent 0848b1fd86
commit 92581f6783

View File

@@ -175,50 +175,44 @@ Sprite_KydrogBoss_Main:
KydrogBoss_WalkState: KydrogBoss_WalkState:
{ {
LDA $0DA0 : BEQ .not_flashing
LDA.b #$20 : STA.w SprTimerD, X
%GotoAction(6) ; Goto KydrogBoss_TakeDamage
RTS
.not_flashing
LDA $0DA0 : BEQ .not_flashing ; LDA !OffspringCount : CMP.b #$05 : BCS .no_offspring
LDA.b #$20 : STA.w SprTimerD, X JSL GetRandomInt : AND.b #$0F : BNE .not_taunting
%GotoAction(6) ; Goto KydrogBoss_TakeDamage LDA.b #$10 : STA.w SprTimerD, X
RTS %GotoAction(8) ; Goto KydrogBoss_TauntPlayer
RTS
.not_taunting
.not_flashing LDA #$50 : STA $09, X
JSL Sprite_DirectionToFacePlayer
TYA : CMP.b #$02 : BCC .WalkRight
; LDA !OffspringCount : CMP.b #$05 : BCS .no_offspring .WalkForward
JSL GetRandomInt : AND.b #$0F : BNE .no_offspring %StopIfTooClose()
LDA.b #$10 : STA.w SprTimerD, X JSL Sprite_IsBelowPlayer ; Check if sprite is below player
%GotoAction(8) ; Goto KydrogBoss_TauntPlayer TYA : BNE .WalkBackwards ; If 1, go to KydrogBoss_WalkBackwards
RTS
.no_offspring %GotoAction(2) ; Goto KydrogBoss_WalkForward
LDA #$50 : STA $09, X RTS
JSL Sprite_DirectionToFacePlayer
TYA : CMP.b #$02 : BCC .WalkRight
.WalkBackwards
%GotoAction(5) ; Goto KydrogBoss_WalkBackwards
RTS
.WalkForward .WalkRight
%StopIfTooClose() %StopIfTooClose()
JSL Sprite_IsBelowPlayer ; Check if sprite is below player JSL Sprite_IsToRightOfPlayer : TYA : BNE .WalkLeft
TYA : BNE .WalkBackwards ; If 1, go to KydrogBoss_WalkBackwards %GotoAction(4)
RTS
%GotoAction(2) ; Goto KydrogBoss_WalkForward .WalkLeft
RTS %GotoAction(3) ; Goto KydrogBoss_WalkLeft
RTS
.WalkBackwards
%GotoAction(5) ; Goto KydrogBoss_WalkBackwards
RTS
.WalkRight
%StopIfTooClose()
JSL Sprite_IsToRightOfPlayer ; Check if sprite is to the right of player
TYA : BNE .WalkLeft ; If so, go to KydrogBoss_WalkLeft
%GotoAction(4)
RTS
.WalkLeft
%GotoAction(3) ; Goto KydrogBoss_WalkLeft
RTS
} }
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
@@ -749,19 +743,24 @@ Kydrog_ThrowBoneAtPlayer:
; oh right yeah y will be equal to the sprite you spawned for that frame ; oh right yeah y will be equal to the sprite you spawned for that frame
; but if you want to do a count what you would do: ; but if you want to do a count what you would do:
; PHX
; STZ $00
; LDX.b #$10
; .loop
; DEX
; LDA $0E20, X : CMP.b #$skull : BNE .notSkull
; LDA $0DD0, X : CMP.b #$09 : BNE .notSkull
; INC $00
; .notSkull
; CPX.b #$00 : BNE .loop
; PLX
; $00 = your stalfos skull count ; $00 = your stalfos skull count
GetNumberSpawnStalfos:
{
PHX
STZ $00
LDX.b #$10
.loop
DEX
LDA $0E20, X : CMP.b #$skull : BNE .notSkull
LDA $0DD0, X : CMP.b #$09 : BNE .notSkull
INC $00
.notSkull
CPX.b #$00 : BNE .loop
PLX
RTL
}