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
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
!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:
{
PHB : PHK : PLB
JSR Sprite_DekuScrub_Draw ; Call the draw code
JSL Sprite_CheckActive ; Check if game is not paused
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_DekuScrub_Main ; Call the main sprite code
JSR Sprite_DekuScrub_Draw
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSR Sprite_DekuScrub_Main
.SpriteIsNotActive
PLB ; Get back the databank we stored previously
RTL ; Go back to original code
PLB
RTL
}
; =========================================================
@@ -53,7 +50,6 @@ Sprite_DekuScrub_Long:
Sprite_DekuScrub_Prep:
{
PHB : PHK : PLB
LDA.b #$80 : STA.w SprDefl, X
; Peacetime Deku Scrub NPCs
@@ -195,7 +191,6 @@ Sprite_DekuScrub_Draw:
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
LDA .start_index, Y : STA $06
PHX
LDX .nbr_of_tiles, Y ;amount of tiles -1
LDY.b #$00

View File

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

View File

@@ -34,10 +34,8 @@
Sprite_Korok_Long:
{
PHB : PHK : PLB
LDA $0AA5 : BEQ .done
LDA.w SprSubtype, X
CMP.b #$00 : BEQ .draw_makar
LDA.w SprSubtype, X : BEQ .draw_makar
CMP.b #$01 : BEQ .draw_hollo
CMP.b #$02 : BEQ .draw_rown
.draw_makar
@@ -52,14 +50,11 @@ Sprite_Korok_Long:
.done
JSL Sprite_DrawShadow
JSL Sprite_CheckActive ; Check if game is not paused
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_Korok_Main ; Call the main sprite code
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSR Sprite_Korok_Main
.SpriteIsNotActive
PLB ; Get back the databank we stored previously
RTL ; Go back to original code
PLB
RTL
}
Sprite_Korok_Prep:

View File

@@ -37,23 +37,21 @@
Sprite_MakuTree_Long:
{
PHB : PHK : PLB
JSL Sprite_CheckActive ; Check if game is not paused
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_MakuTree_Main ; Call the main sprite code
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSR Sprite_MakuTree_Main
.SpriteIsNotActive
PLB ; Get back the databank we stored previously
RTL ; Go back to original code
PLB
RTL
}
; =========================================================
Sprite_MakuTree_Prep:
{
PHB : PHK : PLB
; Play the Maku Song
LDA.l OOSPROG2 : AND.b #$04 : BEQ +
LDA.b #$03 : STA.w $012C
+
PLB
RTL
}

View File

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

View File

@@ -44,17 +44,14 @@ Sprite_Mermaid_Long:
JSR Sprite_Librarian_Draw
JMP .Continue
.MermaidDraw
JSR Sprite_Mermaid_Draw ; Call the draw code
JSR Sprite_Mermaid_Draw
.Continue
JSL Sprite_DrawShadow
JSL Sprite_CheckActive ; Check if game is not paused
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_Mermaid_Main ; Call the main sprite code
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSR Sprite_Mermaid_Main
.SpriteIsNotActive
PLB ; Get back the databank we stored previously
RTL ; Go back to original code
PLB
RTL
}
@@ -169,8 +166,7 @@ Sprite_Mermaid_Main:
Maple_BoughtMilkBottle:
{
REP #$20
LDA.l $7EF360
CMP.w #$1E ; 30 rupees
LDA.l $7EF360 : CMP.w #$1E ; 30 rupees
SEP #$30
BCC .not_enough_rupees
@@ -193,8 +189,7 @@ Sprite_Mermaid_Main:
.finish_storage
REP #$20
LDA.l $7EF360
SEC
SBC.w #$1E ; Subtract 30 rupees
SEC : SBC.w #$1E ; Subtract 30 rupees
STA.l $7EF360
SEP #$30
@@ -431,7 +426,6 @@ Sprite_Mermaid_Draw:
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
LDA .start_index, Y : STA $06
PHX
LDX .nbr_of_tiles, Y ;amount of tiles -1
LDY.b #$00
@@ -515,7 +509,6 @@ Sprite_Maple_Draw:
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
LDA .start_index, Y : STA $06
PHX
LDX .nbr_of_tiles, Y ;amount of tiles -1
LDY.b #$00
@@ -587,7 +580,6 @@ Sprite_Librarian_Draw:
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
LDA .start_index, Y : STA $06
PHX
LDX .nbr_of_tiles, Y ;amount of tiles -1
LDY.b #$00