NPC housekeeping

This commit is contained in:
scawful
2024-11-26 10:05:10 -05:00
parent 173f5816c5
commit b3be08ebcc
6 changed files with 133 additions and 171 deletions

View File

@@ -29,23 +29,20 @@
!ImperviousArrow = 00 ; 01 = Impervious to arrows !ImperviousArrow = 00 ; 01 = Impervious to arrows
!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_DekuScrub_Prep, Sprite_DekuScrub_Long);
%Set_Sprite_Properties(Sprite_DekuScrub_Prep, Sprite_DekuScrub_Long)
; ========================================================= ; =========================================================
Sprite_DekuScrub_Long: Sprite_DekuScrub_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
JSR Sprite_DekuScrub_Draw
JSR Sprite_DekuScrub_Draw ; Call the draw code JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSL Sprite_CheckActive ; Check if game is not paused JSR Sprite_DekuScrub_Main
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_DekuScrub_Main ; Call the main sprite code
.SpriteIsNotActive .SpriteIsNotActive
PLB ; Get back the databank we stored previously PLB
RTL ; Go back to original code RTL
} }
; ========================================================= ; =========================================================
@@ -53,7 +50,6 @@ Sprite_DekuScrub_Long:
Sprite_DekuScrub_Prep: Sprite_DekuScrub_Prep:
{ {
PHB : PHK : PLB PHB : PHK : PLB
LDA.b #$80 : STA.w SprDefl, X LDA.b #$80 : STA.w SprDefl, X
; Peacetime Deku Scrub NPCs ; Peacetime Deku Scrub NPCs
@@ -195,7 +191,6 @@ Sprite_DekuScrub_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

View File

@@ -27,12 +27,12 @@
!ImperviousArrow = 00 ; 01 = Impervious to arrows !ImperviousArrow = 00 ; 01 = Impervious to arrows
!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_Goron_Prep, Sprite_Goron_Long);
%Set_Sprite_Properties(Sprite_Goron_Prep, Sprite_Goron_Long)
Sprite_Goron_Long: Sprite_Goron_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
LDA.w WORLDFLAG : BEQ .kalyxo LDA.w WORLDFLAG : BEQ .kalyxo
JSR Sprite_EonGoron_Draw JSR Sprite_EonGoron_Draw
JMP + JMP +
@@ -40,11 +40,8 @@ Sprite_Goron_Long:
JSR Sprite_KalyxoGoron_Draw JSR Sprite_KalyxoGoron_Draw
+ +
JSL Sprite_DrawShadow JSL Sprite_DrawShadow
JSL Sprite_CheckActive JSL Sprite_CheckActive : BCC .SpriteIsNotActive
BCC .SpriteIsNotActive
JSR Sprite_Goron_Main JSR Sprite_Goron_Main
.SpriteIsNotActive .SpriteIsNotActive
PLB PLB
RTL RTL
@@ -59,7 +56,7 @@ Sprite_Goron_Prep:
+ +
PHX PHX
LDX $8A LDX $8A
LDA.l $7EF280,X : CMP.b #$20 : BEQ +++ LDA.l $7EF280, X : CMP.b #$20 : BEQ +++
PLX PLX
STZ.w SprAction, X STZ.w SprAction, X
++ ++

View File

@@ -34,10 +34,8 @@
Sprite_Korok_Long: Sprite_Korok_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
LDA $0AA5 : BEQ .done LDA $0AA5 : BEQ .done
LDA.w SprSubtype, X LDA.w SprSubtype, X : BEQ .draw_makar
CMP.b #$00 : BEQ .draw_makar
CMP.b #$01 : BEQ .draw_hollo CMP.b #$01 : BEQ .draw_hollo
CMP.b #$02 : BEQ .draw_rown CMP.b #$02 : BEQ .draw_rown
.draw_makar .draw_makar
@@ -52,14 +50,11 @@ Sprite_Korok_Long:
.done .done
JSL Sprite_DrawShadow JSL Sprite_DrawShadow
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_Korok_Main
JSR Sprite_Korok_Main ; Call the main sprite code
.SpriteIsNotActive .SpriteIsNotActive
PLB ; Get back the databank we stored previously PLB
RTL ; Go back to original code RTL
} }
Sprite_Korok_Prep: Sprite_Korok_Prep:

View File

@@ -37,23 +37,21 @@
Sprite_MakuTree_Long: Sprite_MakuTree_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
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_MakuTree_Main
JSR Sprite_MakuTree_Main ; Call the main sprite code
.SpriteIsNotActive .SpriteIsNotActive
PLB ; Get back the databank we stored previously PLB
RTL ; Go back to original code RTL
} }
; ========================================================= ; =========================================================
Sprite_MakuTree_Prep: Sprite_MakuTree_Prep:
{ {
PHB : PHK : PLB PHB : PHK : PLB
; Play the Maku Song ; Play the Maku Song
LDA.l OOSPROG2 : AND.b #$04 : BEQ +
LDA.b #$03 : STA.w $012C LDA.b #$03 : STA.w $012C
+
PLB PLB
RTL RTL
} }

View File

