NPC Housekeeping
This commit is contained in:
@@ -44,16 +44,13 @@ Sprite_EonOwl_Long:
|
|||||||
JSR Sprite_KaeporaGaebora_Draw
|
JSR Sprite_KaeporaGaebora_Draw
|
||||||
JMP .HandleSprite
|
JMP .HandleSprite
|
||||||
.NotGaebora
|
.NotGaebora
|
||||||
JSR Sprite_EonOwl_Draw ; Call the draw code
|
JSR Sprite_EonOwl_Draw
|
||||||
.HandleSprite
|
.HandleSprite
|
||||||
JSL Sprite_CheckActive ; Check if game is not paused
|
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
|
||||||
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
|
JSR Sprite_EonOwl_Main
|
||||||
|
|
||||||
JSR Sprite_EonOwl_Main ; Call the main sprite code
|
|
||||||
|
|
||||||
.SpriteIsNotActive
|
.SpriteIsNotActive
|
||||||
PLB ; Get back the databank we stored previously
|
PLB
|
||||||
RTL ; Go back to original code
|
RTL
|
||||||
.Despawn
|
.Despawn
|
||||||
STZ.w SprState, X
|
STZ.w SprState, X
|
||||||
PLB
|
PLB
|
||||||
@@ -97,7 +94,6 @@ Sprite_EonOwl_Main:
|
|||||||
EonOwl_Idle:
|
EonOwl_Idle:
|
||||||
{
|
{
|
||||||
%PlayAnimation(0,1,16)
|
%PlayAnimation(0,1,16)
|
||||||
|
|
||||||
LDA.w POSX : STA $02
|
LDA.w POSX : STA $02
|
||||||
LDA.w POSY : STA $03
|
LDA.w POSY : STA $03
|
||||||
LDA.w SprX, X : STA $04
|
LDA.w SprX, X : STA $04
|
||||||
@@ -105,26 +101,21 @@ Sprite_EonOwl_Main:
|
|||||||
JSL GetDistance8bit_Long : CMP #$28 : BCS .not_too_close
|
JSL GetDistance8bit_Long : CMP #$28 : BCS .not_too_close
|
||||||
%GotoAction(1)
|
%GotoAction(1)
|
||||||
.not_too_close
|
.not_too_close
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
EonOwl_IntroDialogue:
|
EonOwl_IntroDialogue:
|
||||||
{
|
{
|
||||||
%PlayAnimation(0,1,16)
|
%PlayAnimation(0,1,16)
|
||||||
|
|
||||||
%ShowUnconditionalMessage($00E6)
|
%ShowUnconditionalMessage($00E6)
|
||||||
|
|
||||||
LDA.b #$C0 : STA.w SprTimerA, X
|
LDA.b #$C0 : STA.w SprTimerA, X
|
||||||
%GotoAction(2)
|
%GotoAction(2)
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EonOwl_FlyingAway:
|
EonOwl_FlyingAway:
|
||||||
{
|
{
|
||||||
%PlayAnimation(2,3,10)
|
%PlayAnimation(2,3,10)
|
||||||
|
|
||||||
LDA.b #$F8 : STA.w SprYSpeed, X
|
LDA.b #$F8 : STA.w SprYSpeed, X
|
||||||
JSL Sprite_Move
|
JSL Sprite_Move
|
||||||
|
|
||||||
@@ -153,8 +144,8 @@ Sprite_EonOwl_Main:
|
|||||||
KaeporaGaebora_Respond:
|
KaeporaGaebora_Respond:
|
||||||
{
|
{
|
||||||
LDA $1CE8 : BNE .player_said_no
|
LDA $1CE8 : BNE .player_said_no
|
||||||
%GotoAction(5)
|
%GotoAction(5)
|
||||||
RTS
|
RTS
|
||||||
.player_said_no
|
.player_said_no
|
||||||
%GotoAction(5)
|
%GotoAction(5)
|
||||||
LDA.b #$60 : STA.w SprTimerA, X
|
LDA.b #$60 : STA.w SprTimerA, X
|
||||||
@@ -168,7 +159,7 @@ Sprite_EonOwl_Main:
|
|||||||
LDA.b #-FlyAwaySpeed : STA.w SprYSpeed, X
|
LDA.b #-FlyAwaySpeed : STA.w SprYSpeed, X
|
||||||
JSL Sprite_Move
|
JSL Sprite_Move
|
||||||
LDA.w SprTimerA, X : BNE .not_ready
|
LDA.w SprTimerA, X : BNE .not_ready
|
||||||
STZ.w SprState, X
|
STZ.w SprState, X
|
||||||
.not_ready
|
.not_ready
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -184,7 +175,6 @@ Sprite_EonOwl_Draw:
|
|||||||
LDA.w SprFrame, X : TAY ;Animation Frame
|
LDA.w SprFrame, X : TAY ;Animation Frame
|
||||||
LDA .start_index, Y : STA $06
|
LDA .start_index, Y : STA $06
|
||||||
|
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
||||||
LDY.b #$00
|
LDY.b #$00
|
||||||
@@ -266,7 +256,6 @@ Sprite_KaeporaGaebora_Draw:
|
|||||||
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
||||||
LDA .start_index, Y : STA $06
|
LDA .start_index, Y : STA $06
|
||||||
|
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
||||||
LDY.b #$00
|
LDY.b #$00
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
Sprite_EonZoraElder_Main:
|
Sprite_EonZoraElder_Main:
|
||||||
{
|
{
|
||||||
LDA.w SprAction, X; Load the SprAction
|
LDA.w SprAction, X
|
||||||
JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in
|
JSL UseImplicitRegIndexedLocalJumpTable
|
||||||
|
|
||||||
dw EonZoraElder_Idle
|
dw EonZoraElder_Idle
|
||||||
dw EonZoraElder_Surprised
|
dw EonZoraElder_Surprised
|
||||||
@@ -29,7 +29,6 @@ Sprite_EonZoraElder_Draw:
|
|||||||
LDA.w SprFrame, X : TAY ;Animation Frame
|
LDA.w SprFrame, X : TAY ;Animation Frame
|
||||||
LDA .start_index, Y : STA $06
|
LDA .start_index, Y : STA $06
|
||||||
|
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
||||||
LDY.b #$00
|
LDY.b #$00
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
; =========================================================
|
; =========================================================
|
||||||
; Farore Sprite Properties
|
; Farore
|
||||||
; =========================================================
|
|
||||||
|
|
||||||
!SPRID = Sprite_Farore
|
!SPRID = Sprite_Farore
|
||||||
!NbrTiles = 2 ; Number of tiles used in a frame
|
!NbrTiles = 2 ; Number of tiles used in a frame
|
||||||
@@ -30,8 +29,6 @@
|
|||||||
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
|
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
|
||||||
!Boss = 00 ; 00 = normal sprite, 01 = sprite is a boss
|
!Boss = 00 ; 00 = normal sprite, 01 = sprite is a boss
|
||||||
|
|
||||||
; =========================================================
|
|
||||||
|
|
||||||
%Set_Sprite_Properties(Sprite_Farore_Prep, Sprite_Farore_Long)
|
%Set_Sprite_Properties(Sprite_Farore_Prep, Sprite_Farore_Long)
|
||||||
|
|
||||||
; =========================================================
|
; =========================================================
|
||||||
@@ -39,16 +36,12 @@
|
|||||||
Sprite_Farore_Long:
|
Sprite_Farore_Long:
|
||||||
{
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
JSR Sprite_Farore_Draw
|
||||||
JSR Sprite_Farore_Draw ; Call the draw code
|
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
|
||||||
JSL Sprite_CheckActive ; Check if game is not paused
|
JSR Sprite_Farore_Main
|
||||||
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
|
.SpriteIsNotActive
|
||||||
|
PLB
|
||||||
JSR Sprite_Farore_Main ; Call the main sprite code
|
RTL
|
||||||
|
|
||||||
.SpriteIsNotActive
|
|
||||||
PLB ; Get back the databank we stored previously
|
|
||||||
RTL ; Go back to original code
|
|
||||||
}
|
}
|
||||||
|
|
||||||
; =========================================================
|
; =========================================================
|
||||||
@@ -56,12 +49,10 @@ Sprite_Farore_Long:
|
|||||||
Sprite_Farore_Prep:
|
Sprite_Farore_Prep:
|
||||||
{
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
|
||||||
LDA.b #$80 : STA.w SprDefl, X ; Don't kill Farore when she goes off screen
|
LDA.b #$80 : STA.w SprDefl, X ; Don't kill Farore when she goes off screen
|
||||||
LDA.l $7EF300 : BEQ .PlayIntro
|
LDA.l $7EF300 : BEQ .PlayIntro
|
||||||
STZ.w SprState, X ; Kill the sprite
|
STZ.w SprState, X ; Kill the sprite
|
||||||
.PlayIntro
|
.PlayIntro
|
||||||
|
|
||||||
PLB
|
PLB
|
||||||
RTL
|
RTL
|
||||||
}
|
}
|
||||||
@@ -75,8 +66,8 @@ STORY_STATE = $B6
|
|||||||
|
|
||||||
Sprite_Farore_Main:
|
Sprite_Farore_Main:
|
||||||
{
|
{
|
||||||
LDA.w SprAction, X; Load the SprAction
|
LDA.w SprAction, X
|
||||||
JSL UseImplicitRegIndexedLocalJumpTable ; Goto the SprAction we are currently in
|
JSL UseImplicitRegIndexedLocalJumpTable
|
||||||
|
|
||||||
dw IntroStart
|
dw IntroStart
|
||||||
dw MoveUpTowardsFarore
|
dw MoveUpTowardsFarore
|
||||||
@@ -144,13 +135,12 @@ Sprite_Farore_Main:
|
|||||||
JSL Sprite_ApplySpeedTowardsPlayer
|
JSL Sprite_ApplySpeedTowardsPlayer
|
||||||
JSL Sprite_MoveVert
|
JSL Sprite_MoveVert
|
||||||
LDA.w SprTimerA, X : BNE +
|
LDA.w SprTimerA, X : BNE +
|
||||||
|
STZ $2F
|
||||||
STZ $2F
|
LDA #$00 : STA InCutScene
|
||||||
LDA #$00 : STA InCutScene
|
; "I am Farore, the Oracle of Secrets."
|
||||||
%ShowUnconditionalMessage($0E) ; "I am Farore, the Oracle of Secrets."
|
%ShowUnconditionalMessage($0E)
|
||||||
|
%GotoAction(4)
|
||||||
%GotoAction(4)
|
+
|
||||||
+
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +161,6 @@ Sprite_Farore_Main:
|
|||||||
LDA.b #$08 : STA.b $49 ; Auto-movement north
|
LDA.b #$08 : STA.b $49 ; Auto-movement north
|
||||||
%PlayAnimation(3, 4, 8)
|
%PlayAnimation(3, 4, 8)
|
||||||
|
|
||||||
|
|
||||||
LDA.b #$15
|
LDA.b #$15
|
||||||
JSL Sprite_ApplySpeedTowardsPlayer
|
JSL Sprite_ApplySpeedTowardsPlayer
|
||||||
JSL Sprite_MoveVert
|
JSL Sprite_MoveVert
|
||||||
@@ -188,16 +177,13 @@ Sprite_Farore_Main:
|
|||||||
; 06
|
; 06
|
||||||
MakuArea_FaroreFollowPlayer:
|
MakuArea_FaroreFollowPlayer:
|
||||||
{
|
{
|
||||||
;.keep_walking
|
|
||||||
%PlayAnimation(3, 4, 8)
|
%PlayAnimation(3, 4, 8)
|
||||||
|
|
||||||
LDA.b #$15
|
LDA.b #$15
|
||||||
JSL Sprite_ApplySpeedTowardsPlayer
|
JSL Sprite_ApplySpeedTowardsPlayer
|
||||||
JSL Sprite_MoveVert
|
JSL Sprite_MoveVert
|
||||||
|
|
||||||
; LDA $B6 : CMP.b #$02 : BEQ .keep_walking
|
|
||||||
%GotoAction(6)
|
%GotoAction(6)
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +214,7 @@ Sprite_Farore_Draw:
|
|||||||
PHX
|
PHX
|
||||||
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
||||||
LDY.b #$00
|
LDY.b #$00
|
||||||
.nextTile
|
.nextTile
|
||||||
|
|
||||||
PHX ; Save current Tile Index?
|
PHX ; Save current Tile Index?
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
; 0x00 - Link's house
|
; 0x00 - Link's house
|
||||||
; 0x01 - Sanctuary (Hall of Secrets)
|
; 0x01 - Sanctuary (Hall of Secrets)
|
||||||
; 0x02 - Castle Prison
|
; 0x02 - Castle Prison
|
||||||
@@ -46,10 +44,10 @@ org $05ED10
|
|||||||
NOP #5
|
NOP #5
|
||||||
|
|
||||||
; LDA.b #$19 ; SONG 19
|
; LDA.b #$19 ; SONG 19
|
||||||
;#_05ED12: STA.w $012C
|
; STA.w $012C
|
||||||
org $05ED63
|
org $05ED63
|
||||||
NOP #5
|
NOP #5
|
||||||
; #_05ED63: LDA.b #$10 ; SONG 10
|
; #_05ED63: LDA.b #$10 ; SONG 10
|
||||||
; #_05ED65: STA.w $012C
|
; #_05ED65: STA.w $012C
|
||||||
|
|
||||||
pullpc
|
pullpc
|
||||||
|
|||||||
@@ -170,7 +170,6 @@ Sprite_Korok_DrawMakar:
|
|||||||
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
||||||
LDA .start_index, Y : STA $06
|
LDA .start_index, Y : STA $06
|
||||||
|
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
||||||
LDY.b #$00
|
LDY.b #$00
|
||||||
@@ -298,7 +297,6 @@ Sprite_Korok_DrawHollo:
|
|||||||
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
||||||
LDA .start_index, Y : STA $06
|
LDA .start_index, Y : STA $06
|
||||||
|
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
||||||
LDY.b #$00
|
LDY.b #$00
|
||||||
@@ -426,7 +424,6 @@ Sprite_Korok_DrawRown:
|
|||||||
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
|
||||||
LDA .start_index, Y : STA $06
|
LDA .start_index, Y : STA $06
|
||||||
|
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
||||||
LDY.b #$00
|
LDY.b #$00
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
Sprite_Mermaid_Long:
|
Sprite_Mermaid_Long:
|
||||||
{
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
|
||||||
LDA.w SprMiscE, X : BEQ .MermaidDraw
|
LDA.w SprMiscE, X : BEQ .MermaidDraw
|
||||||
CMP.b #$02 : BEQ .LibrarianDraw
|
CMP.b #$02 : BEQ .LibrarianDraw
|
||||||
JSR Sprite_Maple_Draw
|
JSR Sprite_Maple_Draw
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ Sprite_Piratian_Prep:
|
|||||||
|
|
||||||
Sprite_Piratian_Main:
|
Sprite_Piratian_Main:
|
||||||
{
|
{
|
||||||
JSR Sprite_Piratian_Move ; Call the move code
|
JSR Sprite_Piratian_Move
|
||||||
|
|
||||||
LDA.w SprAction, X
|
LDA.w SprAction, X
|
||||||
JSL UseImplicitRegIndexedLocalJumpTable
|
JSL UseImplicitRegIndexedLocalJumpTable
|
||||||
|
|||||||
Reference in New Issue
Block a user