Merge Zora subtypes into parent sprite, setup Zora_Handler

This commit is contained in:
scawful
2024-10-11 00:01:17 -04:00
parent b8d931333a
commit d2d8c01926
4 changed files with 30 additions and 52 deletions

View File

@@ -6,7 +6,7 @@ Sprite_EonZoraElder_Main:
JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in
dw EonZoraElder_Idle
dw EoNZoraElder_Surprised
dw EonZoraElder_Surprised
dw EonZoraElder_WithRod
EonZoraElder_Idle:

View File

@@ -1,62 +1,32 @@
; Sea Zora NPC Handler
!SPRID = $00; The sprite ID you are overwriting (HEX)
!NbrTiles = 00 ; Number of tiles used in a frame
!Harmless = 00 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
!Health = 00 ; Number of Health the sprite have
!Damage = 00 ; (08 is a whole heart), 04 is half heart
!DeathAnimation = 00 ; 00 = normal death, 01 = no death animation
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
!Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow
!Palette = 00 ; Unused in this template (can be 0 to 7)
!Hitbox = 00 ; 00 to 31, can be viewed in sprite draw tool
!Persist = 00 ; 01 = your sprite continue to live offscreen
!Statis = 00 ; 00 = is sprite is alive?, (kill all enemies room)
!CollisionLayer = 00 ; 01 = will check both layer for collision
!CanFall = 00 ; 01 sprite can fall in hole, 01 = can't fall
!DeflectArrow = 00 ; 01 = deflect arrows
!WaterSprite = 00 ; 01 = can only walk shallow water
!Blockable = 00 ; 01 = can be blocked by link's shield?
!Prize = 00 ; 00-15 = the prize pack the sprite will drop from
!Sound = 00 ; 01 = Play different sound when taking damage
!Interaction = 00 ; ?? No documentation
!Statue = 00 ; 01 = Sprite is statue
!DeflectProjectiles = 00 ; 01 = Sprite will deflect ALL projectiles
!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_Zora_Prep, Sprite_Zora_Long)
Sprite_Zora_Long:
{
PHB : PHK : PLB
; Check what Zora we are drawing
LDA.w ROOMH : BNE .not_princess
LDA.w ROOM : CMP.b #$05 : BNE .not_princess
JSR Sprite_ZoraPrincess_Draw
LDA.b #$A0
JMP +
REP #$30
LDA.w ROOM : CMP.w #$0105 : BNE .not_princess
SEP #$30
JSR Sprite_ZoraPrincess_Draw
LDA.b #$01 : STA.w SprMiscG, X
JMP +
.not_princess
SEP #$30
LDA.w WORLDFLAG : BNE .eon_draw
JSR Sprite_EonZora_Draw
LDA.b #$02 : STA.w SprMiscG, X
JMP +
.eon_draw
LDA.w SprSubtype, X : BNE .special_zora
JSR Sprite_Zora_Draw
STZ.w SprMiscG, X
JMP +
.special_zora
JSR Sprite_EonZoraElder_Draw
LDA.b #$03 : STA.w SprMiscG, X
+
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSR Sprite_Zora_Main
JSR Sprite_Zora_Handler
.SpriteIsNotActive
PLB
@@ -73,6 +43,11 @@ Sprite_Zora_Prep:
Sprite_Zora_Handler:
{
LDA.w SprMiscG, X
CMP.b #$02 : BNE .not_princess
JSR Sprite_ZoraPrincess_Main
RTS
.not_princess
JSL UseImplicitRegIndexedLocalJumpTable
dw Sprite_Zora_Main

View File

@@ -28,7 +28,7 @@
!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_ZoraPrincess_Prep, Sprite_ZoraPrincess_Long);
%Set_Sprite_Properties(Sprite_ZoraPrincess_Prep, Sprite_Zora_Long);
Sprite_ZoraPrincess_Long:
{
@@ -47,17 +47,17 @@ Sprite_ZoraPrincess_Long:
Sprite_ZoraPrincess_Prep:
{
PHB : PHK : PLB
LDA.l $7EF302
BEQ .doesnt_have_mask
STZ.w $0DD0, X ; Kill the sprite
.doesnt_have_mask
PHB : PHK : PLB
LDA.l $7EF302
BEQ .doesnt_have_mask
STZ.w $0DD0, X ; Kill the sprite
.doesnt_have_mask
LDA #$00 : STA $0CAA, X
LDA #$00 : STA $0B6B, X
LDA #$00 : STA $0CAA, X
LDA #$00 : STA $0B6B, X
PLB
RTL
PLB
RTL
}

View File

@@ -267,6 +267,9 @@ incsrc "Sprites/NPCs/eon_owl.asm"
print "End of eon_owl.asm ", pc
Sprite_ZoraPrincess = $B8
incsrc "Sprites/NPCs/eon_zora.asm"
incsrc "Sprites/NPCs/eon_zora_elder.asm"
incsrc "Sprites/NPCs/zora.asm"
incsrc "Sprites/NPCs/zora_princess.asm"
print "End of zora_princess.asm ", pc