update puffstool ai, add damage flash to draw code

This commit is contained in:
scawful
2024-06-16 21:02:14 -04:00
parent 12dc64ba3f
commit 7b7ffa294c

View File

@@ -1,7 +1,7 @@
; ========================================================= ; =========================================================
!SPRID = $00; The sprite ID you are overwriting (HEX) !SPRID = $B1 ; The sprite ID you are overwriting (HEX)
!NbrTiles = 0 ; Number of tiles used in a frame !NbrTiles = 02 ; Number of tiles used in a frame
!Harmless = 00 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless !Harmless = 00 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is !HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
!Health = 0 ; Number of Health the sprite have !Health = 0 ; Number of Health the sprite have
@@ -37,6 +37,7 @@ Sprite_Puffstool_Long:
PHB : PHK : PLB PHB : PHK : PLB
JSR Sprite_Puffstool_Draw ; Call the draw code JSR Sprite_Puffstool_Draw ; Call the draw code
JSL Sprite_DrawShadow
JSL Sprite_CheckActive ; Check if game is not paused JSL Sprite_CheckActive ; Check if game is not paused
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
@@ -53,7 +54,7 @@ Sprite_Puffstool_Prep:
{ {
PHB : PHK : PLB PHB : PHK : PLB
LDA.b #$80 : STA.w SprHealth, X
PLB PLB
RTL RTL
@@ -72,12 +73,42 @@ Sprite_Puffstool_Main:
Puffstool_Walking: Puffstool_Walking:
{ {
%PlayAnimation(0,6,10) %PlayAnimation(0,6,10)
JSL Sprite_PlayerCantPassThrough
LDA.b #$02
JSL Sprite_ApplySpeedTowardsPlayer
JSL Sprite_Move
JSL Sprite_DamageFlash_Long
JSL Sprite_CheckDamageFromPlayer : BCC .no_dano
%GotoAction(1)
LDA.b #$60 : STA.w SprTimerA, X
LDA.b #$60 : STA.w SprTimerF, X
.no_dano
RTS RTS
} }
Puffstool_Stunned: Puffstool_Stunned:
{ {
%PlayAnimation(7,7,10) %PlayAnimation(7,7,10)
JSL Sprite_CheckIfLifted
JSL Sprite_DamageFlash_Long
LDA.w SprTimerA, X : BNE +
%GotoAction(0)
LDA.b #$4A ; SPRITE 4A
LDY.b #$0B
JSL Sprite_SpawnDynamically : BMI .no_space
JSL Sprite_SetSpawnedCoordinates
JSL Sprite_TransmuteToBomb
.no_space
+
RTS RTS
} }
} }
@@ -92,7 +123,7 @@ Sprite_Puffstool_Draw:
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
LDA .start_index, Y : STA $06 LDA .start_index, Y : STA $06
LDA.w SprMiscA, X : STA $08 ; Palette damage flash
PHX PHX
LDX .nbr_of_tiles, Y ;amount of tiles -1 LDX .nbr_of_tiles, Y ;amount of tiles -1
@@ -125,7 +156,7 @@ Sprite_Puffstool_Draw:
INY INY
LDA .chr, X : STA ($90), Y LDA .chr, X : STA ($90), Y
INY INY
LDA .properties, X : STA ($90), Y LDA .properties, X : ORA $08 : STA ($90), Y
PHY PHY