@@ -28,24 +28,19 @@
!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_MaskSalesman_Prep, Sprite_MaskSalesman_Long); %Set_Sprite_Properties(Sprite_MaskSalesman_Prep, Sprite_MaskSalesman_Long)
Sprite_MaskSalesman_Long: Sprite_MaskSalesman_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
JSR Sprite_MaskSalesman_Draw
JSR Sprite_MaskSalesman_Draw ; Call the draw code JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSL Sprite_CheckActive ; Check if game is not paused JSR Sprite_MaskSalesman_Main
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_MaskSalesman_Main ; Call the main sprite code
.SpriteIsNotActive .SpriteIsNotActive
PLB ; Get back the databank we stored previously PLB
RTL ; Go back to original code RTL
} }
Sprite_MaskSalesman_Prep: Sprite_MaskSalesman_Prep:
{ {
PHB : PHK : PLB PHB : PHK : PLB
@@ -76,10 +71,8 @@ Sprite_MaskSalesman_Main:
InquiryHandler: InquiryHandler:
{ {
%PlayAnimation(0, 1, 16) %PlayAnimation(0, 1, 16)
; Player has a Lv1 Ocarina, skip to the you got it message ; Player has a Lv1 Ocarina, skip to the you got it message
LDA.l $7EF34C : CMP.b #$01 : BEQ .has_ocarina LDA.l $7EF34C : CMP.b #$01 : BEQ .has_ocarina
; Player has no Ocarina or Lv2 Ocarina ; Player has no Ocarina or Lv2 Ocarina
; Do you want to buy a mask? ; Do you want to buy a mask?
%ShowSolicitedMessage($E5) : BCC .didnt_converse %ShowSolicitedMessage($E5) : BCC .didnt_converse
@@ -149,7 +142,6 @@ Sprite_MaskSalesman_Main:
OfferBunnyHood: OfferBunnyHood:
{ {
%PlayAnimation(0, 1, 16) %PlayAnimation(0, 1, 16)
%ShowUnconditionalMessage($07F) ; Bunny Hood for 100 rupees? %ShowUnconditionalMessage($07F) ; Bunny Hood for 100 rupees?
%GotoAction(8) %GotoAction(8)
RTS RTS
@@ -186,10 +178,8 @@ Sprite_MaskSalesman_Main:
{ {
%PlayAnimation(0, 1, 16) %PlayAnimation(0, 1, 16)
LDA $1CE8 : BNE .player_said_no LDA $1CE8 : BNE .player_said_no
REP #$20 REP #$20
LDA.l $7EF360 LDA.l $7EF360 : CMP.w #$64 ; 100 rupees
CMP.w #$64 ; 100 rupees
SEP #$30 SEP #$30
BCC .not_enough_rupees BCC .not_enough_rupees
@@ -201,8 +191,7 @@ Sprite_MaskSalesman_Main:
REP #$20 REP #$20
LDA.l $7EF360 LDA.l $7EF360
SEC SEC : SBC.w #$64 ; Subtract 100 rupees
SBC.w #$64 ; Subtract 100 rupees
STA.l $7EF360 STA.l $7EF360
SEP #$30 SEP #$30
@@ -224,8 +213,7 @@ Sprite_MaskSalesman_Main:
%PlayAnimation(0, 1, 16) %PlayAnimation(0, 1, 16)
LDA $1CE8 : BNE .player_said_no LDA $1CE8 : BNE .player_said_no
REP #$20 REP #$20
LDA.l $7EF360 LDA.l $7EF360 : CMP.w #$352 ; 850 rupees
CMP.w #$352 ; 850 rupees
SEP #$30 SEP #$30
BCC .not_enough_rupees BCC .not_enough_rupees
@@ -237,13 +225,11 @@ Sprite_MaskSalesman_Main:
REP #$20 REP #$20
LDA.l $7EF360 LDA.l $7EF360
SEC SEC : SBC.w #$352 ; Subtract 850 rupees
SBC.w #$352 ; Subtract 850 rupees
STA.l $7EF360 STA.l $7EF360
SEP #$30 SEP #$30
%ShowUnconditionalMessage($055) %ShowUnconditionalMessage($055)
%GotoAction(0) %GotoAction(0)
RTS RTS
@@ -272,7 +258,6 @@ Sprite_MaskSalesman_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

View File

@@ -44,17 +44,14 @@ Sprite_Mermaid_Long:
JSR Sprite_Librarian_Draw JSR Sprite_Librarian_Draw
JMP .Continue JMP .Continue
.MermaidDraw .MermaidDraw
JSR Sprite_Mermaid_Draw ; Call the draw code JSR Sprite_Mermaid_Draw
.Continue .Continue
JSL Sprite_DrawShadow JSL Sprite_DrawShadow
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_Mermaid_Main
JSR Sprite_Mermaid_Main ; Call the main sprite code
.SpriteIsNotActive .SpriteIsNotActive
PLB ; Get back the databank we stored previously PLB
RTL ; Go back to original code RTL
} }
@@ -169,8 +166,7 @@ Sprite_Mermaid_Main:
Maple_BoughtMilkBottle: Maple_BoughtMilkBottle:
{ {
REP #$20 REP #$20
LDA.l $7EF360 LDA.l $7EF360 : CMP.w #$1E ; 30 rupees
CMP.w #$1E ; 30 rupees
SEP #$30 SEP #$30
BCC .not_enough_rupees BCC .not_enough_rupees
@@ -193,8 +189,7 @@ Sprite_Mermaid_Main:
.finish_storage .finish_storage
REP #$20 REP #$20
LDA.l $7EF360 LDA.l $7EF360
SEC SEC : SBC.w #$1E ; Subtract 30 rupees
SBC.w #$1E ; Subtract 30 rupees
STA.l $7EF360 STA.l $7EF360
SEP #$30 SEP #$30
@@ -431,7 +426,6 @@ Sprite_Mermaid_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
@@ -515,7 +509,6 @@ Sprite_Maple_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
@@ -587,7 +580,6 @@ Sprite_Librarian_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