From 5115f1a01d8e21e11847807ae56a9bfbf8e74830 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 14 Jun 2024 19:46:29 -0400 Subject: [PATCH] include booki and thunder ghost in game --- Sprites/Enemies/booki.asm | 56 +++++++++++++++++++++++++++---- Sprites/Enemies/thunder_ghost.asm | 31 ++++++++++------- Sprites/all_sprites.asm | 4 +++ 3 files changed, 72 insertions(+), 19 deletions(-) diff --git a/Sprites/Enemies/booki.asm b/Sprites/Enemies/booki.asm index 7162215..f9339d4 100644 --- a/Sprites/Enemies/booki.asm +++ b/Sprites/Enemies/booki.asm @@ -2,8 +2,8 @@ ; Sprite Properties ; ========================================================= -!SPRID = $00; The sprite ID you are overwriting (HEX) -!NbrTiles = 00 ; Number of tiles used in a frame +!SPRID = $CC ; 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 @@ -29,7 +29,9 @@ !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_Booki_Prep, Sprite_Booki_Long); + +%Set_Sprite_Properties(Sprite_Booki_Prep, Sprite_Booki_Long) + ; ========================================================= Sprite_Booki_Long: @@ -53,7 +55,7 @@ Sprite_Booki_Prep: { PHB : PHK : PLB - ; Add more code here to initialize data + LDA.b #$80 : STA.w SprDefl, X PLB RTL @@ -65,13 +67,53 @@ Sprite_Booki_Main: { LDA.w SprAction, X JSL UseImplicitRegIndexedLocalJumpTable - dw Action00 + dw StalkPlayer + dw HideFromPlayer + dw HiddenFromPlayer + dw ApproachPlayer - Action00: + StalkPlayer: + { + %PlayAnimation(0,1,16) + RTS + } - RTS + HideFromPlayer: + { + %PlayAnimation(0,5,16) + RTS + } + + HiddenFromPlayer: + { + %PlayAnimation(5,5,16) + RTS + } + + ApproachPlayer: + { + %PlayAnimation(6,10,16) + } +} + +Sprite_Booki_Move: +{ + JSL Sprite_Move + JSL Sprite_BounceFromTileCollision + JSL Sprite_PlayerCantPassThrough + + LDA.w SprMiscB, X + JSL UseImplicitRegIndexedLocalJumpTable + + dw SlowFloat + + SlowFloat: + { + + RTS + } } diff --git a/Sprites/Enemies/thunder_ghost.asm b/Sprites/Enemies/thunder_ghost.asm index 23e8ed0..11f77b1 100644 --- a/Sprites/Enemies/thunder_ghost.asm +++ b/Sprites/Enemies/thunder_ghost.asm @@ -2,8 +2,8 @@ ; Sprite Properties ; ========================================================= -!SPRID = $00; The sprite ID you are overwriting (HEX) -!NbrTiles = 00 ; Number of tiles used in a frame +!SPRID = $CD ; The sprite ID you are overwriting (HEX) +!NbrTiles = 02 ; 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 @@ -34,6 +34,7 @@ ; ========================================================= Sprite_ThunderGhost_Long: +{ PHB : PHK : PLB JSR Sprite_ThunderGhost_Draw ; Call the draw code @@ -45,35 +46,40 @@ Sprite_ThunderGhost_Long: .SpriteIsNotActive PLB ; Get back the databank we stored previously RTL ; Go back to original code +} - - Sprite_ThunderGhost_Prep: +Sprite_ThunderGhost_Prep: +{ PHB : PHK : PLB - ; Add more code here to initialize data PLB RTL +} ; ========================================================= Sprite_ThunderGhost_Main: - LDA.w SprAction, X; Load the SprAction - JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in - dw Action00 +{ + LDA.w SprAction, X + JSL UseImplicitRegIndexedLocalJumpTable + dw ThunderGhostHandler - Action00: + ThunderGhostHandler: + { + %PlayAnimation(0, 7, 16) - - RTS - + RTS + } +} ; ========================================================= Sprite_ThunderGhost_Draw: +{ JSL Sprite_PrepOamCoord JSL Sprite_OAM_AllocateDeferToPlayer @@ -179,3 +185,4 @@ Sprite_ThunderGhost_Draw: db $02, $00, $00 db $02, $00, $00 db $02, $00, $00 +} diff --git a/Sprites/all_sprites.asm b/Sprites/all_sprites.asm index 8bf9e12..d8caf56 100644 --- a/Sprites/all_sprites.asm +++ b/Sprites/all_sprites.asm @@ -100,6 +100,10 @@ print "End of sea_urchin.asm ", pc incsrc "Sprites/Enemies/helmet_chuchu.asm" print "End of helmet_chuchu.asm ", pc +incsrc "Sprites/Enemies/booki.asm" + +incsrc "Sprites/Enemies/thunder_ghost.asm" + incsrc "Sprites/Objects/switch_track.asm" print "End of switch_track.asm ", pc