From 80fd69d8bb0c498bdd45d932099fd6650a648920 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 10 Jan 2025 20:42:42 -0500 Subject: [PATCH] Enemy housekeeping --- Sprites/Enemies/anti_kirby.asm | 2 -- Sprites/Enemies/booki.asm | 15 --------- Sprites/Enemies/goriya.asm | 9 ------ Sprites/Enemies/octorok.asm | 56 ++++++++-------------------------- 4 files changed, 13 insertions(+), 69 deletions(-) diff --git a/Sprites/Enemies/anti_kirby.asm b/Sprites/Enemies/anti_kirby.asm index 47b2d55..4d54374 100644 --- a/Sprites/Enemies/anti_kirby.asm +++ b/Sprites/Enemies/anti_kirby.asm @@ -43,8 +43,6 @@ Sprite_AntiKirby_Long: RTL } -; ========================================================= - Sprite_AntiKirby_Prep: { PHB : PHK : PLB diff --git a/Sprites/Enemies/booki.asm b/Sprites/Enemies/booki.asm index 00375c1..ac83f02 100644 --- a/Sprites/Enemies/booki.asm +++ b/Sprites/Enemies/booki.asm @@ -32,8 +32,6 @@ %Set_Sprite_Properties(Sprite_Booki_Prep, Sprite_Booki_Long) -; ========================================================= - Sprite_Booki_Long: { PHB : PHK : PLB @@ -46,8 +44,6 @@ Sprite_Booki_Long: RTL } -; ========================================================= - Sprite_Booki_Prep: { PHB : PHK : PLB @@ -61,8 +57,6 @@ Sprite_Booki_Prep: db $04, $08, $10, $18 } -; ========================================================= - Sprite_Booki_Main: { LDA.w SprAction, X @@ -76,16 +70,13 @@ Sprite_Booki_Main: StalkPlayer: { %PlayAnimation(0,1,16) - JSR Sprite_Booki_Move - RTS } HideFromPlayer: { %PlayAnimation(0,4,16) - LDA.w SprTimerA, X : BNE + INC.w SprAction, X + @@ -95,9 +86,7 @@ Sprite_Booki_Main: HiddenFromPlayer: { %PlayAnimation(4,4,16) - JSR Sprite_Booki_Move - JSL GetRandomInt : AND.b #$03 : BEQ + INC.w SprAction, X + @@ -107,9 +96,7 @@ Sprite_Booki_Main: ApproachPlayer: { %PlayAnimation(5,9,16) - JSR Sprite_Booki_Move - RTS } } @@ -198,9 +185,7 @@ Sprite_Booki_Draw: .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 diff --git a/Sprites/Enemies/goriya.asm b/Sprites/Enemies/goriya.asm index e9b1175..2855edd 100644 --- a/Sprites/Enemies/goriya.asm +++ b/Sprites/Enemies/goriya.asm @@ -32,8 +32,6 @@ %Set_Sprite_Properties(Sprite_Goriya_Prep, Sprite_Goriya_Long) -; ========================================================= - Sprite_Goriya_Long: { PHB : PHK : PLB @@ -51,8 +49,6 @@ Sprite_Goriya_Long: RTL } -; ========================================================= - Sprite_Goriya_Prep: { PHB : PHK : PLB @@ -61,8 +57,6 @@ Sprite_Goriya_Prep: RTL } -; ========================================================= - Sprite_Goriya_Main: { LDA.w SprAction, X @@ -309,9 +303,6 @@ Sprite_Goriya_Draw: RTS - - ; ========================================================= - .start_index db $00, $02, $04, $06, $08, $0A, $0C, $0E .nbr_of_tiles diff --git a/Sprites/Enemies/octorok.asm b/Sprites/Enemies/octorok.asm index b83788c..1c73f79 100644 --- a/Sprites/Enemies/octorok.asm +++ b/Sprites/Enemies/octorok.asm @@ -32,8 +32,6 @@ %Set_Sprite_Properties(Sprite_Octorok_Prep, Sprite_Octorok_Long) -; ========================================================= - Sprite_Octorok_Long: { PHB : PHK : PLB @@ -52,8 +50,6 @@ Sprite_Octorok_Long: RTL } -; ========================================================= - Sprite_Octorok_Prep: { PHB : PHK : PLB @@ -62,8 +58,6 @@ Sprite_Octorok_Prep: RTL } -; ========================================================= - Sprite_Octorok_Main: { JSR Sprite_Octorok_Move @@ -148,9 +142,8 @@ Sprite_Octorok_Move: .wait LDY.w SprMiscC, X - LDA.w .speed_x, Y : STA.w SprXSpeed,X - - LDA.w .speed_y, Y : STA.w SprYSpeed,X + LDA.w .speed_x, Y : STA.w SprXSpeed, X + LDA.w .speed_y, Y : STA.w SprYSpeed, X JSL Sprite_CheckTileCollision LDA.w $0E70, X : BEQ .no_collision @@ -159,26 +152,18 @@ Sprite_Octorok_Move: .no_collision RTS - ; --------------------------------------------------------- - .octorok_used_barrage STZ.w SprXSpeed, X : STZ.w SprYSpeed,X - LDA.w SprTimerA, X : BNE Octorock_ShootEmUp INC.w SprMiscF, X - LDA.w SprMiscC, X PHA - JSL GetRandomInt : AND.b #$3F : ADC.b #$30 : STA.w SprTimerA, X AND.b #$03 : STA.w SprMiscC, X - PLA CMP.w SprMiscC, X : BEQ .exit - EOR.w SprMiscC, X : BNE .exit - - LDA.b #$08 : STA.w SprTimerB,X - + EOR.w SprMiscC, X : BNE .exit + LDA.b #$08 : STA.w SprTimerB,X .exit RTS @@ -284,8 +269,7 @@ Sprite_WaterOctorok_Attack: + JSL GetDistance8bit_Long - CMP.b #$40 - BCC .not_close_enough ; LD < 64 + CMP.b #$40 : BCC .not_close_enough ; LD < 64 INC.w SprMiscG, X %SetTimerA($10) .not_close_enough @@ -332,19 +316,14 @@ Sprite_WaterOctorok_Attack: Octorok_ShootSingle: { - LDA.w SprTimerA,X : CMP.b #$1C : BNE .bide_time + LDA.w SprTimerA, X : CMP.b #$1C : BNE .bide_time PHA JSR Octorok_SpawnRock PLA .bide_time - LSR A - LSR A - LSR A + LSR #3 TAY - - LDA.w .mouth_anim_step,Y - STA.w SprMiscB,X - + LDA.w .mouth_anim_step, Y : STA.w SprMiscB, X RTS .mouth_anim_step @@ -355,33 +334,24 @@ Octorok_ShootSingle: db $02, $01, $01, $00 } -; --------------------------------------------------------- - Octorok_Shoot4Ways: { - LDA.w SprTimerA,X + LDA.w SprTimerA, X PHA CMP.b #$80 : BCS .animate AND.b #$0F : BNE .delay_turn PHA - - LDY.w SprMiscC,X - LDA.w .next_direction,Y : STA.w SprMiscC,X - + LDY.w SprMiscC, X + LDA.w .next_direction, Y : STA.w SprMiscC, X PLA .delay_turn CMP.b #$08 : BNE .animate JSR Octorok_SpawnRock .animate PLA - LSR A - LSR A - LSR A - LSR A + LSR #4 TAY - - LDA.w .mouth_anim_step,Y : STA.w SprMiscB,X - + LDA.w .mouth_anim_step, Y : STA.w SprMiscB, X RTS .next_direction