From c986808b289ec44a7ad5e401b534ebaa08686987 Mon Sep 17 00:00:00 2001 From: YohannDR Date: Thu, 28 Jul 2022 23:40:35 +0200 Subject: [PATCH] Part of dessgeega and baristute AI --- asm/disasm_0x08011ed8.s | 144 +-- data/data.h | 2 +- database.json | 2394 +----------------------------------- src/event.h | 2 +- src/sprites_AI/baristute.c | 927 +++++++++++++- src/sprites_AI/baristute.h | 24 +- src/sprites_AI/dessgeega.c | 985 ++++++++++++++- src/sprites_AI/dessgeega.h | 35 +- 8 files changed, 1981 insertions(+), 2532 deletions(-) diff --git a/asm/disasm_0x08011ed8.s b/asm/disasm_0x08011ed8.s index 292032c9..2d133b9d 100644 --- a/asm/disasm_0x08011ed8.s +++ b/asm/disasm_0x08011ed8.s @@ -35320,8 +35320,8 @@ lbl_08023c6c: .4byte 0x0000ffc0 lbl_08023c70: .4byte 0x082d82dc lbl_08023c74: .4byte 0x082b0d68 - thumb_func_start DessgeegaJumpingGFXInit -DessgeegaJumpingGFXInit: @ 0x08023c78 + thumb_func_start DessgeegaJumpWarningInit +DessgeegaJumpWarningInit: @ 0x08023c78 ldr r1, lbl_08023c90 @ =0x03000738 adds r3, r1, #0 adds r3, #0x24 @@ -35337,8 +35337,8 @@ DessgeegaJumpingGFXInit: @ 0x08023c78 lbl_08023c90: .4byte 0x03000738 lbl_08023c94: .4byte 0x082d8364 - thumb_func_start DessgeegaBeforeJumping -DessgeegaBeforeJumping: @ 0x08023c98 + thumb_func_start DessgeegaJumpingInit +DessgeegaJumpingInit: @ 0x08023c98 push {r4, lr} ldr r3, lbl_08023cd0 @ =0x03000738 adds r1, r3, #0 @@ -35389,8 +35389,8 @@ lbl_08023cf4: bx r0 .align 2, 0 - thumb_func_start DessgeegaBeforeLanding -DessgeegaBeforeLanding: @ 0x08023cfc + thumb_func_start DessgeegaLandingInit +DessgeegaLandingInit: @ 0x08023cfc push {lr} ldr r1, lbl_08023d28 @ =0x03000738 adds r3, r1, #0 @@ -35417,15 +35417,15 @@ lbl_08023d28: .4byte 0x03000738 lbl_08023d2c: .4byte 0x082d839c lbl_08023d30: .4byte 0x0000015b - thumb_func_start DessgeegaCheckSamusInRange -DessgeegaCheckSamusInRange: @ 0x08023d34 + thumb_func_start DessgeegaIdleInit +DessgeegaIdleInit: @ 0x08023d34 push {lr} bl DessgeegaCheckSamusNearLeftRight lsls r0, r0, #0x18 lsrs r3, r0, #0x18 cmp r3, #0 beq lbl_08023d48 - bl DessgeegaJumpingGFXInit + bl DessgeegaJumpWarningInit b lbl_08023d9e lbl_08023d48: ldr r2, lbl_08023d7c @ =0x03000738 @@ -35474,8 +35474,8 @@ lbl_08023d9e: .align 2, 0 lbl_08023da4: .4byte 0x082d8304 - thumb_func_start DessgeegaBouncingGFXInit -DessgeegaBouncingGFXInit: @ 0x08023da8 + thumb_func_start DessgeegaFallingInit +DessgeegaFallingInit: @ 0x08023da8 ldr r3, lbl_08023dc4 @ =0x03000738 adds r1, r3, #0 adds r1, #0x24 @@ -35494,8 +35494,8 @@ DessgeegaBouncingGFXInit: @ 0x08023da8 lbl_08023dc4: .4byte 0x03000738 lbl_08023dc8: .4byte 0x082d8384 - thumb_func_start DessgeegaCheckBouncing -DessgeegaCheckBouncing: @ 0x08023dcc + thumb_func_start DessgeegaJumpWarningGround +DessgeegaJumpWarningGround: @ 0x08023dcc push {r4, r5, lr} ldr r4, lbl_08023e0c @ =0x03000738 ldrh r0, [r4, #2] @@ -35522,7 +35522,7 @@ DessgeegaCheckBouncing: @ 0x08023dcc ldrb r0, [r5] cmp r0, #0 bne lbl_08023e14 - bl DessgeegaBouncingGFXInit + bl DessgeegaFallingInit b lbl_08023e20 .align 2, 0 lbl_08023e0c: .4byte 0x03000738 @@ -35531,27 +35531,27 @@ lbl_08023e14: bl check_end_of_current_sprite_anim cmp r0, #0 beq lbl_08023e20 - bl DessgeegaBeforeJumping + bl DessgeegaJumpingInit lbl_08023e20: pop {r4, r5} pop {r0} bx r0 .align 2, 0 - thumb_func_start DessgeegaCheckBeforeJumpingCeilingAnimEnded -DessgeegaCheckBeforeJumpingCeilingAnimEnded: @ 0x08023e28 + thumb_func_start DessgeegaJumpWarningCeiling +DessgeegaJumpWarningCeiling: @ 0x08023e28 push {lr} bl check_end_of_current_sprite_anim cmp r0, #0 beq lbl_08023e36 - bl DessgeegaBeforeJumping + bl DessgeegaJumpingInit lbl_08023e36: pop {r0} bx r0 .align 2, 0 - thumb_func_start DessgeegaMoveGround -DessgeegaMoveGround: @ 0x08023e3c + thumb_func_start DessgeegaJumpingGround +DessgeegaJumpingGround: @ 0x08023e3c push {r4, r5, r6, lr} movs r6, #0 ldr r2, lbl_08023e60 @ =0x03000738 @@ -35687,7 +35687,7 @@ lbl_08023f32: cmp r0, #0 beq lbl_08023f54 strh r1, [r4, #2] - bl DessgeegaBeforeLanding + bl DessgeegaLandingInit b lbl_08024016 .align 2, 0 lbl_08023f4c: .4byte 0x03000738 @@ -35722,7 +35722,7 @@ lbl_08023f86: lbl_08023f8a: ldr r0, lbl_08023f94 @ =0x03000738 strh r1, [r0, #2] - bl DessgeegaBeforeLanding + bl DessgeegaLandingInit b lbl_08024016 .align 2, 0 lbl_08023f94: .4byte 0x03000738 @@ -35752,7 +35752,7 @@ lbl_08023f98: ldrh r0, [r4, #4] subs r0, #6 strh r0, [r4, #4] - bl DessgeegaBouncingGFXInit + bl DessgeegaFallingInit b lbl_08024004 .align 2, 0 lbl_08023fd4: .4byte 0x030007f1 @@ -35776,7 +35776,7 @@ lbl_08023fd8: ldrh r0, [r4, #4] adds r0, #6 strh r0, [r4, #4] - bl DessgeegaBouncingGFXInit + bl DessgeegaFallingInit lbl_08024004: cmp r6, #0 beq lbl_08024016 @@ -35795,8 +35795,8 @@ lbl_08024016: lbl_0802401c: .4byte 0x030007f1 lbl_08024020: .4byte 0x03000738 - thumb_func_start DessgeegaMoveCeiling -DessgeegaMoveCeiling: @ 0x08024024 + thumb_func_start DessgeegaJumpingCeiling +DessgeegaJumpingCeiling: @ 0x08024024 push {r4, r5, r6, r7, lr} movs r7, #0 ldr r2, lbl_08024048 @ =0x03000738 @@ -35939,7 +35939,7 @@ lbl_08024106: ldrh r0, [r4, #4] subs r0, #6 strh r0, [r4, #4] - bl DessgeegaBouncingGFXInit + bl DessgeegaFallingInit b lbl_08024178 .align 2, 0 lbl_08024144: .4byte 0x03000738 @@ -35964,7 +35964,7 @@ lbl_0802414c: ldrh r0, [r4, #4] adds r0, #6 strh r0, [r4, #4] - bl DessgeegaBouncingGFXInit + bl DessgeegaFallingInit lbl_08024178: cmp r7, #0 beq lbl_08024216 @@ -36003,7 +36003,7 @@ lbl_080241a4: adds r0, r2, #0 adds r0, #0x40 strh r0, [r4, #2] - bl DessgeegaBeforeLanding + bl DessgeegaLandingInit b lbl_08024216 .align 2, 0 lbl_080241c8: .4byte 0x030007f0 @@ -36043,7 +36043,7 @@ lbl_0802420a: adds r0, r2, #0 adds r0, #0x40 strh r0, [r1, #2] - bl DessgeegaBeforeLanding + bl DessgeegaLandingInit lbl_08024216: pop {r4, r5, r6, r7} pop {r0} @@ -36057,14 +36057,14 @@ DessgeegaCheckLandingAnimEnded: @ 0x08024220 bl check_end_of_current_sprite_anim cmp r0, #0 beq lbl_0802422e - bl DessgeegaCheckSamusInRange + bl DessgeegaIdleInit lbl_0802422e: pop {r0} bx r0 .align 2, 0 - thumb_func_start DessgeegaJumpingGroundIntoBlock -DessgeegaJumpingGroundIntoBlock: @ 0x08024234 + thumb_func_start DessgeegaFallingGround +DessgeegaFallingGround: @ 0x08024234 push {r4, r5, r6, lr} movs r6, #0 ldr r4, lbl_08024288 @ =0x03000738 @@ -36103,7 +36103,7 @@ lbl_0802427a: lbl_0802427e: ldr r0, lbl_08024288 @ =0x03000738 strh r1, [r0, #2] - bl DessgeegaBeforeLanding + bl DessgeegaLandingInit b lbl_080242d0 .align 2, 0 lbl_08024288: .4byte 0x03000738 @@ -36147,8 +36147,8 @@ lbl_080242d0: bx r0 .align 2, 0 - thumb_func_start DessgeegaJumpingCeilingIntoBlock -DessgeegaJumpingCeilingIntoBlock: @ 0x080242d8 + thumb_func_start DessgeegaFallingCeiling +DessgeegaFallingCeiling: @ 0x080242d8 push {r4, r5, r6, lr} movs r6, #0 ldr r4, lbl_08024330 @ =0x03000738 @@ -36189,7 +36189,7 @@ lbl_08024322: adds r0, r2, #0 adds r0, #0x40 strh r0, [r1, #2] - bl DessgeegaBeforeLanding + bl DessgeegaLandingInit b lbl_08024378 .align 2, 0 lbl_08024330: .4byte 0x03000738 @@ -36233,8 +36233,8 @@ lbl_08024378: bx r0 .align 2, 0 - thumb_func_start dessgeega_screaming_anim -dessgeega_screaming_anim: @ 0x08024380 + thumb_func_start DessgeegaIdleGround +DessgeegaIdleGround: @ 0x08024380 push {r4, r5, lr} bl DessgeegaCheckSamusNearLeftRight lsls r0, r0, #0x18 @@ -36260,7 +36260,7 @@ dessgeega_screaming_anim: @ 0x08024380 ldrb r0, [r5] cmp r0, #0 bne lbl_080243c8 - bl DessgeegaBouncingGFXInit + bl DessgeegaFallingInit b lbl_0802440e .align 2, 0 lbl_080243c0: .4byte 0x03000738 @@ -36282,7 +36282,7 @@ lbl_080243c8: cmp r1, r0 bne lbl_080243f4 lbl_080243e8: - bl DessgeegaJumpingGFXInit + bl DessgeegaJumpWarningInit b lbl_0802440e .align 2, 0 lbl_080243f0: .4byte 0x03000738 @@ -36306,8 +36306,8 @@ lbl_0802440e: .align 2, 0 lbl_08024414: .4byte 0x082d8304 - thumb_func_start DessgeegaCeilingdleAnim -DessgeegaCeilingdleAnim: @ 0x08024418 + thumb_func_start DessgeegaIdleCeiling +DessgeegaIdleCeiling: @ 0x08024418 push {lr} bl DessgeegaCheckSamusNearLeftRight lsls r0, r0, #0x18 @@ -36329,7 +36329,7 @@ DessgeegaCeilingdleAnim: @ 0x08024418 cmp r1, r0 bne lbl_08024450 lbl_08024444: - bl DessgeegaJumpingGFXInit + bl DessgeegaJumpWarningInit b lbl_0802446a .align 2, 0 lbl_0802444c: .4byte 0x03000738 @@ -36352,8 +36352,8 @@ lbl_0802446a: .align 2, 0 lbl_08024470: .4byte 0x082d8304 - thumb_func_start sub_08024474 -sub_08024474: @ 0x08024474 + thumb_func_start DessgeegaDeath +DessgeegaDeath: @ 0x08024474 push {r4, lr} sub sp, #4 ldr r4, lbl_0802448c @ =0x03000738 @@ -36572,7 +36572,7 @@ lbl_08024644: movs r0, #0xa movs r1, #0x81 bl start_vertical_screen_shake - bl DessgeegaBeforeLanding + bl DessgeegaLandingInit b lbl_0802465a lbl_08024654: ldrh r0, [r4, #2] @@ -36700,7 +36700,7 @@ lbl_080247a4: bl DessgeegaLongBeamSpawning b lbl_08024836 lbl_080247aa: - bl DessgeegaJumpingGFXInit + bl DessgeegaJumpWarningInit lbl_080247ae: ldr r0, lbl_080247c4 @ =0x03000738 ldrh r1, [r0] @@ -36709,12 +36709,12 @@ lbl_080247ae: ands r0, r1 cmp r0, #0 beq lbl_080247c8 - bl DessgeegaCheckBeforeJumpingCeilingAnimEnded + bl DessgeegaJumpWarningCeiling b lbl_08024836 .align 2, 0 lbl_080247c4: .4byte 0x03000738 lbl_080247c8: - bl DessgeegaCheckBouncing + bl DessgeegaJumpWarningGround b lbl_08024836 lbl_080247ce: ldr r0, lbl_080247e4 @ =0x03000738 @@ -36724,12 +36724,12 @@ lbl_080247ce: ands r0, r1 cmp r0, #0 beq lbl_080247e8 - bl DessgeegaMoveCeiling + bl DessgeegaJumpingCeiling b lbl_08024836 .align 2, 0 lbl_080247e4: .4byte 0x03000738 lbl_080247e8: - bl DessgeegaMoveGround + bl DessgeegaJumpingGround b lbl_08024836 lbl_080247ee: bl DessgeegaCheckLandingAnimEnded @@ -36742,12 +36742,12 @@ lbl_080247f4: ands r0, r1 cmp r0, #0 beq lbl_0802480c - bl DessgeegaCeilingdleAnim + bl DessgeegaIdleCeiling b lbl_08024836 .align 2, 0 lbl_08024808: .4byte 0x03000738 lbl_0802480c: - bl dessgeega_screaming_anim + bl DessgeegaIdleGround b lbl_08024836 lbl_08024812: ldr r0, lbl_08024828 @ =0x03000738 @@ -36757,15 +36757,15 @@ lbl_08024812: ands r0, r1 cmp r0, #0 beq lbl_0802482c - bl DessgeegaJumpingCeilingIntoBlock + bl DessgeegaFallingCeiling b lbl_08024836 .align 2, 0 lbl_08024828: .4byte 0x03000738 lbl_0802482c: - bl DessgeegaJumpingGroundIntoBlock + bl DessgeegaFallingGround b lbl_08024836 lbl_08024832: - bl sub_08024474 + bl DessgeegaDeath lbl_08024836: pop {r4} pop {r0} @@ -106308,8 +106308,8 @@ lbl_080476a4: .4byte 0x0831043c lbl_080476a8: .4byte 0x0000ff60 lbl_080476ac: .4byte 0x082b0d68 - thumb_func_start BaristuteJumpingGFXInit -BaristuteJumpingGFXInit: @ 0x080476b0 + thumb_func_start BaristuteJumpWarningInit +BaristuteJumpWarningInit: @ 0x080476b0 push {lr} ldr r1, lbl_080476dc @ =0x03000738 adds r3, r1, #0 @@ -106527,8 +106527,8 @@ lbl_08047856: .align 2, 0 lbl_0804785c: .4byte 0x030007f1 - thumb_func_start BaristuteLandingGFXInit -BaristuteLandingGFXInit: @ 0x08047860 + thumb_func_start BaristuteLandingInit +BaristuteLandingInit: @ 0x08047860 push {lr} ldr r1, lbl_08047894 @ =0x03000738 adds r3, r1, #0 @@ -106704,8 +106704,8 @@ lbl_080479ae: pop {r0} bx r0 - thumb_func_start BaristuteWalkingGFXInit -BaristuteWalkingGFXInit: @ 0x080479b4 + thumb_func_start BaristuteWalkingInit +BaristuteWalkingInit: @ 0x080479b4 push {lr} ldr r3, lbl_080479e4 @ =0x03000738 adds r2, r3, #0 @@ -106923,8 +106923,8 @@ lbl_08047b42: .align 2, 0 lbl_08047b48: .4byte 0x03000738 - thumb_func_start BaristuteBouncingGFXInit -BaristuteBouncingGFXInit: @ 0x08047b4c + thumb_func_start BaristuteFallingInit +BaristuteFallingInit: @ 0x08047b4c ldr r3, lbl_08047b68 @ =0x03000738 adds r1, r3, #0 adds r1, #0x24 @@ -106943,8 +106943,8 @@ BaristuteBouncingGFXInit: @ 0x08047b4c lbl_08047b68: .4byte 0x03000738 lbl_08047b6c: .4byte 0x08310484 - thumb_func_start BaristuteBouncing -BaristuteBouncing: @ 0x08047b70 + thumb_func_start BaristuteFalling +BaristuteFalling: @ 0x08047b70 push {r4, r5, lr} ldr r4, lbl_08047b94 @ =0x03000738 ldrh r0, [r4, #2] @@ -107303,7 +107303,7 @@ lbl_08047e74: bl BaristuteInit b lbl_08047eb6 lbl_08047e7a: - bl BaristuteJumpingGFXInit + bl BaristuteJumpWarningInit lbl_08047e7e: bl BaristuteCheckBeforeJumpingAnimEnded b lbl_08047eb6 @@ -107311,12 +107311,12 @@ lbl_08047e84: bl BaristuteJumping b lbl_08047eb6 lbl_08047e8a: - bl BaristuteLandingGFXInit + bl BaristuteLandingInit lbl_08047e8e: bl BaristuteCheckLandingAnimNearEnded b lbl_08047eb6 lbl_08047e94: - bl BaristuteWalkingGFXInit + bl BaristuteWalkingInit lbl_08047e98: bl BaristuteWalking b lbl_08047eb6 @@ -107326,9 +107326,9 @@ lbl_08047ea2: bl BaristuteIdle b lbl_08047eb6 lbl_08047ea8: - bl BaristuteBouncingGFXInit + bl BaristuteFallingInit lbl_08047eac: - bl BaristuteBouncing + bl BaristuteFalling b lbl_08047eb6 lbl_08047eb2: bl BaristuteDeath diff --git a/data/data.h b/data/data.h index ad5fcc06..1d956ffb 100644 --- a/data/data.h +++ b/data/data.h @@ -99,7 +99,7 @@ /* generic_data.c */ i16 sSineYValues[320]; -u8 random_number_table[256]; +u8 sRandomNumberTable[256]; /* blob_0x808ca9c_0x8239463.c */ diff --git a/database.json b/database.json index 76f112a3..5f282702 100644 --- a/database.json +++ b/database.json @@ -1,2393 +1 @@ -{ - "generic_data.c": [{ - "Name": "sSineYValues", - "Offset": 575260, - "Type": "i16", - "IsArray": 1, - "Size": 320 - }, - { - "Name": "random_number_table", - "Offset": 575900, - "Type": "u8", - "IsArray": 1, - "Size": 256 - } - ], - "blob_0x808ca9c_0x8239463.c": [{ - "Name": "blob_0x808ca9c_0x8239463", - "Offset": 576156, - "Type": "u8", - "IsArray": 1, - "Size": 1755592 - }], - "samus_visual_data.c": [{ - "Name": "samus_visual_data", - "Offset": 2331748, - "Type": "u8", - "IsArray": 2, - "Size": 4456451 - }], - "blob_0x8239530_0x823a533.c": [{ - "Name": "blob_0x8239530_0x823a533", - "Offset": 2331952, - "Type": "u8", - "IsArray": 1, - "Size": 4100 - }], - "samus_hitbox_draw_data.c": [{ - "Name": "samus_draw_distance_offsets", - "Offset": 2336052, - "Type": "u16", - "IsArray": 2, - "Size": 262148 - }, - { - "Name": "samus_hitbox_data", - "Offset": 2336084, - "Type": "i16", - "IsArray": 2, - "Size": 262147 - }, - { - "Name": "samus_environmental_effects_oam_pointers", - "Offset": 2336108, - "Type": "u8", - "IsArray": 1, - "Size": 72 - }, - { - "Name": "SamusPullingSelfUp_velocity", - "Offset": 2336180, - "Type": "u16", - "IsArray": 1, - "Size": 4 - } - ], - "blob_0x823a5bc_0x82b0cab.c": [{ - "Name": "blob_0x823a5bc_0x82b0cab", - "Offset": 2336108, - "Type": "u8", - "IsArray": 1, - "Size": 485104 - }], - "sprite_stats.c": [{ - "Name": "sRandomTable0_F", - "Offset": 2821292, - "Type": "u8", - "IsArray": 1, - "Size": 56 - }, - { - "Name": "dessgeega_sidehopper_in_block_yVelocity", - "Offset": 2821348, - "Type": "i16", - "IsArray": 1, - "Size": 16 - }, - { - "Name": "sSpritesFallingSpeed", - "Offset": 2821380, - "Type": "i16", - "IsArray": 1, - "Size": 40 - }, - { - "Name": "worker_robot_sleeping_falling_speed", - "Offset": 2821460, - "Type": "i16", - "IsArray": 1, - "Size": 10 - }, - { - "Name": "sPrimarySpriteStats", - "Offset": 2821480, - "Type": "u16", - "IsArray": 2, - "Size": 13500425 - }, - { - "Name": "sSecondarySpriteStats", - "Offset": 2825188, - "Type": "u16", - "IsArray": 2, - "Size": 5046281 - } - ], - "blob_0x82b214e_0x82b2523.c": [{ - "Name": "blob_0x82b214e_0x82b2523", - "Offset": 2826574, - "Type": "u8", - "IsArray": 1, - "Size": 982 - }], - "sprite_debris_data.c": [{ - "Name": "debris_bouncing_velocity", - "Offset": 2827556, - "Type": "i16", - "IsArray": 1, - "Size": 9 - }, - { - "Name": "debris_11_velocity", - "Offset": 2827574, - "Type": "i16", - "IsArray": 1, - "Size": 9 - }, - { - "Name": "debris_12_velocity", - "Offset": 2827592, - "Type": "i16", - "IsArray": 1, - "Size": 9 - }, - { - "Name": "debris_13_velocity", - "Offset": 2827610, - "Type": "i16", - "IsArray": 1, - "Size": 9 - }, - { - "Name": "debris_4_velocity", - "Offset": 2827628, - "Type": "i16", - "IsArray": 1, - "Size": 9 - }, - { - "Name": "debris_5_velocity", - "Offset": 2827646, - "Type": "i16", - "IsArray": 1, - "Size": 9 - }, - { - "Name": "debris_6_velocity", - "Offset": 2827664, - "Type": "i16", - "IsArray": 1, - "Size": 9 - }, - { - "Name": "debris_7_velocity", - "Offset": 2827682, - "Type": "i16", - "IsArray": 1, - "Size": 9 - }, - { - "Name": "debris_8_velocity", - "Offset": 2827700, - "Type": "i16", - "IsArray": 1, - "Size": 9 - } - ], - "enemy_drop_data.c": [{ - "Name": "small_energy_drop_oam", - "Offset": 2828072, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "large_energy_drop_oam", - "Offset": 2828112, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "missile_drop_oam", - "Offset": 2828152, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "super_missile_drop_oam", - "Offset": 2828176, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "power_bomb_drop_oam", - "Offset": 2828200, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "multiple_large_energy_drop_slot1_oam", - "Offset": 2828224, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "multiple_large_energy_drop_slot3_oam", - "Offset": 2828264, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "multiple_large_energy_drop_slot2_oam", - "Offset": 2828304, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - } - ], - "unused_sprites_data.c": [{ - "Name": "unused_sprites_oam", - "Offset": 2828360, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "unused_sprites_gfx", - "Offset": 2828400, - "Type": "u8", - "IsArray": 1, - "Size": 24 - }, - { - "Name": "unused_sprites_pal", - "Offset": 2828424, - "Type": "u16", - "IsArray": 1, - "Size": 16 - } - ], - "morph_ball_data.c": [{ - "Name": "morph_ball_gfx", - "Offset": 2828456, - "Type": "u8", - "IsArray": 1, - "Size": 672 - }, - { - "Name": "morph_ball_pal", - "Offset": 2829128, - "Type": "u16", - "IsArray": 1, - "Size": 16 - }, - { - "Name": "morph_ball_oam", - "Offset": 2829224, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "morph_ball_outside_oam", - "Offset": 2829264, - "Type": "OAM", - "IsArray": 0, - "Size": 6 - } - ], - "PowerGrip_data.c": [{ - "Name": "PowerGrip_gfx", - "Offset": 2829312, - "Type": "u8", - "IsArray": 1, - "Size": 1116 - }, - { - "Name": "PowerGrip_pal", - "Offset": 2830428, - "Type": "u16", - "IsArray": 1, - "Size": 32 - }, - { - "Name": "PowerGrip_oam", - "Offset": 2830604, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "PowerGrip_glow_oam", - "Offset": 2830644, - "Type": "OAM", - "IsArray": 0, - "Size": 15 - } - ], - "charge_beam_data.c": [{ - "Name": "charge_beam_yPosition_offsets", - "Offset": 2830764, - "Type": "i16", - "IsArray": 1, - "Size": 66 - }, - { - "Name": "charge_beam_gfx", - "Offset": 2830896, - "Type": "u8", - "IsArray": 1, - "Size": 972 - }, - { - "Name": "charge_beam_pal", - "Offset": 2831868, - "Type": "u16", - "IsArray": 1, - "Size": 16 - }, - { - "Name": "charge_beam_oam_visible", - "Offset": 2832632, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "charge_beam_oam", - "Offset": 2832672, - "Type": "OAM", - "IsArray": 0, - "Size": 13 - }, - { - "Name": "charge_beam_glow_oam", - "Offset": 2832776, - "Type": "OAM", - "IsArray": 0, - "Size": 15 - } - ], - "skree_data.c": [{ - "Name": "skree_falling_speed", - "Offset": 2935420, - "Type": "i16", - "IsArray": 1, - "Size": 8 - }, - { - "Name": "skree_gfx", - "Offset": 2935436, - "Type": "u8", - "IsArray": 1, - "Size": 1056 - }, - { - "Name": "skree_pal", - "Offset": 2936492, - "Type": "u16", - "IsArray": 1, - "Size": 16 - }, - { - "Name": "skree_blue_gfx", - "Offset": 2936524, - "Type": "u8", - "IsArray": 1, - "Size": 1056 - }, - { - "Name": "skree_blue_pal", - "Offset": 2937580, - "Type": "u16", - "IsArray": 1, - "Size": 16 - }, - { - "Name": "skree_oam_1", - "Offset": 2937972, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "skree_oam_2", - "Offset": 2938012, - "Type": "OAM", - "IsArray": 0, - "Size": 6 - }, - { - "Name": "skree_oam_3", - "Offset": 2938060, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "skree_oam_4", - "Offset": 2938100, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "skree_oam_5", - "Offset": 2938140, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "skree_oam_6", - "Offset": 2938180, - "Type": "OAM", - "IsArray": 0, - "Size": 6 - }, - { - "Name": "skree_oam_7", - "Offset": 2938228, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "skree_oam_8", - "Offset": 2938268, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "skree_oam_9", - "Offset": 2938308, - "Type": "OAM", - "IsArray": 0, - "Size": 4 - }, - { - "Name": "skree_oam_10", - "Offset": 2938340, - "Type": "OAM", - "IsArray": 0, - "Size": 4 - } - ], - "blob_0x82cd604_0x82f7db3.c": [{ - "Name": "blob_0x82cd604_0x82f7db3", - "Offset": 2938372, - "Type": "u8", - "IsArray": 1, - "Size": 174000 - }], - "area_banner_data.c": [{ - "Name": "area_banner_location_text_pal", - "Offset": 3112372, - "Type": "u16", - "IsArray": 1, - "Size": 16 - }], - "blob_0x82f7dd4_0x82fd107.c": [{ - "Name": "blob_0x82f7dd4_0x82fd107", - "Offset": 3112404, - "Type": "u8", - "IsArray": 1, - "Size": 21300 - }], - "geron_data.c": [{ - "Name": "GeronNorfair_oam", - "Offset": 3134656, - "Type": "OAM", - "IsArray": 0, - "Size": 11 - }, - { - "Name": "geron_gfx", - "Offset": 3134744, - "Type": "u8", - "IsArray": 1, - "Size": 612 - }, - { - "Name": "geron_pal", - "Offset": 3135356, - "Type": "u16", - "IsArray": 1, - "Size": 16 - } - ], - "blob_0x82fd79c_0x830d55b.c": [{ - "Name": "blob_0x82fd79c_0x830d55b", - "Offset": 3135388, - "Type": "u8", - "IsArray": 1, - "Size": 64960 - }], - "glass_tube_data.c": [{ - "Name": "glass_tube_oam", - "Offset": 3200348, - "Type": "OAM", - "IsArray": 0, - "Size": 2 - }, - { - "Name": "glass_tube_oam_cracking", - "Offset": 3200364, - "Type": "OAM", - "IsArray": 0, - "Size": 12 - }, - { - "Name": "glass_tube_oam_breaking", - "Offset": 3200460, - "Type": "OAM", - "IsArray": 0, - "Size": 19 - }, - { - "Name": "glass_tube_oam_broken", - "Offset": 3200612, - "Type": "OAM", - "IsArray": 0, - "Size": 2 - }, - { - "Name": "glass_tube_gfx", - "Offset": 3200628, - "Type": "u8", - "IsArray": 1, - "Size": 2208 - }, - { - "Name": "glass_tube_pal", - "Offset": 3202836, - "Type": "u16", - "IsArray": 1, - "Size": 64 - } - ], - "blob_0x830df94_0x8312b97.c": [{ - "Name": "blob_0x830df94_0x8312b97", - "Offset": 3202964, - "Type": "u8", - "IsArray": 1, - "Size": 19460 - }], - "rising_chozo_pillar_data.c": [{ - "Name": "rising_chozo_pillar_gfx", - "Offset": 3222424, - "Type": "u8", - "IsArray": 1, - "Size": 2684 - }, - { - "Name": "rising_chozo_pillar_pal", - "Offset": 3225108, - "Type": "u16", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "chozo_pillar_platform_oam_spawning", - "Offset": 3226188, - "Type": "OAM", - "IsArray": 0, - "Size": 25 - }, - { - "Name": "chozo_pillar_platform_slot1_oam_spawned", - "Offset": 3226412, - "Type": "OAM", - "IsArray": 0, - "Size": 2 - }, - { - "Name": "chozo_pillar_platform_slot1_oam_spawning", - "Offset": 3226428, - "Type": "OAM", - "IsArray": 0, - "Size": 28 - }, - { - "Name": "chozo_pillar_platform_oam_spawned", - "Offset": 3226652, - "Type": "OAM", - "IsArray": 0, - "Size": 2 - }, - { - "Name": "ChozoPillarPlatformShadow_oam", - "Offset": 3226668, - "Type": "OAM", - "IsArray": 0, - "Size": 4 - } - ], - "blob_0x8313c4c_0x8326ca7.c": [{ - "Name": "blob_0x8313c4c_0x8326ca7", - "Offset": 3226700, - "Type": "u8", - "IsArray": 1, - "Size": 77915 - }], - "tumbling_missile_speed_data.c": [{ - "Name": "tumbling_missile_speed", - "Offset": 3304616, - "Type": "i16", - "IsArray": 1, - "Size": 48 - }], - "bomb_data.c": [{ - "Name": "bomb_oam_normal", - "Offset": 3304768, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "bomb_oam_fast", - "Offset": 3304808, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "power_bomb_oam_normal", - "Offset": 3304848, - "Type": "OAM", - "IsArray": 0, - "Size": 4 - }, - { - "Name": "power_bomb_oam_fast", - "Offset": 3304880, - "Type": "OAM", - "IsArray": 0, - "Size": 4 - } - ], - "missiles_data.c": [{ - "Name": "missile_oam_forward", - "Offset": 3305280, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "missile_oam_diagonal", - "Offset": 3305304, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "missile_oam_up_down", - "Offset": 3305328, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "super_missile_oam_forward", - "Offset": 3305352, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "super_missile_oam_diagonal", - "Offset": 3305376, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "super_missile_oam_up_down", - "Offset": 3305400, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "missile_tumbling_oam", - "Offset": 3305424, - "Type": "OAM", - "IsArray": 0, - "Size": 9 - }, - { - "Name": "super_missile_tumbling_oam", - "Offset": 3305496, - "Type": "OAM", - "IsArray": 0, - "Size": 9 - }, - { - "Name": "particle_missile_trail_oam", - "Offset": 3305568, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "particle_super_missile_trail_oam", - "Offset": 3305632, - "Type": "OAM", - "IsArray": 0, - "Size": 9 - } - ], - "beam_palette_data.c": [{ - "Name": "beam_pal", - "Offset": 3305704, - "Type": "u16", - "IsArray": 1, - "Size": 96 - }], - "normal_beam_data.c": [{ - "Name": "normal_beam_gfx", - "Offset": 3305896, - "Type": "u8", - "IsArray": 1, - "Size": 2048 - }, - { - "Name": "normal_beam_oam_forward", - "Offset": 3308176, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "normal_beam_oam_diagonal", - "Offset": 3308200, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "normal_beam_oam_up_down", - "Offset": 3308224, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "normal_beam_oam_unused1", - "Offset": 3308248, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "normal_beam_oam_unused2", - "Offset": 3308272, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "normal_beam_oam_unused3", - "Offset": 3308296, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_normal_beam_oam_forward", - "Offset": 3308320, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_normal_beam_oam_diagonal", - "Offset": 3308344, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_normal_beam_oam_up_down", - "Offset": 3308368, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "normal_beam_oam_unused4", - "Offset": 3308392, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - } - ], - "long_beam_data.c": [{ - "Name": "long_normal_beam_gfx", - "Offset": 3308368, - "Type": "u8", - "IsArray": 1, - "Size": 2048 - }, - { - "Name": "long_beam_oam_forward", - "Offset": 3310664, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "long_beam_oam_diagonal", - "Offset": 3310688, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "long_beam_oam_up_down", - "Offset": 3310712, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_long_beam_oam_forward", - "Offset": 3310736, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_long_beam_oam_diagonal", - "Offset": 3310760, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_long_beam_oam_up_down", - "Offset": 3310784, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "particle_charged_long_beam_trail_oam", - "Offset": 3310808, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - } - ], - "ice_beam_data.c": [{ - "Name": "ice_beam_gfx", - "Offset": 3310848, - "Type": "u8", - "IsArray": 1, - "Size": 2048 - }, - { - "Name": "ice_beam_oam_forward", - "Offset": 3313196, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "ice_beam_oam_diagonal", - "Offset": 3313220, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "ice_beam_oam_up_down", - "Offset": 3313244, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "ice_beam_oam_unused1", - "Offset": 3313268, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "ice_beam_oam_unused2", - "Offset": 3313292, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "ice_beam_oam_unused3", - "Offset": 3313316, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_ice_beam_oam_forward", - "Offset": 3313340, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_ice_beam_oam_diagonal", - "Offset": 3313364, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_ice_beam_oam_up_down", - "Offset": 3313388, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "particle_charged_ice_beam_trail_oam", - "Offset": 3313412, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - } - ], - "wave_beam_data.c": [{ - "Name": "wave_beam_gfx", - "Offset": 3313460, - "Type": "u8", - "IsArray": 1, - "Size": 2048 - }, - { - "Name": "wave_beam_oam_forward", - "Offset": 3316844, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "wave_beam_oam_diagonal", - "Offset": 3316908, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "wave_beam_oam_up_down", - "Offset": 3316972, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "wave_beam_oam_unused1", - "Offset": 3317036, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "wave_beam_oam_unused2", - "Offset": 3317100, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "wave_beam_oam_unused3", - "Offset": 3317164, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "charged_wave_beam_oam_forward", - "Offset": 3317228, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "charged_wave_beam_oam_diagonal", - "Offset": 3317292, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "charged_wave_beam_oam_up_down", - "Offset": 3317356, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "particle_charged_wave_beam_trail_oam", - "Offset": 3317420, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - } - ], - "plasma_beam_data.c": [{ - "Name": "plasma_beam_gfx", - "Offset": 3317460, - "Type": "u8", - "IsArray": 1, - "Size": 2048 - }, - { - "Name": "plasma_beam_no_wave_oam_forward", - "Offset": 3321120, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "plasma_beam_no_wave_oam_diagonal", - "Offset": 3321144, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "plasma_beam_no_wave_oam_up_down", - "Offset": 3321168, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "plasma_beam_no_wave_oam_unused1", - "Offset": 3321192, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "plasma_beam_no_wave_oam_unused2", - "Offset": 3321216, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "plasma_beam_no_wave_oam_unused3", - "Offset": 3321240, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_plasma_beam_no_wave_oam_forward", - "Offset": 3321264, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_plasma_beam_no_wave_oam_diagonal", - "Offset": 3321288, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_plasma_beam_no_wave_oam_up_down", - "Offset": 3321312, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "plasma_beam_wave_oam_forward", - "Offset": 3321336, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "plasma_beam_wave_oam_diagonal", - "Offset": 3321400, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "plasma_beam_wave_oam_up_down", - "Offset": 3321464, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "plasma_beam_wave_oam_unused1", - "Offset": 3321528, - "Type": "OAM", - "IsArray": 0, - "Size": 6 - }, - { - "Name": "plasma_beam_wave_oam_unused2", - "Offset": 3321576, - "Type": "OAM", - "IsArray": 0, - "Size": 6 - }, - { - "Name": "plasma_beam_wave_oam_unused3", - "Offset": 3321624, - "Type": "OAM", - "IsArray": 0, - "Size": 6 - }, - { - "Name": "charged_plasma_beam_wave_oam_forward", - "Offset": 3321672, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "charged_plasma_beam_wave_oam_diagonal", - "Offset": 3321736, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "charged_plasma_beam_wave_oam_up_down", - "Offset": 3321800, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "particle_charged_plasma_beam_trail_oam", - "Offset": 3321864, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "particle_charged_full_beam_trail_oam", - "Offset": 3321904, - "Type": "OAM", - "IsArray": 0, - "Size": 9 - } - ], - "pistol_data.c": [{ - "Name": "pistol_gfx", - "Offset": 3321976, - "Type": "u8", - "IsArray": 1, - "Size": 2048 - }, - { - "Name": "pistol_oam_forward", - "Offset": 3324208, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "pistol_oam_diagonal", - "Offset": 3324232, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "pistol_oam_up_down", - "Offset": 3324256, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_pistol_oam_forward", - "Offset": 3324280, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_pistol_oam_diagonal", - "Offset": 3324304, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "charged_pistol_oam_up_down", - "Offset": 3324328, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - }, - { - "Name": "particle_charged_pistol_trail_oam", - "Offset": 3324352, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - } - ], - "blob_0x832b9e8_0x832ba07.c": [{ - "Name": "blob_0x832b9e8_0x832ba07", - "Offset": 3324392, - "Type": "u8", - "IsArray": 1, - "Size": 32 - }], - "common_gSpriteData.c": [{ - "Name": "common_sprites_pal", - "Offset": 3324424, - "Type": "u16", - "IsArray": 1, - "Size": 96 - }, - { - "Name": "common_sprites_gfx", - "Offset": 3324616, - "Type": "u8", - "IsArray": 1, - "Size": 14336 - } - ], - "hud_data.c": [{ - "Name": "missile_digits_gfx", - "Offset": 3338952, - "Type": "u8", - "IsArray": 1, - "Size": 2304 - }, - { - "Name": "power_bomb_digits_gfx", - "Offset": 3341256, - "Type": "u8", - "IsArray": 1, - "Size": 2304 - }, - { - "Name": "missile_hud_inactive_gfx", - "Offset": 3343560, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "missile_hud_selected_gfx", - "Offset": 3343624, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "missile_hud_active_gfx", - "Offset": 3343688, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "missile_hud_refill1_gfx", - "Offset": 3343752, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "missile_hud_refill2_gfx", - "Offset": 3343816, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "missile_hud_refill3_gfx", - "Offset": 3343880, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "super_missile_hud_inactive_gfx", - "Offset": 3343944, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "super_missile_hud_selected_gfx", - "Offset": 3344008, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "super_missile_hud_active_gfx", - "Offset": 3344072, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "super_missile_hud_refill1_gfx", - "Offset": 3344136, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "super_missile_hud_refill2_gfx", - "Offset": 3344200, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "super_missile_hud_refill3_gfx", - "Offset": 3344264, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "power_bomb_hud_inactive_gfx", - "Offset": 3344328, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "power_bomb_hud_selected_gfx", - "Offset": 3344392, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "power_bomb_hud_active_gfx", - "Offset": 3344456, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "power_bomb_hud_refill1_gfx", - "Offset": 3344520, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "power_bomb_hud_refill2_gfx", - "Offset": 3344584, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "power_bomb_hud_refill3_gfx", - "Offset": 3344648, - "Type": "u8", - "IsArray": 1, - "Size": 64 - }, - { - "Name": "energy_digits_tens_gfx", - "Offset": 3344712, - "Type": "u8", - "IsArray": 2, - "Size": 655392 - }, - { - "Name": "energy_digits_ones_gfx", - "Offset": 3345032, - "Type": "u8", - "IsArray": 2, - "Size": 655392 - }, - { - "Name": "energy_digits_refill1_tens_gfx", - "Offset": 3345352, - "Type": "u8", - "IsArray": 2, - "Size": 655392 - }, - { - "Name": "energy_digits_refill1_ones_gfx", - "Offset": 3345672, - "Type": "u8", - "IsArray": 2, - "Size": 655392 - }, - { - "Name": "energy_digits_refill2_tens_gfx", - "Offset": 3345992, - "Type": "u8", - "IsArray": 2, - "Size": 655392 - }, - { - "Name": "energy_digits_refill2_ones_gfx", - "Offset": 3346312, - "Type": "u8", - "IsArray": 2, - "Size": 655392 - }, - { - "Name": "energy_digits_refill3_tens_gfx", - "Offset": 3346632, - "Type": "u8", - "IsArray": 2, - "Size": 655392 - }, - { - "Name": "energy_digits_refill3_ones_gfx", - "Offset": 3346952, - "Type": "u8", - "IsArray": 2, - "Size": 655392 - } - ], - "blob_0x8331348_0x8339aa7.c": [{ - "Name": "blob_0x8331348_0x8339aa7", - "Offset": 3347272, - "Type": "u8", - "IsArray": 1, - "Size": 34656 - }], - "particle_beam_data.c": [{ - "Name": "particle_shooting_beam_left_right_oam", - "Offset": 3382500, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "particle_shooting_beam_diagonally_up_oam", - "Offset": 3382540, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "particle_shooting_beam_diagonally_down_oam", - "Offset": 3382580, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "particle_shooting_beam_up_oam", - "Offset": 3382620, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "particle_shooting_beam_down_oam", - "Offset": 3382660, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "particle_bomb_oam", - "Offset": 3382700, - "Type": "OAM", - "IsArray": 0, - "Size": 7 - }, - { - "Name": "particle_beam_trailing_oam", - "Offset": 3382756, - "Type": "OAM", - "IsArray": 0, - "Size": 6 - }, - { - "Name": "particle_charging_beam_oam_begin", - "Offset": 3382804, - "Type": "OAM", - "IsArray": 0, - "Size": 23 - }, - { - "Name": "particle_charging_beam_oam_charged", - "Offset": 3382988, - "Type": "OAM", - "IsArray": 0, - "Size": 3 - } - ], - "particle_misc_data.c": [{ - "Name": "particle_hitting_something_with_base_beam_oam", - "Offset": 3388556, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "particle_hitting_something_with_long_beam_oam", - "Offset": 3388596, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "particle_hitting_something_with_ice_beam_oam", - "Offset": 3388636, - "Type": "OAM", - "IsArray": 0, - "Size": 6 - }, - { - "Name": "particle_hitting_something_with_wave_beam_full_beam_no_plasma_oam", - "Offset": 3388684, - "Type": "OAM", - "IsArray": 0, - "Size": 7 - }, - { - "Name": "particle_hitting_something_with_plasma_beam_full_beam_oam", - "Offset": 3388740, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "particle_hitting_something_invincible_oam", - "Offset": 3388804, - "Type": "OAM", - "IsArray": 0, - "Size": 6 - }, - { - "Name": "particle_hitting_something_with_missile_oam", - "Offset": 3388852, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "particle_hitting_something_with_super_missile_oam", - "Offset": 3388916, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "particle_sprite_explosion_huge_oam", - "Offset": 3388980, - "Type": "OAM", - "IsArray": 0, - "Size": 14 - }, - { - "Name": "particle_small_dust_oam", - "Offset": 3389092, - "Type": "OAM", - "IsArray": 0, - "Size": 7 - }, - { - "Name": "particle_medium_dust_oam", - "Offset": 3389148, - "Type": "OAM", - "IsArray": 0, - "Size": 10 - }, - { - "Name": "particle_two_medium_dust_oam", - "Offset": 3389228, - "Type": "OAM", - "IsArray": 0, - "Size": 11 - }, - { - "Name": "particle_sprite_explosion_small_oam", - "Offset": 3389316, - "Type": "OAM", - "IsArray": 0, - "Size": 12 - }, - { - "Name": "particle_sprite_explosion_medium_oam", - "Offset": 3389412, - "Type": "OAM", - "IsArray": 0, - "Size": 18 - }, - { - "Name": "particle_sprite_explosion_big_oam", - "Offset": 3389556, - "Type": "OAM", - "IsArray": 0, - "Size": 18 - }, - { - "Name": "particle_sprite_explosion_single_then_big_oam", - "Offset": 3389700, - "Type": "OAM", - "IsArray": 0, - "Size": 17 - }, - { - "Name": "particle_screw_attack_destroyed_oam", - "Offset": 3389836, - "Type": "OAM", - "IsArray": 0, - "Size": 9 - }, - { - "Name": "particle_shinespark_destroyed_oam", - "Offset": 3389908, - "Type": "OAM", - "IsArray": 0, - "Size": 11 - }, - { - "Name": "particle_sudo_screw_destroyed_oam", - "Offset": 3389996, - "Type": "OAM", - "IsArray": 0, - "Size": 9 - }, - { - "Name": "particle_speedbooster_destroyed_oam", - "Offset": 3390068, - "Type": "OAM", - "IsArray": 0, - "Size": 9 - }, - { - "Name": "particle_freezing_sprite_with_ice_oam", - "Offset": 3390140, - "Type": "OAM", - "IsArray": 0, - "Size": 17 - }, - { - "Name": "particle_freezing_sprite_with_charged_ice_oam", - "Offset": 3390276, - "Type": "OAM", - "IsArray": 0, - "Size": 16 - }, - { - "Name": "particle_main_boss_death_oam", - "Offset": 3390404, - "Type": "OAM", - "IsArray": 0, - "Size": 18 - }, - { - "Name": "WaterDrop_oam", - "Offset": 3390548, - "Type": "OAM", - "IsArray": 0, - "Size": 8 - }, - { - "Name": "WaterDrop_oam_falling", - "Offset": 3390612, - "Type": "OAM", - "IsArray": 0, - "Size": 2 - }, - { - "Name": "WaterDrop_oam_splashing", - "Offset": 3390628, - "Type": "OAM", - "IsArray": 0, - "Size": 6 - }, - { - "Name": "sprite_debris_oam", - "Offset": 3390676, - "Type": "OAM", - "IsArray": 0, - "Size": 5 - }, - { - "Name": "sprite_debris_oam_unused", - "Offset": 3390716, - "Type": "OAM", - "IsArray": 0, - "Size": 7 - } - ], - "blob_0x833bd34_0x833cbdf.c": [{ - "Name": "blob_0x833bd34_0x833cbdf", - "Offset": 3390772, - "Type": "u8", - "IsArray": 1, - "Size": 3756 - }], - "particle_splash_data.c": [{ - "Name": "particle_sprite_splash_water_big_oam", - "Offset": 3396876, - "Type": "OAM", - "IsArray": 0, - "Size": 10 - }, - { - "Name": "particle_sprite_splash_water_huge_oam", - "Offset": 3396956, - "Type": "OAM", - "IsArray": 0, - "Size": 10 - }, - { - "Name": "particle_sprite_splash_water_small_oam", - "Offset": 3397036, - "Type": "OAM", - "IsArray": 0, - "Size": 7 - }, - { - "Name": "particle_sprite_splash_lava_big_oam", - "Offset": 3397092, - "Type": "OAM", - "IsArray": 0, - "Size": 10 - }, - { - "Name": "particle_sprite_splash_lava_huge_oam", - "Offset": 3397172, - "Type": "OAM", - "IsArray": 0, - "Size": 10 - }, - { - "Name": "particle_sprite_splash_lava_small_oam", - "Offset": 3397252, - "Type": "OAM", - "IsArray": 0, - "Size": 7 - }, - { - "Name": "particle_sprite_splash_acid_big_oam", - "Offset": 3397308, - "Type": "OAM", - "IsArray": 0, - "Size": 10 - }, - { - "Name": "particle_sprite_splash_acid_huge_oam", - "Offset": 3397388, - "Type": "OAM", - "IsArray": 0, - "Size": 10 - }, - { - "Name": "particle_sprite_splash_acid_small_oam", - "Offset": 3397468, - "Type": "OAM", - "IsArray": 0, - "Size": 7 - } - ], - "blob_0x833d75c_0x8345cc8.c": [{ - "Name": "blob_0x83d75c_0x8345cc8", - "Offset": 3397468, - "Type": "u8", - "IsArray": 1, - "Size": 34156 - }], - "bldalpha_data.c": [{ - "Name": "bldalpha_values_for_clipdata", - "Offset": 3431624, - "Type": "u16", - "IsArray": 1, - "Size": 11 - }], - "blob_0x8345cde_0x875e6a7.c": [{ - "Name": "blob_0x8345cde_0x875e6a7", - "Offset": 3431646, - "Type": "u8", - "IsArray": 1, - "Size": 4295113 - }], - "samus_pointers_data.c": [{ - "Name": "samus_pose_functions_pointers", - "Offset": 7726760, - "Type": "Pointer", - "pType": "SamusFunc_T", - "IsArray": 1, - "Size": 67, - "Pointers": [ - "SamusRunning", - "SamusStanding", - "SamusTurningAround", - "SamusStanding", - "SamusCrouching", - "SamusTurningAroundAndCrouching", - "SamusCrouching", - "SamusSkidding", - "SamusMidAir", - "SamusTurningAroundMidAir", - "SamusStanding", - "SamusSpinning", - "SamusSpinning", - "SamusStartingWallJump", - "SamusSpinning", - "SamusSpinning", - "SamusMorphing", - "SamusMorphball", - "SamusRolling", - "SamusUnmorphing", - "SamusMorphballMidAir", - "SamusHangingOnLedge", - "SamusTurningToAimWhileHanging", - "SamusTurningToAimWhileHanging", - "SamusAimingWhileHanging", - "SamusTurningToAimWhileHanging", - "SamusPullingSelfUp", - "SamusPullingSelfForward", - "SamusPullingSelfUp", - "SamusUsingAnElevator", - "SamusFacingTheForeground", - "SamusInactivity", - "SamusInactivity", - "SamusInactivity", - "SamusShinesparking", - "SamusInactivity", - "SamusInactivity", - "SamusDelayBeforeBallsparking", - "SamusShinesparking", - "SamusInactivity", - "SamusOnZipline", - "SamusOnZipline", - "SamusOnZipline", - "SamusMorphballOnZipline", - "SamusSavingLoadingGame", - "SamusSavingLoadingGame", - "SamusInactivity", - "SamusGettingHurt", - "SamusGettingKnockedBack", - "SamusGettingHurt", - "SamusGettingKnockedBack", - "SamusDying", - "SamusInactivity", - "SamusCrawlingStopped", - "SamusCrawlingStopped", - "SamusCrawling", - "SamusInactivity", - "SamusTurningAroundWhileCrawling", - "SamusInactivity", - "SamusStanding", - "SamusCrouching", - "SamusHangingOnLedge", - "SamusFacingTheBackground", - "SamusInactivity", - "SamusInactivity", - "SamusInactivity", - "SamusInactivity" - ] - }, - { - "Name": "samus_pose_gfx_functions_pointers", - "Offset": 7727028, - "Type": "Pointer", - "pType": "SamusFunc_T", - "IsArray": 1, - "Size": 67, - "Pointers": [ - "SamusRunningGFX", - "SamusStandingGFX", - "SamusTurningAroundGFX", - "SamusShootingGFX", - "SamusStandingGFX", - "SamusTurningAroundAndCrouchingGFX", - "SamusShootingAndCrouchingGFX", - "SamusGettingHurtGFX", - "SamusMidAirGFX", - "SamusTurningAroundMidAirGFX", - "SamusShootingGFX", - "SamusStartingSpinJumpGFX", - "SamusSpinningGFX", - "SamusStartingWallJumpGFX", - "SamusSpaceJumpingGFX", - "SamusCrewAttackingGFX", - "SamusMorphingGFX", - "SamusStandingGFX", - "SamusRollingGFX", - "SamusUnmorphingGFX", - "SamusStandingGFX", - "SamusHangingOnLedgeGFX", - "SamusTurningToAimWhileHangingGFX", - "SamusHidingArmCannonWhileHangingGFX", - "SamusStandingGFX", - "SamusTurningToAimWhileHangingGFX", - "SamusPullingSelfUpGFX", - "SamusPullingSelfForwardGFX", - "SamusPullingSelfIntoMorphballTunnelGFX", - "SamusUsingAnElevatorGFX", - "SamusStandingGFX", - "SamusTurningFromFacningForegroundGFX", - "SamusStandingGFX", - "SamusDelayBeforeShinesparkingGFX", - "SamusShinesparkingGFX", - "SamusShinesparkCollisionGFX", - "SamusDelayAfterShinesparkingGFX", - "SamusDelayBeforeBallsparkingGFX", - "SamusBallsparkingGFX", - "SamusBallsparkCollisionGFX", - "SamusInactivity", - "SamusShootingOnZiplineGFX", - "SamusShootingOnZiplineGFX", - "SamusStandingGFX", - "SamusStandingGFX", - "SamusStandingGFX", - "SamusTurningAround_to_download_map_data_gfx", - "SamusGettingHurtGFX", - "SamusGettingHurtGFX", - "SamusInactivity", - "SamusInactivity", - "SamusGettingHurtGFX", - "SamusCrouchingToCrawlGFX", - "SamusStandingGFX", - "SamusStartingToCrawlGFX", - "SamusDyingGFX", - "SamusTurningAroundAndCrouchingGFX", - "SamusCrawlingGFX", - "SamusStartingToCrawlGFX", - "SamusShootingGFX", - "SamusShootingAndCrouchingGFX", - "SamusGrabbingALedgeSuitlessGFX", - "SamusInactivity", - "SamusTurningFromFacingTheBackgroundGFX", - "SamusStandingGFX", - "SamusInactivity", - "SamusTurningToEnterEscapeShipGFX" - ] - } - ], - "primary_sprite_pointers.c": [{ - "Name": "sPrimarySpritesAIPointers", - "Offset": 7727296, - "Type": "Pointer", - "pType": "Func_T", - "IsArray": 1, - "Size": 206, - "Pointers": [ - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "UnusedSprites", - "ItemBanner", - "Zoomer", - "Zoomer", - "Zeela", - "Zeela", - "Ripper", - "Ripper", - "Zeb", - "Zeb", - "EnemyDrop", - "EnemyDrop", - "EnemyDrop", - "EnemyDrop", - "EnemyDrop", - "Skree", - "Skree", - "MorphBall", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "ChozoStatue", - "Sova", - "Sova", - "Multiviola", - "EnemyDrop", - "Geruta", - "Geruta", - "Squeept", - "Squeept", - "MapStation", - "Dragon", - "Dragon", - "Zipline", - "ZiplineButton", - "Reo", - "Reo", - "Gunship", - "Deorem", - "Deorem", - "ChargeBeam", - "skultera", - "Dessgeega", - "Dessgeega", - "Waver", - "Waver", - "Mellow", - "Hive", - "PowerGrip", - "ImagoLarva", - "MorphBallLauncher", - "imago_cocoon", - "ElevatorPad", - "SpacePirate", - "SpacePirate", - "SpacePirate", - "SpacePirate", - "SpacePirate", - "Gamet", - "Gamet", - "UnknownItemChozoStatue", - "SecurityGateDefaultOpen", - "Zebbo", - "Zebbo", - "WorkerRobot", - "ParasiteMultiple", - "Parasite", - "Piston", - "Ridley", - "SecurityGateDefaultClosed", - "ZiplineGenerator", - "Metroid", - "Metroid", - "Polyp", - "Rinka", - "Viola", - "Viola", - "GeronNorfair", - "Holtz", - "GekitaiMachine", - "RuinsTest", - "SavePlatform", - "kraid", - "ImagoCocoonAfterFight", - "Ripper2", - "Mella", - "Atomic", - "area_banner", - "MotherBrain", - "FakePowerBombEventTrigger", - "acid_worm", - "EscapeShip", - "Sidehopper", - "Geega", - "Geega", - "RinkaMotherBrain", - "Zebetite", - "Cannon", - "ImagoLarvaRightSide", - "TangleVineTall", - "TangleVineMedium", - "TangleVineCurved", - "TangleVineShort", - "MellowSwarm", - "MellowSwarm", - "Imago", - "Zebetite", - "Cannon", - "Cannon", - "Crocomire", - "ImagoLarva", - "Geron", - "Geron", - "Geron", - "Geron", - "Geron", - "GlassTube", - "SavePlatformChozodia", - "Baristute", - "UnknownItemChozoStatue", - "KraidElevatorStatue", - "RidleyElevatorStatue", - "RisingChozoPillar", - "SecurityLaster", - "SecurityLaster", - "SecurityLaster", - "SecurityLaster", - "MetroidDoorLock", - "Gamet", - "Gamet", - "Geega", - "Geega", - "Zebbo", - "Zebbo", - "KraidStatue", - "RidleyStatue", - "Rinka", - "SearchlightEye", - "SearchlightEye", - "Steam", - "Steam", - "UnkownItemBlock", - "UnkownItemBlock", - "UnkownItemBlock", - "Gadora", - "Gadora", - "Searchlight", - "Searchlight", - "Searchlight", - "Searchlight", - "PrimarySpriteB3", - "EventTriggerDiscoveredImagoPassage", - "FakePowerBomb", - "SpacePirateCarryingPowerBomb", - "TangleVineGeruta", - "TangleVineLarvaRight", - "TangleVineLarvaLeft", - "WaterDrop", - "FallingChozoPillar", - "MechaRidley", - "ExplosionZebesEscape", - "SteamDiagonal", - "SteamDiagonal", - "SteamDiagonal", - "SteamDiagonal", - "Baristute", - "EscapeGate", - "EscapeGate", - "BlackSpacePirate", - "EscapeShipSpacePirate", - "Baristute", - "RinkaMotherBrain", - "RinkaMotherBrain", - "RinkaMotherBrain", - "RinkaMotherBrain", - "RinkaMotherBrain", - "RinkaMotherBrain" - ] - }], - "blob_0x875ebf8_0x875f1e7.c": [{ - "Name": "blob_0x875ebf8_0x875f1e7", - "Offset": 7727296, - "Type": "u8", - "IsArray": 1, - "Size": 1520 - }], - "secondary_sprites_pointers.c": [{ - "Name": "sSecondarySpritesAIPointers", - "Offset": 7729640, - "Type": "Pointer", - "pType": "Func_T", - "IsArray": 1, - "Size": 77, - "Pointers": [ - "ChozoBall", - "ChozoStatueBody", - "ChozoStatueRefill", - "KraidMouth", - "ChozoStatueMovement", - "ChargeBeamGlow", - "WingedRipper", - "MultiviolaUnused", - "DragonFireball", - "DeoremSegment", - "DeoremEye", - "DeoremThorn", - "SkreeExplosion", - "SavePlatformTop", - "SaveYesNoCursor", - "SkreeExplosion", - "ZeelaEyes", - "HiveRoots", - "ImagoLarvaOutside", - "MorphBallOutside", - "ImagoCocoonVine", - "ImagoCocoonSpore", - "SpacePirateLaser", - "RidleyBody", - "RidleyTail", - "SearchlightEyeBeam", - "MetroidShell", - "PolypProjectile", - "KraidSpike", - "KraidNail", - "ZiplineGeneratorPart", - "AtomicElectricity", - "MotherBrainEye", - "RidleyFireball", - "UnknownItemChozoStatueBody", - "UnknownItemChozoStatueRefill", - "MorphBallLauncherBack", - "AcidWormBody", - "AcidWormSpit", - "CannonBullet", - "CrocomireBody", - "ImagoBody", - "DefeatedImagoCocoon", - "ImagoCeilingVine", - "SearchlightEyeBeam", - "GerutaTangleVine", - "SavePlatformTopChozodia", - "ImagoNeedle", - "ElevatorStatueDebris", - "ImagoDamagedStinger", - "GunshipPart", - "ImagoEgg", - "MapStationScreen", - "ChozoPillarPlatform", - "GadoraEye", - "GadoraBeam", - "UnkownItemBlockLight", - "SearchlightEyeProjectile", - "ChozoPillarPlatformShadow", - "RuinsTestSymbol", - "RuinsTestSamusReflectionStart", - "RuinsTestReflectionCover", - "RuinsTestGhostOutline", - "RuinsTestGhost", - "RuinsTestShootableSymbol", - "RuinsTestSamusReflectionEnd", - "RuinsTestLightning", - "RidleyFireball", - "MechaRidleyPart", - "EscapeShipPart", - "PowerGrip_glow", - "MechaRidleyLaser", - "MechaRidleyMissile", - "MechaRidleyFireball", - "MotherBrainBeam", - "MotherBrainBlock", - "MotherBrainGlassBreaking" - ] - }], - "blob_0x875f31c_0x875f973.c": [{ - "Name": "blob_0x875f31c_0x875f973", - "Offset": 7729948, - "Type": "u8", - "IsArray": 1, - "Size": 16234 - }], - "projectile_pointers.c": [{ - "Name": "process_projectile_functions_pointers", - "Offset": 7731572, - "Type": "Pointer", - "pType": "ProjFunc_T", - "IsArray": 1, - "Size": 16, - "Pointers": [ - "ProjectileProcessNormalBeam", - "ProjectileProcessLongBeam", - "ProjectileProcessIceBeam", - "ProjectileProcessWaveBeam", - "ProjectileProcessPlasmaBeam", - "ProjectileProcessPistol", - "ProjectileProcessChargedNormalBeam", - "ProjectileProcessChargedLongBeam", - "ProjectileProcessChargedIceBeam", - "ProjectileProcessChargedWaveBeam", - "ProjectileProcessChargedPlasmaBeam", - "ProjectileProcessChargedPistol", - "ProjectileDecrementMissileCounter", - "ProjectileProcessMissile", - "ProjectileDecrementSuperMissileCounter", - "ProjectileProcessSuperMissile", - "ProjectileMorphballLauncherCheckLaunchSamus", - "ProjectileCheckSamusBombBounce", - "ProjectileProcessBomb", - "ProjectileProcess_Empty", - "ProjectileProcessPowerBomb" - ] - }], - "particle_pointers.c": [{ - "Name": "process_particle_functions_pointer", - "Offset": 7731640, - "Type": "Pointer", - "pType": "ParticleFunc_T", - "IsArray": 1, - "Size": 61, - "Pointers": [ - "ParticleSpriteSplashSmall", - "ParticleSpriteSplashWaterBig", - "ParticleSpriteSplashWaterHuge", - "ParticleSpriteSplashLavaSmall", - "ParticleSpriteSplashLavaBig", - "ParticleSpriteSplashLavaHuge", - "ParticleSpriteSplashAcidSmall", - "ParticleSpriteSplashAcidBig", - "ParticleSpriteSplashAcidHuge", - "ParticleShootingBeamLeft", - "ParticleShootingBeamRight", - "ParticleShootingBeamDiagUpLeft", - "ParticleShootingBeamDiagUpRight", - "ParticleShootingBeamDiagDownLeft", - "ParticleShootingBeamDiagDownRight", - "ParticleShootingBeamDownLeft", - "ParticleShootingBeamDownRight", - "ParticleShootingBeamDownLeft", - "ParticleShootingBeamDownRight", - "ParticleBomb", - "ParticleMissileTrail", - "ParticleSuperMissileTrail", - "ParticleBeamTrailingRight", - "ParticleBeamTrailingLeft", - "ParticleChargedLongBeamTrail", - "ParticleChargedIceBeamTrail", - "ParticleChargedWaveBeamTrail", - "ParticleChargedPlasmaBeamTrail", - "ParticleChargedFullBeamTrail", - "ParticleChargedPistolTrail", - "ParticleSpriteExplosionHuge", - "ParticleSpriteExplosionSmall", - "ParticleSpriteExplosionMedium", - "ParticleSpriteExplosionBig", - "ParticleSpriteExplosionSingleThenBig", - "ParticleScrewAttackDestroyed", - "ParticleShinesparkDestroyed", - "ParticleSudoScrewDestroyed", - "ParticleSpeedboosterDestroyed", - "ParticleMainBossDeath", - "ParticleFreezingSpriteWithIce", - "ParticleFreezingSpriteWithChargedIce", - "ParticleHittingSomethingWithBaseBeam", - "ParticleHittingSomethingWithLongBeam", - "ParticleHittingSomethingWithIceBeam", - "ParticleHittingSomethingWithWaveBeam", - "ParticleHittingSomethingWithFullBeamNoPlasma", - "ParticleHittingSomethingWithPlasmaBeam", - "ParticleHittingSomethingWithFullBeam", - "ParticleHittingSomethingInvincible", - "ParticleHittingSomethingWithMissile", - "ParticleHittingSomethingWithSuperMissile", - "ParticleSmallDust", - "ParticleMediumDust", - "ParticleTwoMediumDust", - "ParticleSecondSmallDust", - "ParticleSecondMediumDust", - "ParticleSecondTwoMediumDust", - "ParticleChargingBeam", - "ParticleEscape", - "ParticleSamusReflection" - ] - }] -} \ No newline at end of file + \ No newline at end of file diff --git a/src/event.h b/src/event.h index 32aacf8b..e2e0ff10 100644 --- a/src/event.h +++ b/src/event.h @@ -56,7 +56,7 @@ #define EVENT_CROCOMIRE_KILLED 0x28 #define EVENT_REPEL_MACHINE_KILLED 0x29 #define EVENT_VIEWED_STATUE_ROOM 0x2A -#define EVENT_DESSGEEGA_KILLED 0x2B +#define EVENT_LONG_BEAM_DESSGEEGA_KILLED 0x2B #define EVENT_THREE_HIVES_DESTROYED 0x2C #define EVENT_BUGS_KILLED 0x2D #define EVENT_ZIPLINES_ACTIVATED 0x2E diff --git a/src/sprites_AI/baristute.c b/src/sprites_AI/baristute.c index 3c803e99..0f4a3006 100644 --- a/src/sprites_AI/baristute.c +++ b/src/sprites_AI/baristute.c @@ -2,82 +2,969 @@ #include "../../data/data.h" #include "../globals.h" +const i16 sBaristuteFallingYVelocity[8] = { + 0x4, 0x8, 0xC, 0x10, 0x14, 0x18, 0x1C, SPRITE_ARRAY_TERMINATOR +}; + +const i16 sBaristuteJumpingYVelocity[10] = { + -0xC, -0x10, -0x10, -0x8, -0x4, 0x0, 0xC, 0x12, 0x18, 0x20 +}; + +const u8 sBaristuteGFX[2384]; +const u16 sBaristutePAL[80]; + +const u16 sBaristuteOAM_Idle_Frame0[49] = { + 0x10, + OBJ_SHAPE_VERTICAL | 0xd8, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xd8, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xef, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x212, + 0xef, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x212, + OBJ_SHAPE_VERTICAL | 0xe7, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xb, OBJ_SPRITE_OAM | 0x247, + 0xd9, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xb, OBJ_SPRITE_OAM | 0x207, + 0xdd, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x202, + 0xf7, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x10, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x13, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x7, OBJ_SPRITE_OAM | 0x21e, + OBJ_SHAPE_VERTICAL | 0xe7, OBJ_SIZE_16x32 | 0x1e5, OBJ_SPRITE_OAM | 0x247, + 0xd9, OBJ_SIZE_16x16 | 0x1e5, OBJ_SPRITE_OAM | 0x207, + 0xdd, OBJ_SIZE_16x16 | 0x1ef, OBJ_SPRITE_OAM | 0x202, + 0xf7, OBJ_SIZE_16x16 | 0x1e0, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_SIZE_16x16 | 0x1dd, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_SIZE_16x16 | 0x1e9, OBJ_SPRITE_OAM | 0x21e +}; + +const u16 sBaristuteOAM_Walking_Frame1[52] = { + 0x11, + OBJ_SHAPE_VERTICAL | 0xe0, OBJ_SIZE_16x32 | 0x1e2, OBJ_SPRITE_OAM | 0x20c, + 0xd7, OBJ_SIZE_16x16 | 0x1e5, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xd7, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xd7, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xee, 0x1fc, OBJ_SPRITE_OAM | 0x25a, + 0xed, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x252, + 0xed, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x252, + 0xf6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x10, OBJ_SPRITE_OAM | 0x21c, + 0xf4, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x13, OBJ_SPRITE_OAM | 0x21c, + 0xf4, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x7, OBJ_SPRITE_OAM | 0x21e, + 0xda, OBJ_SIZE_16x16 | 0x1ef, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_VERTICAL | 0xe6, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xb, OBJ_SPRITE_OAM | 0x247, + 0xd8, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xb, OBJ_SPRITE_OAM | 0x207, + 0xdc, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x202, + 0xf2, OBJ_SIZE_16x16 | 0x1dd, OBJ_SPRITE_OAM | 0x21c, + 0xf1, OBJ_SIZE_16x16 | 0x1da, OBJ_SPRITE_OAM | 0x21a, + 0xf1, OBJ_SIZE_16x16 | 0x1e5, OBJ_SPRITE_OAM | 0x21 +}; + +const u16 sBaristuteOAM_Walking_Frame2[52] = { + 0x11, + OBJ_SHAPE_VERTICAL | 0xd6, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xd6, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xec, 0x1fc, OBJ_SPRITE_OAM | 0x25b, + 0xec, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x292, + 0xec, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x292, + 0xd8, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xb, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xe6, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xc, OBJ_SPRITE_OAM | 0x247, + 0xdb, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x202, + 0xf5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x10, OBJ_SPRITE_OAM | 0x21c, + 0xf2, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x14, OBJ_SPRITE_OAM | 0x21c, + 0xf3, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x7, OBJ_SPRITE_OAM | 0x21e, + 0xd3, OBJ_SIZE_16x16 | 0x1e5, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xdb, OBJ_SIZE_16x32 | 0x1e1, OBJ_SPRITE_OAM | 0x20a, + 0xd8, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x202, + 0xec, OBJ_SIZE_16x16 | 0x1db, OBJ_SPRITE_OAM | 0x21c, + 0xea, OBJ_SIZE_16x16 | 0x1d7, OBJ_SPRITE_OAM | 0x21a, + 0xeb, OBJ_SIZE_16x16 | 0x1e5, OBJ_SPRITE_OAM | 0x21e +}; + +const u16 sBaristuteOAM_Walking_Frame3[52] = { + 0x11, + OBJ_SHAPE_VERTICAL | 0xd9, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xd9, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xf3, 0x1fc, OBJ_SPRITE_OAM | 0x25b, + 0xf1, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x292, + 0xf1, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x292, + OBJ_SHAPE_VERTICAL | 0xe4, OBJ_SIZE_16x32 | 0x1e3, OBJ_SPRITE_OAM | 0x20c, + 0xda, OBJ_SIZE_16x16 | 0x1e5, OBJ_SPRITE_OAM | 0x207, + 0xdf, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_VERTICAL | 0xe3, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xf, OBJ_SPRITE_OAM | 0x20c, + 0xda, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xc, OBJ_SPRITE_OAM | 0x207, + 0xdf, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x202, + 0xf7, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x12, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x15, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x9, OBJ_SPRITE_OAM | 0x21e, + 0xf8, OBJ_SIZE_16x16 | 0x1df, OBJ_SPRITE_OAM | 0x21c, + 0xf6, OBJ_SIZE_16x16 | 0x1db, OBJ_SPRITE_OAM | 0x21c, + 0xf6, OBJ_SIZE_16x16 | 0x1e8, OBJ_SPRITE_OAM | 0x21e +}; + +const u16 sBaristuteOAM_Walking_Frame4[52] = { + 0x11, + OBJ_SHAPE_VERTICAL | 0xd7, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xd7, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xf0, 0x1fc, OBJ_SPRITE_OAM | 0x25a, + 0xef, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x252, + 0xef, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x252, + 0xd7, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xc, OBJ_SPRITE_OAM | 0x207, + 0xdc, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_VERTICAL | 0xe3, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xd, OBJ_SPRITE_OAM | 0x247, + 0xf2, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x11, OBJ_SPRITE_OAM | 0x21c, + 0xef, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x15, OBJ_SPRITE_OAM | 0x21c, + 0xf0, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x8, OBJ_SPRITE_OAM | 0x21e, + OBJ_SHAPE_VERTICAL | 0xe3, OBJ_SIZE_16x32 | 0x1e3, OBJ_SPRITE_OAM | 0x20c, + 0xd9, OBJ_SIZE_16x16 | 0x1e5, OBJ_SPRITE_OAM | 0x207, + 0xdd, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x202, + 0xf6, OBJ_SIZE_16x16 | 0x1e0, OBJ_SPRITE_OAM | 0x21c, + 0xf3, OBJ_SIZE_16x16 | 0x1dc, OBJ_SPRITE_OAM | 0x21c, + 0xf4, OBJ_SIZE_16x16 | 0x1e8, OBJ_SPRITE_OAM | 0x21e +}; + +const u16 sBaristuteOAM_Walking_Frame5[49] = { + 0x10, + OBJ_SHAPE_VERTICAL | 0xd6, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xd6, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xee, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x212, + 0xee, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x212, + 0xd4, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xd, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xdc, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xd, OBJ_SPRITE_OAM | 0x204, + 0xda, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x202, + 0xef, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x10, OBJ_SPRITE_OAM | 0x25c, + 0xec, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x14, OBJ_SPRITE_OAM | 0x25c, + 0xed, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x8, OBJ_SPRITE_OAM | 0x25e, + OBJ_SHAPE_VERTICAL | 0xe1, OBJ_SIZE_16x32 | 0x1e5, OBJ_SPRITE_OAM | 0x204, + 0xd7, OBJ_SIZE_16x16 | 0x1e4, OBJ_SPRITE_OAM | 0x207, + 0xdc, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x202, + 0xf5, OBJ_SIZE_16x16 | 0x1e2, OBJ_SPRITE_OAM | 0x21c, + 0xf3, OBJ_SIZE_16x16 | 0x1df, OBJ_SPRITE_OAM | 0x21c, + 0xf3, OBJ_SIZE_16x16 | 0x1eb, OBJ_SPRITE_OAM | 0x21e +}; + +const u16 sBaristuteOAM_Warning_Frame1[55] = { + 0x12, + 0xe6, 0x1fc, OBJ_SPRITE_OAM | 0x25a, + OBJ_SHAPE_VERTICAL | 0xd8, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xd8, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xf0, 0x1fc, OBJ_SPRITE_OAM | 0x25a, + 0xee, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x212, + 0xee, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x212, + OBJ_SHAPE_VERTICAL | 0xe7, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xc, OBJ_SPRITE_OAM | 0x247, + 0xda, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xb, OBJ_SPRITE_OAM | 0x207, + 0xdd, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x202, + 0xf5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x10, OBJ_SPRITE_OAM | 0x21c, + 0xf4, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x14, OBJ_SPRITE_OAM | 0x21a, + 0xf3, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x7, OBJ_SPRITE_OAM | 0x21e, + OBJ_SHAPE_VERTICAL | 0xe7, OBJ_SIZE_16x32 | 0x1e4, OBJ_SPRITE_OAM | 0x247, + 0xda, OBJ_SIZE_16x16 | 0x1e5, OBJ_SPRITE_OAM | 0x207, + 0xdd, OBJ_SIZE_16x16 | 0x1ef, OBJ_SPRITE_OAM | 0x202, + 0xf5, OBJ_SIZE_16x16 | 0x1e0, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_SIZE_16x16 | 0x1dc, OBJ_SPRITE_OAM | 0x21a, + 0xf3, OBJ_SIZE_16x16 | 0x1e9, OBJ_SPRITE_OAM | 0x21e +}; + +const u16 sBaristuteOAM_Warning_Frame2[55] = { + 0x12, + 0xe9, 0x1fc, OBJ_SPRITE_OAM | 0x25b, + OBJ_SHAPE_VERTICAL | 0xdd, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xdd, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xf3, 0x1fc, OBJ_SPRITE_OAM | 0x25b, + 0xf1, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x212, + 0xf1, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x212, + 0xdd, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xa, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xe4, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xc, OBJ_SPRITE_OAM | 0x204, + 0xe1, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x202, + 0xf7, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x10, OBJ_SPRITE_OAM | 0x21c, + 0xf6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x15, OBJ_SPRITE_OAM | 0x21a, + 0xf6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x21e, + 0xde, OBJ_SIZE_16x16 | 0x1e6, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xe5, OBJ_SIZE_16x32 | 0x1e3, OBJ_SPRITE_OAM | 0x204, + 0xe1, OBJ_SIZE_16x16 | 0x1ef, OBJ_SPRITE_OAM | 0x202, + 0xf7, OBJ_SIZE_16x16 | 0x1e0, OBJ_SPRITE_OAM | 0x21c, + 0xf7, OBJ_SIZE_16x16 | 0x1db, OBJ_SPRITE_OAM | 0x21a, + 0xf6, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x21e +}; + +const u16 sBaristuteOAM_Jumping_Frame0[49] = { + 0x10, + OBJ_SHAPE_VERTICAL | 0xd2, OBJ_SIZE_16x32 | 0x1e5, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xd2, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xb, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xd0, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xd0, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xf2, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xc, OBJ_SPRITE_OAM | 0x287, + 0xf1, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x11, OBJ_SPRITE_OAM | 0x25c, + 0xf1, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x14, OBJ_SPRITE_OAM | 0x29c, + 0xf0, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x8, OBJ_SPRITE_OAM | 0x25e, + 0xf2, OBJ_SIZE_16x16 | 0x1e4, OBJ_SPRITE_OAM | 0x287, + 0xf1, OBJ_SIZE_16x16 | 0x1df, OBJ_SPRITE_OAM | 0x25c, + 0xf1, OBJ_SIZE_16x16 | 0x1dc, OBJ_SPRITE_OAM | 0x29c, + 0xf0, OBJ_SIZE_16x16 | 0x1e8, OBJ_SPRITE_OAM | 0x25e, + 0xda, OBJ_SIZE_16x16 | 0x1f1, OBJ_SPRITE_OAM | 0x202, + 0xda, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x1ff, OBJ_SPRITE_OAM | 0x202, + 0xe4, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x292, + 0xe4, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x292 +}; + +const u16 sBaristuteOAM_Jumping_Frame1[49] = { + 0x10, + OBJ_SHAPE_VERTICAL | 0xd0, OBJ_SIZE_16x32 | 0x1e5, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xd0, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xb, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xce, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xce, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + 0xf0, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xc, OBJ_SPRITE_OAM | 0x287, + 0xef, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x11, OBJ_SPRITE_OAM | 0x25c, + 0xef, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x14, OBJ_SPRITE_OAM | 0x29c, + 0xee, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x8, OBJ_SPRITE_OAM | 0x25e, + 0xf0, OBJ_SIZE_16x16 | 0x1e4, OBJ_SPRITE_OAM | 0x287, + 0xef, OBJ_SIZE_16x16 | 0x1df, OBJ_SPRITE_OAM | 0x25c, + 0xef, OBJ_SIZE_16x16 | 0x1dc, OBJ_SPRITE_OAM | 0x29c, + 0xee, OBJ_SIZE_16x16 | 0x1e8, OBJ_SPRITE_OAM | 0x25e, + 0xd8, OBJ_SIZE_16x16 | 0x1f1, OBJ_SPRITE_OAM | 0x202, + 0xd8, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x1ff, OBJ_SPRITE_OAM | 0x202, + 0xe3, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x292, + 0xe3, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x292 +}; + +const u16 sBaristuteOAM_Idle_Frame2[61] = { + 0x14, + 0xe8, 0x1fc, OBJ_SPRITE_OAM | 0x25b, + OBJ_SHAPE_VERTICAL | 0xda, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xda, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xef, 0x1fc, OBJ_SPRITE_OAM | 0x25b, + 0xef, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x292, + 0xef, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x292, + 0xda, OBJ_SIZE_16x16 | 0x1e5, OBJ_SPRITE_OAM | 0x207, + 0xe8, OBJ_SIZE_16x16 | 0x1e6, OBJ_SPRITE_OAM | 0x247, + 0xf8, OBJ_SIZE_16x16 | 0x1e6, OBJ_SPRITE_OAM | 0x287, + 0xf8, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xa, OBJ_SPRITE_OAM | 0x287, + 0xe1, OBJ_SIZE_16x16 | 0x1f2, OBJ_SPRITE_OAM | 0x202, + 0xf6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xf, OBJ_SPRITE_OAM | 0x21c, + 0xf6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x12, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x21e, + 0xda, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xb, OBJ_SPRITE_OAM | 0x207, + 0xe8, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xa, OBJ_SPRITE_OAM | 0x247, + 0xe1, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x1fe, OBJ_SPRITE_OAM | 0x202, + 0xf6, OBJ_SIZE_16x16 | 0x1e1, OBJ_SPRITE_OAM | 0x21c, + 0xf6, OBJ_SIZE_16x16 | 0x1de, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x21e +}; + +const u16 sBaristuteOAM_Idle_Frame1[55] = { + 0x12, + 0xe7, 0x1fc, OBJ_SPRITE_OAM | 0x25a, + OBJ_SHAPE_VERTICAL | 0xd9, OBJ_SIZE_16x32 | 0x1f0, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_VERTICAL | 0xd9, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0x0, OBJ_SPRITE_OAM | 0x200, + 0xf0, 0x1fc, OBJ_SPRITE_OAM | 0x25a, + 0xef, OBJ_SIZE_16x16 | 0x1f0, OBJ_SPRITE_OAM | 0x252, + 0xef, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x0, OBJ_SPRITE_OAM | 0x252, + 0xd9, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0xb, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xe7, OBJ_X_FLIP | OBJ_SIZE_16x32 | 0xb, OBJ_SPRITE_OAM | 0x247, + 0xdf, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x1ff, OBJ_SPRITE_OAM | 0x202, + 0xf6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x10, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x13, OBJ_SPRITE_OAM | 0x21c, + 0xf4, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x7, OBJ_SPRITE_OAM | 0x21e, + 0xd9, OBJ_SIZE_16x16 | 0x1e5, OBJ_SPRITE_OAM | 0x207, + OBJ_SHAPE_VERTICAL | 0xe7, OBJ_SIZE_16x32 | 0x1e5, OBJ_SPRITE_OAM | 0x247, + 0xdf, OBJ_SIZE_16x16 | 0x1f1, OBJ_SPRITE_OAM | 0x202, + 0xf6, OBJ_SIZE_16x16 | 0x1e0, OBJ_SPRITE_OAM | 0x21c, + 0xf5, OBJ_SIZE_16x16 | 0x1dd, OBJ_SPRITE_OAM | 0x21c, + 0xf4, OBJ_SIZE_16x16 | 0x1e9, OBJ_SPRITE_OAM | 0x21e +}; + +const struct FrameData sBaristuteOAM_Idle[5] = { + sBaristuteOAM_Idle_Frame0, + 0x10, + sBaristuteOAM_Idle_Frame1, + 0x6, + sBaristuteOAM_Idle_Frame2, + 0x10, + sBaristuteOAM_Idle_Frame1, + 0x6, + NULL, + 0x0 +}; + +const struct FrameData sBaristuteOAM_Warning[4] = { + sBaristuteOAM_Idle_Frame0, + 0x6, + sBaristuteOAM_Warning_Frame1, + 0x8, + sBaristuteOAM_Warning_Frame2, + 0x10, + NULL, + 0x0 +}; + +const struct FrameData sBaristuteOAM_Jumping[3] = { + sBaristuteOAM_Jumping_Frame0, + 0x2, + sBaristuteOAM_Jumping_Frame1, + 0x2, + NULL, + 0x0 +}; + +const struct FrameData sBaristuteOAM_Landing[4] = { + sBaristuteOAM_Idle_Frame0, + 0x6, + sBaristuteOAM_Warning_Frame2, + 0x8, + sBaristuteOAM_Warning_Frame1, + 0xC, + NULL, + 0x0 +}; + +const struct FrameData sBaristuteOAM_WalkingSlow[7] = { + sBaristuteOAM_Idle_Frame0, + 0x8, + sBaristuteOAM_Walking_Frame1, + 0x8, + sBaristuteOAM_Walking_Frame2, + 0x8, + sBaristuteOAM_Walking_Frame3, + 0x8, + sBaristuteOAM_Walking_Frame4, + 0x8, + sBaristuteOAM_Walking_Frame5, + 0x8, + NULL, + 0x0 +}; + +const struct FrameData sBaristuteOAM_WalkingFast[7] = { + sBaristuteOAM_Idle_Frame0, + 0x5, + sBaristuteOAM_Walking_Frame1, + 0x5, + sBaristuteOAM_Walking_Frame2, + 0x5, + sBaristuteOAM_Walking_Frame3, + 0x5, + sBaristuteOAM_Walking_Frame4, + 0x5, + sBaristuteOAM_Walking_Frame5, + 0x5, + NULL, + 0x0 +}; + +const struct FrameData sBaristuteOAM_WalkingVeryFast[7] = { + sBaristuteOAM_Idle_Frame0, + 0x3, + sBaristuteOAM_Walking_Frame1, + 0x3, + sBaristuteOAM_Walking_Frame2, + 0x3, + sBaristuteOAM_Walking_Frame3, + 0x3, + sBaristuteOAM_Walking_Frame4, + 0x3, + sBaristuteOAM_Walking_Frame5, + 0x3, + NULL, + 0x0 +}; + +const struct FrameData sBaristuteOAM_WalkingExtremelyFast[7] = { + sBaristuteOAM_Idle_Frame0, + 0x2, + sBaristuteOAM_Walking_Frame1, + 0x2, + sBaristuteOAM_Walking_Frame2, + 0x2, + sBaristuteOAM_Walking_Frame3, + 0x2, + sBaristuteOAM_Walking_Frame4, + 0x2, + sBaristuteOAM_Walking_Frame5, + 0x2, + NULL, + 0x0 +}; + + +/** + * @brief 47600 | 20 | Checks if samus is near the baristute (8 blocks range on each side) + * + * @return u8 1 if near, 0 otherwise + */ u8 BaristuteCheckSamusInRange(void) { - + if (SpriteUtilCheckSamusNearSpriteLeftRight(BLOCK_SIZE * 8, BLOCK_SIZE * 8) != NSLR_OUT_OF_RANGE) + { + SpriteUtilMakeSpriteFaceSamusDirection(); + return TRUE; + } + return FALSE; } +/** + * @brief 47620 | 90 | Initializes a baristute sprite + * + */ void BaristuteInit(void) { - + // Check for kraid baristutes + if (gCurrentSprite.spriteID == PSPRITE_BARISTUTE_KRAID_UPPER || gCurrentSprite.spriteID == PSPRITE_BARISTUTE_KRAID_LOWER) + { + if (EventFunction(EVENT_ACTION_CHECKING, EVENT_KRAID_BARISTUTES_KILLED)) + { + // Kill if already dead + gCurrentSprite.status = 0x0; + return; + } + + gDoorUnlockTimer = 0x1; // Lock doors + } + + gCurrentSprite.pose = BARISTUTE_POSE_IDLE_INIT; + + gCurrentSprite.pOam = sBaristuteOAM_Idle; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + + gCurrentSprite.drawDistanceTopOffset = 0x30; + gCurrentSprite.drawDistanceBottomOffset = 0x8; + gCurrentSprite.drawDistanceHorizontalOffset = 0x28; + + gCurrentSprite.hitboxTopOffset = -0xA0; + gCurrentSprite.hitboxBottomOffset = 0x0; + gCurrentSprite.hitboxLeftOffset = -0x54; + gCurrentSprite.hitboxRightOffset = 0x54; + + gCurrentSprite.samusCollision = SSC_HURTS_SAMUS; + gCurrentSprite.health = sSecondarySpriteStats[gCurrentSprite.spriteID][0x0]; + SpriteUtilMakeSpriteFaceSamusDirection(); } -void BaristuteJumpingGFXInit(void) +/** + * @brief 476b0 | 34 | Initializes a baristute to do the warning before a jump + * + */ +void BaristuteJumpWarningInit(void) { - + gCurrentSprite.pose = BARISTUTE_POSE_CHECK_WARNING_ENDED; + + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.pOam = sBaristuteOAM_Warning; + + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + SoundPlayNotAlreadyPlaying(0x18C); } +/** + * @brief 476e4 | 7c | Checks if the animation before jumping has ended + * + */ void BaristuteCheckBeforeJumpingAnimEnded(void) { - + u16 yPosition; + u16 xPosition; + + yPosition = gCurrentSprite.yPosition; + xPosition = gCurrentSprite.xPosition; + + // Check if there's still ground under the baristute + if (SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxRightOffset) == COLLISION_AIR + && SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxLeftOffset) == COLLISION_AIR) + { + gCurrentSprite.pose = BARISTUTE_POSE_FALLING_INIT; // Set falling + } + else + { + if (SpriteUtilCheckEndCurrentSpriteAnim()) + { + // Set jumping behavior + gCurrentSprite.pose = BARISTUTE_POSE_JUMPING; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.arrayOffset = 0x0; + gCurrentSprite.pOam = sBaristuteOAM_Jumping; + + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + SoundPlayNotAlreadyPlaying(0x18D); + } + } } +/** + * @brief 47760 | 100 | Handles the baristute jumping + * + */ void BaristuteJumping(void) { - + i32 movement; + u32 topEdge; + + movement = sBaristuteJumpingYVelocity[gCurrentSprite.arrayOffset / 4]; + + if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT) + { + // Check wall on right + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + 0x4); + if (gPreviousCollisionCheck == COLLISION_SOLID) + { + gCurrentSprite.xPosition -= 0xA; + gCurrentSprite.status &= ~SPRITE_STATUS_FACING_RIGHT; + gCurrentSprite.pose = BARISTUTE_POSE_FALLING_INIT; + return; + } + gCurrentSprite.xPosition += 0xA; + } + else + { + // Check wall on left + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - 0x4); + if (gPreviousCollisionCheck == COLLISION_SOLID) + { + gCurrentSprite.xPosition += 0xA; + gCurrentSprite.status |= SPRITE_STATUS_FACING_RIGHT; + gCurrentSprite.pose = BARISTUTE_POSE_FALLING_INIT; + return; + } + gCurrentSprite.xPosition -= 0xA; + } + + // Apply y movement + gCurrentSprite.yPosition += movement; + + // Check update array offset + if (gCurrentSprite.arrayOffset < 0x27) + gCurrentSprite.arrayOffset++; + + if (movement >= 0x1) + { + // Check landing if velocity is positive + topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition); + if (gPreviousVerticalCollisionCheck != COLLISION_AIR) + { + gCurrentSprite.yPosition = topEdge; + gCurrentSprite.pose = BARISTUTE_POSE_LANDING_INIT; + } + } + else + { + // Check for ceiling if velocity is negative + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTopOffset, gCurrentSprite.xPosition); + if (gPreviousCollisionCheck == COLLISION_SOLID) + gCurrentSprite.pose = BARISTUTE_POSE_FALLING_INIT; + } } -void BaristuteLandingGFXInit(void) +/** + * @brief 47860 | 3c | Initializes a baristute to be landing + * + */ +void BaristuteLandingInit(void) { - + gCurrentSprite.pose = BARISTUTE_POSE_LANDING; + + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.pOam = sBaristuteOAM_Landing; + + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + { + ScreenShakeStartVertical(0xA, 0x81); + SoundPlayNotAlreadyPlaying(0x18E); + } } +/** + * @brief 4789c | 1c | Checks if the landing animation has nearly ended + * + */ void BaristuteCheckLandingAnimNearEnded(void) { - + if (SpriteUtilCheckNearEndCurrentSpriteAnim()) + gCurrentSprite.pose = BARISTUTE_POSE_IDLE_INIT; // Set idle } -void BaristuteGFXInit(void) +/** + * @brief 478b8 | 30 | Initializes a baristute to be idle + * + */ +void BaristuteIdleInit(void) { - + gCurrentSprite.pose = BARISTUTE_POSE_IDLE; + + gCurrentSprite.pOam = sBaristuteOAM_Idle; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + + gCurrentSprite.workVariable = gSpriteRNG & 0x3; } +/** + * @brief 478e8 | cc | Handles a baristute being idle + * + */ void BaristuteIdle(void) { - + // https://decomp.me/scratch/bFiH7 + + u16 yPosition; + u32 xPosition; + u32 collision; + + yPosition = gCurrentSprite.yPosition; + xPosition = gCurrentSprite.xPosition; + + if (SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxRightOffset) == COLLISION_AIR + && SpriteUtilGetCollisionAtPosition(yPosition, xPosition + gCurrentSprite.hitboxLeftOffset) == COLLISION_AIR) + { + gCurrentSprite.pose = BARISTUTE_POSE_FALLING_INIT; + } + else + { + if (SpriteUtilCheckNearEndCurrentSpriteAnim()) + { + SpriteUtilMakeSpriteFaceSamusDirection(); + if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT) + gCurrentSprite.status |= SPRITE_STATUS_XFLIP; + else + gCurrentSprite.status &= ~SPRITE_STATUS_XFLIP; + + // /!\ Not fully merged calls + if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT) + collision = SpriteUtilGetCollisionAtPosition(yPosition - 0x10, xPosition + gCurrentSprite.hitboxRightOffset + 0x10); + else + collision = SpriteUtilGetCollisionAtPosition(yPosition - 0x10, xPosition + gCurrentSprite.hitboxLeftOffset - 0x10); + + if (collision == COLLISION_AIR) + { + if (gCurrentSprite.spriteID == PSPRITE_BARISTUTE_KRAID_UPPER) + gCurrentSprite.pose = BARISTUTE_POSE_WALKING_INIT; + else if (gCurrentSprite.spriteID != PSPRITE_BARISTUTE_KRAID_LOWER) + { + if (gCurrentSprite.workVariable > 0x1) + gCurrentSprite.pose = BARISTUTE_POSE_WALKING_INIT; + else + gCurrentSprite.pose = BARISTUTE_POSE_JUMP_WARNING_INIT; + } + else + gCurrentSprite.pose = BARISTUTE_POSE_JUMP_WARNING_INIT; + } + } + } } -void BaristuteWalkingGFXInit(void) +/** + * @brief 479b4 | 74 | Initializes a baristute to be walking + * + */ +void BaristuteWalkingInit(void) { + u8 paletteRow; + gCurrentSprite.pose = BARISTUTE_POSE_WALKING; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.xPositionSpawn = gCurrentSprite.xPosition; + + paletteRow = gCurrentSprite.absolutePaletteRow; + // Set OAM and walking speed based on palette row (affected by health) + if (paletteRow == 0x1) + { + gCurrentSprite.pOam = sBaristuteOAM_WalkingFast; + gCurrentSprite.workVariable2 = 0x6; + } + else if (paletteRow == 0x2) + { + gCurrentSprite.pOam = sBaristuteOAM_WalkingVeryFast; + gCurrentSprite.workVariable2 = 0x8; + } + else if (paletteRow == 0x3) + { + gCurrentSprite.pOam = sBaristuteOAM_WalkingExtremelyFast; + gCurrentSprite.workVariable2 = 0xA; + } + else + { + gCurrentSprite.pOam = sBaristuteOAM_WalkingSlow; + gCurrentSprite.workVariable2 = 0x3; + } } +/** + * @brief 47a28 | 50 | Checks if the walking sound should play, if yes plays it + * + */ void BaristutePlayWalkingSound(void) { - + if (gCurrentSprite.animationDurationCounter == 0x1 && + (gCurrentSprite.currentAnimationFrame == 0x1 || gCurrentSprite.currentAnimationFrame == 0x4)) + { + if (gCurrentSprite.workVariable2 < 0x7) // Slow or fast + { + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + SoundPlayNotAlreadyPlaying(0x18F); + } + else // Very fast or extremely fast + { + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + SoundPlayNotAlreadyPlaying(0x258); + } + } } +/** + * @brief 47a78 | d4 | Handles a baristute walking + * + */ void BaristuteWalking(void) { + u8 velocity; + u16 walkingDistance; + + velocity = gCurrentSprite.workVariable2; + + // Determined by RNG + walkingDistance = BLOCK_SIZE * 6; + if (gCurrentSprite.workVariable == 0x3) + walkingDistance *= 2; + if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT) + { + // Check collision + if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition - 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + 0x4) == COLLISION_AIR + && SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + 0x4) == COLLISION_SOLID) + { + if ((u16)(gCurrentSprite.xPosition - gCurrentSprite.xPositionSpawn) > walkingDistance) + gCurrentSprite.pose = BARISTUTE_POSE_IDLE_INIT; // Walking distance reached, set idle + else + { + // Walk + gCurrentSprite.xPosition += velocity; + BaristutePlayWalkingSound(); + } + } + else + { + // Encountered wall, go back and set idle + gCurrentSprite.xPosition -= velocity; + gCurrentSprite.pose = BARISTUTE_POSE_IDLE_INIT; + } + } + else + { + // Check collision + if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition - 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - 0x4) == COLLISION_AIR + && SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - 0x4) == COLLISION_SOLID) + { + if ((u16)(gCurrentSprite.xPositionSpawn - gCurrentSprite.xPosition) > walkingDistance) + gCurrentSprite.pose = BARISTUTE_POSE_IDLE_INIT; // Walking distance reached, set idle + else + { + // Walk + gCurrentSprite.xPosition -= velocity; + BaristutePlayWalkingSound(); + } + } + else + { + // Encountered wall, go back and set idle + gCurrentSprite.xPosition += velocity; + gCurrentSprite.pose = BARISTUTE_POSE_IDLE_INIT; + } + } } -void BaristuteBouncingGFXInit(void) +/** + * @brief 47b4c | 24 | Initializes a baristute to bve falling + * + */ +void BaristuteFallingInit(void) { - + gCurrentSprite.pose = BARISTUTE_POSE_FALLING; + + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.arrayOffset = 0x0; + gCurrentSprite.pOam = sBaristuteOAM_Jumping; } -void BaristuteBouncing(void) +/** + * @brief 47b70 | 70 | Handles a baristute falling + * + */ +void BaristuteFalling(void) { - + u32 topEdge; + i32 velocity; + u8 offset; + + topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition); + + if (gPreviousVerticalCollisionCheck != COLLISION_AIR) + { + // Touching ground + gCurrentSprite.yPosition = topEdge; + gCurrentSprite.pose = BARISTUTE_POSE_LANDING_INIT; + } + else + { + // Update Y position + offset = gCurrentSprite.arrayOffset; + velocity = sBaristuteFallingYVelocity[offset]; + if (velocity == SPRITE_ARRAY_TERMINATOR) + { + // Reached end of array, use last velocity + velocity = sBaristuteFallingYVelocity[offset - 1]; + gCurrentSprite.yPosition += velocity; + } + else + { + gCurrentSprite.arrayOffset = offset + 1; + gCurrentSprite.yPosition += velocity; + } + } } +/** + * @brief 47be0 | 150 | Handles a baristute death + * + */ void BaristuteDeath(void) { - + u8 spriteID; + struct SpriteData* pSprite; + u8 count; + u16 yPosition; + u16 xPosition; + u8 rng; + + // Check for the second baristute in Kraid + + // Get sprite ID + spriteID = 0x0; + if (gCurrentSprite.spriteID == PSPRITE_BARISTUTE_KRAID_UPPER) + spriteID = PSPRITE_BARISTUTE_KRAID_LOWER; + else if (gCurrentSprite.spriteID == PSPRITE_BARISTUTE_KRAID_LOWER) + spriteID = PSPRITE_BARISTUTE_KRAID_UPPER; + + if (spriteID != 0x0) + { + // Check if dead + count = 0x0; + for (pSprite = gSpriteData; pSprite < gSpriteData + 24; pSprite++) + { + if (pSprite->status & SPRITE_STATUS_EXISTS && !(pSprite->properties & SP_SECONDARY_SPRITE) + && pSprite->spriteID == spriteID && pSprite->health != 0x0) + count++; // Baristute found + } + + if (count == 0x0) + { + // Both baristutes dead + // Set event + EventFunction(EVENT_ACTION_SETTING, EVENT_KRAID_BARISTUTES_KILLED); + // Unlock doors + gDoorUnlockTimer = -0x14; + } + } + + yPosition = gCurrentSprite.yPosition - 0x60; + xPosition = gCurrentSprite.xPosition; + rng = (u8)(gSpriteRNG * 2); + + // Kill sprite + SpriteUtilSpriteDeath(DEATH_NORMAL, yPosition, xPosition, TRUE, PE_SPRITE_EXPLOSION_SINGLE_THEN_BIG); + if (gCurrentSprite.status) + { + // Has drop, spawn 2 other drops + if (gSpriteRNG & 0x1) + spriteID = PSPRITE_LARGE_ENERGY_DROP; + else + spriteID = PSPRITE_MISSILE_DROP; + + SpriteSpawnDropFollowers(spriteID, gCurrentSprite.roomSlot, 0x0, gCurrentSprite.primarySpriteRAMSlot, yPosition - 0x18 + rng, xPosition + 0x4C - rng, 0x0); + + if (sRandomNumberTable[gSpriteRNG] & 0x1) + spriteID = PSPRITE_LARGE_ENERGY_DROP; + else + spriteID = PSPRITE_MISSILE_DROP; + + SpriteSpawnDropFollowers(spriteID, gCurrentSprite.roomSlot, 0x0, gCurrentSprite.primarySpriteRAMSlot, yPosition + 0x14 - rng, xPosition - 0x48 + rng, 0x0); + } } +/** + * @brief 47d30 | 18c | Baristute AI + * + */ void Baristute(void) { - + u16 spawnHealth; + u16 health; + + // Check play damaged sound + if (gCurrentSprite.properties & SP_DAMAGED) + { + gCurrentSprite.properties &= ~SP_DAMAGED; + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + SoundPlayNotAlreadyPlaying(0x259); + } + + //Check update palette + if (gCurrentSprite.invicibilityStunFlashTimer & 0x7F) + { + // Damaged + spawnHealth = sPrimarySpriteStats[gCurrentSprite.spriteID][0x0]; + health = gCurrentSprite.health; + + if (health <= spawnHealth / 4) + gCurrentSprite.absolutePaletteRow = 0x3; + else if (health <= spawnHealth / 2) + gCurrentSprite.absolutePaletteRow = 0x2; + else if (health <= (spawnHealth * 3) / 4) + gCurrentSprite.absolutePaletteRow = 0x1; + } + + switch (gCurrentSprite.pose) + { + case 0x0: + BaristuteInit(); + break; + + case BARISTUTE_POSE_JUMP_WARNING_INIT: + BaristuteJumpWarningInit(); + + case BARISTUTE_POSE_CHECK_WARNING_ENDED: + BaristuteCheckBeforeJumpingAnimEnded();; + break; + + case BARISTUTE_POSE_JUMPING: + BaristuteJumping(); + break; + + case BARISTUTE_POSE_LANDING_INIT: + BaristuteLandingInit(); + + case BARISTUTE_POSE_LANDING: + BaristuteCheckLandingAnimNearEnded(); + break; + + case BARISTUTE_POSE_WALKING_INIT: + BaristuteWalkingInit(); + + case BARISTUTE_POSE_WALKING: + BaristuteWalking(); + break; + + case BARISTUTE_POSE_IDLE_INIT: + BaristuteIdleInit(); + + case BARISTUTE_POSE_IDLE: + BaristuteIdle(); + break; + + case BARISTUTE_POSE_FALLING_INIT: + BaristuteFallingInit(); + + case BARISTUTE_POSE_FALLING: + BaristuteFalling(); + break; + + default: + BaristuteDeath(); + } } \ No newline at end of file diff --git a/src/sprites_AI/baristute.h b/src/sprites_AI/baristute.h index 0e22a2b9..77632d60 100644 --- a/src/sprites_AI/baristute.h +++ b/src/sprites_AI/baristute.h @@ -3,20 +3,32 @@ #include "../types.h" +#define BARISTUTE_POSE_JUMP_WARNING_INIT 0x8 +#define BARISTUTE_POSE_CHECK_WARNING_ENDED 0x9 +#define BARISTUTE_POSE_IDLE_INIT 0xE +#define BARISTUTE_POSE_IDLE 0xF +#define BARISTUTE_POSE_FALLING_INIT 0x1E +#define BARISTUTE_POSE_FALLING 0x1F +#define BARISTUTE_POSE_JUMPING 0x23 +#define BARISTUTE_POSE_LANDING_INIT 0x24 +#define BARISTUTE_POSE_LANDING 0x25 +#define BARISTUTE_POSE_WALKING_INIT 0x26 +#define BARISTUTE_POSE_WALKING 0x27 + u8 BaristuteCheckSamusInRange(void); void BaristuteInit(void); -void BaristuteJumpingGFXInit(void); +void BaristuteJumpWarningInit(void); void BaristuteCheckBeforeJumpingAnimEnded(void); void BaristuteJumping(void); -void BaristuteLandingGFXInit(void); +void BaristuteLandingInit(void); void BaristuteCheckLandingAnimNearEnded(void); -void BaristuteGFXInit(void); +void BaristuteIdleInit(void); void BaristuteIdle(void); -void BaristuteWalkingGFXInit(void); +void BaristuteWalkingInit(void); void BaristutePlayWalkingSound(void); void BaristuteWalking(void); -void BaristuteBouncingGFXInit(void); -void BaristuteBouncing(void); +void BaristuteFallingInit(void); +void BaristuteFalling(void); void BaristuteDeath(void); void Baristute(void); diff --git a/src/sprites_AI/dessgeega.c b/src/sprites_AI/dessgeega.c index 6d8a448c..17369011 100644 --- a/src/sprites_AI/dessgeega.c +++ b/src/sprites_AI/dessgeega.c @@ -2,102 +2,1035 @@ #include "../../data/data.h" #include "../globals.h" +const i16 sDessgeegaHighJumpYVelocity[10] = { + -8, -16, -16, -8, -4, 0, 4, 8, 16, 16 +}; + +const i16 sDessgeegaLowJumpYVelocity[10] = { + -4, -8, -4, -2, 0, 4, 8, 16, 16, 16 +}; + +const u8 sDessgeegaGFX[1080]; +const u16 sDessgeegaPAL[16]; + +const u16 sDessgeegaOAM_Idle_Frame0[31] = { + 0xa, + 0xe9, 0x1f8, OBJ_SPRITE_OAM | 0x229, + OBJ_SHAPE_VERTICAL | 0xf1, 0x1f8, OBJ_SPRITE_OAM | 0x208, + 0xe9, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x229, + OBJ_SHAPE_VERTICAL | 0xf1, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x208, + 0xe4, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf4, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, 0x1ea, OBJ_SPRITE_OAM | 0x224, + 0xe4, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf4, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x224 +}; + +const u16 sDessgeegaOAM_Idle_Frame1[31] = { + 0xa, + OBJ_SHAPE_VERTICAL | 0xf0, 0x1f8, OBJ_SPRITE_OAM | 0x207, + 0xe8, 0x1f8, OBJ_SPRITE_OAM | 0x229, + OBJ_SHAPE_VERTICAL | 0xf0, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x207, + 0xe8, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x229, + 0xe5, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf5, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, 0x1ea, OBJ_SPRITE_OAM | 0x200, + 0xe5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf5, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x200 +}; + +const u16 sDessgeegaOAM_Idle_Frame2[31] = { + 0xa, + 0xe6, 0x1f8, OBJ_SPRITE_OAM | 0x209, + OBJ_SHAPE_VERTICAL | 0xee, 0x1f8, OBJ_SPRITE_OAM | 0x206, + 0xe6, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x209, + OBJ_SHAPE_VERTICAL | 0xee, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x206, + 0xe6, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf6, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, 0x1ea, OBJ_SPRITE_OAM | 0x220, + 0xe6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf6, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x220 +}; + +const u16 sDessgeegaOAM_JumpWarning_Frame1[31] = { + 0xa, + OBJ_SHAPE_VERTICAL | 0xf3, 0x1f8, OBJ_SPRITE_OAM | 0x207, + 0xeb, 0x1f8, OBJ_SPRITE_OAM | 0x229, + OBJ_SHAPE_VERTICAL | 0xf3, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x207, + 0xeb, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x229, + OBJ_SHAPE_HORIZONTAL | 0xfc, 0x1ea, OBJ_SPRITE_OAM | 0x200, + 0xe6, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf6, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x200, + 0xe6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf6, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204 +}; + +const u16 sDessgeegaOAM_JumpWarning_Frame2[31] = { + 0xa, + 0xed, 0x1f8, OBJ_SPRITE_OAM | 0x209, + OBJ_SHAPE_VERTICAL | 0xf5, 0x1f8, OBJ_SPRITE_OAM | 0x206, + 0xed, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x209, + OBJ_SHAPE_VERTICAL | 0xf5, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x206, + OBJ_SHAPE_HORIZONTAL | 0xfc, 0x1ea, OBJ_SPRITE_OAM | 0x220, + 0xe8, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf8, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x220, + 0xe8, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf8, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204 +}; + +const u16 sDessgeegaOAM_Landing_Frame0[37] = { + 0xc, + 0xe1, 0x1f8, OBJ_SPRITE_OAM | 0x209, + OBJ_SHAPE_VERTICAL | 0xe9, 0x1f8, OBJ_SPRITE_OAM | 0x206, + 0xe1, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x209, + OBJ_SHAPE_VERTICAL | 0xe9, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x206, + OBJ_SHAPE_HORIZONTAL | 0xf3, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xf3, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204, + 0xe3, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x214, + OBJ_SHAPE_VERTICAL | 0xe5, 0x1fa, OBJ_SPRITE_OAM | 0x216, + 0xe3, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x214, + OBJ_SHAPE_VERTICAL | 0xe5, OBJ_X_FLIP | 0x1fe, OBJ_SPRITE_OAM | 0x216, + OBJ_SHAPE_HORIZONTAL | 0xfb, 0x1e9, OBJ_SPRITE_OAM | 0x200, + OBJ_SHAPE_HORIZONTAL | 0xfb, OBJ_X_FLIP | 0x7, OBJ_SPRITE_OAM | 0x200 +}; + +const u16 sDessgeegaOAM_Jumping_Frame0[37] = { + 0xc, + 0xd9, 0x1f8, OBJ_SPRITE_OAM | 0x209, + OBJ_SHAPE_VERTICAL | 0xe1, 0x1f8, OBJ_SPRITE_OAM | 0x206, + 0xd9, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x209, + OBJ_SHAPE_VERTICAL | 0xe1, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x206, + OBJ_SHAPE_HORIZONTAL | 0xf0, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xf8, 0x1ec, OBJ_SPRITE_OAM | 0x20e, + OBJ_SHAPE_HORIZONTAL | 0xf0, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xf8, OBJ_X_FLIP | 0x4, OBJ_SPRITE_OAM | 0x20e, + 0xe0, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x217, + OBJ_SHAPE_VERTICAL | 0xe0, 0x1fa, OBJ_SPRITE_OAM | 0x219, + 0xe0, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x217, + OBJ_SHAPE_VERTICAL | 0xe0, OBJ_X_FLIP | 0x1fe, OBJ_SPRITE_OAM | 0x219 +}; + +const u16 sDessgeegaOAM_Jumping_Frame1[37] = { + 0xc, + 0xd8, 0x1f8, OBJ_SPRITE_OAM | 0x209, + OBJ_SHAPE_VERTICAL | 0xe0, 0x1f8, OBJ_SPRITE_OAM | 0x206, + 0xd8, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x209, + OBJ_SHAPE_VERTICAL | 0xe0, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x206, + OBJ_SHAPE_HORIZONTAL | 0xef, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xf7, 0x1ec, OBJ_SPRITE_OAM | 0x20e, + OBJ_SHAPE_HORIZONTAL | 0xef, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xf7, OBJ_X_FLIP | 0x4, OBJ_SPRITE_OAM | 0x20e, + 0xdf, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x217, + OBJ_SHAPE_VERTICAL | 0xdf, 0x1fa, OBJ_SPRITE_OAM | 0x219, + 0xdf, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x217, + OBJ_SHAPE_VERTICAL | 0xdf, OBJ_X_FLIP | 0x1fe, OBJ_SPRITE_OAM | 0x219 +}; + +const u16 sDessgeegaOAM_Screaming_Frame1[37] = { + 0xc, + 0xe6, 0x1f8, OBJ_SPRITE_OAM | 0x22e, + OBJ_SHAPE_VERTICAL | 0xee, 0x1f8, OBJ_SPRITE_OAM | 0x20c, + 0xe6, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x22e, + OBJ_SHAPE_VERTICAL | 0xee, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x20c, + 0xe5, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf5, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, 0x1ea, OBJ_SPRITE_OAM | 0x200, + 0xe5, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf5, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x200, + 0xee, 0x1fa, OBJ_SPRITE_OAM | 0x22a, + 0xee, OBJ_X_FLIP | 0x1fe, OBJ_SPRITE_OAM | 0x22a +}; + +const u16 sDessgeegaOAM_Screaming_Frame2[37] = { + 0xc, + 0xe6, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x211, + OBJ_SHAPE_VERTICAL | 0xee, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x210, + 0xe6, 0x1f8, OBJ_SPRITE_OAM | 0x211, + OBJ_SHAPE_VERTICAL | 0xee, 0x1f8, OBJ_SPRITE_OAM | 0x210, + 0xe6, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf6, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, 0x1ea, OBJ_SPRITE_OAM | 0x220, + 0xe6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf6, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x220, + 0xef, 0x1fa, OBJ_SPRITE_OAM | 0x22a, + 0xef, OBJ_X_FLIP | 0x1fe, OBJ_SPRITE_OAM | 0x22a +}; + +const u16 sDessgeegaOAM_Screaming_Frame3[37] = { + 0xc, + 0xe5, 0x1f8, OBJ_SPRITE_OAM | 0x213, + OBJ_SHAPE_VERTICAL | 0xed, 0x1f8, OBJ_SPRITE_OAM | 0x212, + 0xe5, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x213, + OBJ_SHAPE_VERTICAL | 0xed, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x212, + 0xe7, OBJ_SIZE_16x16 | 0x1e9, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf7, 0x1e9, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfd, 0x1ea, OBJ_SPRITE_OAM | 0x220, + 0xe7, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x7, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf7, OBJ_X_FLIP | 0x7, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfd, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x220, + 0xef, 0x1f9, OBJ_SPRITE_OAM | 0x22a, + 0xef, OBJ_X_FLIP | 0x1ff, OBJ_SPRITE_OAM | 0x22a +}; + +const u16 sDessgeegaOAM_Screaming_Frame4[37] = { + 0xc, + 0xe5, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x211, + OBJ_SHAPE_VERTICAL | 0xed, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x210, + 0xe5, 0x1f8, OBJ_SPRITE_OAM | 0x211, + OBJ_SHAPE_VERTICAL | 0xed, 0x1f8, OBJ_SPRITE_OAM | 0x210, + 0xe6, OBJ_SIZE_16x16 | 0x1ea, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf6, 0x1ea, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, 0x1ea, OBJ_SPRITE_OAM | 0x220, + 0xe6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x6, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf6, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, OBJ_X_FLIP | 0x6, OBJ_SPRITE_OAM | 0x220, + 0xef, 0x1fa, OBJ_SPRITE_OAM | 0x22a, + 0xef, OBJ_X_FLIP | 0x1fe, OBJ_SPRITE_OAM | 0x22a +}; + +const u16 sDessgeegaOAM_Screaming_Frame5[37] = { + 0xc, + 0xe4, 0x1f8, OBJ_SPRITE_OAM | 0x213, + OBJ_SHAPE_VERTICAL | 0xec, 0x1f8, OBJ_SPRITE_OAM | 0x212, + 0xe4, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x213, + OBJ_SHAPE_VERTICAL | 0xec, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x212, + 0xe6, OBJ_SIZE_16x16 | 0x1e9, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf5, 0x1e9, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, 0x1e9, OBJ_SPRITE_OAM | 0x220, + 0xee, 0x1f8, OBJ_SPRITE_OAM | 0x22a, + 0xe6, OBJ_X_FLIP | OBJ_SIZE_16x16 | 0x7, OBJ_SPRITE_OAM | 0x202, + OBJ_SHAPE_HORIZONTAL | 0xf5, OBJ_X_FLIP | 0x7, OBJ_SPRITE_OAM | 0x204, + OBJ_SHAPE_HORIZONTAL | 0xfc, OBJ_X_FLIP | 0x7, OBJ_SPRITE_OAM | 0x220, + 0xee, OBJ_X_FLIP | 0x0, OBJ_SPRITE_OAM | 0x22a +}; + +const struct FrameData sDessgeegaOAM_Idle[5] = { + sDessgeegaOAM_Idle_Frame0, + 0x8, + sDessgeegaOAM_Idle_Frame1, + 0x8, + sDessgeegaOAM_Idle_Frame2, + 0x8, + sDessgeegaOAM_Idle_Frame1, + 0x8, + NULL, + 0x0 +}; + +const struct FrameData sDessgeegaOAM_Screaming[12] = { + sDessgeegaOAM_Idle_Frame0, + 0x8, + sDessgeegaOAM_Screaming_Frame1, + 0x6, + sDessgeegaOAM_Screaming_Frame2, + 0x6, + sDessgeegaOAM_Screaming_Frame3, + 0x4, + sDessgeegaOAM_Screaming_Frame4, + 0x4, + sDessgeegaOAM_Screaming_Frame5, + 0x3, + sDessgeegaOAM_Screaming_Frame4, + 0x3, + sDessgeegaOAM_Screaming_Frame5, + 0x3, + sDessgeegaOAM_Screaming_Frame4, + 0x4, + sDessgeegaOAM_Screaming_Frame5, + 0x4, + sDessgeegaOAM_Screaming_Frame1, + 0x8, + NULL, + 0x0 +}; + +const struct FrameData sDessgeegaOAM_JumpWarning[4] = { + sDessgeegaOAM_Idle_Frame0, + 0x6, + sDessgeegaOAM_JumpWarning_Frame1, + 0x8, + sDessgeegaOAM_JumpWarning_Frame2, + 0xC, + NULL, + 0x0 +}; + +const struct FrameData sDessgeegaOAM_Jumping[3] = { + sDessgeegaOAM_Jumping_Frame0, + 0x2, + sDessgeegaOAM_Jumping_Frame1, + 0x2, + NULL, + 0x0 +}; + +const struct FrameData sDessgeegaOAM_Landing[5] = { + sDessgeegaOAM_Landing_Frame0, + 0x4, + sDessgeegaOAM_JumpWarning_Frame2, + 0xC, + sDessgeegaOAM_JumpWarning_Frame1, + 0x8, + sDessgeegaOAM_Idle_Frame0, + 0x4, + NULL, + 0x0 +}; + + +/** + * @brief 23b4c | 20 | Checks if samus is near the dessgeega on the sides in a 5 block range + * + * @return u8 1 if near, 0 otherwise + */ u8 DessgeegaCheckSamusNearLeftRight(void) { + u8 result; + result = FALSE; + if (SpriteUtilCheckSamusNearSpriteLeftRight(BLOCK_SIZE * 5, BLOCK_SIZE * 5) != NSLR_OUT_OF_RANGE) + { + result = TRUE; + SpriteUtilMakeSpriteFaceSamusDirection(); + } + return result; } +/** + * @brief 23b6c | 10c | Initializes a dessgeega sprite + * + */ void DessgeegaInit(void) { + u8 spriteID; + spriteID = gCurrentSprite.spriteID; + + if (spriteID == PSPRITE_DESSGEEGA_AFTER_LONG_BEAM) + { + // Check should kill dessgeega + if (EventFunction(EVENT_ACTION_CHECKING, EVENT_LONG_BEAM_DESSGEEGA_KILLED) + || !EventFunction(EVENT_ACTION_CHECKING, EVENT_VIEWED_STATUE_ROOM)) + { + // If already dead or didn't view statue room + gCurrentSprite.status = 0x0; + return; + } + + // Lock doors and set samus detection behavior + gDoorUnlockTimer = 0x1; + gCurrentSprite.pose = DESSGEEGA_POSE_LONG_BEAM_DETECT; + } + else + { + // Check is on ceiling + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - (BLOCK_SIZE + 4), gCurrentSprite.xPosition); + if (gPreviousCollisionCheck & (COLLISION_PASS_THROUGH_BOTTOM | 0x20 | 0x40 | 0x80)) + { + gCurrentSprite.status |= SPRITE_STATUS_FACING_DOWN; + gCurrentSprite.yPosition -= BLOCK_SIZE; + } + gCurrentSprite.pose = DESSGEEGA_POSE_IDLE; + } + + // Set hitbox and draw distances based on direction + gCurrentSprite.timer = 0x0; + if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN) + { + gCurrentSprite.drawDistanceTopOffset = 0x8; + gCurrentSprite.drawDistanceBottomOffset = 0x28; + gCurrentSprite.hitboxTopOffset = 0x0; + gCurrentSprite.hitboxBottomOffset = 0x58; + } + else + { + gCurrentSprite.drawDistanceTopOffset = 0x28; + gCurrentSprite.drawDistanceBottomOffset = 0x8; + gCurrentSprite.hitboxTopOffset = -0x58; + gCurrentSprite.hitboxBottomOffset = 0x0; + } + + gCurrentSprite.drawDistanceHorizontalOffset = 0x18; + gCurrentSprite.hitboxLeftOffset = -0x40; + gCurrentSprite.hitboxRightOffset = 0x40; + + gCurrentSprite.pOam = sDessgeegaOAM_Idle; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + + gCurrentSprite.samusCollision = SSC_HURTS_SAMUS; + gCurrentSprite.health = sPrimarySpriteStats[spriteID][0]; + SpriteUtilChooseRandomXDirection(); } -void DessgeegaJumpingGFXInit(void) +/** + * @brief 23c78 | 20 | Initializes a dessgeega to do the warning before a jump + * + */ +void DessgeegaJumpWarningInit(void) { - + gCurrentSprite.pose = DESSGEEGA_POSE_JUMP_WARNING; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.pOam = sDessgeegaOAM_JumpWarning; } -void DessgeegaBeforeJumping(void) +/** + * @brief 23c98 | 64 | Initializes a dessgeega to be jumping + * + */ +void DessgeegaJumpingInit(void) { + gCurrentSprite.pose = DESSGEEGA_POSE_JUMPING; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.arrayOffset = 0x0; + gCurrentSprite.pOam = sDessgeegaOAM_Jumping; + // Set high or low jump depending on RNG + if (gSpriteRNG & 0x1) + gCurrentSprite.workVariable2 = TRUE; // Low + else + gCurrentSprite.workVariable2 = FALSE; // High + + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + SoundPlayNotAlreadyPlaying(0x15A); } -void DessgeegaBeforeLanding(void) +/** + * @brief 23cfc | 38 | Initializes a dessgeega to be landing + * + */ +void DessgeegaLandingInit(void) { + gCurrentSprite.pose = DESSGEEGA_POSE_LANDING; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.pOam = sDessgeegaOAM_Landing; + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + SoundPlayNotAlreadyPlaying(0x15B); } -void DessgeegaCheckSamusInRange(void) +/** + * @brief 23d34 | 74 | Initializes a dessgeega to be idle + * + */ +void DessgeegaIdleInit(void) { + if (DessgeegaCheckSamusNearLeftRight()) + DessgeegaJumpWarningInit(); // Jump if smaus near + else + { + // Set idle + gCurrentSprite.pose = DESSGEEGA_POSE_IDLE; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.timer = 0x0; + gCurrentSprite.workVariable = gSpriteRNG & 0x3; + // Set screaming or idle + if (gSpriteRNG >= 0x8) + gCurrentSprite.pOam = sDessgeegaOAM_Idle; + else + { + gCurrentSprite.pOam = sDessgeegaOAM_Screaming; + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + SoundPlayNotAlreadyPlaying(0x15C); + } + } } -void DessgeegaBouncingGFXInit(void) +/** + * @brief 23da8 | 24 | Initializes a dessgeega to be falling + * + */ +void DessgeegaFallingInit(void) { - + gCurrentSprite.pose = DESSGEEGA_POSE_FALLING; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.arrayOffset = 0x0; + gCurrentSprite.pOam = sDessgeegaOAM_Jumping; // Use same animation as jumping } -void DessgeegaCheckBouncing(void) +/** + * @brief 23dcc | 5c | Handles the jump warning of a dessgeega on the ground + * + */ +void DessgeegaJumpWarningGround(void) { - + // Check should fall + if (SpriteUtilGetCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition) == COLLISION_AIR) + { + // Check right block + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset); + if (gPreviousCollisionCheck == COLLISION_AIR) + { + // Check left block + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset); + if (gPreviousCollisionCheck == COLLISION_AIR) + DessgeegaFallingInit(); + } + } + else if (SpriteUtilCheckEndCurrentSpriteAnim()) + DessgeegaJumpingInit(); // Jump if anim ended } -void DessgeegaCheckBeforeJumpingCeilingAnimEnded(void) +/** + * @brief 23e28 | 14 | Handles the jump warning of a dessgeega on the ceiling + * + */ +void DessgeegaJumpWarningCeiling(void) { - + if (SpriteUtilCheckEndCurrentSpriteAnim()) + DessgeegaJumpingInit(); // Jump if anim ended } -void DessgeegaMoveGround(void) +/** + * @brief 23e3c | 1e8 | Handles the dessgeega jumping from the ground + * + */ +void DessgeegaJumpingGround(void) { + u8 collision; + i32 yVelocity; + u32 topEdge; + collision = 0x0; + if (gCurrentSprite.workVariable2) // Low jump flag + yVelocity = sDessgeegaLowJumpYVelocity[gCurrentSprite.arrayOffset / 4]; + else + yVelocity = sDessgeegaHighJumpYVelocity[gCurrentSprite.arrayOffset / 4]; + + // Apply movement + if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT) + { + // Check colliding with wall on right + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + 4); + if (gPreviousCollisionCheck == COLLISION_SOLID) + { + collision++; + gCurrentSprite.xPosition -= 0x6; + } + else if (yVelocity >= 0x1) + gCurrentSprite.xPosition += 0x4; + else + gCurrentSprite.xPosition += 0x5; + } + else + { + // Check colliding with wall on left + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition - 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - 4); + if (gPreviousCollisionCheck == COLLISION_SOLID) + { + collision++; + gCurrentSprite.xPosition += 0x6; + } + else if (yVelocity >= 0x1) + gCurrentSprite.xPosition -= 0x4; + else + gCurrentSprite.xPosition -= 0x5; + } + + // Apply Y + gCurrentSprite.yPosition += yVelocity; + + if (gCurrentSprite.arrayOffset < 0x27) + gCurrentSprite.arrayOffset++; + + if (yVelocity >= 0x1) + { + // Positive velocity, check if landing + + // Rotate if collided + if (collision) + gCurrentSprite.status ^= SPRITE_STATUS_FACING_RIGHT; + + // Block right below + topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition); + if (gPreviousVerticalCollisionCheck != COLLISION_AIR) + { + // Set landing behavior + gCurrentSprite.yPosition = topEdge; + DessgeegaLandingInit(); + } + else if (!collision) // No need to check for side blocks if colliding with a wall + { + // Block on right + topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, + gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset); + if (gPreviousVerticalCollisionCheck == COLLISION_AIR) + { + // Block on left + topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, + gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset); + if (gPreviousVerticalCollisionCheck != COLLISION_AIR) + collision = TRUE; + + if (!collision) + return; + } + + // Set landing behavior + gCurrentSprite.yPosition = topEdge; + DessgeegaLandingInit(); + } + } + else + { + // Negative velocity, check if colliding with ceiling to fall + if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT) + { + // Check block on top right + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTopOffset, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset); + if (gPreviousCollisionCheck == COLLISION_SOLID) + { + // Set falling behavior + collision++; + gCurrentSprite.xPosition -= 0x6; + DessgeegaFallingInit(); + } + } + else + { + // Check block on top left + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxTopOffset, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset); + if (gPreviousCollisionCheck == COLLISION_SOLID) + { + // Set falling behavior + collision++; + gCurrentSprite.xPosition += 0x6; + DessgeegaFallingInit(); + } + } + + // Rotate if collided + if (collision) + gCurrentSprite.status ^= SPRITE_STATUS_FACING_RIGHT; + } } -void DessgeegaMoveCeiling(void) +/** + * @brief 24024 | 1fc | Handles the dessgeega jumping from the ceiling + * + */ +void DessgeegaJumpingCeiling(void) { + u8 collision; + i32 yVelocity; + u32 topEdge; + collision = 0x0; + if (gCurrentSprite.workVariable2) // Low jump flag + yVelocity = sDessgeegaLowJumpYVelocity[gCurrentSprite.arrayOffset / 4]; + else + yVelocity = sDessgeegaHighJumpYVelocity[gCurrentSprite.arrayOffset / 4]; + + // Apply movement + if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT) + { + // Check colliding with wall on right + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset + 4); + if (gPreviousCollisionCheck == COLLISION_SOLID) + { + collision++; + gCurrentSprite.xPosition -= 0x6; + } + else if (yVelocity >= 0x1) + gCurrentSprite.xPosition += 0x4; + else + gCurrentSprite.xPosition += 0x5; + } + else + { + // Check colliding with wall on left + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + 0x10, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset - 4); + if (gPreviousCollisionCheck == COLLISION_SOLID) + { + collision++; + gCurrentSprite.xPosition += 0x6; + } + else if (yVelocity >= 0x1) + gCurrentSprite.xPosition -= 0x4; + else + gCurrentSprite.xPosition -= 0x5; + } + + // Apply Y + gCurrentSprite.yPosition -= yVelocity; + + if (gCurrentSprite.arrayOffset < 0x27) + gCurrentSprite.arrayOffset++; + + if (yVelocity < 0x0) + { + // Negative velocity, check if colliding with ground to fall + if (gCurrentSprite.status & SPRITE_STATUS_FACING_RIGHT) + { + // Check block on bottom right + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottomOffset, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset); + if (gPreviousCollisionCheck == COLLISION_SOLID) + { + // Set falling behavior + collision++; + gCurrentSprite.xPosition -= 0x6; + DessgeegaFallingInit(); + } + } + else + { + // Check block on bottom left + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition + gCurrentSprite.hitboxBottomOffset, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset); + if (gPreviousCollisionCheck == COLLISION_SOLID) + { + // Set falling behavior + collision++; + gCurrentSprite.xPosition += 0x6; + DessgeegaFallingInit(); + } + } + + // Rotate if collided + if (collision) + gCurrentSprite.status ^= SPRITE_STATUS_FACING_RIGHT; + } + else + { + // Positive velocity, check if landing + + // Rotate if collided + if (collision) + gCurrentSprite.status ^= SPRITE_STATUS_FACING_RIGHT; + + // Block right below + topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition); + if (gPreviousVerticalCollisionCheck & 0xF) + { + // Set landing behavior + gCurrentSprite.yPosition = topEdge + BLOCK_SIZE; + DessgeegaLandingInit(); + } + else if (!collision) // No need to check for side blocks if colliding with a wall + { + // Block on right + topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, + gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset); + if (!(gPreviousVerticalCollisionCheck & 0xF)) + { + // Block on left + topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, + gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset); + if (gPreviousVerticalCollisionCheck & 0xF) + collision = TRUE; + + if (!collision) + return; + } + + // Set landing behavior + gCurrentSprite.yPosition = topEdge + BLOCK_SIZE; + DessgeegaLandingInit(); + } + } } +/** + * @brief 24220 | 14 | Checks if the landing animation as ended + * + */ void DessgeegaCheckLandingAnimEnded(void) { - + if (SpriteUtilCheckEndCurrentSpriteAnim()) + DessgeegaIdleInit(); // Set idle } -void DessgeegaJumpingGroundIntoBlock(void) +void DessgeegaFallingGround(void) +{ + // https://decomp.me/scratch/rzu1N + + /*u8 colliding; + u8 offset; + i32 velocity; + u32 topEdge; + + colliding = FALSE; + + topEdge = SpriteUtilCheckVerticalCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition); + if (gPreviousVerticalCollisionCheck != COLLISION_AIR) + colliding = TRUE; + else + { + topEdge = SpriteUtilCheckVerticalCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset); + if (gPreviousVerticalCollisionCheck != COLLISION_AIR) + colliding = TRUE; + else + { + topEdge = SpriteUtilCheckVerticalCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset); + if (gPreviousVerticalCollisionCheck != COLLISION_AIR) + colliding = TRUE; + } + } + + if (colliding) + { + gCurrentSprite.yPosition = topEdge; + DessgeegaLandingInit(); + } + else + { + // Update Y position + offset = gCurrentSprite.arrayOffset; + velocity = sSpritesFallingSpeed[offset]; + if (sSpritesFallingSpeed[offset] == SPRITE_ARRAY_TERMINATOR) + { + // Reached end of array, use last velocity + velocity = sSpritesFallingSpeed[offset - 1] + gCurrentSprite.yPosition; + gCurrentSprite.yPosition = velocity; + } + else + { + gCurrentSprite.arrayOffset = offset + 1; + gCurrentSprite.yPosition += velocity; + } + }*/ +} + +void DessgeegaFallingCeiling(void) { } -void DessgeegaJumpingCeilingIntoBlock(void) -{ - -} - -void DessgeegaGroundIdleAnim(void) -{ - -} - -void DessgeegaCeilingdleAnim(void) +void DessgeegaIdleGround(void) +{ + // https://decomp.me/scratch/rPiEB + + /*if (!DessgeegaCheckSamusNearLeftRight()) + { + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxRightOffset); + if (gPreviousCollisionCheck == COLLISION_AIR) + { + SpriteUtilCheckCollisionAtPosition(gCurrentSprite.yPosition, gCurrentSprite.xPosition + gCurrentSprite.hitboxLeftOffset); + if (gPreviousCollisionCheck == COLLISION_AIR) + { + DessgeegaFallingInit(); + return; + } + } + if (SpriteUtilCheckEndCurrentSpriteAnim()) + { + if (gCurrentSprite.timer++ == gCurrentSprite.workVariable) + DessgeegaJumpWarningInit(); + else + { + if (gCurrentSprite.pOam == sDessgeegaOAM_Screaming && gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + SoundPlayNotAlreadyPlaying(0x15C); + } + } + }*/ +} + +void DessgeegaIdleCeiling(void) { } +/** + * @brief 24474 | 58 | Handles the death of a dessgeega + * + */ void DessgeegaDeath(void) { + u16 yPosition; + if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN) + yPosition = gCurrentSprite.yPosition + 0x30; + else + { + // Set event every time a ground dessgeega is killed instead of checking for the sprite ID ? + EventFunction(EVENT_ACTION_SETTING, EVENT_LONG_BEAM_DESSGEEGA_KILLED); + // Unlock doors + gDoorUnlockTimer = -0x14; + yPosition = gCurrentSprite.yPosition - 0x30; + } + + // Kill sprite + SpriteUtilSpriteDeath(DEATH_NORMAL, yPosition, gCurrentSprite.xPosition, TRUE, PE_SPRITE_EXPLOSION_SINGLE_THEN_BIG); } +/** + * @brief 244cc | b8 | Handles the detection of samus for the long beam dessgeega + * + */ void DessgeegaLongBeamDetectSamus(void) { + u16 yPosition; + u16 xPosition; + gCurrentSprite.ignoreSamusCollisionTimer = 0x1; + gCurrentSprite.status |= SPRITE_STATUS_UNKNOWN3; + + // Detect samus + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN && + SpriteUtilCheckSamusNearSpriteLeftRight(BLOCK_SIZE * 12, BLOCK_SIZE * 4 - 0x10) != NSLR_OUT_OF_RANGE) + { + gCurrentSprite.pose = DESSGEEGA_POSE_LONG_BEAM_SPAWNING; + gCurrentSprite.pOam = sDessgeegaOAM_Jumping; + gCurrentSprite.animationDurationCounter = 0x0; + gCurrentSprite.currentAnimationFrame = 0x0; + gCurrentSprite.arrayOffset = FALSE; + gCurrentSprite.status &= ~SPRITE_STATUS_UNKNOWN3; + + ScreenShakeStartVertical(0xA, 0x81); + + yPosition = gCurrentSprite.yPosition; + xPosition = gCurrentSprite.xPosition; + + SpriteDebrisInit(0x0, 0x5, yPosition + 0x30, xPosition + 0x50); + SpriteDebrisInit(0x0, 0x7, yPosition + 0x10, xPosition + 0x1A); + SpriteDebrisInit(0x0, 0x8, yPosition + 0x40, xPosition - 0x5A); + SpriteDebrisInit(0x0, 0x6, yPosition + 0x20, xPosition - 0x10); + SoundPlay(0x220); + } } +/** + * @brief 24584 | dc | Handles the spawning of the dessgeega long beam + * + */ void DessgeegaLongBeamSpawning(void) { + u32 topEdge; + u16 yPosition; + u16 xPosition; + u8 caa; + topEdge = SpriteUtilCheckVerticalCollisionAtPositionSlopes(gCurrentSprite.yPosition, gCurrentSprite.xPosition); + + if (gPreviousVerticalCollisionCheck != COLLISION_AIR) + { + // Colliding with solid + // Check hasn't destroyed floor + if (!gCurrentSprite.arrayOffset) + { + gCurrentSprite.arrayOffset++; // Set block destroyed flag + + yPosition = gCurrentSprite.yPosition; + xPosition = gCurrentSprite.xPosition; + + caa = CAA_REMOVE_SOLID; + // Remove middle block + gCurrentClipdataAffectingAction = caa; + ClipdataProcess(yPosition, xPosition); + + // Remove right block + gCurrentClipdataAffectingAction = caa; + ClipdataProcess(yPosition, xPosition + BLOCK_SIZE); + + // Remove left block + gCurrentClipdataAffectingAction = caa; + ClipdataProcess(yPosition, xPosition - BLOCK_SIZE); + + // Play effects + ParticleSet(yPosition - 0x8, xPosition + 0x34, PE_TWO_MEDIUM_DUST); + ParticleSet(yPosition + 0x8, xPosition - 0x34, PE_MEDIUM_DUST); + + SpriteDebrisInit(0x0, 0x11, yPosition - 0x40, xPosition); + SpriteDebrisInit(0x0, 0x12, yPosition - 0x20, xPosition + 0x3E); + SpriteDebrisInit(0x0, 0x13, yPosition - 0x28, xPosition - 0x5C); + SpriteDebrisInit(0x0, 0x4, yPosition - 0x48, xPosition + 0x1E); + SoundPlay(0x13A); + } + else + { + // Set landing behavior + gCurrentSprite.yPosition = topEdge; + ScreenShakeStartVertical(0xA, 0x81); + DessgeegaLandingInit(); + } + } + else + gCurrentSprite.yPosition += 0x18; // Go down } +/** + * @brief 24660 | 1dc | Dessgeega AI + * + */ void Dessgeega(void) { + if (gCurrentSprite.properties & SP_DAMAGED) + { + gCurrentSprite.properties &= ~SP_DAMAGED; + if (gCurrentSprite.status & SPRITE_STATUS_ONSCREEN) + SoundPlayNotAlreadyPlaying(0x15D); + } + if (gCurrentSprite.freezeTimer != 0x0) + SpriteUtilUpdateFreezeTimer(); + else + { + if (SpriteUtilIsSpriteStunned()) + return; + + switch (gCurrentSprite.pose) + { + case 0x0: + DessgeegaInit(); + break; + + case DESSGEEGA_POSE_LONG_BEAM_DETECT: + DessgeegaLongBeamDetectSamus(); + break; + + case DESSGEEGA_POSE_LONG_BEAM_SPAWNING: + DessgeegaLongBeamSpawning(); + break; + + case DESSGEEGA_POSE_JUMP_WARNING_INIT: + DessgeegaJumpWarningInit(); + + case DESSGEEGA_POSE_JUMP_WARNING: + if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN) + DessgeegaJumpWarningCeiling(); + else + DessgeegaJumpWarningGround(); + break; + + case DESSGEEGA_POSE_JUMPING: + if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN) + DessgeegaJumpingCeiling(); + else + DessgeegaJumpingGround(); + break; + + case DESSGEEGA_POSE_LANDING: + DessgeegaCheckLandingAnimEnded(); + break; + + case DESSGEEGA_POSE_IDLE: + if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN) + DessgeegaIdleCeiling(); + else + DessgeegaIdleGround(); + break; + + case DESSGEEGA_POSE_FALLING: + if (gCurrentSprite.status & SPRITE_STATUS_FACING_DOWN) + DessgeegaFallingCeiling(); + else + DessgeegaFallingGround(); + break; + + default: + DessgeegaDeath(); + } + } } \ No newline at end of file diff --git a/src/sprites_AI/dessgeega.h b/src/sprites_AI/dessgeega.h index 152fad23..06c3f21d 100644 --- a/src/sprites_AI/dessgeega.h +++ b/src/sprites_AI/dessgeega.h @@ -3,22 +3,31 @@ #include "../types.h" +#define DESSGEEGA_POSE_JUMP_WARNING_INIT 0x8 +#define DESSGEEGA_POSE_JUMP_WARNING 0x9 +#define DESSGEEGA_POSE_IDLE 0xF +#define DESSGEEGA_POSE_LONG_BEAM_DETECT 0x11 +#define DESSGEEGA_POSE_FALLING 0x1F +#define DESSGEEGA_POSE_JUMPING 0x23 +#define DESSGEEGA_POSE_LANDING 0x25 +#define DESSGEEGA_POSE_LONG_BEAM_SPAWNING 0x33 + u8 DessgeegaCheckSamusNearLeftRight(void); void DessgeegaInit(void); -void DessgeegaJumpingGFXInit(void); -void DessgeegaBeforeJumping(void); -void DessgeegaBeforeLanding(void); -void DessgeegaCheckSamusInRange(void); -void DessgeegaBouncingGFXInit(void); -void DessgeegaCheckBouncing(void); -void DessgeegaCheckBeforeJumpingCeilingAnimEnded(void); -void DessgeegaMoveGround(void); -void DessgeegaMoveCeiling(void); +void DessgeegaJumpWarningInit(void); +void DessgeegaJumpingInit(void); +void DessgeegaLandingInit(void); +void DessgeegaIdleInit(void); +void DessgeegaFallingInit(void); +void DessgeegaJumpWarningGround(void); +void DessgeegaJumpWarningCeiling(void); +void DessgeegaJumpingGround(void); +void DessgeegaJumpingCeiling(void); void DessgeegaCheckLandingAnimEnded(void); -void DessgeegaJumpingGroundIntoBlock(void); -void DessgeegaJumpingCeilingIntoBlock(void); -void DessgeegaGroundIdleAnim(void); -void DessgeegaCeilingdleAnim(void); +void DessgeegaFallingGround(void); +void DessgeegaFallingCeiling(void); +void DessgeegaIdleGround(void); +void DessgeegaIdleCeiling(void); void DessgeegaDeath(void); void DessgeegaLongBeamDetectSamus(void); void DessgeegaLongBeamSpawning(void);