Add Piratian friendly and aggro behavior

This commit is contained in:
scawful
2025-01-19 12:34:53 -05:00
parent aef81e8032
commit 206993e3d5
8 changed files with 28 additions and 77 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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