From a443be7951dbc39ffc177ff0cf9b4351e05dfcc4 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 27 Jul 2024 17:21:45 -0400 Subject: [PATCH] add EonOwl ID, update AI --- Sprites/NPCs/eon_owl.asm | 35 +++++++++++++++++++++++++++++++---- Sprites/all_sprites.asm | 4 ++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/Sprites/NPCs/eon_owl.asm b/Sprites/NPCs/eon_owl.asm index 68997ed..ffa0271 100644 --- a/Sprites/NPCs/eon_owl.asm +++ b/Sprites/NPCs/eon_owl.asm @@ -1,7 +1,8 @@ ; ========================================================= ; Sprite Properties ; ========================================================= -!SPRID = $F6 ; The sprite ID you are overwriting (HEX) + +!SPRID = Sprite_EonOwl !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 @@ -50,38 +51,63 @@ Sprite_EonOwl_Long: ; ========================================================= Sprite_EonOwl_Prep: +{ PHB : PHK : PLB - ; Add more code here to initialize data PLB RTL +} ; ========================================================= Sprite_EonOwl_Main: +{ LDA.w SprAction, X; Load the SprAction JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in + dw EonOwl_Idle - dw EonOwl_Flying + dw EonOwl_IntroDialogue + + dw EonOwl_FlyingAway EonOwl_Idle: { %PlayAnimation(0,1,16) + + LDA POSX : STA $02 + LDA POSY : STA $03 + LDA SprX, X : STA $04 + LDA SprY, X : STA $05 + JSL GetDistance8bit_Long : CMP #$18 : BCS .not_too_close + %GotoAction(1) + .not_too_close + + RTS + } + + EonOwl_IntroDialogue: + { + %PlayAnimation(0,1,16) + + ; TODO: Pick a dialogue ID and display it + RTS } EonOwl_Flying: { - %PlayAnimation(2,3,16) + %PlayAnimation(2,3,16) RTS } +} ; ========================================================= Sprite_EonOwl_Draw: +{ JSL Sprite_PrepOamCoord JSL Sprite_OAM_AllocateDeferToPlayer @@ -165,3 +191,4 @@ Sprite_EonOwl_Draw: db $02, $02 db $02, $02 db $02, $02 +} diff --git a/Sprites/all_sprites.asm b/Sprites/all_sprites.asm index b668879..871d8de 100644 --- a/Sprites/all_sprites.asm +++ b/Sprites/all_sprites.asm @@ -258,6 +258,10 @@ print "End of Lanmola_Expanded.asm ", pc incsrc "Sprites/NPCs/followers.asm" print "End of followers.asm ", pc +Sprite_EonOwl = $0A +incsrc "Sprites/NPCs/eon_owl.asm" +print "End of eon_owl.asm ", pc + incsrc "Sprites/NPCs/fortune_teller.asm" print "End of fortune_teller.asm ", pc