From 206993e3d542f3d637c62eec9c316f162725b709 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 19 Jan 2025 12:34:53 -0500 Subject: [PATCH] Add Piratian friendly and aggro behavior --- Sprites/Bosses/dark_link.asm | 2 +- Sprites/Bosses/octoboss.asm | 12 ++--- Sprites/Enemies/keese.asm | 2 +- Sprites/Enemies/octorok.asm | 2 +- Sprites/NPCs/goron.asm | 2 +- Sprites/NPCs/piratian.asm | 81 ++++++++------------------------- Sprites/NPCs/tingle.asm | 2 +- Sprites/Objects/collectible.asm | 2 +- 8 files changed, 28 insertions(+), 77 deletions(-) diff --git a/Sprites/Bosses/dark_link.asm b/Sprites/Bosses/dark_link.asm index 68c89f3..16aca25 100644 --- a/Sprites/Bosses/dark_link.asm +++ b/Sprites/Bosses/dark_link.asm @@ -1,7 +1,7 @@ ; ========================================================= ; Dark Link Boss -!SPRID = $C1 ; The sprite ID you are overwriting (HEX) +!SPRID = $C1 !NbrTiles = 4 ; 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 diff --git a/Sprites/Bosses/octoboss.asm b/Sprites/Bosses/octoboss.asm index 299510e..678d791 100644 --- a/Sprites/Bosses/octoboss.asm +++ b/Sprites/Bosses/octoboss.asm @@ -501,7 +501,7 @@ Sprite_Octoboss_Secondary: LDA.w SprHealth, Y : STA.b $00 LDA.w SprHealth, X : CLC : ADC.b $00 RTS - } + } } Sprite_Octoboss_Draw: @@ -509,10 +509,9 @@ Sprite_Octoboss_Draw: JSL Sprite_PrepOamCoord JSL Sprite_OAM_AllocateDeferToPlayer - LDA $0DC0, X : CLC : ADC SprFrame, X : TAY;Animation Frame + LDA $0DC0, X : CLC : ADC.w SprFrame, X : TAY LDA .start_index, Y : STA $06 - PHX LDX .nbr_of_tiles, Y ;amount of tiles -1 LDY.b #$00 @@ -560,11 +559,6 @@ Sprite_Octoboss_Draw: RTS - - ; ========================================================= - ; Sprite Draw Generated Data - ; This is where the generated Data for the sprite go - ; ========================================================= .start_index db $00, $04, $0A, $10, $16, $1C, $20, $24, $28, $2C, $30, $34, $38, $3C, $40, $44 .nbr_of_tiles @@ -662,7 +656,7 @@ Sprite_Octoboss_Draw2: JSL Sprite_PrepOamCoord JSL Sprite_OAM_AllocateDeferToPlayer - LDA $0DC0, X : CLC : ADC SprFrame, X : TAY;Animation Frame + LDA $0DC0, X : CLC : ADC.w SprFrame, X : TAY;Animation Frame LDA .start_index, Y : STA $06 diff --git a/Sprites/Enemies/keese.asm b/Sprites/Enemies/keese.asm index a383734..19d2cee 100644 --- a/Sprites/Enemies/keese.asm +++ b/Sprites/Enemies/keese.asm @@ -4,7 +4,7 @@ ; 01 - Fire ; 02 - Vampire Bat -!SPRID = $11 ; The sprite ID you are overwriting (HEX) +!SPRID = $11 !NbrTiles = 08 ; 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 diff --git a/Sprites/Enemies/octorok.asm b/Sprites/Enemies/octorok.asm index 1c73f79..b4d855f 100644 --- a/Sprites/Enemies/octorok.asm +++ b/Sprites/Enemies/octorok.asm @@ -2,7 +2,7 @@ ; Sprite Properties ; ========================================================= -!SPRID = $08 ; The sprite ID you are overwriting (HEX) +!SPRID = $08 !NbrTiles = 05 ; 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 diff --git a/Sprites/NPCs/goron.asm b/Sprites/NPCs/goron.asm index 141c819..9c3bbce 100644 --- a/Sprites/NPCs/goron.asm +++ b/Sprites/NPCs/goron.asm @@ -1,6 +1,6 @@ ; Goron Sprite -!SPRID = $F2 ; The sprite ID you are overwriting (HEX) +!SPRID = $F2 !NbrTiles = 04 ; Number of tiles used in a frame !Harmless = 01 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless !HVelocity = 00 ; Is your sprite going super fast? put 01 if it is diff --git a/Sprites/NPCs/piratian.asm b/Sprites/NPCs/piratian.asm index ec209d9..e29a52c 100644 --- a/Sprites/NPCs/piratian.asm +++ b/Sprites/NPCs/piratian.asm @@ -1,8 +1,6 @@ -; ========================================================= -; Sprite Properties -; ========================================================= +; Piratian -!SPRID = $0E ; The sprite ID you are overwriting (HEX) +!SPRID = $0E !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 @@ -44,18 +42,15 @@ Sprite_Piratian_Long: RTL } -; ========================================================= - Sprite_Piratian_Prep: { PHB : PHK : PLB - + LDA.b #$08 : STA.w SprHealth, X + STZ.w SprMiscA, X PLB RTL } -; ========================================================= - Sprite_Piratian_Main: { JSR Sprite_Piratian_Move @@ -67,10 +62,8 @@ Sprite_Piratian_Main: dw Piratian_MoveUp dw Piratian_MoveLeft dw Piratian_MoveRight - dw SkullHead - Piratian_MoveDown: { %PlayAnimation(0,1,16) @@ -119,68 +112,32 @@ Sprite_Piratian_Move: JSL ThrownSprite_TileAndSpriteInteraction_long JSL Sprite_CheckDamageFromPlayer : BCC .no_dano + LDA.b #$01 : STA.w SprMiscA, X %SetTimerA($60) %SetTimerF($20) .no_dano + LDA.w SprMiscA, X : BEQ .no_aggro + JSL Sprite_ProjectSpeedTowardsPlayer + JSL Sprite_CheckDamageToPlayer + JMP .return + .no_aggro + + JSR Sprite_Pirate_Friendly + .return RTS } -; ========================================================= +Sprite_Piratian_Friendly: +{ + %ShowSolicitedMessage($01BB) + RTS +} Sprite_Piratian_Draw: { - JSL Sprite_PrepOamCoord - JSL Sprite_OAM_AllocateDeferToPlayer + %DrawSprite() - LDA.w SprFrame, X : TAY ;Animation Frame - LDA .start_index, Y : STA $06 - - - PHX - LDX .nbr_of_tiles, Y ;amount of tiles -1 - LDY.b #$00 - .nextTile - - PHX ; Save current Tile Index? - TXA : CLC : ADC $06 ; Add Animation Index Offset - - PHA ; Keep the value with animation index offset? - - ASL A : TAX - - REP #$20 - - LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y - AND.w #$0100 : STA $0E - INY - LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y - CLC : ADC #$0010 : CMP.w #$0100 - SEP #$20 - BCC .on_screen_y - - LDA.b #$F0 : STA ($90), Y ;Put the sprite out of the way - STA $0E - .on_screen_y - - PLX ; Pullback Animation Index Offset (without the *2 not 16bit anymore) - INY - LDA .chr, X : STA ($90), Y - INY - LDA .properties, X : STA ($90), Y - - PHY - TYA : LSR #2 : TAY - LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer - PLY : INY - PLX : DEX : BPL .nextTile - - PLX - - RTS - - - ; ========================================================= .start_index db $00, $01, $02, $03, $04, $05, $06, $07, $08, $09 .nbr_of_tiles diff --git a/Sprites/NPCs/tingle.asm b/Sprites/NPCs/tingle.asm index 829e4d3..dd868b3 100644 --- a/Sprites/NPCs/tingle.asm +++ b/Sprites/NPCs/tingle.asm @@ -1,6 +1,6 @@ ; Tingle Sprite -!SPRID = $22 ; The sprite ID you are overwriting (HEX) +!SPRID = $22 !NbrTiles = 03 ; Number of tiles used in a frame !Harmless = 01 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless !HVelocity = 00 ; Is your sprite going super fast? put 01 if it is diff --git a/Sprites/Objects/collectible.asm b/Sprites/Objects/collectible.asm index 8e0ec93..ff2456f 100644 --- a/Sprites/Objects/collectible.asm +++ b/Sprites/Objects/collectible.asm @@ -2,7 +2,7 @@ ; Sprite Properties ; ========================================================= -!SPRID = $52 ; The sprite ID you are overwriting (HEX) +!SPRID = $52 !NbrTiles = 03 ; Number of tiles used in a frame !Harmless = 01 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless !HVelocity = 00 ; Is your sprite going super fast? put 01 if it is