From d2d8c01926188cebaa0d08a29fed71c3e37c7aa0 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 11 Oct 2024 00:01:17 -0400 Subject: [PATCH] Merge Zora subtypes into parent sprite, setup Zora_Handler --- Sprites/NPCs/eon_zora_elder.asm | 2 +- Sprites/NPCs/zora.asm | 57 +++++++++------------------------ Sprites/NPCs/zora_princess.asm | 20 ++++++------ Sprites/all_sprites.asm | 3 ++ 4 files changed, 30 insertions(+), 52 deletions(-) diff --git a/Sprites/NPCs/eon_zora_elder.asm b/Sprites/NPCs/eon_zora_elder.asm index f2f63ff..2783141 100644 --- a/Sprites/NPCs/eon_zora_elder.asm +++ b/Sprites/NPCs/eon_zora_elder.asm @@ -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: diff --git a/Sprites/NPCs/zora.asm b/Sprites/NPCs/zora.asm index de3d863..dfe9cbe 100644 --- a/Sprites/NPCs/zora.asm +++ b/Sprites/NPCs/zora.asm @@ -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 diff --git a/Sprites/NPCs/zora_princess.asm b/Sprites/NPCs/zora_princess.asm index 95de6c1..62e6a42 100644 --- a/Sprites/NPCs/zora_princess.asm +++ b/Sprites/NPCs/zora_princess.asm @@ -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 } diff --git a/Sprites/all_sprites.asm b/Sprites/all_sprites.asm index 42de988..c8a6267 100644 --- a/Sprites/all_sprites.asm +++ b/Sprites/all_sprites.asm @@ -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