From 4f38b309f8b20da607664835920780eaf0d08dca Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 30 Mar 2023 10:38:28 +0000 Subject: [PATCH] entities: label AnimateBossDying --- src/code/entities/18__helpers_3.asm | 5 ++-- src/code/entities/18_blaino.asm | 2 +- src/code/entities/18_turtle_rock_head.asm | 2 +- src/code/entities/bank19.asm | 28 ++++++++++++----------- src/code/entities/bank36.asm | 9 ++++---- src/constants/sfx.asm | 2 +- 6 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/code/entities/18__helpers_3.asm b/src/code/entities/18__helpers_3.asm index 62a129e2..644a8458 100644 --- a/src/code/entities/18__helpers_3.asm +++ b/src/code/entities/18__helpers_3.asm @@ -404,7 +404,8 @@ ClearEntityStatusBank18:: ld [hl], $00 ; $7F0C: $36 $00 ret ; $7F0E: $C9 -func_018_7F0F:: +; Kill boss or mini-boss enemy with explosions animation +AnimateBossAgony_18:: ld hl, wEntitiesPrivateState2Table ; $7F0F: $21 $C0 $C2 add hl, bc ; $7F12: $09 ld a, [hl] ; $7F13: $7E @@ -510,7 +511,7 @@ label_018_7F6F: jr_018_7FB0: call ClearEntityStatusBank18 ; $7FB0: $CD $08 $7F ld hl, hNoiseSfx ; $7FB3: $21 $F4 $FF - ld [hl], $1A ; $7FB6: $36 $1A + ld [hl], NOISE_SFX_1A ; $7FB6: $36 $1A ret ; $7FB8: $C9 SetRoomStatus20:: diff --git a/src/code/entities/18_blaino.asm b/src/code/entities/18_blaino.asm index 51b8426c..42f99271 100644 --- a/src/code/entities/18_blaino.asm +++ b/src/code/entities/18_blaino.asm @@ -5,7 +5,7 @@ BlainoEntityHandler:: call func_018_68EA ; $64CC: $CD $EA $68 ldh a, [hActiveEntityStatus] ; $64CF: $F0 $EA cp $01 ; $64D1: $FE $01 - jp z, func_018_7F0F ; $64D3: $CA $0F $7F + jp z, AnimateBossAgony_18 ; $64D3: $CA $0F $7F call ReturnIfNonInteractive_18 ; $64D6: $CD $E8 $7D call BossIntro ; $64D9: $CD $E8 $3E diff --git a/src/code/entities/18_turtle_rock_head.asm b/src/code/entities/18_turtle_rock_head.asm index 5f3ee35e..4f324abd 100644 --- a/src/code/entities/18_turtle_rock_head.asm +++ b/src/code/entities/18_turtle_rock_head.asm @@ -68,7 +68,7 @@ TurtleRockHeadEntityHandler:: cp $05 ; $7365: $FE $05 jr z, jr_018_737E ; $7367: $28 $15 - call func_018_7F0F ; $7369: $CD $0F $7F + call AnimateBossAgony_18 ; $7369: $CD $0F $7F ld hl, wEntitiesStatusTable ; $736C: $21 $80 $C2 add hl, bc ; $736F: $09 ld a, [hl] ; $7370: $7E diff --git a/src/code/entities/bank19.asm b/src/code/entities/bank19.asm index a95570cd..b11ff59d 100644 --- a/src/code/entities/bank19.asm +++ b/src/code/entities/bank19.asm @@ -979,15 +979,17 @@ ClearEntityStatus_19:: ld [hl], b ; $7E65: $70 ret ; $7E66: $C9 +; Kill boss or mini-boss with explosions animation (unused in this bank) +AnimateBossAgony_19:: ld hl, wEntitiesPrivateState2Table ; $7E67: $21 $C0 $C2 add hl, bc ; $7E6A: $09 ld a, [hl] ; $7E6B: $7E JP_TABLE ; $7E6C -._00 dw func_019_7E73 ; $7E6D -._01 dw func_019_7E84 ; $7E6F -._02 dw func_019_7E93 ; $7E71 +._00 dw AnimateBossAgonyInit_19 ; $7E6D +._01 dw AnimateBossAgonyFlashing_19 ; $7E6F +._02 dw AnimateBossAgonyExploding_19 ; $7E71 -func_019_7E73:: +AnimateBossAgonyInit_19:: call GetEntityTransitionCountdown ; $7E73: $CD $05 $0C ld [hl], $A0 ; $7E76: $36 $A0 ld hl, wEntitiesFlashCountdownTable ; $7E78: $21 $20 $C4 @@ -1000,7 +1002,7 @@ IncrementEntityPrivateState2_19: inc [hl] ; $7E82: $34 ret ; $7E83: $C9 -func_019_7E84:: +AnimateBossAgonyFlashing_19:: call GetEntityTransitionCountdown ; $7E84: $CD $05 $0C ret nz ; $7E87: $C0 @@ -1010,18 +1012,18 @@ func_019_7E84:: ld [hl], $FF ; $7E8E: $36 $FF jp IncrementEntityPrivateState2_19 ; $7E90: $C3 $7E $7E -func_019_7E93:: +AnimateBossAgonyExploding_19:: + ; When the explosions end, make the boss die call GetEntityTransitionCountdown ; $7E93: $CD $05 $0C - jr nz, .jr_7EA1 ; $7E96: $20 $09 - + jr nz, .notDeadYet ; $7E96: $20 $09 call PlayBombExplosionSfx ; $7E98: $CD $4B $0C call label_27DD ; $7E9B: $CD $DD $27 jp DidKillEnemy ; $7E9E: $C3 $50 $3F -.jr_7EA1 - jp label_019_7EA4 ; $7EA1: $C3 $A4 $7E +.notDeadYet + jp .animateExplosions ; $7EA1: $C3 $A4 $7E -label_019_7EA4: +.animateExplosions and $07 ; $7EA4: $E6 $07 ret nz ; $7EA6: $C0 @@ -1049,7 +1051,7 @@ label_019_7EC4: ldh [hMultiPurpose1], a ; $7ECD: $E0 $D8 ld a, TRANSCIENT_VFX_POOF ; $7ECF: $3E $02 call AddTranscientVfx ; $7ED1: $CD $C7 $0C - ld a, $13 ; $7ED4: $3E $13 + ld a, NOISE_SFX_ENEMY_DESTROYED ; $7ED4: $3E $13 ldh [hNoiseSfx], a ; $7ED6: $E0 $F4 ret ; $7ED8: $C9 @@ -1083,7 +1085,7 @@ label_019_7EC4: jr_019_7F05: call ClearEntityStatus_19 ; $7F05: $CD $61 $7E ld hl, hNoiseSfx ; $7F08: $21 $F4 $FF - ld [hl], $1A ; $7F0B: $36 $1A + ld [hl], NOISE_SFX_1A ; $7F0B: $36 $1A ret ; $7F0D: $C9 func_019_7F0E:: diff --git a/src/code/entities/bank36.asm b/src/code/entities/bank36.asm index bc47172d..8aba6ddc 100644 --- a/src/code/entities/bank36.asm +++ b/src/code/entities/bank36.asm @@ -2206,7 +2206,7 @@ HardhitBeetleEntityHandler:: call func_036_4F4E ; $4CBD: $CD $4E $4F ldh a, [hActiveEntityStatus] ; $4CC0: $F0 $EA cp $05 ; $4CC2: $FE $05 - jp nz, label_036_5C3C ; $4CC4: $C2 $3C $5C + jp nz, AnimateBossAgony_1836 ; $4CC4: $C2 $3C $5C ldh a, [hFrameCounter] ; $4CC7: $F0 $E7 and $1F ; $4CC9: $E6 $1F @@ -3449,7 +3449,7 @@ GiantBuzzBlobEntityHandler:: call func_036_5844 ; $54E9: $CD $44 $58 ldh a, [hActiveEntityStatus] ; $54EC: $F0 $EA cp $05 ; $54EE: $FE $05 - jp nz, label_036_5C3C ; $54F0: $C2 $3C $5C + jp nz, AnimateBossAgony_1836 ; $54F0: $C2 $3C $5C ld a, [wMagicPowderCount] ; $54F3: $FA $4C $DB and a ; $54F6: $A7 @@ -4645,7 +4645,7 @@ AvalaunchEntityHandler:: call label_3CD9 ; $5C01: $CD $D9 $3C ldh a, [hActiveEntityStatus] ; $5C04: $F0 $EA cp $05 ; $5C06: $FE $05 - jr nz, label_036_5C3C ; $5C08: $20 $32 + jr nz, AnimateBossAgony_1836 ; $5C08: $20 $32 call BossIntro ; $5C0A: $CD $E8 $3E call ReturnIfNonInteractive_36 ; $5C0D: $CD $40 $6A @@ -4679,7 +4679,8 @@ AvalaunchEntityHandler:: ._09 dw AvalaunchState9Handler ._0A dw AvalaunchStateAHandler -label_036_5C3C: +; Kill boss or mini-boss enemy with explosions +AnimateBossAgony_1836:: ld hl, wEntitiesPrivateState5Table ; $5C3C: $21 $90 $C3 add hl, bc ; $5C3F: $09 ld a, [hl] ; $5C40: $7E diff --git a/src/constants/sfx.asm b/src/constants/sfx.asm index f551a4ce..f00605a5 100644 --- a/src/constants/sfx.asm +++ b/src/constants/sfx.asm @@ -228,7 +228,7 @@ NOISE_SFX_DRAW_SHIELD equ $16; ;NOISE_SFX_UNKNOWN equ $17;LVL2 shield? NOISE_SFX_SWORD_D equ $18; NOISE_SFX_TITLE_APPEARS equ $19;probably correct -;NOISE_SFX_UNKNOWN equ $1A +NOISE_SFX_1A equ $1A ;NOISE_SFX_UNKNOWN equ $1B ;NOISE_SFX_UNKNOWN equ $1C ;NOISE_SFX_UNKNOWN equ $1D