Add GetNumberSpawnStalfos to KydrogBoss
This commit is contained in:
@@ -175,27 +175,24 @@ Sprite_KydrogBoss_Main:
|
|||||||
|
|
||||||
KydrogBoss_WalkState:
|
KydrogBoss_WalkState:
|
||||||
{
|
{
|
||||||
|
|
||||||
LDA $0DA0 : BEQ .not_flashing
|
LDA $0DA0 : BEQ .not_flashing
|
||||||
LDA.b #$20 : STA.w SprTimerD, X
|
LDA.b #$20 : STA.w SprTimerD, X
|
||||||
%GotoAction(6) ; Goto KydrogBoss_TakeDamage
|
%GotoAction(6) ; Goto KydrogBoss_TakeDamage
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
.not_flashing
|
.not_flashing
|
||||||
|
|
||||||
; LDA !OffspringCount : CMP.b #$05 : BCS .no_offspring
|
; LDA !OffspringCount : CMP.b #$05 : BCS .no_offspring
|
||||||
JSL GetRandomInt : AND.b #$0F : BNE .no_offspring
|
JSL GetRandomInt : AND.b #$0F : BNE .not_taunting
|
||||||
LDA.b #$10 : STA.w SprTimerD, X
|
LDA.b #$10 : STA.w SprTimerD, X
|
||||||
%GotoAction(8) ; Goto KydrogBoss_TauntPlayer
|
%GotoAction(8) ; Goto KydrogBoss_TauntPlayer
|
||||||
RTS
|
RTS
|
||||||
|
.not_taunting
|
||||||
|
|
||||||
.no_offspring
|
|
||||||
LDA #$50 : STA $09, X
|
LDA #$50 : STA $09, X
|
||||||
JSL Sprite_DirectionToFacePlayer
|
JSL Sprite_DirectionToFacePlayer
|
||||||
TYA : CMP.b #$02 : BCC .WalkRight
|
TYA : CMP.b #$02 : BCC .WalkRight
|
||||||
|
|
||||||
|
.WalkForward
|
||||||
.WalkForward
|
|
||||||
%StopIfTooClose()
|
%StopIfTooClose()
|
||||||
JSL Sprite_IsBelowPlayer ; Check if sprite is below player
|
JSL Sprite_IsBelowPlayer ; Check if sprite is below player
|
||||||
TYA : BNE .WalkBackwards ; If 1, go to KydrogBoss_WalkBackwards
|
TYA : BNE .WalkBackwards ; If 1, go to KydrogBoss_WalkBackwards
|
||||||
@@ -207,12 +204,9 @@ Sprite_KydrogBoss_Main:
|
|||||||
%GotoAction(5) ; Goto KydrogBoss_WalkBackwards
|
%GotoAction(5) ; Goto KydrogBoss_WalkBackwards
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
.WalkRight
|
.WalkRight
|
||||||
%StopIfTooClose()
|
%StopIfTooClose()
|
||||||
|
JSL Sprite_IsToRightOfPlayer : TYA : BNE .WalkLeft
|
||||||
JSL Sprite_IsToRightOfPlayer ; Check if sprite is to the right of player
|
|
||||||
TYA : BNE .WalkLeft ; If so, go to KydrogBoss_WalkLeft
|
|
||||||
|
|
||||||
%GotoAction(4)
|
%GotoAction(4)
|
||||||
RTS
|
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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user