diff --git a/Progress.md b/Progress.md index 104c7df6e68..729b4246ccb 100644 --- a/Progress.md +++ b/Progress.md @@ -21,8 +21,8 @@ Total | 54.954197% | 2209528 | 4020672 Section | Percentage | Decompiled (bytes) | Total (bytes) ---|---|---|--- main.dol | 54.954197% | 2209528 | 4020672 -RELs | 38.647050% | 4444536 | 11500324 -Total | 42.871372% | 6654064 | 15520996 +RELs | 38.671154% | 4447308 | 11500324 +Total | 42.889232% | 6656836 | 15520996 ## RELs @@ -46,7 +46,7 @@ d_a_b_gnd | 25.489573% | 19264 | 75576 d_a_b_go | 100.000000% | 6268 | 6268 d_a_b_gos | 100.000000% | 7816 | 7816 d_a_b_mgn | 26.103833% | 15064 | 57708 -d_a_b_ob | 26.856326% | 15784 | 58772 +d_a_b_ob | 31.572858% | 18556 | 58772 d_a_b_oh | 35.387431% | 4640 | 13112 d_a_b_oh2 | 100.000000% | 5532 | 5532 d_a_b_tn | 24.850960% | 21176 | 85212 @@ -785,4 +785,4 @@ d_a_vrbox2 | 44.907111% | 2804 | 6244 d_a_warp_bug | 100.000000% | 2024 | 2024 d_a_ykgr | 44.400631% | 2252 | 5072 f_pc_profile_lst | 100.000000% | 28156 | 28156 -Total | 38.647050% | 4444536 | 11500324 +Total | 38.671154% | 4447308 | 11500324 diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinACallBack__FP8J3DJointi.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinACallBack__FP8J3DJointi.s deleted file mode 100644 index fc479150963..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinACallBack__FP8J3DJointi.s +++ /dev/null @@ -1,105 +0,0 @@ -lbl_806109AC: -/* 806109AC 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 806109B0 7C 08 02 A6 */ mflr r0 -/* 806109B4 90 01 00 24 */ stw r0, 0x24(r1) -/* 806109B8 39 61 00 20 */ addi r11, r1, 0x20 -/* 806109BC 4B D5 18 21 */ bl _savegpr_29 -/* 806109C0 2C 04 00 00 */ cmpwi r4, 0 -/* 806109C4 40 82 01 5C */ bne lbl_80610B20 -/* 806109C8 A0 83 00 14 */ lhz r4, 0x14(r3) -/* 806109CC 3C 60 80 43 */ lis r3, j3dSys@ha /* 0x80434AC8@ha */ -/* 806109D0 38 63 4A C8 */ addi r3, r3, j3dSys@l /* 0x80434AC8@l */ -/* 806109D4 83 E3 00 38 */ lwz r31, 0x38(r3) -/* 806109D8 83 BF 00 14 */ lwz r29, 0x14(r31) -/* 806109DC 28 1D 00 00 */ cmplwi r29, 0 -/* 806109E0 41 82 01 40 */ beq lbl_80610B20 -/* 806109E4 2C 04 00 02 */ cmpwi r4, 2 -/* 806109E8 41 82 00 0C */ beq lbl_806109F4 -/* 806109EC 2C 04 00 01 */ cmpwi r4, 1 -/* 806109F0 40 82 01 30 */ bne lbl_80610B20 -lbl_806109F4: -/* 806109F4 80 7F 00 84 */ lwz r3, 0x84(r31) -/* 806109F8 80 03 00 0C */ lwz r0, 0xc(r3) -/* 806109FC 1F C4 00 30 */ mulli r30, r4, 0x30 -/* 80610A00 7C 60 F2 14 */ add r3, r0, r30 -/* 80610A04 3C 80 80 45 */ lis r4, calc_mtx@ha /* 0x80450768@ha */ -/* 80610A08 38 84 07 68 */ addi r4, r4, calc_mtx@l /* 0x80450768@l */ -/* 80610A0C 80 84 00 00 */ lwz r4, 0(r4) -/* 80610A10 4B D3 5A A1 */ bl PSMTXCopy -/* 80610A14 3C 60 80 62 */ lis r3, fin@ha /* 0x8061B538@ha */ -/* 80610A18 80 03 B5 38 */ lwz r0, fin@l(r3) /* 0x8061B538@l */ -/* 80610A1C 2C 00 00 00 */ cmpwi r0, 0 -/* 80610A20 40 82 00 50 */ bne lbl_80610A70 -/* 80610A24 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610A28 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610A2C 80 63 00 00 */ lwz r3, 0(r3) -/* 80610A30 3C 80 80 62 */ lis r4, pno@ha /* 0x8061B534@ha */ -/* 80610A34 80 04 B5 34 */ lwz r0, pno@l(r4) /* 0x8061B534@l */ -/* 80610A38 1C 00 01 78 */ mulli r0, r0, 0x178 -/* 80610A3C 7C 9D 02 14 */ add r4, r29, r0 -/* 80610A40 A8 84 05 EE */ lha r4, 0x5ee(r4) -/* 80610A44 4B 9F B9 F1 */ bl mDoMtx_YrotM__FPA4_fs -/* 80610A48 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610A4C 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610A50 80 63 00 00 */ lwz r3, 0(r3) -/* 80610A54 3C 80 80 62 */ lis r4, pno@ha /* 0x8061B534@ha */ -/* 80610A58 80 04 B5 34 */ lwz r0, pno@l(r4) /* 0x8061B534@l */ -/* 80610A5C 1C 00 01 78 */ mulli r0, r0, 0x178 -/* 80610A60 7C 9D 02 14 */ add r4, r29, r0 -/* 80610A64 A8 84 05 EE */ lha r4, 0x5ee(r4) -/* 80610A68 4B 9F B9 35 */ bl mDoMtx_XrotM__FPA4_fs -/* 80610A6C 48 00 00 5C */ b lbl_80610AC8 -lbl_80610A70: -/* 80610A70 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610A74 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610A78 80 63 00 00 */ lwz r3, 0(r3) -/* 80610A7C 3C 80 80 62 */ lis r4, pno@ha /* 0x8061B534@ha */ -/* 80610A80 80 04 B5 34 */ lwz r0, pno@l(r4) /* 0x8061B534@l */ -/* 80610A84 1C 00 01 78 */ mulli r0, r0, 0x178 -/* 80610A88 7C 9D 02 14 */ add r4, r29, r0 -/* 80610A8C A8 04 05 EE */ lha r0, 0x5ee(r4) -/* 80610A90 7C 00 00 D0 */ neg r0, r0 -/* 80610A94 7C 04 07 34 */ extsh r4, r0 -/* 80610A98 4B 9F B9 9D */ bl mDoMtx_YrotM__FPA4_fs -/* 80610A9C 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610AA0 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610AA4 80 63 00 00 */ lwz r3, 0(r3) -/* 80610AA8 3C 80 80 62 */ lis r4, pno@ha /* 0x8061B534@ha */ -/* 80610AAC 80 04 B5 34 */ lwz r0, pno@l(r4) /* 0x8061B534@l */ -/* 80610AB0 1C 00 01 78 */ mulli r0, r0, 0x178 -/* 80610AB4 7C 9D 02 14 */ add r4, r29, r0 -/* 80610AB8 A8 04 05 EE */ lha r0, 0x5ee(r4) -/* 80610ABC 7C 00 00 D0 */ neg r0, r0 -/* 80610AC0 7C 04 07 34 */ extsh r4, r0 -/* 80610AC4 4B 9F B8 D9 */ bl mDoMtx_XrotM__FPA4_fs -lbl_80610AC8: -/* 80610AC8 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610ACC 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610AD0 80 63 00 00 */ lwz r3, 0(r3) -/* 80610AD4 3C 80 80 62 */ lis r4, pno@ha /* 0x8061B534@ha */ -/* 80610AD8 80 04 B5 34 */ lwz r0, pno@l(r4) /* 0x8061B534@l */ -/* 80610ADC 1C 00 01 78 */ mulli r0, r0, 0x178 -/* 80610AE0 7C 9D 02 14 */ add r4, r29, r0 -/* 80610AE4 A8 84 05 EC */ lha r4, 0x5ec(r4) -/* 80610AE8 4B 9F B9 E5 */ bl mDoMtx_ZrotM__FPA4_fs -/* 80610AEC 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610AF0 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610AF4 80 63 00 00 */ lwz r3, 0(r3) -/* 80610AF8 80 9F 00 84 */ lwz r4, 0x84(r31) -/* 80610AFC 80 04 00 0C */ lwz r0, 0xc(r4) -/* 80610B00 7C 80 F2 14 */ add r4, r0, r30 -/* 80610B04 4B D3 59 AD */ bl PSMTXCopy -/* 80610B08 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610B0C 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610B10 80 63 00 00 */ lwz r3, 0(r3) -/* 80610B14 3C 80 80 43 */ lis r4, mCurrentMtx__6J3DSys@ha /* 0x80434BE4@ha */ -/* 80610B18 38 84 4B E4 */ addi r4, r4, mCurrentMtx__6J3DSys@l /* 0x80434BE4@l */ -/* 80610B1C 4B D3 59 95 */ bl PSMTXCopy -lbl_80610B20: -/* 80610B20 38 60 00 01 */ li r3, 1 -/* 80610B24 39 61 00 20 */ addi r11, r1, 0x20 -/* 80610B28 4B D5 17 01 */ bl _restgpr_29 -/* 80610B2C 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80610B30 7C 08 03 A6 */ mtlr r0 -/* 80610B34 38 21 00 20 */ addi r1, r1, 0x20 -/* 80610B38 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinBCallBack__FP8J3DJointi.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinBCallBack__FP8J3DJointi.s deleted file mode 100644 index 283f41867a3..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinBCallBack__FP8J3DJointi.s +++ /dev/null @@ -1,61 +0,0 @@ -lbl_80610B3C: -/* 80610B3C 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80610B40 7C 08 02 A6 */ mflr r0 -/* 80610B44 90 01 00 24 */ stw r0, 0x24(r1) -/* 80610B48 39 61 00 20 */ addi r11, r1, 0x20 -/* 80610B4C 4B D5 16 91 */ bl _savegpr_29 -/* 80610B50 2C 04 00 00 */ cmpwi r4, 0 -/* 80610B54 40 82 00 B4 */ bne lbl_80610C08 -/* 80610B58 A0 83 00 14 */ lhz r4, 0x14(r3) -/* 80610B5C 3C 60 80 43 */ lis r3, j3dSys@ha /* 0x80434AC8@ha */ -/* 80610B60 38 63 4A C8 */ addi r3, r3, j3dSys@l /* 0x80434AC8@l */ -/* 80610B64 83 E3 00 38 */ lwz r31, 0x38(r3) -/* 80610B68 83 BF 00 14 */ lwz r29, 0x14(r31) -/* 80610B6C 28 1D 00 00 */ cmplwi r29, 0 -/* 80610B70 41 82 00 98 */ beq lbl_80610C08 -/* 80610B74 38 04 FF FE */ addi r0, r4, -2 -/* 80610B78 28 00 00 01 */ cmplwi r0, 1 -/* 80610B7C 40 81 00 14 */ ble lbl_80610B90 -/* 80610B80 2C 04 00 05 */ cmpwi r4, 5 -/* 80610B84 41 82 00 0C */ beq lbl_80610B90 -/* 80610B88 2C 04 00 06 */ cmpwi r4, 6 -/* 80610B8C 40 82 00 7C */ bne lbl_80610C08 -lbl_80610B90: -/* 80610B90 80 7F 00 84 */ lwz r3, 0x84(r31) -/* 80610B94 80 03 00 0C */ lwz r0, 0xc(r3) -/* 80610B98 1F C4 00 30 */ mulli r30, r4, 0x30 -/* 80610B9C 7C 60 F2 14 */ add r3, r0, r30 -/* 80610BA0 3C 80 80 45 */ lis r4, calc_mtx@ha /* 0x80450768@ha */ -/* 80610BA4 38 84 07 68 */ addi r4, r4, calc_mtx@l /* 0x80450768@l */ -/* 80610BA8 80 84 00 00 */ lwz r4, 0(r4) -/* 80610BAC 4B D3 59 05 */ bl PSMTXCopy -/* 80610BB0 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610BB4 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610BB8 80 63 00 00 */ lwz r3, 0(r3) -/* 80610BBC 3C 80 80 62 */ lis r4, pno@ha /* 0x8061B534@ha */ -/* 80610BC0 80 04 B5 34 */ lwz r0, pno@l(r4) /* 0x8061B534@l */ -/* 80610BC4 1C 00 01 78 */ mulli r0, r0, 0x178 -/* 80610BC8 7C 9D 02 14 */ add r4, r29, r0 -/* 80610BCC A8 84 05 F4 */ lha r4, 0x5f4(r4) -/* 80610BD0 4B 9F B8 65 */ bl mDoMtx_YrotM__FPA4_fs -/* 80610BD4 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610BD8 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610BDC 80 63 00 00 */ lwz r3, 0(r3) -/* 80610BE0 80 9F 00 84 */ lwz r4, 0x84(r31) -/* 80610BE4 80 04 00 0C */ lwz r0, 0xc(r4) -/* 80610BE8 7C 80 F2 14 */ add r4, r0, r30 -/* 80610BEC 4B D3 58 C5 */ bl PSMTXCopy -/* 80610BF0 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610BF4 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610BF8 80 63 00 00 */ lwz r3, 0(r3) -/* 80610BFC 3C 80 80 43 */ lis r4, mCurrentMtx__6J3DSys@ha /* 0x80434BE4@ha */ -/* 80610C00 38 84 4B E4 */ addi r4, r4, mCurrentMtx__6J3DSys@l /* 0x80434BE4@l */ -/* 80610C04 4B D3 58 AD */ bl PSMTXCopy -lbl_80610C08: -/* 80610C08 38 60 00 01 */ li r3, 1 -/* 80610C0C 39 61 00 20 */ addi r11, r1, 0x20 -/* 80610C10 4B D5 16 19 */ bl _restgpr_29 -/* 80610C14 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80610C18 7C 08 03 A6 */ mtlr r0 -/* 80610C1C 38 21 00 20 */ addi r1, r1, 0x20 -/* 80610C20 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinCCallBack__FP8J3DJointi.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinCCallBack__FP8J3DJointi.s deleted file mode 100644 index be90e0c7272..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinCCallBack__FP8J3DJointi.s +++ /dev/null @@ -1,66 +0,0 @@ -lbl_80610C24: -/* 80610C24 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80610C28 7C 08 02 A6 */ mflr r0 -/* 80610C2C 90 01 00 24 */ stw r0, 0x24(r1) -/* 80610C30 39 61 00 20 */ addi r11, r1, 0x20 -/* 80610C34 4B D5 15 A9 */ bl _savegpr_29 -/* 80610C38 2C 04 00 00 */ cmpwi r4, 0 -/* 80610C3C 40 82 00 CC */ bne lbl_80610D08 -/* 80610C40 A0 83 00 14 */ lhz r4, 0x14(r3) -/* 80610C44 3C 60 80 43 */ lis r3, j3dSys@ha /* 0x80434AC8@ha */ -/* 80610C48 38 63 4A C8 */ addi r3, r3, j3dSys@l /* 0x80434AC8@l */ -/* 80610C4C 83 E3 00 38 */ lwz r31, 0x38(r3) -/* 80610C50 83 BF 00 14 */ lwz r29, 0x14(r31) -/* 80610C54 28 1D 00 00 */ cmplwi r29, 0 -/* 80610C58 41 82 00 B0 */ beq lbl_80610D08 -/* 80610C5C 2C 04 00 01 */ cmpwi r4, 1 -/* 80610C60 40 82 00 A8 */ bne lbl_80610D08 -/* 80610C64 80 7F 00 84 */ lwz r3, 0x84(r31) -/* 80610C68 80 03 00 0C */ lwz r0, 0xc(r3) -/* 80610C6C 1F C4 00 30 */ mulli r30, r4, 0x30 -/* 80610C70 7C 60 F2 14 */ add r3, r0, r30 -/* 80610C74 3C 80 80 45 */ lis r4, calc_mtx@ha /* 0x80450768@ha */ -/* 80610C78 38 84 07 68 */ addi r4, r4, calc_mtx@l /* 0x80450768@l */ -/* 80610C7C 80 84 00 00 */ lwz r4, 0(r4) -/* 80610C80 4B D3 58 31 */ bl PSMTXCopy -/* 80610C84 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610C88 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610C8C 80 63 00 00 */ lwz r3, 0(r3) -/* 80610C90 3C 80 80 62 */ lis r4, pno@ha /* 0x8061B534@ha */ -/* 80610C94 80 04 B5 34 */ lwz r0, pno@l(r4) /* 0x8061B534@l */ -/* 80610C98 1C 00 01 78 */ mulli r0, r0, 0x178 -/* 80610C9C 7C 9D 02 14 */ add r4, r29, r0 -/* 80610CA0 A8 84 05 FA */ lha r4, 0x5fa(r4) -/* 80610CA4 4B 9F B7 91 */ bl mDoMtx_YrotM__FPA4_fs -/* 80610CA8 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610CAC 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610CB0 80 63 00 00 */ lwz r3, 0(r3) -/* 80610CB4 3C 80 80 62 */ lis r4, pno@ha /* 0x8061B534@ha */ -/* 80610CB8 80 04 B5 34 */ lwz r0, pno@l(r4) /* 0x8061B534@l */ -/* 80610CBC 1C 00 01 78 */ mulli r0, r0, 0x178 -/* 80610CC0 7C 9D 02 14 */ add r4, r29, r0 -/* 80610CC4 A8 04 05 FA */ lha r0, 0x5fa(r4) -/* 80610CC8 7C 00 00 D0 */ neg r0, r0 -/* 80610CCC 7C 04 07 34 */ extsh r4, r0 -/* 80610CD0 4B 9F B6 CD */ bl mDoMtx_XrotM__FPA4_fs -/* 80610CD4 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610CD8 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610CDC 80 63 00 00 */ lwz r3, 0(r3) -/* 80610CE0 80 9F 00 84 */ lwz r4, 0x84(r31) -/* 80610CE4 80 04 00 0C */ lwz r0, 0xc(r4) -/* 80610CE8 7C 80 F2 14 */ add r4, r0, r30 -/* 80610CEC 4B D3 57 C5 */ bl PSMTXCopy -/* 80610CF0 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610CF4 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610CF8 80 63 00 00 */ lwz r3, 0(r3) -/* 80610CFC 3C 80 80 43 */ lis r4, mCurrentMtx__6J3DSys@ha /* 0x80434BE4@ha */ -/* 80610D00 38 84 4B E4 */ addi r4, r4, mCurrentMtx__6J3DSys@l /* 0x80434BE4@l */ -/* 80610D04 4B D3 57 AD */ bl PSMTXCopy -lbl_80610D08: -/* 80610D08 38 60 00 01 */ li r3, 1 -/* 80610D0C 39 61 00 20 */ addi r11, r1, 0x20 -/* 80610D10 4B D5 15 19 */ bl _restgpr_29 -/* 80610D14 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80610D18 7C 08 03 A6 */ mtlr r0 -/* 80610D1C 38 21 00 20 */ addi r1, r1, 0x20 -/* 80610D20 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/HeadCallBack__FP8J3DJointi.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/HeadCallBack__FP8J3DJointi.s deleted file mode 100644 index 98ade1744e0..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/HeadCallBack__FP8J3DJointi.s +++ /dev/null @@ -1,85 +0,0 @@ -lbl_8061066C: -/* 8061066C 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80610670 7C 08 02 A6 */ mflr r0 -/* 80610674 90 01 00 24 */ stw r0, 0x24(r1) -/* 80610678 39 61 00 20 */ addi r11, r1, 0x20 -/* 8061067C 4B D5 1B 61 */ bl _savegpr_29 -/* 80610680 2C 04 00 00 */ cmpwi r4, 0 -/* 80610684 40 82 01 14 */ bne lbl_80610798 -/* 80610688 A0 83 00 14 */ lhz r4, 0x14(r3) -/* 8061068C 3C 60 80 43 */ lis r3, j3dSys@ha /* 0x80434AC8@ha */ -/* 80610690 38 63 4A C8 */ addi r3, r3, j3dSys@l /* 0x80434AC8@l */ -/* 80610694 83 E3 00 38 */ lwz r31, 0x38(r3) -/* 80610698 83 DF 00 14 */ lwz r30, 0x14(r31) -/* 8061069C 28 1E 00 00 */ cmplwi r30, 0 -/* 806106A0 41 82 00 F8 */ beq lbl_80610798 -/* 806106A4 2C 04 00 02 */ cmpwi r4, 2 -/* 806106A8 41 80 00 78 */ blt lbl_80610720 -/* 806106AC 2C 04 00 04 */ cmpwi r4, 4 -/* 806106B0 41 81 00 70 */ bgt lbl_80610720 -/* 806106B4 80 7F 00 84 */ lwz r3, 0x84(r31) -/* 806106B8 80 03 00 0C */ lwz r0, 0xc(r3) -/* 806106BC 1F A4 00 30 */ mulli r29, r4, 0x30 -/* 806106C0 7C 60 EA 14 */ add r3, r0, r29 -/* 806106C4 3C 80 80 45 */ lis r4, calc_mtx@ha /* 0x80450768@ha */ -/* 806106C8 38 84 07 68 */ addi r4, r4, calc_mtx@l /* 0x80450768@l */ -/* 806106CC 80 84 00 00 */ lwz r4, 0(r4) -/* 806106D0 4B D3 5D E1 */ bl PSMTXCopy -/* 806106D4 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 806106D8 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 806106DC 80 63 00 00 */ lwz r3, 0(r3) -/* 806106E0 A8 9E 47 AE */ lha r4, 0x47ae(r30) -/* 806106E4 4B 9F BD 51 */ bl mDoMtx_YrotM__FPA4_fs -/* 806106E8 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 806106EC 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 806106F0 80 63 00 00 */ lwz r3, 0(r3) -/* 806106F4 80 9F 00 84 */ lwz r4, 0x84(r31) -/* 806106F8 80 04 00 0C */ lwz r0, 0xc(r4) -/* 806106FC 7C 80 EA 14 */ add r4, r0, r29 -/* 80610700 4B D3 5D B1 */ bl PSMTXCopy -/* 80610704 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610708 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 8061070C 80 63 00 00 */ lwz r3, 0(r3) -/* 80610710 3C 80 80 43 */ lis r4, mCurrentMtx__6J3DSys@ha /* 0x80434BE4@ha */ -/* 80610714 38 84 4B E4 */ addi r4, r4, mCurrentMtx__6J3DSys@l /* 0x80434BE4@l */ -/* 80610718 4B D3 5D 99 */ bl PSMTXCopy -/* 8061071C 48 00 00 7C */ b lbl_80610798 -lbl_80610720: -/* 80610720 2C 04 00 05 */ cmpwi r4, 5 -/* 80610724 41 80 00 74 */ blt lbl_80610798 -/* 80610728 2C 04 00 07 */ cmpwi r4, 7 -/* 8061072C 41 81 00 6C */ bgt lbl_80610798 -/* 80610730 80 7F 00 84 */ lwz r3, 0x84(r31) -/* 80610734 80 03 00 0C */ lwz r0, 0xc(r3) -/* 80610738 1F A4 00 30 */ mulli r29, r4, 0x30 -/* 8061073C 7C 60 EA 14 */ add r3, r0, r29 -/* 80610740 3C 80 80 45 */ lis r4, calc_mtx@ha /* 0x80450768@ha */ -/* 80610744 38 84 07 68 */ addi r4, r4, calc_mtx@l /* 0x80450768@l */ -/* 80610748 80 84 00 00 */ lwz r4, 0(r4) -/* 8061074C 4B D3 5D 65 */ bl PSMTXCopy -/* 80610750 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610754 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610758 80 63 00 00 */ lwz r3, 0(r3) -/* 8061075C A8 9E 47 AE */ lha r4, 0x47ae(r30) -/* 80610760 4B 9F BC D5 */ bl mDoMtx_YrotM__FPA4_fs -/* 80610764 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610768 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 8061076C 80 63 00 00 */ lwz r3, 0(r3) -/* 80610770 80 9F 00 84 */ lwz r4, 0x84(r31) -/* 80610774 80 04 00 0C */ lwz r0, 0xc(r4) -/* 80610778 7C 80 EA 14 */ add r4, r0, r29 -/* 8061077C 4B D3 5D 35 */ bl PSMTXCopy -/* 80610780 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610784 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610788 80 63 00 00 */ lwz r3, 0(r3) -/* 8061078C 3C 80 80 43 */ lis r4, mCurrentMtx__6J3DSys@ha /* 0x80434BE4@ha */ -/* 80610790 38 84 4B E4 */ addi r4, r4, mCurrentMtx__6J3DSys@l /* 0x80434BE4@l */ -/* 80610794 4B D3 5D 1D */ bl PSMTXCopy -lbl_80610798: -/* 80610798 38 60 00 01 */ li r3, 1 -/* 8061079C 39 61 00 20 */ addi r11, r1, 0x20 -/* 806107A0 4B D5 1A 89 */ bl _restgpr_29 -/* 806107A4 80 01 00 24 */ lwz r0, 0x24(r1) -/* 806107A8 7C 08 03 A6 */ mtlr r0 -/* 806107AC 38 21 00 20 */ addi r1, r1, 0x20 -/* 806107B0 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/TailCallBack__FP8J3DJointi.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/TailCallBack__FP8J3DJointi.s deleted file mode 100644 index 6137c22ef0e..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/TailCallBack__FP8J3DJointi.s +++ /dev/null @@ -1,133 +0,0 @@ -lbl_806107B4: -/* 806107B4 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 806107B8 7C 08 02 A6 */ mflr r0 -/* 806107BC 90 01 00 24 */ stw r0, 0x24(r1) -/* 806107C0 39 61 00 20 */ addi r11, r1, 0x20 -/* 806107C4 4B D5 1A 15 */ bl _savegpr_28 -/* 806107C8 2C 04 00 00 */ cmpwi r4, 0 -/* 806107CC 40 82 01 C4 */ bne lbl_80610990 -/* 806107D0 A0 83 00 14 */ lhz r4, 0x14(r3) -/* 806107D4 3C 60 80 43 */ lis r3, j3dSys@ha /* 0x80434AC8@ha */ -/* 806107D8 38 63 4A C8 */ addi r3, r3, j3dSys@l /* 0x80434AC8@l */ -/* 806107DC 83 E3 00 38 */ lwz r31, 0x38(r3) -/* 806107E0 83 DF 00 14 */ lwz r30, 0x14(r31) -/* 806107E4 28 1E 00 00 */ cmplwi r30, 0 -/* 806107E8 41 82 01 A8 */ beq lbl_80610990 -/* 806107EC 2C 04 00 03 */ cmpwi r4, 3 -/* 806107F0 40 82 00 70 */ bne lbl_80610860 -/* 806107F4 80 7F 00 84 */ lwz r3, 0x84(r31) -/* 806107F8 80 03 00 0C */ lwz r0, 0xc(r3) -/* 806107FC 1F A4 00 30 */ mulli r29, r4, 0x30 -/* 80610800 7C 60 EA 14 */ add r3, r0, r29 -/* 80610804 3C 80 80 45 */ lis r4, calc_mtx@ha /* 0x80450768@ha */ -/* 80610808 38 84 07 68 */ addi r4, r4, calc_mtx@l /* 0x80450768@l */ -/* 8061080C 80 84 00 00 */ lwz r4, 0(r4) -/* 80610810 4B D3 5C A1 */ bl PSMTXCopy -/* 80610814 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610818 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 8061081C 80 63 00 00 */ lwz r3, 0(r3) -/* 80610820 A8 9E 47 AA */ lha r4, 0x47aa(r30) -/* 80610824 4B 9F BC 11 */ bl mDoMtx_YrotM__FPA4_fs -/* 80610828 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 8061082C 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610830 80 63 00 00 */ lwz r3, 0(r3) -/* 80610834 80 9F 00 84 */ lwz r4, 0x84(r31) -/* 80610838 80 04 00 0C */ lwz r0, 0xc(r4) -/* 8061083C 7C 80 EA 14 */ add r4, r0, r29 -/* 80610840 4B D3 5C 71 */ bl PSMTXCopy -/* 80610844 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610848 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 8061084C 80 63 00 00 */ lwz r3, 0(r3) -/* 80610850 3C 80 80 43 */ lis r4, mCurrentMtx__6J3DSys@ha /* 0x80434BE4@ha */ -/* 80610854 38 84 4B E4 */ addi r4, r4, mCurrentMtx__6J3DSys@l /* 0x80434BE4@l */ -/* 80610858 4B D3 5C 59 */ bl PSMTXCopy -/* 8061085C 48 00 01 34 */ b lbl_80610990 -lbl_80610860: -/* 80610860 2C 04 00 06 */ cmpwi r4, 6 -/* 80610864 40 82 00 78 */ bne lbl_806108DC -/* 80610868 80 7F 00 84 */ lwz r3, 0x84(r31) -/* 8061086C 80 03 00 0C */ lwz r0, 0xc(r3) -/* 80610870 1F A4 00 30 */ mulli r29, r4, 0x30 -/* 80610874 7C 60 EA 14 */ add r3, r0, r29 -/* 80610878 3C 80 80 45 */ lis r4, calc_mtx@ha /* 0x80450768@ha */ -/* 8061087C 38 84 07 68 */ addi r4, r4, calc_mtx@l /* 0x80450768@l */ -/* 80610880 80 84 00 00 */ lwz r4, 0(r4) -/* 80610884 4B D3 5C 2D */ bl PSMTXCopy -/* 80610888 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 8061088C 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610890 80 63 00 00 */ lwz r3, 0(r3) -/* 80610894 A8 1E 47 AA */ lha r0, 0x47aa(r30) -/* 80610898 7C 00 00 D0 */ neg r0, r0 -/* 8061089C 7C 04 07 34 */ extsh r4, r0 -/* 806108A0 4B 9F BB 95 */ bl mDoMtx_YrotM__FPA4_fs -/* 806108A4 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 806108A8 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 806108AC 80 63 00 00 */ lwz r3, 0(r3) -/* 806108B0 80 9F 00 84 */ lwz r4, 0x84(r31) -/* 806108B4 80 04 00 0C */ lwz r0, 0xc(r4) -/* 806108B8 7C 80 EA 14 */ add r4, r0, r29 -/* 806108BC 4B D3 5B F5 */ bl PSMTXCopy -/* 806108C0 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 806108C4 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 806108C8 80 63 00 00 */ lwz r3, 0(r3) -/* 806108CC 3C 80 80 43 */ lis r4, mCurrentMtx__6J3DSys@ha /* 0x80434BE4@ha */ -/* 806108D0 38 84 4B E4 */ addi r4, r4, mCurrentMtx__6J3DSys@l /* 0x80434BE4@l */ -/* 806108D4 4B D3 5B DD */ bl PSMTXCopy -/* 806108D8 48 00 00 B8 */ b lbl_80610990 -lbl_806108DC: -/* 806108DC 2C 04 00 02 */ cmpwi r4, 2 -/* 806108E0 41 82 00 14 */ beq lbl_806108F4 -/* 806108E4 2C 04 00 04 */ cmpwi r4, 4 -/* 806108E8 41 82 00 0C */ beq lbl_806108F4 -/* 806108EC 2C 04 00 05 */ cmpwi r4, 5 -/* 806108F0 40 82 00 A0 */ bne lbl_80610990 -lbl_806108F4: -/* 806108F4 7C 9C 23 78 */ mr r28, r4 -/* 806108F8 2C 04 00 02 */ cmpwi r4, 2 -/* 806108FC 40 82 00 0C */ bne lbl_80610908 -/* 80610900 3B 80 00 00 */ li r28, 0 -/* 80610904 48 00 00 10 */ b lbl_80610914 -lbl_80610908: -/* 80610908 2C 04 00 04 */ cmpwi r4, 4 -/* 8061090C 41 80 00 08 */ blt lbl_80610914 -/* 80610910 3B 84 FF FD */ addi r28, r4, -3 -lbl_80610914: -/* 80610914 80 7F 00 84 */ lwz r3, 0x84(r31) -/* 80610918 80 03 00 0C */ lwz r0, 0xc(r3) -/* 8061091C 1F A4 00 30 */ mulli r29, r4, 0x30 -/* 80610920 7C 60 EA 14 */ add r3, r0, r29 -/* 80610924 3C 80 80 45 */ lis r4, calc_mtx@ha /* 0x80450768@ha */ -/* 80610928 38 84 07 68 */ addi r4, r4, calc_mtx@l /* 0x80450768@l */ -/* 8061092C 80 84 00 00 */ lwz r4, 0(r4) -/* 80610930 4B D3 5B 81 */ bl PSMTXCopy -/* 80610934 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610938 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 8061093C 80 63 00 00 */ lwz r3, 0(r3) -/* 80610940 57 80 08 3C */ slwi r0, r28, 1 -/* 80610944 7C 9E 02 14 */ add r4, r30, r0 -/* 80610948 A8 84 47 A4 */ lha r4, 0x47a4(r4) -/* 8061094C A8 1E 47 AC */ lha r0, 0x47ac(r30) -/* 80610950 7C 04 02 14 */ add r0, r4, r0 -/* 80610954 7C 04 07 34 */ extsh r4, r0 -/* 80610958 4B 9F BA DD */ bl mDoMtx_YrotM__FPA4_fs -/* 8061095C 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80610960 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610964 80 63 00 00 */ lwz r3, 0(r3) -/* 80610968 80 9F 00 84 */ lwz r4, 0x84(r31) -/* 8061096C 80 04 00 0C */ lwz r0, 0xc(r4) -/* 80610970 7C 80 EA 14 */ add r4, r0, r29 -/* 80610974 4B D3 5B 3D */ bl PSMTXCopy -/* 80610978 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 8061097C 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80610980 80 63 00 00 */ lwz r3, 0(r3) -/* 80610984 3C 80 80 43 */ lis r4, mCurrentMtx__6J3DSys@ha /* 0x80434BE4@ha */ -/* 80610988 38 84 4B E4 */ addi r4, r4, mCurrentMtx__6J3DSys@l /* 0x80434BE4@l */ -/* 8061098C 4B D3 5B 25 */ bl PSMTXCopy -lbl_80610990: -/* 80610990 38 60 00 01 */ li r3, 1 -/* 80610994 39 61 00 20 */ addi r11, r1, 0x20 -/* 80610998 4B D5 18 8D */ bl _restgpr_28 -/* 8061099C 80 01 00 24 */ lwz r0, 0x24(r1) -/* 806109A0 7C 08 03 A6 */ mtlr r0 -/* 806109A4 38 21 00 20 */ addi r1, r1, 0x20 -/* 806109A8 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/cam_3d_morf__FP10b_ob_classf.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/cam_3d_morf__FP10b_ob_classf.s deleted file mode 100644 index 74224a4bb54..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/cam_3d_morf__FP10b_ob_classf.s +++ /dev/null @@ -1,58 +0,0 @@ -lbl_806158E0: -/* 806158E0 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 806158E4 7C 08 02 A6 */ mflr r0 -/* 806158E8 90 01 00 24 */ stw r0, 0x24(r1) -/* 806158EC DB E1 00 10 */ stfd f31, 0x10(r1) -/* 806158F0 F3 E1 00 18 */ psq_st f31, 24(r1), 0, 0 /* qr0 */ -/* 806158F4 93 E1 00 0C */ stw r31, 0xc(r1) -/* 806158F8 7C 7F 1B 78 */ mr r31, r3 -/* 806158FC FF E0 08 90 */ fmr f31, f1 -/* 80615900 38 7F 5C 90 */ addi r3, r31, 0x5c90 -/* 80615904 C0 3F 5C A8 */ lfs f1, 0x5ca8(r31) -/* 80615908 FC 40 F8 90 */ fmr f2, f31 -/* 8061590C C0 7F 5C C0 */ lfs f3, 0x5cc0(r31) -/* 80615910 C0 1F 5C D0 */ lfs f0, 0x5cd0(r31) -/* 80615914 EC 63 00 32 */ fmuls f3, f3, f0 -/* 80615918 4B C5 A1 25 */ bl cLib_addCalc2__FPffff -/* 8061591C 38 7F 5C 94 */ addi r3, r31, 0x5c94 -/* 80615920 C0 3F 5C AC */ lfs f1, 0x5cac(r31) -/* 80615924 FC 40 F8 90 */ fmr f2, f31 -/* 80615928 C0 7F 5C C4 */ lfs f3, 0x5cc4(r31) -/* 8061592C C0 1F 5C D0 */ lfs f0, 0x5cd0(r31) -/* 80615930 EC 63 00 32 */ fmuls f3, f3, f0 -/* 80615934 4B C5 A1 09 */ bl cLib_addCalc2__FPffff -/* 80615938 38 7F 5C 98 */ addi r3, r31, 0x5c98 -/* 8061593C C0 3F 5C B0 */ lfs f1, 0x5cb0(r31) -/* 80615940 FC 40 F8 90 */ fmr f2, f31 -/* 80615944 C0 7F 5C C8 */ lfs f3, 0x5cc8(r31) -/* 80615948 C0 1F 5C D0 */ lfs f0, 0x5cd0(r31) -/* 8061594C EC 63 00 32 */ fmuls f3, f3, f0 -/* 80615950 4B C5 A0 ED */ bl cLib_addCalc2__FPffff -/* 80615954 38 7F 5C 84 */ addi r3, r31, 0x5c84 -/* 80615958 C0 3F 5C 9C */ lfs f1, 0x5c9c(r31) -/* 8061595C FC 40 F8 90 */ fmr f2, f31 -/* 80615960 C0 7F 5C B4 */ lfs f3, 0x5cb4(r31) -/* 80615964 C0 1F 5C D0 */ lfs f0, 0x5cd0(r31) -/* 80615968 EC 63 00 32 */ fmuls f3, f3, f0 -/* 8061596C 4B C5 A0 D1 */ bl cLib_addCalc2__FPffff -/* 80615970 38 7F 5C 88 */ addi r3, r31, 0x5c88 -/* 80615974 C0 3F 5C A0 */ lfs f1, 0x5ca0(r31) -/* 80615978 FC 40 F8 90 */ fmr f2, f31 -/* 8061597C C0 7F 5C B8 */ lfs f3, 0x5cb8(r31) -/* 80615980 C0 1F 5C D0 */ lfs f0, 0x5cd0(r31) -/* 80615984 EC 63 00 32 */ fmuls f3, f3, f0 -/* 80615988 4B C5 A0 B5 */ bl cLib_addCalc2__FPffff -/* 8061598C 38 7F 5C 8C */ addi r3, r31, 0x5c8c -/* 80615990 C0 3F 5C A4 */ lfs f1, 0x5ca4(r31) -/* 80615994 FC 40 F8 90 */ fmr f2, f31 -/* 80615998 C0 7F 5C BC */ lfs f3, 0x5cbc(r31) -/* 8061599C C0 1F 5C D0 */ lfs f0, 0x5cd0(r31) -/* 806159A0 EC 63 00 32 */ fmuls f3, f3, f0 -/* 806159A4 4B C5 A0 99 */ bl cLib_addCalc2__FPffff -/* 806159A8 E3 E1 00 18 */ psq_l f31, 24(r1), 0, 0 /* qr0 */ -/* 806159AC CB E1 00 10 */ lfd f31, 0x10(r1) -/* 806159B0 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 806159B4 80 01 00 24 */ lwz r0, 0x24(r1) -/* 806159B8 7C 08 03 A6 */ mtlr r0 -/* 806159BC 38 21 00 20 */ addi r1, r1, 0x20 -/* 806159C0 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/daB_OB_Delete__FP10b_ob_class.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/daB_OB_Delete__FP10b_ob_class.s deleted file mode 100644 index 136b54b74b3..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/daB_OB_Delete__FP10b_ob_class.s +++ /dev/null @@ -1,34 +0,0 @@ -lbl_806193BC: -/* 806193BC 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 806193C0 7C 08 02 A6 */ mflr r0 -/* 806193C4 90 01 00 14 */ stw r0, 0x14(r1) -/* 806193C8 93 E1 00 0C */ stw r31, 0xc(r1) -/* 806193CC 7C 7F 1B 78 */ mr r31, r3 -/* 806193D0 38 7F 05 AC */ addi r3, r31, 0x5ac -/* 806193D4 3C 80 80 62 */ lis r4, d_a_b_ob__stringBase0@ha /* 0x8061B09C@ha */ -/* 806193D8 38 84 B0 9C */ addi r4, r4, d_a_b_ob__stringBase0@l /* 0x8061B09C@l */ -/* 806193DC 4B A1 3C 2D */ bl dComIfG_resDelete__FP30request_of_phase_process_classPCc -/* 806193E0 88 1F 5D E0 */ lbz r0, 0x5de0(r31) -/* 806193E4 28 00 00 00 */ cmplwi r0, 0 -/* 806193E8 41 82 00 10 */ beq lbl_806193F8 -/* 806193EC 38 00 00 00 */ li r0, 0 -/* 806193F0 3C 60 80 62 */ lis r3, struct_8061B4FC+0x1@ha /* 0x8061B4FD@ha */ -/* 806193F4 98 03 B4 FD */ stb r0, struct_8061B4FC+0x1@l(r3) /* 0x8061B4FD@l */ -lbl_806193F8: -/* 806193F8 80 1F 00 F0 */ lwz r0, 0xf0(r31) -/* 806193FC 28 00 00 00 */ cmplwi r0, 0 -/* 80619400 41 82 00 20 */ beq lbl_80619420 -/* 80619404 38 7F 59 3C */ addi r3, r31, 0x593c -/* 80619408 4B CA 72 ED */ bl stopAnime__10Z2CreatureFv -/* 8061940C 38 7F 59 E0 */ addi r3, r31, 0x59e0 -/* 80619410 81 9F 59 E0 */ lwz r12, 0x59e0(r31) -/* 80619414 81 8C 00 08 */ lwz r12, 8(r12) -/* 80619418 7D 89 03 A6 */ mtctr r12 -/* 8061941C 4E 80 04 21 */ bctrl -lbl_80619420: -/* 80619420 38 60 00 01 */ li r3, 1 -/* 80619424 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80619428 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8061942C 7C 08 03 A6 */ mtlr r0 -/* 80619430 38 21 00 10 */ addi r1, r1, 0x10 -/* 80619434 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/dark__FP12J3DModelDatas.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/dark__FP12J3DModelDatas.s deleted file mode 100644 index ae281c23c97..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/dark__FP12J3DModelDatas.s +++ /dev/null @@ -1,50 +0,0 @@ -lbl_80610E2C: -/* 80610E2C 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80610E30 7C 08 02 A6 */ mflr r0 -/* 80610E34 90 01 00 24 */ stw r0, 0x24(r1) -/* 80610E38 39 61 00 20 */ addi r11, r1, 0x20 -/* 80610E3C 4B D5 13 9D */ bl _savegpr_28 -/* 80610E40 7C 7C 1B 78 */ mr r28, r3 -/* 80610E44 7C 9D 23 78 */ mr r29, r4 -/* 80610E48 7F A0 07 35 */ extsh. r0, r29 -/* 80610E4C 41 82 00 80 */ beq lbl_80610ECC -/* 80610E50 3B C0 00 00 */ li r30, 0 -/* 80610E54 48 00 00 68 */ b lbl_80610EBC -lbl_80610E58: -/* 80610E58 80 7C 00 60 */ lwz r3, 0x60(r28) -/* 80610E5C 57 C0 13 BA */ rlwinm r0, r30, 2, 0xe, 0x1d -/* 80610E60 7F E3 00 2E */ lwzx r31, r3, r0 -/* 80610E64 80 7F 00 2C */ lwz r3, 0x2c(r31) -/* 80610E68 38 80 00 00 */ li r4, 0 -/* 80610E6C 81 83 00 00 */ lwz r12, 0(r3) -/* 80610E70 81 8C 00 68 */ lwz r12, 0x68(r12) -/* 80610E74 7D 89 03 A6 */ mtctr r12 -/* 80610E78 4E 80 04 21 */ bctrl -/* 80610E7C B3 A3 00 00 */ sth r29, 0(r3) -/* 80610E80 80 7F 00 2C */ lwz r3, 0x2c(r31) -/* 80610E84 38 80 00 00 */ li r4, 0 -/* 80610E88 81 83 00 00 */ lwz r12, 0(r3) -/* 80610E8C 81 8C 00 68 */ lwz r12, 0x68(r12) -/* 80610E90 7D 89 03 A6 */ mtctr r12 -/* 80610E94 4E 80 04 21 */ bctrl -/* 80610E98 B3 A3 00 02 */ sth r29, 2(r3) -/* 80610E9C 80 7F 00 2C */ lwz r3, 0x2c(r31) -/* 80610EA0 38 80 00 00 */ li r4, 0 -/* 80610EA4 81 83 00 00 */ lwz r12, 0(r3) -/* 80610EA8 81 8C 00 68 */ lwz r12, 0x68(r12) -/* 80610EAC 7D 89 03 A6 */ mtctr r12 -/* 80610EB0 4E 80 04 21 */ bctrl -/* 80610EB4 B3 A3 00 04 */ sth r29, 4(r3) -/* 80610EB8 3B DE 00 01 */ addi r30, r30, 1 -lbl_80610EBC: -/* 80610EBC 57 C3 04 3E */ clrlwi r3, r30, 0x10 -/* 80610EC0 A0 1C 00 5C */ lhz r0, 0x5c(r28) -/* 80610EC4 7C 03 00 40 */ cmplw r3, r0 -/* 80610EC8 41 80 FF 90 */ blt lbl_80610E58 -lbl_80610ECC: -/* 80610ECC 39 61 00 20 */ addi r11, r1, 0x20 -/* 80610ED0 4B D5 13 55 */ bl _restgpr_28 -/* 80610ED4 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80610ED8 7C 08 03 A6 */ mtlr r0 -/* 80610EDC 38 21 00 20 */ addi r1, r1, 0x20 -/* 80610EE0 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/pl_check__FP10b_ob_classfs.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/pl_check__FP10b_ob_classfs.s deleted file mode 100644 index 9aeaf1807a5..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/pl_check__FP10b_ob_classfs.s +++ /dev/null @@ -1,53 +0,0 @@ -lbl_806131A8: -/* 806131A8 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 806131AC 7C 08 02 A6 */ mflr r0 -/* 806131B0 90 01 00 24 */ stw r0, 0x24(r1) -/* 806131B4 DB E1 00 18 */ stfd f31, 0x18(r1) -/* 806131B8 39 61 00 18 */ addi r11, r1, 0x18 -/* 806131BC 4B D4 F0 21 */ bl _savegpr_29 -/* 806131C0 7C 7F 1B 78 */ mr r31, r3 -/* 806131C4 FF E0 08 90 */ fmr f31, f1 -/* 806131C8 7C 9D 23 78 */ mr r29, r4 -/* 806131CC 3C 80 80 40 */ lis r4, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 806131D0 38 84 61 C0 */ addi r4, r4, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 806131D4 80 84 5D AC */ lwz r4, 0x5dac(r4) -/* 806131D8 7C 9E 23 78 */ mr r30, r4 -/* 806131DC 4B A0 76 05 */ bl fopAcM_searchActorDistance__FPC10fopAc_ac_cPC10fopAc_ac_c -/* 806131E0 FC 01 F8 40 */ fcmpo cr0, f1, f31 -/* 806131E4 40 80 00 6C */ bge lbl_80613250 -/* 806131E8 A8 7F 47 6C */ lha r3, 0x476c(r31) -/* 806131EC A8 1F 04 DE */ lha r0, 0x4de(r31) -/* 806131F0 7C 03 00 50 */ subf r0, r3, r0 -/* 806131F4 7C 04 07 34 */ extsh r4, r0 -/* 806131F8 A8 7F 47 6E */ lha r3, 0x476e(r31) -/* 806131FC A8 1F 04 DC */ lha r0, 0x4dc(r31) -/* 80613200 7C 03 00 50 */ subf r0, r3, r0 -/* 80613204 7C 05 07 34 */ extsh r5, r0 -/* 80613208 7F A3 07 34 */ extsh r3, r29 -/* 8061320C 7C 04 18 00 */ cmpw r4, r3 -/* 80613210 40 80 00 40 */ bge lbl_80613250 -/* 80613214 7C 03 00 D0 */ neg r0, r3 -/* 80613218 7C 00 07 34 */ extsh r0, r0 -/* 8061321C 7C 04 00 00 */ cmpw r4, r0 -/* 80613220 40 81 00 30 */ ble lbl_80613250 -/* 80613224 7C 05 18 00 */ cmpw r5, r3 -/* 80613228 40 80 00 28 */ bge lbl_80613250 -/* 8061322C 7C 05 00 00 */ cmpw r5, r0 -/* 80613230 40 81 00 20 */ ble lbl_80613250 -/* 80613234 7F E3 FB 78 */ mr r3, r31 -/* 80613238 7F C4 F3 78 */ mr r4, r30 -/* 8061323C 4B A0 9B C1 */ bl fopAcM_otherBgCheck__FPC10fopAc_ac_cPC10fopAc_ac_c -/* 80613240 2C 03 00 00 */ cmpwi r3, 0 -/* 80613244 40 82 00 0C */ bne lbl_80613250 -/* 80613248 38 60 00 01 */ li r3, 1 -/* 8061324C 48 00 00 08 */ b lbl_80613254 -lbl_80613250: -/* 80613250 38 60 00 00 */ li r3, 0 -lbl_80613254: -/* 80613254 CB E1 00 18 */ lfd f31, 0x18(r1) -/* 80613258 39 61 00 18 */ addi r11, r1, 0x18 -/* 8061325C 4B D4 EF CD */ bl _restgpr_29 -/* 80613260 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80613264 7C 08 03 A6 */ mtlr r0 -/* 80613268 38 21 00 20 */ addi r1, r1, 0x20 -/* 8061326C 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_bf_sub__FPvPv.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_bf_sub__FPvPv.s deleted file mode 100644 index 0fe8b06f91f..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_bf_sub__FPvPv.s +++ /dev/null @@ -1,24 +0,0 @@ -lbl_80611C20: -/* 80611C20 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80611C24 7C 08 02 A6 */ mflr r0 -/* 80611C28 90 01 00 14 */ stw r0, 0x14(r1) -/* 80611C2C 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80611C30 7C 7F 1B 78 */ mr r31, r3 -/* 80611C34 4B A0 70 AD */ bl fopAc_IsActor__FPv -/* 80611C38 2C 03 00 00 */ cmpwi r3, 0 -/* 80611C3C 41 82 00 24 */ beq lbl_80611C60 -/* 80611C40 A8 1F 00 08 */ lha r0, 8(r31) -/* 80611C44 2C 00 02 02 */ cmpwi r0, 0x202 -/* 80611C48 40 82 00 18 */ bne lbl_80611C60 -/* 80611C4C 3C 60 80 62 */ lis r3, bf_ct@ha /* 0x8061B53C@ha */ -/* 80611C50 38 83 B5 3C */ addi r4, r3, bf_ct@l /* 0x8061B53C@l */ -/* 80611C54 80 64 00 00 */ lwz r3, 0(r4) -/* 80611C58 38 03 00 01 */ addi r0, r3, 1 -/* 80611C5C 90 04 00 00 */ stw r0, 0(r4) -lbl_80611C60: -/* 80611C60 38 60 00 00 */ li r3, 0 -/* 80611C64 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80611C68 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80611C6C 7C 08 03 A6 */ mtlr r0 -/* 80611C70 38 21 00 10 */ addi r1, r1, 0x10 -/* 80611C74 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_bfdel_sub__FPvPv.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_bfdel_sub__FPvPv.s deleted file mode 100644 index 070be7b9bc1..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_bfdel_sub__FPvPv.s +++ /dev/null @@ -1,21 +0,0 @@ -lbl_80611C78: -/* 80611C78 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80611C7C 7C 08 02 A6 */ mflr r0 -/* 80611C80 90 01 00 14 */ stw r0, 0x14(r1) -/* 80611C84 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80611C88 7C 7F 1B 78 */ mr r31, r3 -/* 80611C8C 4B A0 70 55 */ bl fopAc_IsActor__FPv -/* 80611C90 2C 03 00 00 */ cmpwi r3, 0 -/* 80611C94 41 82 00 18 */ beq lbl_80611CAC -/* 80611C98 A8 1F 00 08 */ lha r0, 8(r31) -/* 80611C9C 2C 00 02 02 */ cmpwi r0, 0x202 -/* 80611CA0 40 82 00 0C */ bne lbl_80611CAC -/* 80611CA4 7F E3 FB 78 */ mr r3, r31 -/* 80611CA8 4B A0 7F D5 */ bl fopAcM_delete__FP10fopAc_ac_c -lbl_80611CAC: -/* 80611CAC 38 60 00 00 */ li r3, 0 -/* 80611CB0 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80611CB4 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80611CB8 7C 08 03 A6 */ mtlr r0 -/* 80611CBC 38 21 00 10 */ addi r1, r1, 0x10 -/* 80611CC0 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_hasidel_sub__FPvPv.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_hasidel_sub__FPvPv.s deleted file mode 100644 index 0083c72bb60..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_hasidel_sub__FPvPv.s +++ /dev/null @@ -1,21 +0,0 @@ -lbl_806159C4: -/* 806159C4 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 806159C8 7C 08 02 A6 */ mflr r0 -/* 806159CC 90 01 00 14 */ stw r0, 0x14(r1) -/* 806159D0 93 E1 00 0C */ stw r31, 0xc(r1) -/* 806159D4 7C 7F 1B 78 */ mr r31, r3 -/* 806159D8 4B A0 33 09 */ bl fopAc_IsActor__FPv -/* 806159DC 2C 03 00 00 */ cmpwi r3, 0 -/* 806159E0 41 82 00 18 */ beq lbl_806159F8 -/* 806159E4 A8 1F 00 08 */ lha r0, 8(r31) -/* 806159E8 2C 00 00 6D */ cmpwi r0, 0x6d -/* 806159EC 40 82 00 0C */ bne lbl_806159F8 -/* 806159F0 7F E3 FB 78 */ mr r3, r31 -/* 806159F4 4B A0 42 89 */ bl fopAcM_delete__FP10fopAc_ac_c -lbl_806159F8: -/* 806159F8 38 60 00 00 */ li r3, 0 -/* 806159FC 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80615A00 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80615A04 7C 08 03 A6 */ mtlr r0 -/* 80615A08 38 21 00 10 */ addi r1, r1, 0x10 -/* 80615A0C 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_kaisoudel_sub__FPvPv.s b/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_kaisoudel_sub__FPvPv.s deleted file mode 100644 index 4da38869fe9..00000000000 --- a/asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_kaisoudel_sub__FPvPv.s +++ /dev/null @@ -1,21 +0,0 @@ -lbl_80611CC4: -/* 80611CC4 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80611CC8 7C 08 02 A6 */ mflr r0 -/* 80611CCC 90 01 00 14 */ stw r0, 0x14(r1) -/* 80611CD0 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80611CD4 7C 7F 1B 78 */ mr r31, r3 -/* 80611CD8 4B A0 70 09 */ bl fopAc_IsActor__FPv -/* 80611CDC 2C 03 00 00 */ cmpwi r3, 0 -/* 80611CE0 41 82 00 18 */ beq lbl_80611CF8 -/* 80611CE4 A8 1F 00 08 */ lha r0, 8(r31) -/* 80611CE8 2C 00 00 6A */ cmpwi r0, 0x6a -/* 80611CEC 40 82 00 0C */ bne lbl_80611CF8 -/* 80611CF0 7F E3 FB 78 */ mr r3, r31 -/* 80611CF4 4B A0 7F 89 */ bl fopAcM_delete__FP10fopAc_ac_c -lbl_80611CF8: -/* 80611CF8 38 60 00 00 */ li r3, 0 -/* 80611CFC 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80611D00 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80611D04 7C 08 03 A6 */ mtlr r0 -/* 80611D08 38 21 00 10 */ addi r1, r1, 0x10 -/* 80611D0C 4E 80 00 20 */ blr diff --git a/include/JSystem/JParticle/JPAEmitter.h b/include/JSystem/JParticle/JPAEmitter.h index 1d3ff569133..c82839360f1 100644 --- a/include/JSystem/JParticle/JPAEmitter.h +++ b/include/JSystem/JParticle/JPAEmitter.h @@ -83,6 +83,7 @@ enum { JPAEmtrStts_FirstEmit = 0x10, JPAEmtrStts_RateStepEmit = 0x20, JPAEmtrStts_Immortal = 0x40, + JPAEmtrStts_Delete = 0x100, }; /** @@ -169,6 +170,7 @@ public: void playCreateParticle() { clearStatus(JPAEmtrStts_StopEmit); } void becomeImmortalEmitter() { setStatus(JPAEmtrStts_Immortal); } void becomeContinuousParticle() { mMaxFrame = 0; } + void becomeDeleteEmitter() { setStatus(JPAEmtrStts_Delete); } void becomeInvalidEmitter() { stopCreateParticle(); mMaxFrame = 1; diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index 6f46d277e29..66a7ecb317f 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -656,6 +656,10 @@ inline s16 fopAcM_searchPlayerAngleY(const fopAc_ac_c* actor) { return fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0)); } +inline s16 fopAcM_searchPlayerAngleX(const fopAc_ac_c* actor) { + return fopAcM_searchActorAngleX(actor, dComIfGp_getPlayer(0)); +} + inline f32 fopAcM_searchPlayerDistanceY(const fopAc_ac_c* actor) { return fopAcM_searchActorDistanceY(actor, dComIfGp_getPlayer(0)); } diff --git a/include/rel/d/a/b/d_a_b_ob/d_a_b_ob.h b/include/rel/d/a/b/d_a_b_ob/d_a_b_ob.h index 430497a5977..555ee1aec38 100644 --- a/include/rel/d/a/b/d_a_b_ob/d_a_b_ob.h +++ b/include/rel/d/a/b/d_a_b_ob/d_a_b_ob.h @@ -8,29 +8,56 @@ #include "d/cc/d_cc_d.h" #include "d/cc/d_cc_uty.h" -struct ob_part_s { - /* 8061A658 */ ~ob_part_s(); - /* 8061A72C */ ob_part_s(); +enum b_ob_action { + // Phase 1 + OB_ACTION_CORE_START, + OB_ACTION_CORE_HAND_MOVE, + OB_ACTION_BOMBFISH_SET, + OB_ACTION_CORE_HOOK, + OB_ACTION_CORE_CHANCE, + OB_ACTION_CORE_END, - /* 0x00 */ mDoExt_McaMorf* field_0x0; - /* 0x04 */ mDoExt_McaMorf* field_0x4; - /* 0x08 */ mDoExt_McaMorf* field_0x8; - /* 0x0C */ mDoExt_McaMorf* field_0xc; - /* 0x10 */ mDoExt_McaMorf* field_0x10; - /* 0x14 */ cXyz field_0x14; - /* 0x20 */ csXyz field_0x20; + // Phase 2 + OB_ACTION_FISH_NORMAL = 100, + OB_ACTION_FISH_VACUME, + OB_ACTION_FISH_END, +}; + +enum b_oh_anm { + OB_ANM_APPEAR = 0x12, + OB_ANM_APPEAR_2, + OB_ANM_DEAD, + OB_ANM_EAT, + OB_ANM_EAT_2, + OB_ANM_LAST_DAMAGE, + OB_ANM_OPEN_MOUTH, + OB_ANM_OPEN_MOUTH_WAIT, + OB_ANM_SWALLOW, + OB_ANM_SWIM_WAIT, + OB_ANM_TENTACLE_END, + OB_ANM_THROWUP, + OB_ANM_WAIT, +}; + +struct ob_part_s { + /* 0x00 */ mDoExt_McaMorf* mpMorf; + /* 0x04 */ mDoExt_McaMorf* mpFinMorf; + /* 0x08 */ mDoExt_McaMorf* mpFinUnkMorf; + /* 0x0C */ mDoExt_McaMorf* mpFinBMorf; + /* 0x10 */ mDoExt_McaMorf* mpFinCMorf; + /* 0x14 */ cXyz mPos; + /* 0x20 */ csXyz mAngle; /* 0x26 */ s16 field_0x26; - /* 0x28 */ f32 field_0x28; - /* 0x2C */ csXyz field_0x2c; - /* 0x32 */ csXyz field_0x32; - /* 0x38 */ csXyz field_0x38; + /* 0x28 */ f32 mSize; + /* 0x2C */ csXyz mFinARot; + /* 0x32 */ csXyz mFinBRot; + /* 0x38 */ csXyz mFinCRot; + /* 0x3E */ s8 field_0x3e; + /* 0x3F */ s8 mHide; /* 0x40 */ dCcD_Sph mSph; }; // Size: 0x178 struct ob_ke_s { - /* 8061A3A0 */ ~ob_ke_s(); - /* 8061A41C */ ob_ke_s(); - /* 0x000 */ cXyz field_0x0[20]; /* 0x0F0 */ cXyz field_0xf0[20]; /* 0x1E0 */ cXyz field_0x1e0; @@ -40,102 +67,95 @@ struct ob_ke_s { * @ingroup actors-enemies * @brief Morpheel (body) * - * Lakebed Temple dungeon boss. This is the body part of the boss. + * Lakebed Temple dungeon boss. This is the core/body part of the boss. * */ class b_ob_class : public fopEn_enemy_c { public: - /* 8061A0C0 */ b_ob_class(); - /* 0x05AC */ request_of_phase_process_class mPhase; - /* 0x05B4 */ mDoExt_McaMorfSO* field_0x5b4; - /* 0x05B8 */ u8 field_0x5b8[0x5BC - 0x5B8]; - /* 0x05BC */ f32 field_0x5bc; - /* 0x05C0 */ ob_part_s mParts[20]; + /* 0x05B4 */ mDoExt_McaMorfSO* mpCoreMorf; + /* 0x05B8 */ s8 mHideCore; + /* 0x05BC */ f32 mBossLightScale; + /* 0x05C0 */ ob_part_s mBodyParts[20]; /* 0x2320 */ int field_0x2320; /* 0x2324 */ cXyz field_0x2324[512]; /* 0x3B24 */ csXyz field_0x3b24[512]; - /* 0x4724 */ J3DModel* field_0x4724; - /* 0x4728 */ mDoExt_btkAnm* field_0x4728; - /* 0x472C */ mDoExt_brkAnm* field_0x472c; - /* 0x4730 */ f32 field_0x4730; - /* 0x4734 */ int mAnmResID; - /* 0x4738 */ int field_0x4738; - /* 0x4738 */ u8 field_0x473c; + /* 0x4724 */ J3DModel* mpSuiModel; + /* 0x4728 */ mDoExt_btkAnm* mpSuiBtk; + /* 0x472C */ mDoExt_brkAnm* mpSuiBrk; + /* 0x4730 */ f32 mSuiBrkFrame; + /* 0x4734 */ int mAnmID; + /* 0x4738 */ int mCoreAnm; + /* 0x4738 */ u8 mCoreAnmMode; /* 0x4740 */ f32 field_0x4740; /* 0x4744 */ s8 field_0x4744; - /* 0x4745 */ u8 field_0x4745; - /* 0x4748 */ u32 field_0x4748; - /* 0x474C */ u8 field_0x474c; - /* 0x474D */ u8 field_0x474d; - /* 0x474E */ u8 field_0x474e[0x4750 - 0x474e]; + /* 0x4745 */ s8 mDrawShadow; + /* 0x4748 */ u32 mShadowKey; + /* 0x474C */ s8 mCoreBattleMode; + /* 0x474D */ s8 mFishBattleMode; + /* 0x474E */ u8 mAttnOffTimer; /* 0x4750 */ s16 field_0x4750; - /* 0x4752 */ s16 field_0x4752; - /* 0x4754 */ s16 field_0x4754; + /* 0x4752 */ s16 mAction; + /* 0x4754 */ s16 mMode; /* 0x4756 */ s16 field_0x4756; - /* 0x4758 */ cXyz field_0x4758; - /* 0x4764 */ csXyz field_0x4764; + /* 0x4758 */ cXyz mTargetMovePos; + /* 0x4764 */ csXyz mMoveAngle; /* 0x476A */ s16 field_0x476a; /* 0x476C */ s16 mYAngleToPlayer; /* 0x476E */ s16 mXAngleToPlayer; /* 0x4770 */ f32 mDistToPlayer; /* 0x4774 */ u8 field_0x4774[0x4778 - 0x4774]; - /* 0x4778 */ s16 field_0x4778; - /* 0x477A */ s16 field_0x477a; - /* 0x477C */ s16 field_0x477c; - /* 0x477E */ s16 field_0x477e; - /* 0x4780 */ s16 field_0x4780; - /* 0x4782 */ u8 field_0x4782[0x4784 - 0x4782]; - /* 0x05AC */ s16 field_0x4784; + /* 0x4778 */ s16 mTimers[6]; + /* 0x05AC */ s16 mHitIFrameTimer; /* 0x4786 */ u8 field_0x4786[0x4788 - 0x4786]; - /* 0x4788 */ int field_0x4788; + /* 0x4788 */ int mCoreHandNo; /* 0x478C */ int field_0x478c; /* 0x4790 */ int field_0x4790; /* 0x4794 */ s16 field_0x4794; /* 0x4798 */ f32 field_0x4798; /* 0x479C */ f32 field_0x479c; /* 0x47A0 */ f32 field_0x47a0; - /* 0x47A4 */ u8 field_0x47a4[0x47aa - 0x47a4]; + /* 0x47A4 */ s16 field_0x47a4[3]; /* 0x47AA */ s16 field_0x47aa; /* 0x47AC */ s16 field_0x47ac; /* 0x47AE */ s16 field_0x47ae; /* 0x47B0 */ s16 field_0x47b0; /* 0x47B4 */ int field_0x47b4; - /* 0x47B8 */ s16 field_0x47b8; + /* 0x47B8 */ s16 mHangTimer; /* 0x47BA */ s16 field_0x47ba; /* 0x47BC */ s16 field_0x47bc; /* 0x47C0 */ f32 field_0x47c0; /* 0x47C4 */ s16 field_0x47c4; - /* 0x47C8 */ int field_0x47c8; - /* 0x47CC */ dCcD_Stts field_0x47cc; + /* 0x47C8 */ int mDemoMovePosIdx; + /* 0x47CC */ dCcD_Stts mCoreCcStts; /* 0x4808 */ dCcD_Sph mCcSph; /* 0x4940 */ dCcD_Sph mCoreSph; /* 0x4A78 */ dCcU_AtInfo mAtInfo; /* 0x4A9C */ u8 field_0x4a9c[0x4aa0 - 0x4a9c]; - /* 0x4AA0 */ dCcD_Stts field_0x4aa0; + /* 0x4AA0 */ dCcD_Stts mBodyCcStts; /* 0x4ADC */ dCcD_Sph mBodySph; - /* 0x4C14 */ dCcD_Sph field_0x4c14; - /* 0x4D4C */ dBgS_AcchCir field_0x4d4c; - /* 0x4D8C */ dBgS_ObjAcch field_0x4d8c; + /* 0x4C14 */ dCcD_Sph mFishHeadSph; + /* 0x4D4C */ dBgS_AcchCir mAcchCir; + /* 0x4D8C */ dBgS_ObjAcch mAcch; /* 0x4F64 */ u32 mTentacleActorIDs[8]; /* 0x4F84 */ ob_ke_s field_0x4f84[5]; /* 0x5920 */ mDoExt_3DlineMat0_c field_0x5920; - /* 0x593C */ Z2CreatureEnemy field_0x593c; - /* 0x59E0 */ Z2CreatureOI field_0x59e0; + /* 0x593C */ Z2CreatureEnemy mSound; + /* 0x59E0 */ Z2CreatureOI mOISound; /* 0x5BE4 */ cXyz field_0x5be4[13]; /* 0x5C80 */ s16 mDemoAction; - /* 0x5C82 */ s16 field_0x5c82; - /* 0x5C84 */ cXyz field_0x5c84; - /* 0x5C90 */ cXyz field_0x5c90; - /* 0x5C9C */ cXyz field_0x5c9c; - /* 0x5CA8 */ cXyz field_0x5ca8; + /* 0x5C82 */ s16 mDemoActionTimer; + /* 0x5C84 */ cXyz mDemoCamEye; + /* 0x5C90 */ cXyz mDemoCamCenter; + /* 0x5C9C */ cXyz mDemoCamEyeTarget; + /* 0x5CA8 */ cXyz mDemoCamCenterTarget; /* 0x5CB4 */ f32 field_0x5cb4; /* 0x5CB8 */ f32 field_0x5cb8; /* 0x5CBC */ f32 field_0x5cbc; /* 0x5CC0 */ f32 field_0x5cc0; /* 0x5CC4 */ f32 field_0x5cc4; /* 0x5CC8 */ f32 field_0x5cc8; - /* 0x5CCC */ f32 field_0x5ccc; + /* 0x5CCC */ f32 mDemoCamFovy; /* 0x5CD0 */ f32 field_0x5cd0; /* 0x5CD4 */ f32 field_0x5cd4; /* 0x5CD8 */ f32 field_0x5cd8; @@ -149,28 +169,23 @@ public: /* 0x5D00 */ f32 field_0x5d00; /* 0x5D04 */ f32 field_0x5d04; /* 0x5D08 */ s16 field_0x5d08; - /* 0x5D0A */ s16 field_0x5d0a; - /* 0x5D0C */ s16 field_0x5d0c; + /* 0x5D0A */ s16 mBlureRate; + /* 0x5D0C */ s16 mBlureRateTarget; /* 0x5D0E */ u8 field_0x5d0e[0x5d10 - 0x5d0e]; /* 0x5D10 */ u8 field_0x5d10; - /* 0x5D11 */ s8 field_0x5d11; - /* 0x5D12 */ s8 field_0x5d12; + /* 0x5D11 */ s8 mHangHitCount; + /* 0x5D12 */ s8 mHangFinishCount; + /* 0x5D12 */ s8 field_0x5d13; /* 0x5D14 */ f32 field_0x5d14; /* 0x5D18 */ u8 field_0x5d18; /* 0x5D19 */ u8 field_0x5d19[0x5d24 - 0x5d19]; - /* 0x5D24 */ u32 field_0x5d24[3]; - /* 0x5D30 */ u8 field_0x5d30[0x5d38 - 0x5D30]; + /* 0x5D24 */ u32 field_0x5d24[5]; /* 0x5D38 */ u32 field_0x5d38; - /* 0x5D3C */ s16 field_0x5d3c; - /* 0x5D40 */ u32 field_0x5d40; - /* 0x5D44 */ u8 field_0x5d44[0x5d88 - 0x5d44]; - /* 0x5D88 */ u32 field_0x5d88; - /* 0x5D8C */ u32 field_0x5d8c; - /* 0x5D90 */ u8 field_0x5d90[0x5dd4 - 0x5d90]; - /* 0x5DD4 */ u32 field_0x5dd4; + /* 0x5D3C */ s16 mZoneSwTimer; + /* 0x5D40 */ JPABaseEmitter* field_0x5d40[2][19]; /* 0x5DD8 */ int field_0x5dd8; - /* 0x5DDC */ f32 field_0x5ddc; - /* 0x5DE0 */ u8 field_0x5de0; + /* 0x5DDC */ f32 mColsetBlend; + /* 0x5DE0 */ u8 mHIOInit; }; #endif /* D_A_B_OB_H */ diff --git a/include/rel/d/a/b/d_a_b_oh/d_a_b_oh.h b/include/rel/d/a/b/d_a_b_oh/d_a_b_oh.h index b790e213dc7..fc5862ebc90 100644 --- a/include/rel/d/a/b/d_a_b_oh/d_a_b_oh.h +++ b/include/rel/d/a/b/d_a_b_oh/d_a_b_oh.h @@ -16,6 +16,15 @@ public: /* 0xC */ f32 mLength; }; +enum b_oh_action { + OH_ACTION_START, + OH_ACTION_WAIT, + OH_ACTION_ATTACK, + OH_ACTION_CAUGHT, + OH_ACTION_END = 10, + OH_ACTION_NON = 11, +}; + /** * @ingroup actors-enemies * @brief Morpheel (head) @@ -79,7 +88,10 @@ public: /* 0x0CB0 */ dCcD_Stts mCcStts; /* 0x0CEC */ dCcD_Sph mColliders[15]; /* 0x1F34 */ dCcU_AtInfo mAtInfo; - /* 0x1F58 */ u8 field_0x1F58[0x1F80 - 0x1F58]; + /* 0x1F58 */ u8 field_0x1F58[0x1F68 - 0x1F58]; + /* 0x1F68 */ cXyz field_0x1f68; + /* 0x1F74 */ csXyz field_0x1f74; + /* 0x1F7C */ f32 field_0x1f7c; /* 0x1F80 */ u32 field_0x1f80; /* 0x1F84 */ u8 field_0x1F84[0x1F86 - 0x1F84]; /* 0x1F86 */ u8 field_0x1f86; diff --git a/include/rel/d/a/b/d_a_b_oh2/d_a_b_oh2.h b/include/rel/d/a/b/d_a_b_oh2/d_a_b_oh2.h index 45c87a04d41..9c0163bbe1f 100644 --- a/include/rel/d/a/b/d_a_b_oh2/d_a_b_oh2.h +++ b/include/rel/d/a/b/d_a_b_oh2/d_a_b_oh2.h @@ -1,7 +1,8 @@ #ifndef D_A_B_OH2_H #define D_A_B_OH2_H -#include "rel/d/a/b/d_a_b_ob/d_a_b_ob.h" +#include "f_op/f_op_actor_mng.h" +#include "Z2AudioLib/Z2Creature.h" /** * @ingroup actors-enemies diff --git a/include/rel/d/a/obj/d_a_obj_lv3WaterB/d_a_obj_lv3WaterB.h b/include/rel/d/a/obj/d_a_obj_lv3WaterB/d_a_obj_lv3WaterB.h index a33afc9acf1..31dfebae432 100644 --- a/include/rel/d/a/obj/d_a_obj_lv3WaterB/d_a_obj_lv3WaterB.h +++ b/include/rel/d/a/obj/d_a_obj_lv3WaterB/d_a_obj_lv3WaterB.h @@ -3,6 +3,12 @@ #include "f_op/f_op_actor_mng.h" +enum obj_lv3waterB_action { + LV3WATERB_ACT_WAIT, + LV3WATERB_ACT_REMOVE, + LV3WATERB_ACT_END, +}; + class obj_lv3WaterB_class : public fopAc_ac_c { public: /* 0x568 */ request_of_phase_process_class mBWaterPhase; diff --git a/rel/d/a/b/d_a_b_ob/d_a_b_ob.cpp b/rel/d/a/b/d_a_b_ob/d_a_b_ob.cpp index a120001a10c..5865738745b 100644 --- a/rel/d/a/b/d_a_b_ob/d_a_b_ob.cpp +++ b/rel/d/a/b/d_a_b_ob/d_a_b_ob.cpp @@ -1,28 +1,37 @@ -// -// Generated By: dol2asm -// Translation Unit: d_a_b_ob -// +/** + * d_a_b_ob.cpp + * Morpheel Boss (Core/Body) + */ #include "rel/d/a/b/d_a_b_ob/d_a_b_ob.h" +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "SSystem/SComponent/c_math.h" +#include "c/c_damagereaction.h" +#include "cmath.h" +#include "d/a/d_a_player.h" #include "d/com/d_com_inf_game.h" +#include "d/s/d_s_play.h" #include "dol2asm.h" +#include "f_op/f_op_msg_mng.h" +#include "m_Do/m_Do_controller_pad.h" #include "m_Do/m_Do_graphic.h" +#include "rel/d/a/b/d_a_b_oh/d_a_b_oh.h" +#include "rel/d/a/obj/d_a_obj_lv3WaterB/d_a_obj_lv3WaterB.h" +#include "rel/d/a/obj/d_a_obj_ystone/d_a_obj_ystone.h" -// -// Types: -// - -namespace std { -/* 8061AACC */ void fabsf(f32); -}; - -struct obj_ystone_class { - /* 8061AA70 */ void setCurrentPos(cXyz); -}; - -struct daB_OB_HIO_c { +class daB_OB_HIO_c { +public: /* 8061056C */ daB_OB_HIO_c(); - /* 8061A808 */ ~daB_OB_HIO_c(); + /* 8061A808 */ virtual ~daB_OB_HIO_c(); + + /* 0x04 */ s8 field_0x04; + /* 0x08 */ f32 mCoreSize; + /* 0x0C */ f32 mCoreMoveSpeed; + /* 0x10 */ f32 mBodySize; + /* 0x14 */ s16 mLightR; + /* 0x16 */ s16 mLightG; + /* 0x18 */ s16 mLightB; + /* 0x1C */ f32 mRange; }; // @@ -357,22 +366,15 @@ SECTION_DATA static u8 iso_eff_5401[10 + 2 /* padding */] = { }; /* 8061B0D0-8061B11C 00002C 004C+00 1/1 0/0 0/0 .data buf_p */ -SECTION_DATA static u8 buf_p[76] = { - 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, - 0x40, 0x80, 0x00, 0x00, 0x40, 0xA0, 0x00, 0x00, 0x40, 0xC0, 0x00, 0x00, 0x40, 0xE0, 0x00, 0x00, - 0x41, 0x00, 0x00, 0x00, 0x41, 0x0C, 0xCC, 0xCD, 0x41, 0x19, 0x99, 0x9A, 0x41, 0x26, 0x66, 0x66, - 0x41, 0x33, 0x33, 0x33, 0x41, 0x40, 0x00, 0x00, 0x41, 0x49, 0x99, 0x9A, 0x41, 0x53, 0x33, 0x33, - 0x41, 0x5C, 0xCC, 0xCD, 0x41, 0x66, 0x66, 0x66, 0x41, 0x70, 0x00, 0x00, +SECTION_DATA static f32 buf_p[] = { + 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 8.8f, + 9.6f, 10.4f, 11.2f, 12.0f, 12.6f, 13.2f, 13.8f, 14.4f, 15.0f, }; /* 8061B11C-8061B168 000078 004C+00 1/1 0/0 0/0 .data size_p */ -SECTION_DATA static u8 size_p[76] = { - 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x86, 0x66, 0x66, 0x3F, 0x89, 0x99, 0x9A, 0x3F, 0x8C, 0xCC, 0xCD, - 0x3F, 0x8C, 0xCC, 0xCD, 0x3F, 0x89, 0x99, 0x9A, 0x3F, 0x86, 0x66, 0x66, 0x3F, 0x80, 0x00, 0x00, - 0x3F, 0x66, 0x66, 0x66, 0x3F, 0x59, 0x99, 0x9A, 0x3F, 0x4C, 0xCC, 0xCD, 0x3F, 0x40, 0x00, 0x00, - 0x3F, 0x33, 0x33, 0x33, 0x3F, 0x26, 0x66, 0x66, 0x3F, 0x19, 0x99, 0x9A, 0x3F, 0x0C, 0xCC, 0xCD, - 0x3F, 0x00, 0x00, 0x00, 0x3E, 0xE6, 0x66, 0x66, 0x3F, 0x80, 0x00, 0x00, -}; +SECTION_DATA static f32 size_p[] = {1.0f, 1.05f, 1.075f, 1.1f, 1.1f, 1.075f, 1.05f, + 1.0f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, + 0.6f, 0.55f, 0.5f, 0.45f, 1.0f}; /* 8061B168-8061B174 0000C4 000A+02 1/1 0/0 0/0 .data ex_eff$6145 */ SECTION_DATA static u8 ex_eff[10 + 2 /* padding */] = { @@ -520,14 +522,14 @@ SECTION_DATA static u8 p_bmd[76] = { #pragma force_active on static dCcD_SrcSph cc_sph_src = { { - {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj - {dCcD_SE_METAL, 0x0, 0x2, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf + {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_METAL, 0x0, 0x2, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf { - {{0.0f, 0.0f, 0.0f}, 50.0f} // mSph - } // mSphAttr + {{0.0f, 0.0f, 0.0f}, 50.0f} // mSph + } // mSphAttr }; #pragma pop @@ -536,14 +538,14 @@ static dCcD_SrcSph cc_sph_src = { #pragma force_active on static dCcD_SrcSph body_sph_src = { { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x3}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x3}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf { - {{0.0f, 0.0f, 0.0f}, 60.0f} // mSph - } // mSphAttr + {{0.0f, 0.0f, 0.0f}, 60.0f} // mSph + } // mSphAttr }; #pragma pop @@ -552,14 +554,14 @@ static dCcD_SrcSph body_sph_src = { #pragma force_active on static dCcD_SrcSph parts_sph_src = { { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x3}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x3}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf { - {{0.0f, 0.0f, 0.0f}, 60.0f} // mSph - } // mSphAttr + {{0.0f, 0.0f, 0.0f}, 60.0f} // mSph + } // mSphAttr }; #pragma pop @@ -568,14 +570,14 @@ static dCcD_SrcSph parts_sph_src = { #pragma force_active on static dCcD_SrcSph core_sph_src = { { - {0x0, {{0x0, 0x0, 0x0}, {0x4002, 0x3}, 0x75}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf + {0x0, {{0x0, 0x0, 0x0}, {0x4002, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf { - {{0.0f, 0.0f, 0.0f}, 50.0f} // mSph - } // mSphAttr + {{0.0f, 0.0f, 0.0f}, 50.0f} // mSph + } // mSphAttr }; #pragma pop @@ -669,14 +671,27 @@ SECTION_DATA extern void* __vt__12daB_OB_HIO_c[3] = { }; /* 8061056C-806105BC 0000EC 0050+00 1/1 0/0 0/0 .text __ct__12daB_OB_HIO_cFv */ +// matches with literals +#ifdef NONMATCHING +daB_OB_HIO_c::daB_OB_HIO_c() { + field_0x04 = -1; + mCoreSize = 1.0f; + mCoreMoveSpeed = 0.2f; + mBodySize = 1.0f; + mLightR = 0xA3; + mLightG = 0xFF; + mLightB = 0xFF; + mRange = 3.0f; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm daB_OB_HIO_c::daB_OB_HIO_c() { - nofralloc +asm daB_OB_HIO_c::daB_OB_HIO_c(){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/__ct__12daB_OB_HIO_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061AD90-8061AD94 00000C 0004+00 5/19 0/0 0/0 .rodata @3788 */ @@ -703,34 +718,85 @@ SECTION_DEAD static char const* const stringBase_8061B09C = "B_oh"; #pragma pop /* 806105BC-8061066C 00013C 00B0+00 8/8 0/0 0/0 .text anm_init__FP10b_ob_classifUcf */ +// matches with literals +#ifdef NONMATCHING +static void anm_init(b_ob_class* i_this, int i_anmID, f32 i_morf, u8 i_mode, f32 i_speed) { + J3DAnmTransform* pbck = (J3DAnmTransform*)dComIfG_getObjectRes("B_oh", i_anmID); + i_this->mBodyParts[0].mpMorf->setAnm(pbck, i_mode, i_morf, i_speed, 0.0f, -1.0f, NULL); + i_this->mAnmID = i_anmID; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void anm_init(b_ob_class* param_0, int param_1, f32 param_2, u8 param_3, f32 param_4) { +static asm void anm_init(b_ob_class* i_this, int param_1, f32 param_2, u8 param_3, f32 param_4) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/anm_init__FP10b_ob_classifUcf.s" } #pragma pop +#endif /* 8061066C-806107B4 0001EC 0148+00 1/1 0/0 0/0 .text HeadCallBack__FP8J3DJointi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void HeadCallBack(J3DJoint* param_0, int param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/HeadCallBack__FP8J3DJointi.s" +static int HeadCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no >= 2 && joint_no <= 4) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->field_0x47ae); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } else if (joint_no >= 5 && joint_no <= 7) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->field_0x47ae); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; } -#pragma pop /* 806107B4-806109AC 000334 01F8+00 1/1 0/0 0/0 .text TailCallBack__FP8J3DJointi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void TailCallBack(J3DJoint* param_0, int param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/TailCallBack__FP8J3DJointi.s" +static int TailCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no == 3) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->field_0x47aa); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } else if (joint_no == 6) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, -a_this->field_0x47aa); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } else if (joint_no == 2 || joint_no == 4 || joint_no == 5) { + int idx = joint_no; + if (joint_no == 2) { + idx = 0; + } else if (joint_no >= 4) { + idx = joint_no - 3; + } + + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->field_0x47a4[idx] + a_this->field_0x47ac); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; } -#pragma pop /* ############################################################################################## */ /* 8061B4C0-8061B4C4 000008 0001+03 4/4 0/0 0/0 .bss @1109 */ @@ -823,58 +889,110 @@ static u8 lit_1010[1 + 3 /* padding */]; /* 8061B4FC-8061B500 -00001 0004+00 1/2 0/0 0/0 .bss None */ /* 8061B4FC 0001+00 data_8061B4FC @1009 */ /* 8061B4FD 0003+00 data_8061B4FD None */ -static u8 struct_8061B4FC[4]; +#pragma push +#pragma force_active on +static u8 struct_8061B4FC; +#pragma pop + +#pragma push +#pragma force_active on +static u8 data_8061B4FD; +#pragma pop /* 8061B500-8061B504 000048 0004+00 0/2 0/0 0/0 .bss moveSW */ #pragma push #pragma force_active on -static u8 moveSW[4]; +static BOOL moveSW; #pragma pop /* 8061B504-8061B508 00004C 0004+00 1/4 0/0 0/0 .bss moveSW2 */ -static u8 moveSW2[4]; +static BOOL moveSW2; /* 8061B508-8061B514 000050 000C+00 1/1 0/0 0/0 .bss @3767 */ static u8 lit_3767[12]; /* 8061B514-8061B534 00005C 0020+00 4/7 0/0 0/0 .bss l_HIO */ +#ifdef NONMATCHING +static daB_OB_HIO_c l_HIO; +#else static u8 l_HIO[32]; +#endif /* 8061B534-8061B538 00007C 0004+00 3/4 0/0 0/0 .bss pno */ -static u8 pno[4]; +static int pno; /* 8061B538-8061B53C 000080 0004+00 1/2 0/0 0/0 .bss fin */ -static u8 fin[4]; +static int fin; /* 806109AC-80610B3C 00052C 0190+00 1/1 0/0 0/0 .text FinACallBack__FP8J3DJointi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void FinACallBack(J3DJoint* param_0, int param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinACallBack__FP8J3DJointi.s" +static int FinACallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no == 2 || joint_no == 1) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + + if (fin == 0) { + cMtx_YrotM(*calc_mtx, a_this->mBodyParts[pno].mFinARot.y); + cMtx_XrotM(*calc_mtx, a_this->mBodyParts[pno].mFinARot.y); + } else { + cMtx_YrotM(*calc_mtx, -a_this->mBodyParts[pno].mFinARot.y); + cMtx_XrotM(*calc_mtx, -a_this->mBodyParts[pno].mFinARot.y); + } + + cMtx_ZrotM(*calc_mtx, a_this->mBodyParts[pno].mFinARot.x); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; } -#pragma pop /* 80610B3C-80610C24 0006BC 00E8+00 1/1 0/0 0/0 .text FinBCallBack__FP8J3DJointi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void FinBCallBack(J3DJoint* param_0, int param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinBCallBack__FP8J3DJointi.s" +static int FinBCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no == 2 || joint_no == 3 || joint_no == 5 || joint_no == 6) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->mBodyParts[pno].mFinBRot.y); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; } -#pragma pop /* 80610C24-80610D24 0007A4 0100+00 1/1 0/0 0/0 .text FinCCallBack__FP8J3DJointi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void FinCCallBack(J3DJoint* param_0, int param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/FinCCallBack__FP8J3DJointi.s" +static int FinCCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no == 1) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->mBodyParts[pno].mFinCRot.y); + cMtx_XrotM(*calc_mtx, -a_this->mBodyParts[pno].mFinCRot.y); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; } -#pragma pop /* ############################################################################################## */ /* 8061AD9C-8061ADA4 000018 0008+00 1/7 0/0 0/0 .rodata @4017 */ @@ -884,24 +1002,50 @@ SECTION_RODATA static u8 const lit_4017[8] = { COMPILER_STRIP_GATE(0x8061AD9C, &lit_4017); /* 80610D24-80610E2C 0008A4 0108+00 1/1 0/0 0/0 .text sui_nodeCallBack__FP8J3DJointi */ +// matches with literals +#ifdef NONMATCHING +static int sui_nodeCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no >= 2 && joint_no <= 4) { + f32 rot = a_this->field_0x47c4 * (TREG_F(8) + 1.0f); + + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_ZrotM(*calc_mtx, rot); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void sui_nodeCallBack(J3DJoint* param_0, int param_1) { +static asm int sui_nodeCallBack(J3DJoint* param_0, int param_1) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/sui_nodeCallBack__FP8J3DJointi.s" } #pragma pop +#endif /* 80610E2C-80610EE4 0009AC 00B8+00 1/1 0/0 0/0 .text dark__FP12J3DModelDatas */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void dark(J3DModelData* param_0, s16 param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/dark__FP12J3DModelDatas.s" +static void dark(J3DModelData* i_modelData, s16 i_color) { + if (i_color != 0) { + for (u16 i = 0; i < i_modelData->getMaterialNum(); i++) { + J3DMaterial* material = i_modelData->getMaterialNodePointer(i); + material->getTevColor(0)->r = i_color; + material->getTevColor(0)->g = i_color; + material->getTevColor(0)->b = i_color; + } + } } -#pragma pop /* ############################################################################################## */ /* 8061ADA4-8061ADAC 000020 0008+00 0/7 0/0 0/0 .rodata @4266 */ @@ -953,22 +1097,143 @@ COMPILER_STRIP_GATE(0x8061ADC4, &lit_4271); #pragma pop /* 80610EE4-80611408 000A64 0524+00 1/0 0/0 0/0 .text daB_OB_Draw__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static int daB_OB_Draw(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + g_env_light.settingTevStruct(0, &a_this->current.pos, &a_this->tevStr); + BOOL var_r28 = true; + + if (i_this->mFishBattleMode == 2) { + camera_class* camera = (camera_class*)dComIfGp_getCamera(0); + var_r28 = false; + + for (int i = 0; i < 19; i++) { + if (!i_this->mBodyParts[i].mHide) { + if ((i_this->mBodyParts[i].mPos - camera->mLookat.mEye).abs() > + i_this->mBodyParts[i].mSize * (JREG_F(17) + 500.0f)) + { + g_env_light.setLightTevColorType_MAJI(i_this->mBodyParts[i].mpMorf->getModel(), + &a_this->tevStr); + dark(i_this->mBodyParts[i].mpMorf->getModel()->getModelData(), + i_this->field_0x5d14); + i_this->mBodyParts[i].mpMorf->entryDL(); + + if (i == 0) { + var_r28 = true; + } + + if (i_this->mBodyParts[i].mpFinMorf != NULL) { + g_env_light.setLightTevColorType_MAJI( + i_this->mBodyParts[i].mpFinMorf->getModel(), &a_this->tevStr); + dark(i_this->mBodyParts[i].mpFinMorf->getModel()->getModelData(), + i_this->field_0x5d14); + i_this->mBodyParts[i].mpFinMorf->entryDL(); + } + + if (i_this->mBodyParts[i].mpFinUnkMorf != NULL) { + g_env_light.setLightTevColorType_MAJI( + i_this->mBodyParts[i].mpFinUnkMorf->getModel(), &a_this->tevStr); + dark(i_this->mBodyParts[i].mpFinUnkMorf->getModel()->getModelData(), + i_this->field_0x5d14); + i_this->mBodyParts[i].mpFinUnkMorf->entryDL(); + } + + if (i_this->mBodyParts[i].mpFinBMorf != NULL) { + g_env_light.setLightTevColorType_MAJI( + i_this->mBodyParts[i].mpFinBMorf->getModel(), &a_this->tevStr); + dark(i_this->mBodyParts[i].mpFinBMorf->getModel()->getModelData(), + i_this->field_0x5d14); + i_this->mBodyParts[i].mpFinBMorf->entryDL(); + } + + if (i_this->mBodyParts[i].mpFinCMorf != NULL) { + g_env_light.setLightTevColorType_MAJI( + i_this->mBodyParts[i].mpFinCMorf->getModel(), &a_this->tevStr); + dark(i_this->mBodyParts[i].mpFinCMorf->getModel()->getModelData(), + i_this->field_0x5d14); + i_this->mBodyParts[i].mpFinCMorf->entryDL(); + } + } + } + } + + if (!i_this->mHideCore) { + g_env_light.setLightTevColorType_MAJI(i_this->mpCoreMorf->getModel(), &a_this->tevStr); + i_this->mpCoreMorf->entryDL(); + } + } + + if (i_this->mCoreBattleMode && var_r28) { + g_env_light.setLightTevColorType_MAJI(i_this->mpCoreMorf->getModel(), &a_this->tevStr); + + if (i_this->mAction == OB_ACTION_CORE_START || i_this->mAction == OB_ACTION_CORE_HAND_MOVE) + { + i_this->mpCoreMorf->getModel() + ->getModelData() + ->getMaterialNodePointer(1) + ->getShape() + ->hide(); + } else { + i_this->mpCoreMorf->getModel() + ->getModelData() + ->getMaterialNodePointer(1) + ->getShape() + ->show(); + } + + i_this->mpCoreMorf->entryDL(); + + if (i_this->mDrawShadow) { + cXyz pos; + pos.set(a_this->current.pos.x, a_this->current.pos.y + 100.0f, a_this->current.pos.z); + + i_this->mShadowKey = dComIfGd_setShadow( + i_this->mShadowKey, 1, i_this->mpCoreMorf->getModel(), &pos, BREG_F(19) + 1300.0f, 0.0f, + a_this->current.pos.y, i_this->mAcch.GetGroundH(), i_this->mAcch.m_gnd, + &a_this->tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); + } + + g_env_light.settingTevStruct(0, &a_this->home.pos, &a_this->tevStr); + g_env_light.setLightTevColorType_MAJI(i_this->mBodyParts[0].mpMorf->getModel(), + &a_this->tevStr); + i_this->mBodyParts[0].mpMorf->entryDL(); + } + + if (i_this->mSuiBrkFrame > 0.0f) { + g_env_light.setLightTevColorType_MAJI(i_this->mpSuiModel, &a_this->tevStr); + i_this->mpSuiBrk->entry(i_this->mpSuiModel->getModelData()); + i_this->mpSuiBtk->entry(i_this->mpSuiModel->getModelData()); + mDoExt_modelUpdateDL(i_this->mpSuiModel); + } + + if (i_this->mBlureRate > 2) { + mDoGph_gInf_c::setBlureRate(i_this->mBlureRate); + mDoGph_gInf_c::onBlure(); + } else { + mDoGph_gInf_c::offBlure(); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void daB_OB_Draw(b_ob_class* param_0) { +static asm int daB_OB_Draw(b_ob_class* i_this) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/daB_OB_Draw__FP10b_ob_class.s" } #pragma pop +#endif /* 80611408-80611444 000F88 003C+00 5/5 0/0 0/0 .text __dt__4cXyzFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off // asm cXyz::~cXyz() { -extern "C" asm void __dt__4cXyzFv() { - nofralloc +extern "C" asm void __dt__4cXyzFv(){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/__dt__4cXyzFv.s" } #pragma pop @@ -1010,14 +1275,119 @@ COMPILER_STRIP_GATE(0x8061ADD8, &lit_4376); #pragma pop /* 80611444-80611824 000FC4 03E0+00 1/1 0/0 0/0 .text core_start__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static void core_start(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz sp28; + cXyz sp34; + + i_this->mDistToPlayer = fopAcM_searchPlayerDistance(i_this); + + switch (i_this->mMode) { + case 0: + if (i_this->mTimers[0] == 0) { + b_oh_class* tentacle = + (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i_this->mCoreHandNo]); + if (tentacle != NULL) { + i_this->mMode = 1; + i_this->field_0x478c = 0; + + anm_init(i_this, OB_ANM_APPEAR, 0.0f, 0, 0.0f); + a_this->home.pos.y = (i_this->field_0x47a0 - 200.0f) + KREG_F(11); + a_this->current.pos.y = a_this->home.pos.y - 500.0f; + } + } + break; + case 1: +#ifdef DEBUG + if (mDoCPd_c::getTrigY(PAD_2)) { + i_this->mMode = 2; + i_this->mDemoAction = 30; + } +#endif + + if (i_this->mDistToPlayer < 1600.0f) { + i_this->mMode = 2; + i_this->mDemoAction = 30; + } + break; + case 2: + b_oh_class* tentacle = + (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i_this->mCoreHandNo]); + MTXCopy(tentacle->mpMorf->getModel()->getAnmMtx(i_this->field_0x478c), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp28); + + MTXCopy( + tentacle->mpMorf->getModel()->getAnmMtx(i_this->field_0x478c + i_this->field_0x4790), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp34); + + a_this->current.pos = sp28 + ((sp34 - sp28) * i_this->field_0x4798); + + int var_r4; + if (i_this->mTimers[0] == 0) { + if (i_this->field_0x4790 > 0) { + i_this->field_0x4798 += l_HIO.mCoreMoveSpeed; + var_r4 = i_this->field_0x478c + i_this->field_0x4790; + a_this->current.angle.y += 0x200; + } else { + i_this->field_0x4798 += l_HIO.mCoreMoveSpeed * 2.0f; + var_r4 = i_this->field_0x478c + i_this->field_0x4790 + i_this->field_0x4790; + + if (var_r4 < tentacle->field_0xca8) { + var_r4 = tentacle->field_0xca8; + } + } + + cLib_addCalc2(&tentacle->field_0x9dc[var_r4], BREG_F(9) + 2.0f, 0.5f, l_HIO.mCoreMoveSpeed * (BREG_F(12) + 2.0f)); + } else { + int var_r27 = i_this->field_0x478c; + cLib_addCalc2(&tentacle->field_0x9dc[var_r27], BREG_F(9) + 1.5f, 0.5f, l_HIO.mCoreMoveSpeed * (BREG_F(12) + 2.0f)); + + if (i_this->field_0x4790 > 0) { + var_r27 -= i_this->field_0x4790; + } else { + var_r27 += i_this->field_0x4790; + } + + if (var_r27 < tentacle->field_0xca8) { + var_r27 = tentacle->field_0xca8; + } + + cLib_addCalc2(&tentacle->field_0x9dc[var_r27], BREG_F(9) + 1.5f, 0.5f, l_HIO.mCoreMoveSpeed * (BREG_F(12) + 2.0f)); + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 2, 0x800); + cLib_addCalcAngleS2(&a_this->current.angle.x, i_this->mXAngleToPlayer, 2, 0x800); + } + + if (i_this->field_0x4798 >= 1.0f) { + i_this->field_0x4798--; + i_this->field_0x478c += i_this->field_0x4790; + + if (i_this->field_0x478c >= 28) { + i_this->field_0x4790 *= -1; + i_this->mTimers[0] = 110; + } else if (i_this->field_0x478c <= tentacle->field_0xca8) { + i_this->mMode = 3; + } + } + break; + case 3: + break; + } + + a_this->shape_angle.z += 0xA00; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void core_start(b_ob_class* param_0) { - nofralloc +static asm void core_start(b_ob_class* i_this){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/core_start__FP10b_ob_class.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061ADDC-8061ADE0 000058 0004+00 0/3 0/0 0/0 .rodata @4479 */ @@ -1042,48 +1412,142 @@ COMPILER_STRIP_GATE(0x8061ADE4, &lit_4481); #pragma pop /* 80611824-80611C20 0013A4 03FC+00 1/1 0/0 0/0 .text core_hand_move__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static void core_hand_move(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz sp38; + cXyz sp44; + + switch (i_this->mMode) { + case 0: + if (i_this->mTimers[0] == 0) { + b_oh_class* tentacle = + (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i_this->mCoreHandNo]); + if (tentacle == NULL || (tentacle != NULL && tentacle->mAction == OH_ACTION_END)) { + i_this->mCoreHandNo += cM_rndF(7.0f) + 1.0f; + if (i_this->mCoreHandNo >= 8) { + i_this->mCoreHandNo -= 8; + } + } else { + i_this->mMode = 1; + i_this->field_0x478c = tentacle->field_0xca8; + } + } + break; + case 1: + b_oh_class* tentacle = + (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i_this->mCoreHandNo]); + if (tentacle == NULL || (tentacle != NULL && tentacle->mAction == OH_ACTION_END)) { + i_this->mMode = 0; + return; + } + + MTXCopy(tentacle->mpMorf->getModel()->getAnmMtx(i_this->field_0x478c), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp38); + + MTXCopy( + tentacle->mpMorf->getModel()->getAnmMtx(i_this->field_0x478c + i_this->field_0x4790), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp44); + + a_this->current.pos = sp38 + ((sp44 - sp38) * i_this->field_0x4798); + + if (tentacle->mAction == OH_ACTION_ATTACK || tentacle->mAction == OH_ACTION_CAUGHT) { + if (i_this->field_0x4790 > 0) { + i_this->field_0x4790 = -1; + } + + i_this->field_0x4798 += l_HIO.mCoreMoveSpeed * 2.0f; + } else { + i_this->field_0x4798 += l_HIO.mCoreMoveSpeed; + } + + int var_r4; + if (i_this->field_0x4790 > 0) { + var_r4 = i_this->field_0x478c + i_this->field_0x4790; + } else { + var_r4 = i_this->field_0x478c + i_this->field_0x4790 + i_this->field_0x4790; + if (var_r4 < tentacle->field_0xca8) { + var_r4 = tentacle->field_0xca8; + } + } + + cLib_addCalc2(&tentacle->field_0x9dc[var_r4], BREG_F(9) + 2.0f, 0.5f, l_HIO.mCoreMoveSpeed * (BREG_F(12) + 2.0f)); + + if (i_this->field_0x4798 >= 1.0f) { + i_this->field_0x4798--; + i_this->field_0x478c += i_this->field_0x4790; + + if (i_this->field_0x478c >= 29) { + i_this->field_0x4790 *= -1; + } else if (i_this->field_0x478c <= tentacle->field_0xca8) { + i_this->mMode = 2; + } + } + + cLib_addCalc0(&i_this->field_0x479c, 1.0f, 10.0f); + break; + case 2: + cLib_addCalc2(&i_this->field_0x479c, -200.0f, 1.0f, 10.0f); + + if (i_this->mTimers[0] == 0) { + i_this->mMode = 0; + i_this->field_0x478c = 0; + i_this->field_0x4790 = 1; + + i_this->mCoreHandNo += cM_rndF(7.0f) + 1.0f; + if (i_this->mCoreHandNo >= 8) { + i_this->mCoreHandNo -= 8; + } + } + break; + } + + a_this->shape_angle.z += 0xA00; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void core_hand_move(b_ob_class* param_0) { +static asm void core_hand_move(b_ob_class* i_this) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/core_hand_move__FP10b_ob_class.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061B53C-8061B540 000084 0004+00 2/2 0/0 0/0 .bss bf_ct */ -static u8 bf_ct[4]; +static int bf_ct; /* 80611C20-80611C78 0017A0 0058+00 1/1 0/0 0/0 .text s_bf_sub__FPvPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void s_bf_sub(void* param_0, void* param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_bf_sub__FPvPv.s" +static void* s_bf_sub(void* i_this, void* i_data) { + if (fopAcM_IsActor(i_this) && fopAcM_GetName(i_this) == PROC_E_OctBg) { + bf_ct++; + } + + return NULL; } -#pragma pop /* 80611C78-80611CC4 0017F8 004C+00 1/1 0/0 0/0 .text s_bfdel_sub__FPvPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void s_bfdel_sub(void* param_0, void* param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_bfdel_sub__FPvPv.s" +static void* s_bfdel_sub(void* i_this, void* i_data) { + if (fopAcM_IsActor(i_this) && fopAcM_GetName(i_this) == PROC_E_OctBg) { + fopAcM_delete((fopAc_ac_c*)i_this); + } + + return NULL; } -#pragma pop /* 80611CC4-80611D10 001844 004C+00 1/1 0/0 0/0 .text s_kaisoudel_sub__FPvPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void s_kaisoudel_sub(void* param_0, void* param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_kaisoudel_sub__FPvPv.s" +static void* s_kaisoudel_sub(void* i_this, void* i_data) { + if (fopAcM_IsActor(i_this) && fopAcM_GetName(i_this) == PROC_Obj_Kaisou) { + fopAcM_delete((fopAc_ac_c*)i_this); + } + + return NULL; } -#pragma pop /* ############################################################################################## */ /* 8061ADE8-8061ADEC 000064 0004+00 0/5 0/0 0/0 .rodata @4544 */ @@ -1108,14 +1572,65 @@ COMPILER_STRIP_GATE(0x8061ADF0, &lit_4546); #pragma pop /* 80611D10-80611EF8 001890 01E8+00 1/1 0/0 0/0 .text bombfishset__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static void bombfishset(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz pos; + i_this->mHitIFrameTimer = 20; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, OB_ANM_WAIT, 5.0f, J3DFrameCtrl::LOOP_REPEAT_e, 3.0f); + i_this->mMode = 1; + + if (a_this->field_0x567 == 0 && i_this->mDemoAction == 0) { + i_this->mDemoAction = 60; + a_this->field_0x567 = 1; + } + + i_this->mTimers[0] = 150; + break; + case 1: + if (i_this->mTimers[0] < 100 && !(i_this->mTimers[0] & 15)) { + bf_ct = 0; + fpcM_Search(s_bf_sub, i_this); + + if (bf_ct < 10) { + pos = a_this->home.pos; + pos.y += (JREG_F(6) + 350.0f); + + csXyz angle(-0x3800, 0, 0); + angle.y = cM_rndF(0x10000); + + fopAcM_createChild(PROC_E_OctBg, fopAcM_GetID(a_this), 0xFFFFFFFF, &pos, + fopAcM_GetRoomNo(a_this), &angle, NULL, -1, NULL); + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_BG_APPEAR, -1); + } + } + + if (i_this->mTimers[0] == 0) { + if (i_this->mDemoAction != 0) { + i_this->mDemoAction = 101; + } + + i_this->mAction = OB_ACTION_CORE_HAND_MOVE; + i_this->mMode = 0; + anm_init(i_this, OB_ANM_WAIT, 5.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + break; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void bombfishset(b_ob_class* param_0) { +static asm void bombfishset(b_ob_class* i_this) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/bombfishset__FP10b_ob_class.s" } #pragma pop +#endif /* 80611EF8-80611F34 001A78 003C+00 2/2 0/0 0/0 .text __dt__5csXyzFv */ #pragma push @@ -1129,14 +1644,38 @@ extern "C" asm void __dt__5csXyzFv() { #pragma pop /* 80611F34-80611FAC 001AB4 0078+00 1/1 0/0 0/0 .text core_hook__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static void core_hook(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + i_this->mHitIFrameTimer = 20; + + switch (i_this->mMode) { + case 0: + i_this->mMode = 1; + a_this->speedF = 0.0f; + i_this->mTimers[0] = 3; + break; + case 1: + break; + } + + if (i_this->mTimers[0] == 0 && !fopAcM_checkHookCarryNow(a_this)) { + i_this->mAction = OB_ACTION_CORE_CHANCE; + i_this->mMode = 0; + } + + a_this->shape_angle.z += 0xA00; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void core_hook(b_ob_class* param_0) { - nofralloc +static asm void core_hook(b_ob_class* i_this){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/core_hook__FP10b_ob_class.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061ADF4-8061ADF8 000070 0004+00 0/4 0/0 0/0 .rodata @4682 */ @@ -1175,14 +1714,111 @@ COMPILER_STRIP_GATE(0x8061AE04, &lit_4686); #pragma pop /* 80611FAC-80612484 001B2C 04D8+00 1/1 0/0 0/0 .text core_chance__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static int core_chance(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz sp68; + cXyz sp74; + int var_r30 = 1; + + switch (i_this->mMode) { + case 0: + a_this->current.angle.x = 0; + a_this->speedF = 0.0f; + a_this->speed.y = 0.0f; + + sp68.x = a_this->home.pos.x - a_this->current.pos.x; + sp68.z = a_this->home.pos.z - a_this->current.pos.z; + if (JMAFastSqrt(sp68.x * sp68.x + sp68.z * sp68.z) < (NREG_F(4) + 500.0f)) { + i_this->mMode = 2; + } else { + i_this->mMode = 1; + i_this->mTimers[0] = 150; + } + break; + case 1: + if (i_this->mAcch.i_ChkGroundHit()) { + if (i_this->mTimers[0] == 0) { + i_this->mMode = 2; + } else { + a_this->speed.y = VREG_F(1) + cM_rndF(10.0f) + 10.0f + 10.0f; + a_this->current.angle.y = cM_rndF(0x10000); + a_this->speedF = VREG_F(2) + cM_rndF(3.0f) + 3.0f + 5.0f; + } + } + + if (a_this->speedF >= 20.0f) { + i_this->mTimers[0] = 2; + cLib_addCalc2(&a_this->speedF, 6.0f, 1.0f, 1.0f); + } + break; + case 2: + i_this->mHitIFrameTimer = 20; + var_r30 = 2; + + cLib_addCalc2(&a_this->speedF, 50.0f, 1.0f, 5.0f); + i_this->mTargetMovePos = a_this->home.pos; + i_this->mTargetMovePos.y += (VREG_F(6) + 350.0f); + sp68 = i_this->mTargetMovePos - a_this->current.pos; + + f32 var_f31 = JMAFastSqrt(sp68.x * sp68.x + sp68.z * sp68.z); + + f32 var_f30 = var_f31 * 10.0f; + if (var_f30 > 7000.0f) { + var_f30 = 7000.0f; + } + + f32 var_f29 = var_f31 * 20.0f; + if (var_f29 > 10000.0f) { + var_f29 = 10000.0f; + } + + s16 sp58 = var_f30 * cM_ssin(i_this->field_0x4750 * 1000); + s16 sp50 = var_f30 * cM_ssin(i_this->field_0x4750 * 800) - var_f29; + + a_this->current.angle.y = sp58 + cM_atan2s(sp68.x, sp68.z); + a_this->current.angle.x = sp50 - cM_atan2s(sp68.y, var_f31); + + if (sp68.abs() < 100.0f) { + if (i_this->field_0x4744 != 0) { + i_this->mAction = OB_ACTION_CORE_END; + i_this->mMode = 0; + } else { + if (i_this->field_0x5d13 && i_this->mDemoAction == 0) { + i_this->mAction = OB_ACTION_BOMBFISH_SET; + i_this->mMode = 0; + i_this->field_0x5d13 = 1; + } else { + i_this->mAction = OB_ACTION_CORE_HAND_MOVE; + i_this->mMode = 0; + } + + i_this->field_0x478c = 0; + i_this->field_0x4790 = 1; + i_this->field_0x479c = -200.0f; + + i_this->mCoreHandNo += (cM_rndF(7.0f) + 1.0f); + if (i_this->mCoreHandNo >= 8) { + i_this->mCoreHandNo -= 8; + } + } + } + break; + } + + a_this->shape_angle.z += 0xA00; + return var_r30; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void core_chance(b_ob_class* param_0) { - nofralloc +static asm int core_chance(b_ob_class* i_this){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/core_chance__FP10b_ob_class.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061AE08-8061AE0C 000084 0004+00 0/2 0/0 0/0 .rodata @4776 */ @@ -1200,14 +1836,103 @@ COMPILER_STRIP_GATE(0x8061AE0C, &lit_4777); #pragma pop /* 80612484-8061285C 002004 03D8+00 1/1 0/0 0/0 .text core_end__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static void core_end(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + int frame = i_this->mBodyParts[0].mpMorf->getFrame(); + i_this->mHitIFrameTimer = 10; + + cXyz sp34; + switch (i_this->mMode) { + case 0: + i_this->mMode = 1; + a_this->gravity = 0.0f; + i_this->mDemoAction = 20; + i_this->field_0x479c = -1000.0f; + anm_init(i_this, OB_ANM_TENTACLE_END, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + + sp34.set(0.0f, 0.0f, 0.0f); + dComIfGp_particle_set(0x880A, &sp34, NULL, NULL); + mDoAud_seStart(Z2SE_EN_OI_DEMO_APPEAR2, NULL, 0, 0); + break; + case 1: + if (frame == 100) { + dComIfGp_getVibration().StartQuake(3, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (frame >= 100) { + i_this->field_0x5ce4 = WREG_F(11) + 6.0f; + } + + if (i_this->mBodyParts[0].mpMorf->isStop()) { + i_this->mMode = 2; + i_this->mTimers[0] = 120; + dComIfGp_getVibration().StopQuake(31); + a_this->home.pos.y = i_this->field_0x47a0 - 900.0f; + } + break; + case 2: + if (i_this->mTimers[0] == 60) { + for (int i = 0; i < 8; i++) { + fopAc_ac_c* tentacle = fopAcM_SearchByID(i_this->mTentacleActorIDs[i]); + fopAcM_delete(tentacle); + } + } + + if (i_this->mTimers[0] <= 50) { + i_this->field_0x5ce4 = WREG_F(11) + 6.0f; + + if (i_this->mTimers[0] == 50) { + dComIfGp_getVibration().StartQuake(4, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + } + + if (i_this->mTimers[0] == 0) { + i_this->mCoreBattleMode = 0; + i_this->mFishBattleMode = 1; + i_this->mZoneSwTimer = 0; + a_this->home.pos.y = i_this->field_0x47a0; + a_this->health = 2; + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getBaseTRMtx(), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&a_this->current.pos); + a_this->current.angle.y = 0; + a_this->current.angle.x = -0x4000; + a_this->shape_angle.x = -0x4000; + + i_this->mAction = OB_ACTION_FISH_NORMAL; + i_this->mMode = 1; + + i_this->mMoveAngle.y = a_this->current.angle.y; + i_this->mMoveAngle.x = -0x4000; + i_this->field_0x4750 = 0; + i_this->mTimers[0] = 110; + anm_init(i_this, OB_ANM_APPEAR_2, 1.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + + fopAcM_OffStatus(a_this, 0x80000); + fopAcM_OnStatus(a_this, 0x200000); + i_this->mTimers[3] = VREG_S(8) + 220; + + for (int i = 0; i < 8; i++) { + i_this->mTentacleActorIDs[i] = + fopAcM_createChild(PROC_B_OH2, fopAcM_GetID(a_this), i, &a_this->current.pos, + fopAcM_GetRoomNo(a_this), NULL, NULL, -1, NULL); + } + } + break; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void core_end(b_ob_class* param_0) { - nofralloc +static asm void core_end(b_ob_class* i_this){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/core_end__FP10b_ob_class.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061AE10-8061AE14 00008C 0004+00 0/4 0/0 0/0 .rodata @4875 */ @@ -1225,14 +1950,120 @@ COMPILER_STRIP_GATE(0x8061AE14, &lit_4876); #pragma pop /* 8061285C-80612CC8 0023DC 046C+00 1/1 0/0 0/0 .text core_action__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static void core_action(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + cXyz sp30; + cXyz sp3C; + + if (i_this->mCoreAnm != 0) { + anm_init(i_this, i_this->mCoreAnm, 10.0f, i_this->mCoreAnmMode, 1.0f); + i_this->mCoreAnm = 0; + } + + BOOL attn_ON = true; + BOOL look_at_player = true; + int var_r26 = 0; + BOOL check_eat = false; + BOOL play_move_sound = true; + + switch (i_this->mAction) { + case OB_ACTION_CORE_START: + core_start(i_this); + look_at_player = false; + break; + case OB_ACTION_CORE_HAND_MOVE: + core_hand_move(i_this); + check_eat = true; + break; + case OB_ACTION_BOMBFISH_SET: + bombfishset(i_this); + play_move_sound = false; + break; + case OB_ACTION_CORE_HOOK: + core_hook(i_this); + look_at_player = false; + play_move_sound = false; + break; + case OB_ACTION_CORE_CHANCE: + var_r26 = core_chance(i_this); + look_at_player = false; + break; + case OB_ACTION_CORE_END: + core_end(i_this); + var_r26 = 0; + look_at_player = false; + attn_ON = false; + break; + } + + if (check_eat && i_this->mDemoAction == 0) { + sp30 = dComIfGp_getPlayer(0)->current.pos - a_this->home.pos; + if (JMAFastSqrt(sp30.x * sp30.x + sp30.z * sp30.z) < (VREG_F(17) + 300.0f) && sp30.y < (VREG_F(18) + 800.0f)) { + i_this->mDemoAction = 50; + } + } + + if (attn_ON && i_this->field_0x479c > -1.0f && a_this->eyePos.y >= a_this->home.pos.y) { + fopAcM_OnStatus(a_this, 0); + a_this->attention_info.flags = 4; + } else { + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; + } + + if (look_at_player) { + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 2, 0x800); + cLib_addCalcAngleS2(&a_this->current.angle.x, i_this->mXAngleToPlayer, 2, 0x800); + } + + if (var_r26 == 1) { + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + + sp30.x = 0.0f; + sp30.y = 0.0f; + sp30.z = a_this->speedF; + MtxPosition(&sp30, &sp3C); + a_this->speed.x = sp3C.x; + a_this->speed.z = sp3C.z; + + a_this->current.pos += a_this->speed; + a_this->speed.y -= (VREG_F(0) + 3.0f); + + f32 temp_y_offset = VREG_F(11) + 20.0f; + a_this->current.pos.y -= temp_y_offset; + a_this->old.pos.y -= temp_y_offset; + + i_this->mAcch.CrrPos(dComIfG_Bgsp()); + a_this->current.pos.y += temp_y_offset; + a_this->old.pos.y += temp_y_offset; + } else if (var_r26 == 2) { + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + cMtx_XrotM(*calc_mtx, a_this->current.angle.x); + + sp30.x = 0.0f; + sp30.y = 0.0f; + sp30.z = a_this->speedF; + MtxPosition(&sp30, &a_this->speed); + a_this->current.pos += a_this->speed; + } + + if (play_move_sound) { + f32 dist_to_oldpos = (a_this->current.pos - a_this->old.pos).abs(); + i_this->mSound.startCreatureSoundLevel(Z2SE_EN_OI_CORE_MOVE, dist_to_oldpos, -1); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void core_action(b_ob_class* param_0) { - nofralloc +static asm void core_action(b_ob_class* i_this){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/core_action__FP10b_ob_class.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061AE18-8061AE1C 000094 0004+00 0/3 0/0 0/0 .rodata @4912 */ @@ -1244,35 +2075,166 @@ COMPILER_STRIP_GATE(0x8061AE18, &lit_4912); /* 80612CC8-80612ED4 002848 020C+00 1/1 0/0 0/0 .text core_damage_check__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static void core_damage_check(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + if (fopAcM_checkStatus(a_this, 0x100000)) { + i_this->field_0x5d38 = + dComIfGp_particle_set(i_this->field_0x5d38, 0x8802, &a_this->current.pos, NULL, NULL); + } + + i_this->mCoreCcStts.Move(); + + if (i_this->mHitIFrameTimer == 0 && i_this->mCcSph.ChkTgHit()) { + i_this->mAtInfo.mpCollider = i_this->mCcSph.GetTgHitObj(); + cc_at_check(a_this, &i_this->mAtInfo); + + dComIfGp_particle_set(0x8801, &a_this->current.pos, NULL, NULL); + + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) { + i_this->mAction = OB_ACTION_CORE_HOOK; + i_this->mMode = 0; + i_this->mSound.startCreatureSound(Z2SE_EN_OI_CORE_PULLOUT, 0, -1); + dComIfGs_onOneZoneSwitch(7, -1); + } else { + a_this->current.angle.y = i_this->mYAngleToPlayer + 0x8000; + a_this->speedF = 30.0f; + a_this->speed.y = 7.0f; + + i_this->mSound.startCreatureVoice(Z2SE_EN_OI_V_CORE_DAMAGE, -1); + + if (a_this->health <= 0 && !dComIfGp_event_runCheck()) { + i_this->field_0x4744 = 1; + } else { + i_this->field_0x5d13 = 1; + } + } + + i_this->mHitIFrameTimer = 10; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void core_damage_check(b_ob_class* param_0) { +static asm void core_damage_check(b_ob_class* i_this) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/core_damage_check__FP10b_ob_class.s" } #pragma pop +#endif /* 80612ED4-806131A8 002A54 02D4+00 1/1 0/0 0/0 .text fish_damage_check__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static void fish_damage_check(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + i_this->mBodyCcStts.Move(); + + if (i_this->mHitIFrameTimer == 0) { + for (int i = 0; i < 19; i++) { + if (i_this->mBodyParts[i].mSph.ChkTgHit()) { + i_this->mHitIFrameTimer = 10; + def_se_set(&i_this->mOISound, i_this->mBodyParts[i].mSph.GetTgHitObj(), 0x2A, NULL); + } + } + + if (i_this->field_0x4756 == 0 && i_this->mCoreSph.ChkTgHit()) { + i_this->mAtInfo.mpCollider = i_this->mCoreSph.GetTgHitObj(); + cc_at_check(a_this, &i_this->mAtInfo); + + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) { + i_this->mTimers[1] = 40; + i_this->field_0x4756 = 1; + + if (i_this->mAction != OB_ACTION_FISH_NORMAL) { + i_this->mAction = OB_ACTION_FISH_NORMAL; + i_this->mMode = 0; + OS_REPORT("B_OB HOOK VAC OFF !!\n"); + } + } + } + + fopEn_enemy_c* e_this = (fopEn_enemy_c*)a_this; + if (e_this->checkCutDownHitFlg()) { + e_this->offCutDownHitFlg(); + i_this->field_0x5d18 = 125; + + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0x5d38); + if (emitter != NULL) { + emitter->becomeDeleteEmitter(); + } + + i_this->field_0x5d38 = 0; + dComIfGp_getVibration().StartShock(5, 31, cXyz(0.0f, 1.0f, 0.0f)); + i_this->mHangHitCount++; + dComIfGs_onOneZoneSwitch(9, -1); + + if (player->getCutType() == daPy_py_c::CUT_TYPE_FINISH_STAB) { + i_this->mHangHitCount = 4; + i_this->mHangFinishCount = 3; + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_TODOME, -1); + i_this->mSound.startCollisionSE(Z2SE_HIT_SWORD_STAB, 0x20); + } else { + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_DAMAGE, -1); + i_this->mSound.startCollisionSE(Z2SE_HIT_SWORD_STAB, 0x1F); + } + + if (i_this->mHangHitCount >= 4) { + i_this->mHangFinishCount++; + if (i_this->mHangFinishCount >= 2) { + e_this->onDownFlg(); + } + + i_this->mTimers[2] = 100; + + if (i_this->mHangFinishCount >= 3) { + i_this->mHangTimer = 250; + } else { + i_this->mHangTimer = 210; + } + } + + i_this->field_0x47b0 = (JREG_S(2) + 20); + } + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void fish_damage_check(b_ob_class* param_0) { +static asm void fish_damage_check(b_ob_class* i_this) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/fish_damage_check__FP10b_ob_class.s" } #pragma pop +#endif /* 806131A8-80613270 002D28 00C8+00 2/2 0/0 0/0 .text pl_check__FP10b_ob_classfs */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void pl_check(b_ob_class* param_0, f32 param_1, s16 param_2) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/pl_check__FP10b_ob_classfs.s" +static BOOL pl_check(b_ob_class* i_this, f32 i_range, s16 i_maxAngle) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); + + if (fopAcM_searchPlayerDistance(a_this) < i_range) { + s16 y_diff = a_this->current.angle.y - i_this->mYAngleToPlayer; + s16 x_diff = a_this->current.angle.x - i_this->mXAngleToPlayer; + + if (y_diff < i_maxAngle && y_diff > (s16)-i_maxAngle && x_diff < i_maxAngle && + x_diff > (s16)-i_maxAngle) + { + if (!fopAcM_otherBgCheck(a_this, player)) { + return true; + } + } + } + + return false; } -#pragma pop /* ############################################################################################## */ /* 8061AE1C-8061AE20 000098 0004+00 0/3 0/0 0/0 .rodata @5274 */ @@ -1376,14 +2338,258 @@ static u8 sdemo_p[48]; #pragma pop /* 80613270-80613E00 002DF0 0B90+00 1/1 0/0 0/0 .text fish_normal__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static int fish_normal(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + cXyz sp64; + f32 dist_to_ground = fabsf(i_this->mAcch.GetGroundH() - a_this->current.pos.y); + BOOL throw_player = false; + f32 dist_to_player = (a_this->eyePos - player->current.pos).abs(); + + if (i_this->field_0x4756 == 1) { + if (dist_to_player < KREG_F(11) + 150.0f) { + Z2GetAudioMgr()->changeBgmStatus(2); + i_this->field_0x4756 = 2; + } + } else if (i_this->field_0x4756 == 2) { + if (dist_to_player >= KREG_F(11) + 150.0f) { + i_this->field_0x4756 = 0; + Z2GetAudioMgr()->changeBgmStatus(1); + } + } + + BOOL player_hang_on; + if (dist_to_player < KREG_F(11) + 150.0f) { + player_hang_on = true; + i_this->field_0x47b4 = 0; + moveSW2 = false; + } else { + player_hang_on = false; + } + + int ret = 0; + BOOL in_opening_demo = false; + if (i_this->mDemoAction >= 20 && i_this->mDemoAction < 30) { + in_opening_demo = true; + } + + static cXyz sdemo_p[4] = { + cXyz(2000.0f, 3500.0f, 0.0f), + cXyz(-1000.0f, 2000.0f, 1000.0f), + cXyz(0.0f, 3500.0f, 2000.0f), + cXyz(1000.0f, 2000.0f, -1000.0f), + }; + + switch (i_this->mMode) { + case 0: + if (in_opening_demo) { + i_this->mTargetMovePos = a_this->home.pos + sdemo_p[i_this->mDemoMovePosIdx]; + i_this->mDemoMovePosIdx++; + i_this->mDemoMovePosIdx &= 3; + + i_this->mTimers[0] = 30; + i_this->field_0x47b4 = 0; + } else { + i_this->mTargetMovePos.x = a_this->home.pos.x + cM_rndFX(2000.0f); + i_this->mTargetMovePos.y = a_this->home.pos.y + 1000.0f + cM_rndFX(2000.0f); + i_this->mTargetMovePos.z = a_this->home.pos.z + cM_rndFX(2000.0f); + i_this->mTimers[0] = cM_rndF(30.0f) + 30.0f; + } + + sp64 = i_this->mTargetMovePos - a_this->current.pos; + i_this->mMoveAngle.y = cM_atan2s(sp64.x, sp64.z); + i_this->mMoveAngle.x = -cM_atan2s(sp64.y, JMAFastSqrt(sp64.x * sp64.x + sp64.z * sp64.z)); + + if (i_this->mMoveAngle.x > 0x1000) { + i_this->mMoveAngle.x = 0x1000; + } else if (i_this->mMoveAngle.x < -0x1000) { + i_this->mMoveAngle.x = -0x1000; + } + + i_this->mMode = 1; + i_this->field_0x476a = 0; + /* fallthrough */ + case 1: + if (in_opening_demo && i_this->mTimers[0] > 60) { + ret = 4; + } + + if (i_this->mAnmID != OB_ANM_SWIM_WAIT) { + anm_init(i_this, OB_ANM_SWIM_WAIT, 10.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + + if (dist_to_ground < l_HIO.mBodySize * (ZREG_F(8) + 1200.0f)) { + if (i_this->mMoveAngle.x > 0) { + cLib_addCalcAngleS2(&i_this->mMoveAngle.x, 0, 4, 0x40); + } + + if (a_this->current.angle.x > 0) { + cLib_addCalcAngleS2(&a_this->current.angle.x, 0, 4, 0x40); + } + } + + s16 y_diff = a_this->current.angle.y - i_this->mMoveAngle.y; + s16 x_diff = a_this->current.angle.x - i_this->mMoveAngle.x; + if (i_this->mTimers[0] == 0 && y_diff <= 0x100 && y_diff >= (s16)-0x100 && + x_diff <= 0x100 && x_diff >= (s16)-0x100) + { + i_this->mMode = 0; + i_this->field_0x47b4++; + } + + if (!player_hang_on && i_this->field_0x47b4 >= 3 && pl_check(i_this, 5000.0f, 0x2000)) { + i_this->mMode = 2; + i_this->mTimers[0] = cM_rndF(50.0f) + 200.0f; + i_this->field_0x47b4 = 0; + i_this->field_0x476a = 0; + i_this->mTimers[4] = 30; + } + break; + case 2: + ret = 1; + i_this->mTargetMovePos.x = player->current.pos.x; + + if (dist_to_ground < l_HIO.mBodySize * (ZREG_F(8) + 1200.0f)) { + i_this->mTargetMovePos.y = player->current.pos.y + 300.0f + AREG_F(7); + } else { + i_this->mTargetMovePos.y = player->current.pos.y; + } + + i_this->mTargetMovePos.z = player->current.pos.z; + + sp64 = i_this->mTargetMovePos - a_this->current.pos; + i_this->mMoveAngle.y = cM_atan2s(sp64.x, sp64.z); + i_this->mMoveAngle.x = -cM_atan2s(sp64.y, JMAFastSqrt(sp64.x * sp64.x + sp64.z * sp64.z)); + sp64.abs(); + + if (!daPy_getPlayerActorClass()->checkHookshotShootReturnMode() && + i_this->mTimers[4] == 0 && pl_check(i_this, BREG_F(17) + 3000.0f, 0x3000)) + { + i_this->mAction = OB_ACTION_FISH_VACUME; + i_this->mMode = 0; + moveSW2 = true; + return 1; + } + + if (player_hang_on || daPy_getPlayerActorClass()->checkEquipHeavyBoots() || + !pl_check(i_this, 10000.0f, 0x3000) || i_this->mTimers[0] == 0) + { + i_this->mMode = 1; + + if (dist_to_ground < l_HIO.mBodySize * (ZREG_F(8) + 1200.0f)) { + i_this->mMoveAngle.x = -0x2000; + i_this->mTimers[0] = cM_rndF(30.0f) + 30.0f; + } else { + i_this->mMoveAngle.x = -0x1000; + i_this->mTimers[0] = cM_rndF(10.0f) + 20.0f; + } + } + break; + case 10: + ret = 1; + i_this->mMoveAngle.y += 0x200; + i_this->field_0x476a = 0x200; + i_this->mMoveAngle.x = -0x1000; + + if (i_this->mTimers[2] == 0) { + i_this->mMode = 1; + } + break; + } + + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mMoveAngle.y, 0x10, i_this->field_0x476a); + cLib_addCalcAngleS2(&a_this->current.angle.x, i_this->mMoveAngle.x, 0x10, i_this->field_0x476a); + + if (in_opening_demo) { + cLib_addCalcAngleS2(&i_this->field_0x476a, 0x100, 1, 2); + } else { + cLib_addCalcAngleS2(&i_this->field_0x476a, 0x180, 1, 8); + } + + cLib_addCalc0(&i_this->mSuiBrkFrame, 1.0f, 0.5f); + cLib_addCalc2(&i_this->field_0x5d04, 0.7f, 1.0f, 0.05f); + + a_this->speedF = TREG_F(0) + 100.0f; + + if (player_hang_on) { + ret = 3; + i_this->mHangTimer++; + + if (i_this->mHangTimer == (JREG_S(5) + 210)) { + i_this->field_0x47b0 = (JREG_S(3) + 35); + } + + if (i_this->mHangTimer == (JREG_S(6) + 230)) { + player->setOctaIealWildHang(); + } + + if (i_this->mHangTimer == (JREG_S(7) + 284)) { + throw_player = true; + + if (i_this->mTimers[2] != 0) { + if (i_this->mHangFinishCount >= 3) { + i_this->mAction = OB_ACTION_FISH_END; + i_this->mMode = 0; + i_this->mDemoAction = 40; + } else { + i_this->mMode = 10; + i_this->mTimers[2] = 80; + } + } + } + + if (i_this->mHangTimer >= 230 || i_this->mHangHitCount >= 4) { + i_this->field_0x47b0 = (JREG_S(3) + 25); + } + } else { + i_this->mHangTimer = 0; + i_this->mHangHitCount = 0; + } + + if (i_this->mTimers[3] != 0) { + i_this->field_0x5ce4 = JREG_F(11) + 6.0f; + + cXyz sp70; + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp70); + + i_this->field_0x5d24[0] = + dComIfGp_particle_set(i_this->field_0x5d24[0], 0x87EC, &sp70, NULL, NULL); + + sp64.set(0.0f, 0.0f, 0.0f); + i_this->field_0x5d24[1] = + dComIfGp_particle_set(i_this->field_0x5d24[1], 0x87ED, &sp64, NULL, NULL); + + if (i_this->mTimers[3] == 1) { + dComIfGp_getVibration().StopQuake(31); + } + } + + if (i_this->mAnmID == OB_ANM_APPEAR_2 && i_this->mBodyParts[0].mpMorf->isStop()) { + anm_init(i_this, OB_ANM_SWIM_WAIT, 10.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + + if (throw_player) { + player->cancelOctaIealHang(); + daPy_getPlayerActorClass()->setThrowDamage(a_this->current.angle.y + 0x8000, 40.0f, KREG_F(14) + 50.0f, + 0, 0, 2); + i_this->mAttnOffTimer = 70; + } + + return ret; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void fish_normal(b_ob_class* param_0) { - nofralloc +static asm int fish_normal(b_ob_class* i_this){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/fish_normal__FP10b_ob_class.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061AE44-8061AE48 0000C0 0004+00 0/1 0/0 0/0 .rodata @5383 */ @@ -1394,14 +2600,93 @@ COMPILER_STRIP_GATE(0x8061AE44, &lit_5383); #pragma pop /* 80613E00-80614228 003980 0428+00 1/1 0/0 0/0 .text fish_vacume__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static int fish_vacume(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + cXyz sp3C; + int var_r30 = 0; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, OB_ANM_OPEN_MOUTH, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mMode = 1; + i_this->field_0x476a = 0; + break; + case 1: + if (i_this->mBodyParts[0].mpMorf->isStop()) { + anm_init(i_this, OB_ANM_OPEN_MOUTH_WAIT, 3.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + i_this->mMode = 2; + i_this->mTimers[0] = 200; + } + break; + case 2: + i_this->mMoveAngle.y = i_this->mYAngleToPlayer; + i_this->mMoveAngle.x = 0; + var_r30 = 1; + + cLib_addCalc2(&a_this->current.pos.x, 0.0f, 0.05f, 5.0f); + cLib_addCalc2(&a_this->current.pos.z, 0.0f, 0.05f, 5.0f); + + if (i_this->mTimers[0] == 0) { + i_this->mAction = OB_ACTION_FISH_NORMAL; + i_this->mMode = 0; + } else if ((a_this->eyePos - player->current.pos).abs() > (KREG_F(11) + 150.0f) && + i_this->mTimers[0] < 100) + { + if (!daPy_getPlayerActorClass()->checkEquipHeavyBoots() && + pl_check(i_this, 3000.0f, 0x4000)) + { + i_this->mDemoAction = 10; + i_this->mMode = 3; + } + } + break; + case 3: + if (i_this->mDemoActionTimer < 30) { + var_r30 = 1; + } + + i_this->mBodyParts[0].mSph.OffCoSetBit(); + + if (i_this->mBodyParts[0].mpMorf->isStop()) { + if (i_this->mAnmID == OB_ANM_SWALLOW) { + anm_init(i_this, OB_ANM_EAT_2, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } else if (i_this->mAnmID == OB_ANM_EAT_2) { + anm_init(i_this, OB_ANM_THROWUP, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_THROWUP, -1); + } else if (i_this->mAnmID == OB_ANM_THROWUP) { + i_this->mAction = OB_ACTION_FISH_NORMAL; + i_this->mMode = 0; + } + } + break; + } + + if (var_r30) { + cLib_addCalc2(&i_this->mSuiBrkFrame, 29.0f, 1.0f, 0.5f); + i_this->mOISound.startCreatureVoiceLevel(Z2SE_EN_OI_V_DRAWIN, -1); + } else { + cLib_addCalc0(&i_this->mSuiBrkFrame, 1.0f, 0.5f); + } + + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mMoveAngle.y, 0x10, i_this->field_0x476a); + cLib_addCalcAngleS2(&a_this->current.angle.x, i_this->mMoveAngle.x, 0x10, i_this->field_0x476a); + cLib_addCalcAngleS2(&i_this->field_0x476a, 0x180, 1, 8); + cLib_addCalc2(&i_this->field_0x5d04, 0.0f, 1.0f, 0.05f); + return 2; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void fish_vacume(b_ob_class* param_0) { - nofralloc +static asm int fish_vacume(b_ob_class* i_this){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/fish_vacume__FP10b_ob_class.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061AE48-8061AE4C 0000C4 0004+00 0/1 0/0 0/0 .rodata @5478 */ @@ -1538,14 +2823,132 @@ COMPILER_STRIP_GATE(0x8061AE90, &lit_5496); #pragma pop /* 80614228-806147D4 003DA8 05AC+00 1/1 0/0 0/0 .text fish_end__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static int fish_end(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + cXyz sp68; + + f32 speed_f = 100.0f; + s16 angleX_max_step = 0x300; + + switch (i_this->mMode) { + case 0: + i_this->mMode = 1; + i_this->mTargetMovePos.set(0.0f, -16000.0f, 6500.0f); + i_this->mTimers[0] = 100; + i_this->field_0x5d04 = KREG_F(8) + 1.5f; + i_this->mBlureRateTarget = 150; + i_this->field_0x5dd8 = 3; + anm_init(i_this, OB_ANM_LAST_DAMAGE, 0.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + break; + case 1: + if (i_this->mBodyParts[0].mpMorf->isStop()) { + anm_init(i_this, OB_ANM_SWIM_WAIT, 5.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + + if (i_this->mTimers[0] == 0) { + i_this->mMode = 2; + i_this->mTargetMovePos.set(0.0f, -19000.0f, -6500.0f); + i_this->mTimers[0] = 150; + i_this->mDemoCamEye.set(-6000.0f, -22000.0f, 2000.0f); + anm_init(i_this, OB_ANM_LAST_DAMAGE, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } + break; + case 2: + sp68.set(VREG_F(0) + -1325.0f, -24000.0f, VREG_F(1) + 9178.0f); + player->setPlayerPosAndAngle(&sp68, VREG_S(1) + 10000, 0); + + if (i_this->mTimers[0] == 0) { + i_this->mMode = 3; + i_this->mTargetMovePos.set(0.0f, TREG_F(14) + -23550.0f, 10200.0f); + i_this->mTimers[0] = 120; + i_this->mDemoCamEye.set(2130.0f, -23071.0f, 7383.0f); + i_this->mDemoAction = 42; + i_this->mDemoActionTimer = 0; + i_this->mBlureRateTarget = 0; + anm_init(i_this, OB_ANM_LAST_DAMAGE, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } + break; + case 3: + if (i_this->mAcch.ChkWallHit() && i_this->mTimers[0] == 0) { + anm_init(i_this, OB_ANM_DEAD, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + dComIfGp_getVibration().StartShock(8, 31, cXyz(0.0f, 1.0f, 0.0f)); + mDoAud_seStart(Z2SE_OBJ_BOMB_EXPLODE, NULL, 0, 0); + + i_this->mMode = 10; + i_this->field_0x5ce4 = WREG_F(14) + 20.0f; + i_this->mTimers[0] = 0; + a_this->current.angle.x = 0x1000; + i_this->mMoveAngle.x = 0; + i_this->mMoveAngle.y = 0; + i_this->field_0x5d08 = 50; + + moveSW2 = true; + i_this->mDemoAction = 43; + i_this->mDemoActionTimer = 1; + + obj_lv3WaterB_class* water = + (obj_lv3WaterB_class*)fopAcM_SearchByName(PROC_OBJ_LV3WATERB); + water->mAction = LV3WATERB_ACT_REMOVE; + a_this->home.pos.set(0.0f, -23580.0f, 10300.0f); + + for (int i = 0; i < 5; i++) { + static u16 iso_eff[] = {0x87F2, 0x87F3, 0x87F4, 0x87F5, 0x87F6}; + dComIfGp_particle_set(iso_eff[i], &a_this->home.pos, NULL, NULL); + } + + mDoAud_seStart(Z2SE_EN_OI_HIT_WALL, &a_this->home.pos, 0, 0); + speed_f = 0.0f; + } + break; + case 10: + cLib_addCalc2(&a_this->current.pos.x, i_this->mTargetMovePos.x, 0.1f, 10.0f); + cLib_addCalc2(&a_this->current.pos.y, VREG_F(7) + -23550.0f, 0.1f, 10.0f); + cLib_addCalc2(&a_this->current.pos.z, (VREG_F(8) + 9128.0f) - 500.0f, 0.1f, 10.0f); + speed_f = 0.0f; + + i_this->field_0x4750--; + cLib_addCalcAngleS2(&a_this->current.angle.z, 0x4000, 0x20, 0x80); + break; + } + + s16 angleY_offset = 0; + s16 angleX_offset = 0; + + if (speed_f > 1.0f) { + sp68 = i_this->mTargetMovePos - a_this->current.pos; + f32 var_f30 = JMAFastSqrt(sp68.x * sp68.x + sp68.z * sp68.z); + + i_this->mMoveAngle.y = cM_atan2s(sp68.x, sp68.z); + i_this->mMoveAngle.x = -cM_atan2s(sp68.y, var_f30); + + f32 temp_f2 = var_f30 * 2.0f; + if (temp_f2 > 12000.0f) { + temp_f2 = 12000.0f; + } + + angleY_offset = temp_f2 * cM_ssin(i_this->field_0x4750 * 1300); + angleX_offset = (temp_f2 / 2) * cM_ssin(i_this->field_0x4750 * 1100); + } else { + angleX_max_step = 0x20; + } + + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mMoveAngle.y + angleY_offset, 0x10, 0x300); + cLib_addCalcAngleS2(&a_this->current.angle.x, i_this->mMoveAngle.x + angleX_offset, 0x20, angleX_max_step); + a_this->speedF = speed_f; + return 4; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void fish_end(b_ob_class* param_0) { - nofralloc +static asm int fish_end(b_ob_class* i_this){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/fish_end__FP10b_ob_class.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061AE94-8061AE98 000110 0004+00 0/1 0/0 0/0 .rodata @5572 */ @@ -1605,14 +3008,116 @@ COMPILER_STRIP_GATE(0x8061AEB0, &lit_5579); #pragma pop /* 806147D4-80614B70 004354 039C+00 1/1 0/0 0/0 .text dmcalc__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static void dmcalc(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + int i; + ob_part_s* part; + + cXyz sp2C; + cXyz sp20; + cXyz sp14; + + f32 var_f29; + f32 var_f28 = 0.0f; + + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + cMtx_XrotM(*calc_mtx, a_this->shape_angle.x); + cMtx_YrotM(*calc_mtx, i_this->field_0x47c4); + + sp2C.x = 0.0f; + sp2C.y = 0.0f; + + if (i_this->mAction == OB_ACTION_FISH_END) { + sp2C.z = WREG_F(3) + -40.0f; + var_f28 = NREG_F(11) + -5.0f; + } else { + sp2C.z = AREG_F(15) + -20.0f; + } + + MtxPosition(&sp2C, &sp14); + sp2C.x = 0.0f; + sp2C.y = 0.0f; + f32 temp_f30 = 1.0f; + + part = i_this->mBodyParts; + + i_this->mBodyParts[0].field_0x26 = i_this->mBodyParts[0].mAngle.y; + i_this->mBodyParts[0].mPos = a_this->current.pos; + i_this->mBodyParts[0].mAngle = a_this->shape_angle; + i_this->mBodyParts[0].mAngle.z = i_this->field_0x47c4; + part++; + + if (i_this->field_0x5d08 != 0) { + i_this->field_0x5d08--; + } + + f32 var_f27 = (f32)i_this->field_0x5d08 * 0.6f; + + f32 var_f26; + if (a_this->speedF < 1.0f) { + var_f26 = JREG_F(19) + -10.0f; + } else { + var_f26 = 0.0f; + } + + for (i = 1; i < 20; i++, part++) { + // this block is almost certainly fake, but cant figure out a better way to fix instruction + // order + int var_r27 = i * (JREG_S(6) + 5000); + int temp_r3 = (JREG_S(4) + i_this->field_0x5d08 * (JREG_S(5) + 1200)); + int temp_r0 = (temp_r3 + var_r27); + temp_r0 = temp_r0; + + f32 temp_f2 = var_f27 * cM_ssin(temp_r0 + 3000); + f32 temp_f3 = var_f26 * cM_ssin(JREG_S(7) + var_r27 + 3000); + + f32 temp_f4; + if (i == (KREG_S(7) + 18)) { + sp2C.z = part->mSize * (WREG_F(17) + 250.0f); + temp_f4 = part->mSize * (WREG_F(9) + 0.4f); + } else { + sp2C.z = part->mSize * (WREG_F(14) + 450.0f); + temp_f4 = part->mSize; + } + + f32 temp_f1 = part->mPos.x; + temp_f1 -= part[-1].mPos.x; + + var_f29 = temp_f3 + (temp_f1 + (sp14.x * temp_f30)); + f32 temp_f2_2 = temp_f2 + (var_f28 + (part->mPos.y + (sp14.y * temp_f30))); + + if (temp_f2_2 < i_this->field_0x47a0 + (temp_f4 * (NREG_F(12) + 350.0f))) { + temp_f2_2 = i_this->field_0x47a0 + (temp_f4 * (NREG_F(12) + 350.0f)); + } + + temp_f30 *= (WREG_F(15) + 1.0f); + + f32 var_f24 = temp_f2_2 - part[-1].mPos.y; + f32 var_f23 = (part->mPos.z - part[-1].mPos.z) + (sp14.z * temp_f30); + part[-1].field_0x26 = part[-1].mAngle.y; + part->mAngle.y = cM_atan2s(var_f29, var_f23); + part->mAngle.x = + -cM_atan2s(var_f24, JMAFastSqrt(var_f29 * var_f29 + var_f23 * var_f23)); + + cMtx_YrotS(*calc_mtx, part->mAngle.y); + cMtx_XrotM(*calc_mtx, part->mAngle.x); + MtxPosition(&sp2C, &sp20); + part->mPos = part[-1].mPos + sp20; + part->mAngle.y += -0x8000; + part->mAngle.x *= -1; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void dmcalc(b_ob_class* param_0) { - nofralloc +static asm void dmcalc(b_ob_class* i_this){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/dmcalc__FP10b_ob_class.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8061AEB4-8061AEB8 000130 0004+00 0/2 0/0 0/0 .rodata @5876 */ @@ -1749,34 +3254,359 @@ COMPILER_STRIP_GATE(0x8061AEFC, &lit_5894); #pragma pop /* 80614B70-806158E0 0046F0 0D70+00 1/1 0/0 0/0 .text fish_move__FP10b_ob_class */ +// matches with literals +#ifdef NONMATCHING +static void fish_move(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + cXyz sp84; + cXyz sp90; + + if (moveSW) { + int var_r16 = 0; + BOOL attn_ON = true; + + i_this->mBodyParts[0].mSph.OnCoSetBit(); + + switch (i_this->mAction) { + case OB_ACTION_FISH_NORMAL: + var_r16 = fish_normal(i_this); + break; + case OB_ACTION_FISH_VACUME: + var_r16 = fish_vacume(i_this); + break; + case OB_ACTION_FISH_END: + var_r16 = fish_end(i_this); + attn_ON = false; + break; + } + + if (i_this->mAttnOffTimer != 0) { + i_this->mAttnOffTimer--; + } + + if (attn_ON && i_this->mAttnOffTimer == 0) { + fopAcM_OnStatus(a_this, 0); + a_this->attention_info.flags = 4; + } else { + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; + } + + cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 2, 0x800); + cLib_addCalcAngleS2(&a_this->shape_angle.x, a_this->current.angle.x, 2, 0x800); + cLib_addCalcAngleS2(&a_this->shape_angle.z, a_this->current.angle.z, 2, 0x800); + + s16 var_r17_2 = 0; + f32 temp_f1 = 0.0f; + + if (var_r16 == 0) { + var_r17_2 = VREG_S(5) + 700; + temp_f1 = 30.0f; + } else if (var_r16 == 1) { + var_r17_2 = VREG_S(6) + 1600; + temp_f1 = 30.0f; + } else if (var_r16 == 2) { + var_r17_2 = VREG_S(5) + 1000; + temp_f1 = 15.0f; + } else if (var_r16 == 3) { + var_r17_2 = VREG_S(7) + 1600; + temp_f1 = VREG_F(18) + 30.0f; + } else if (var_r16 == 4) { + var_r17_2 = VREG_S(5) + 700; + } else if (var_r16 == 5) { + var_r17_2 = VREG_S(8) + 1000; + temp_f1 = KREG_F(18) + 30.0f; + } else if (var_r16 == 6) { + var_r17_2 = VREG_S(8) + 1200; + temp_f1 = KREG_F(18) + 40.0f; + } + + cLib_addCalc2(&i_this->field_0x47c0, temp_f1, 0.5f, 1.0f); + cLib_addCalcAngleS2(&i_this->field_0x47bc, var_r17_2, 1, 20); + i_this->field_0x47ba += i_this->field_0x47bc; + + s16 temp_r16 = i_this->field_0x47c0 * (a_this->speedF * cM_ssin(i_this->field_0x47ba)); + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + cMtx_XrotM(*calc_mtx, a_this->current.angle.x); + cMtx_YrotM(*calc_mtx, temp_r16); + + sp84.x = 0.0f; + sp84.y = 0.0f; + sp84.z = i_this->field_0x5d04 * (a_this->speedF * 0.6f * l_HIO.mBodySize); + MtxPosition(&sp84, &a_this->speed); + a_this->current.pos += a_this->speed; + + i_this->mOISound.startCreatureSoundLevel( + Z2SE_EN_OI_MOVE, i_this->field_0x5d04 * (a_this->speedF * 0.6f * l_HIO.mBodySize), + dComIfGp_getReverb(fopAcM_GetRoomNo(a_this))); + i_this->field_0x3b24[i_this->field_0x2320].z = temp_r16; + i_this->field_0x47c4 = temp_r16; + } + + i_this->field_0x2324[i_this->field_0x2320] = a_this->current.pos; + i_this->field_0x3b24[i_this->field_0x2320].y = a_this->current.angle.y; + i_this->field_0x3b24[i_this->field_0x2320].x = a_this->current.angle.x; + + ob_part_s* part = i_this->mBodyParts; + int var_r22 = 0; + s16 var_r17_2; + + f32 var_f31; + if (!moveSW2) { + var_f31 = (TREG_F(1) + 7.5f) / i_this->field_0x5d04; + } else { + dmcalc(i_this); + } + + for (int i = 0; i < 19 && !part->mHide; i++, part++) { + s16 var_r25; + + if (!moveSW2) { + if (i >= 1) { + var_r22 = XREG_S(0) + 4; + var_r17_2 = 0; + } else { + if (i_this->field_0x47b0 == 100) { + var_r17_2 = cM_ssin(i_this->field_0x47b0 * 3000) * JREG_F(15); + } else { + var_r17_2 = + i_this->field_0x47b0 * cM_ssin(i_this->field_0x4750 * 3000) * (JREG_F(12) + 170.0f); + if (i_this->field_0x47b0 != 0) { + i_this->field_0x47b0--; + } + } + } + + int sp48 = var_f31 * buf_p[i]; + int temp_r4 = ((i_this->field_0x2320 - (s16)var_r22) - sp48) & 0x1FF; + part->mPos = i_this->field_0x2324[temp_r4]; + part->field_0x26 = part->mAngle.y + part->mAngle.z; + part->mAngle = i_this->field_0x3b24[temp_r4]; + part->mSize = l_HIO.mBodySize * size_p[i]; + var_r25 = (s16)(part->field_0x26 - (part->mAngle.y + part->mAngle.z)); + } else { + var_r17_2 = 0; + var_r25 = (s16) - (part->field_0x26 - part->mAngle.y); + } + + mDoMtx_stack_c::transS(part->mPos.x, part->mPos.y, part->mPos.z); + mDoMtx_stack_c::scaleM(part->mSize, part->mSize, part->mSize); + mDoMtx_stack_c::YrotM(part->mAngle.y); + mDoMtx_stack_c::XrotM(part->mAngle.x + var_r17_2); + mDoMtx_stack_c::YrotM(part->mAngle.z); + mDoMtx_stack_c::ZrotM(a_this->shape_angle.z); + + if (i == 0) { + mDoMtx_stack_c::push(); + cLib_addCalcAngleS2(&i_this->field_0x47ae, var_r25 * (VREG_S(4) + 7), 4, 0x400); + mDoMtx_stack_c::pop(); + } else if (i == 18) { + f32 temp_f28 = YREG_F(0) + 1000.0f; + f32 temp_f27 = YREG_F(1) + 4000.0f; + + for (int j = 0; j < 3; j++) { + i_this->field_0x47a4[j] = + temp_f28 * cM_ssin(i_this->field_0x4750 * (YREG_S(1) + 1000) + (j * (YREG_S(2) + -12000))); + } + + i_this->field_0x47aa = temp_f27 * cM_ssin(i_this->field_0x4750 * (YREG_S(2) + 1200)); + cLib_addCalcAngleS2(&i_this->field_0x47ac, var_r25 * (VREG_S(3) + 4), 4, 0x400); + } + + if (!moveSW2) { + if (i == 18) { + mDoMtx_stack_c::transM(0.0f, 0.0f, XREG_F(1) + 250.0f); + } else if (i != 0) { + mDoMtx_stack_c::transM(0.0f, 0.0f, XREG_F(0) + 600.0f); + } + } else if (i == 18) { + mDoMtx_stack_c::transM(0.0f, 0.0f, (XREG_F(1) + 250.0f) - 150.0f); + } else if (i != 0) { + mDoMtx_stack_c::transM(0.0f, 0.0f, (XREG_F(0) + 600.0f) - 250.0f); + } + + if (i == 0) { + part->mpMorf->play(NULL, 0, 0); + + if (i_this->mAnmID == OB_ANM_EAT_2 && i_this->mBodyParts[0].mpMorf->checkFrame(1.0f)) { + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_EAT02, -1); + } + } + + part->mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + part->mpMorf->modelCalc(); + + if (i == 0 && i_this->mSuiBrkFrame > 0.0f) { + i_this->mpSuiBrk->setFrame(i_this->mSuiBrkFrame); + i_this->mpSuiBtk->play(); + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0), mDoMtx_stack_c::get()); + mDoMtx_stack_c::XrotM(VREG_S(1) + 0x4000); + mDoMtx_stack_c::transM(0.0f, VREG_F(0) + 1300.0f, 0.0f); + i_this->mpSuiModel->setBaseTRMtx(mDoMtx_stack_c::get()); + } + + if (i >= 4 && i <= 17) { + pno = i; + fin = 0; + + if (part->field_0x3e == 0) { + cLib_addCalcAngleS2(&part->mFinARot.x, -4000, 0x20, 0x28); + } else { + cLib_addCalcAngleS2(&part->mFinARot.x, 0, 8, 100); + } + + cLib_addCalcAngleS2(&part->mFinARot.y, var_r25 * (TREG_S(9) + 7), 4, 0x400); + + mDoMtx_stack_c::push(); + mDoMtx_stack_c::transM(KREG_F(0), KREG_F(1) + 510.00003f, KREG_F(2) + -390.00003f); + part->mpFinMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + part->mpFinMorf->modelCalc(); + mDoMtx_stack_c::pop(); + } + + if (i >= 7 && i <= 15) { + pno = i; + fin = 1; + + mDoMtx_stack_c::push(); + mDoMtx_stack_c::transM(ZREG_F(0), ZREG_F(1) + -500.00003f, ZREG_F(2) + -290.00003f); + mDoMtx_stack_c::ZrotM(-0x8000); + part->mpFinUnkMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + part->mpFinUnkMorf->modelCalc(); + mDoMtx_stack_c::pop(); + } + + if (i == 8) { + pno = i; + + cLib_addCalcAngleS2(&part->mFinBRot.y, var_r25 * (VREG_S(8) + 7), 4, 0x400); + + mDoMtx_stack_c::push(); + mDoMtx_stack_c::transM(KREG_F(3), KREG_F(4) + -360.0f, KREG_F(5) + -360.0f); + part->mpFinBMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + part->mpFinBMorf->modelCalc(); + mDoMtx_stack_c::pop(); + } + + if (i == 17) { + pno = i; + + cLib_addCalcAngleS2(&part->mFinCRot.y, var_r25 * (TREG_S(8) + 13), 4, 0x400); + + mDoMtx_stack_c::push(); + mDoMtx_stack_c::transM(KREG_F(6), KREG_F(7) + -480.00003f, KREG_F(8) + -120.00001f); + part->mpFinCMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + part->mpFinCMorf->modelCalc(); + mDoMtx_stack_c::pop(); + } + + if (i == 0) { + MTXCopy(part->mpMorf->getModel()->getBaseTRMtx(), *calc_mtx); + + sp84.set(0.0f, 0.0f, VREG_F(2) + 700.0f); + MtxPosition(&sp84, &sp90); + part->mSph.SetC(sp90); + part->mSph.SetR(part->mSize * (TREG_F(16) + 400.0f)); + + sp84.set(0.0f, 0.0f, VREG_F(1)); + MtxPosition(&sp84, &sp90); + i_this->mFishHeadSph.SetC(sp90); + i_this->mFishHeadSph.SetR(part->mSize * (TREG_F(16) + 450.0f)); + + dComIfG_Ccsp()->Set(&i_this->mFishHeadSph); + } else { + part->mSph.SetC(part->mPos); + + if (i != 18) { + part->mSph.SetR(part->mSize * (TREG_F(18) + 450.0f)); + } else { + part->mSph.SetR(part->mSize * (TREG_F(17) + 200.0f)); + } + } + + dComIfG_Ccsp()->Set(&part->mSph); + } + + if (moveSW) { + i_this->field_0x2320++; + i_this->field_0x2320 &= 0x1FF; + } + + f32 var_f31_2 = l_HIO.mBodySize * ((VREG_F(17) + 360.0f) * 0.6f); + a_this->current.pos.y -= var_f31_2; + a_this->old.pos.y -= var_f31_2; + i_this->mAcch.CrrPos(dComIfG_Bgsp()); + a_this->current.pos.y += var_f31_2; + a_this->old.pos.y += var_f31_2; + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getBaseTRMtx(), mDoMtx_stack_c::get()); + mDoMtx_stack_c::transM(XREG_F(5), XREG_F(6) + 390.0f, XREG_F(7) + 400.0f + 11.0f); + mDoMtx_stack_c::multVecZero(&sp90); + a_this->eyePos = sp90; + a_this->attention_info.position = a_this->eyePos; + a_this->attention_info.position.y += 50.0f; + + if (i_this->mDemoAction == 21 || i_this->mDemoAction == 22) { + sp84 = dComIfGp_getCamera(0)->mLookat.mEye - sp90; + } else { + sp84 = player->eyePos - sp90; + } + + s16 temp_r15_2 = -cM_atan2s(sp84.y, sp84.z); + int temp_r16_2 = cM_atan2s(sp84.x, JMAFastSqrt(sp84.y * sp84.y + sp84.z * sp84.z)); + + mDoMtx_stack_c::transS(sp90.x, sp90.y, sp90.z); + mDoMtx_stack_c::XrotM(temp_r15_2); + mDoMtx_stack_c::YrotM(temp_r16_2); + + i_this->field_0x4740 = cM_ssin(i_this->field_0x4750 * 1000) * 9.5f + 9.5f; + i_this->mpCoreMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpCoreMorf->setFrame(i_this->field_0x4740); + i_this->mpCoreMorf->modelCalc(); + + i_this->mCoreSph.SetC(sp90); + i_this->mCoreSph.SetR(l_HIO.mCoreSize * 80.0f); + dComIfG_Ccsp()->Set(&i_this->mCoreSph); + i_this->mFishBattleMode = 2; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void fish_move(b_ob_class* param_0) { +static asm void fish_move(b_ob_class* i_this) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/fish_move__FP10b_ob_class.s" } #pragma pop +#endif /* 806158E0-806159C4 005460 00E4+00 1/1 0/0 0/0 .text cam_3d_morf__FP10b_ob_classf */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void cam_3d_morf(b_ob_class* param_0, f32 param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/cam_3d_morf__FP10b_ob_classf.s" +static void cam_3d_morf(b_ob_class* i_this, f32 param_1) { + cLib_addCalc2(&i_this->mDemoCamCenter.x, i_this->mDemoCamCenterTarget.x, param_1, + i_this->field_0x5cc0 * i_this->field_0x5cd0); + cLib_addCalc2(&i_this->mDemoCamCenter.y, i_this->mDemoCamCenterTarget.y, param_1, + i_this->field_0x5cc4 * i_this->field_0x5cd0); + cLib_addCalc2(&i_this->mDemoCamCenter.z, i_this->mDemoCamCenterTarget.z, param_1, + i_this->field_0x5cc8 * i_this->field_0x5cd0); + + cLib_addCalc2(&i_this->mDemoCamEye.x, i_this->mDemoCamEyeTarget.x, param_1, + i_this->field_0x5cb4 * i_this->field_0x5cd0); + cLib_addCalc2(&i_this->mDemoCamEye.y, i_this->mDemoCamEyeTarget.y, param_1, + i_this->field_0x5cb8 * i_this->field_0x5cd0); + cLib_addCalc2(&i_this->mDemoCamEye.z, i_this->mDemoCamEyeTarget.z, param_1, + i_this->field_0x5cbc * i_this->field_0x5cd0); } -#pragma pop /* 806159C4-80615A10 005544 004C+00 1/1 0/0 0/0 .text s_hasidel_sub__FPvPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void s_hasidel_sub(void* param_0, void* param_1) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/s_hasidel_sub__FPvPv.s" +static void* s_hasidel_sub(void* i_this, void* i_data) { + if (fopAcM_IsActor(i_this) && fopAcM_GetName(i_this) == PROC_OCTHASHI) { + fopAcM_delete((fopAc_ac_c*)i_this); + } + + return NULL; } -#pragma pop /* ############################################################################################## */ /* 8061AF00-8061AF04 00017C 0004+00 0/1 0/0 0/0 .rodata @6720 */ @@ -1822,14 +3652,1022 @@ COMPILER_STRIP_GATE(0x8061AF14, &lit_6725); #pragma pop /* 80615A10-80618540 005590 2B30+00 2/1 0/0 0/0 .text demo_camera__FP10b_ob_class */ +// matches with literals? +#ifdef NONMATCHING +static void demo_camera(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + camera_class* camera0 = dComIfGp_getCamera(0); + + cXyz sp58; + cXyz sp64; + cXyz sp70; + cXyz sp7C; + cXyz sp88; + + b_oh_class* tentacle = + (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i_this->field_0x5ce8]); + int var_r27 = 0; + + switch (i_this->mDemoAction) { + case 1: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFEF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 2; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(46, 0, 0, 0); + + i_this->mDemoCamEye = camera0->mLookat.mEye; + i_this->mDemoCamCenter = camera0->mLookat.mCenter; + sp58 = i_this->mDemoCamEye - tentacle->current.pos; + + i_this->field_0x5ce0 = cM_atan2s(sp58.x, sp58.z); + + tentacle->field_0x1f68 = player->current.pos; + tentacle->field_0x1f74 = player->shape_angle; + tentacle->field_0x1f7c = 0.1f; + + i_this->field_0x5cd8 = 300.0f; + i_this->field_0x5cdc = 1500.0f; + /* fallthrough */ + case 2: + cLib_addCalc2(&i_this->mDemoCamCenter.x, player->current.pos.x, 0.3f, + i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, player->current.pos.y + 150.0f, 0.3f, + i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, player->current.pos.z, 0.3f, + i_this->field_0x5cd0 * 200.0f); + + cMtx_YrotS(*calc_mtx, i_this->field_0x5ce0); + + sp58.x = 0.0f; + sp58.y = i_this->field_0x5cd8; + sp58.z = i_this->field_0x5cdc; + MtxPosition(&sp58, &sp64); + + if (i_this->mDemoActionTimer > 30) { + cLib_addCalc2(&i_this->field_0x5cd8, 1050.0f, 0.2f, 15.0f); + cLib_addCalc2(&i_this->field_0x5cdc, 1000.0f, 0.2f, 10.0f); + } + + sp64 += tentacle->current.pos; + + cLib_addCalc2(&i_this->mDemoCamEye.x, sp64.x, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamEye.y, sp64.y, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamEye.z, sp64.z, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, TREG_F(7) + 0.1f); + + MTXCopy(tentacle->mpMorf->getModel()->getAnmMtx(29), mDoMtx_stack_c::get()); + + mDoMtx_stack_c::transM(ZREG_F(0) + 50.0f, ZREG_F(1) + -100.0f, + -(ZREG_F(2) + 80.0f) * (f32)tentacle->field_0xc88); + + if (tentacle->mAction == OH_ACTION_CAUGHT) { + player->setPlayerPosAndAngle(mDoMtx_stack_c::get()); + } else { + csXyz sp174; + + mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &sp174); + cLib_addCalcAngleS2(&tentacle->field_0x1f74.y, sp174.y, 1, 0x800); + mDoMtx_stack_c::multVecZero(&sp64); + + cLib_addCalc2(&tentacle->field_0x1f7c, 1.0f, 1.0f, 0.1f); + cLib_addCalc2(&tentacle->field_0x1f68.x, sp64.x, 1.0f, tentacle->field_0x1f7c * 100.0f); + cLib_addCalc2(&tentacle->field_0x1f68.y, sp64.y, 1.0f, tentacle->field_0x1f7c * 100.0f); + cLib_addCalc2(&tentacle->field_0x1f68.z, sp64.z, 1.0f, tentacle->field_0x1f7c * 100.0f); + player->setPlayerPosAndAngle(&tentacle->field_0x1f68, &tentacle->field_0x1f74); + } + break; + case 3: + player->setPlayerPosAndAngle(&a_this->home.pos, &tentacle->field_0x1f74); + + cMtx_YrotS(*calc_mtx, i_this->field_0x5ce0); + sp58.x = 0.0f; + sp58.y = i_this->field_0x5cd8; + sp58.z = i_this->field_0x5cdc; + MtxPosition(&sp58, &sp64); + + cLib_addCalc2(&i_this->field_0x5cd8, 800.0f, 0.2f, 10.0f); + cLib_addCalc2(&i_this->field_0x5cdc, 1000.0f, 0.2f, 10.0f); + + sp64 += tentacle->current.pos; + cLib_addCalc2(&i_this->mDemoCamEye.x, sp64.x, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamEye.y, sp64.y, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamEye.z, sp64.z, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, TREG_F(7) + 0.1f); + + if (!(i_this->field_0x4750 & 15)) { + dComIfGp_getVibration().StartShock(4, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (i_this->mAnmID == OB_ANM_EAT && i_this->mBodyParts[0].mpMorf->checkFrame(153.0f)) { + i_this->mDemoAction = 4; + i_this->mDemoActionTimer = 0; + + sp64 = a_this->home.pos; + sp64.y += KREG_F(13) + 400.0f; + player->setPlayerPosAndAngle(&sp64, &tentacle->field_0x1f74); + + daPy_getPlayerActorClass()->setThrowDamage(a_this->home.angle.y, 10.0f, + KREG_F(14) + 30.0f, 4, 1, 2); + daPy_getPlayerActorClass()->changeDemoMode(1, 0, 0, 0); + } + break; + case 4: + cLib_addCalc2(&i_this->mDemoCamCenter.x, player->current.pos.x, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, player->current.pos.y, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, player->current.pos.z, 0.4f, 300.0f); + + if (i_this->mBodyParts[0].mpMorf->isStop()) { + i_this->mDemoAction = 100; + i_this->mCoreAnm = OB_ANM_WAIT; + i_this->mCoreAnmMode = J3DFrameCtrl::LOOP_REPEAT_e; + i_this->field_0x4794 = 100; + } + break; + case 10: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFEF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 11; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + + i_this->field_0x5cf8 = player->shape_angle.y; + i_this->field_0x5cfc = 0; + i_this->field_0x5d00 = ZREG_F(3) + 1000.0; + + anm_init(i_this, OB_ANM_OPEN_MOUTH_WAIT, 3.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + + if (cM_rndF(1.0f) < 0.5f) { + i_this->field_0x5cd4 = 500.0f; + } else { + i_this->field_0x5cd4 = -500.0f; + } + /* fallthrough */ + case 11: + f32 temp_f31 = (a_this->eyePos - player->current.pos).abs(); + if (temp_f31 < KREG_F(11) + 150.0f) { + i_this->mDemoAction = 100; + break; + } + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0x13), mDoMtx_stack_c::get()); + + sp58.x = i_this->field_0x5d00; + sp58.y = 0.0; + sp58.z = 0.0; + mDoMtx_stack_c::multVec(&sp58, &i_this->field_0x5cec); + + if (i_this->field_0x5cec.y < a_this->home.pos.y) { + i_this->field_0x5cec.y = a_this->home.pos.y; + } + + if (i_this->mDemoActionTimer >= 118) { + daPy_getPlayerActorClass()->changeDemoMode(46, 0, 0, 0); + } + + if (i_this->mDemoActionTimer < 75) { + if (!(i_this->field_0x4750 & 7)) { + dComIfGp_getVibration().StartShock(1, 0x1f, cXyz(0.0f, 1.0f, 0.0f)); + } + } else if (i_this->mDemoActionTimer < 146 && !(i_this->field_0x4750 & 15)) { + dComIfGp_getVibration().StartShock(4, 0x1f, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (i_this->mDemoActionTimer >= 138) { + cLib_addCalc2(&i_this->field_0x5d00, 700.0f, 0.1f, 200.0f); + + if (i_this->mDemoActionTimer > 170) { + i_this->mDemoAction = 100; + } + + if (i_this->mDemoActionTimer == 138) { + daPy_getPlayerActorClass()->setThrowDamage(a_this->current.angle.y, 0.0f, 0.0f, 4, + 1, 2); + daPy_getPlayerActorClass()->changeDemoMode(1, 0, 0, 0); + } + } else { + i_this->field_0x5cf8 += 0x300; + + if (i_this->mDemoActionTimer >= 15) { + if (i_this->mDemoActionTimer == 30) { + anm_init(i_this, OB_ANM_SWALLOW, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_SWALLOW, -1); + } + + cLib_addCalc0(&i_this->field_0x5d00, 1.0f, i_this->field_0x5cfc); + cLib_addCalc2(&i_this->field_0x5cfc, 100.0f, 1.0f, 2.0f); + } + } + + player->setPlayerPosAndAngle(&i_this->field_0x5cec, i_this->field_0x5cf8, 0); + + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + sp58.x = i_this->field_0x5cd4; + sp58.y = ZREG_F(12) + 500.0f; + sp58.z = ZREG_F(13) + 2000.0f; + MtxPosition(&sp58, &i_this->mDemoCamEye); + i_this->mDemoCamEye += a_this->current.pos; + + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = i_this->field_0x5cec; + } else { + cLib_addCalc2(&i_this->mDemoCamCenter.x, player->current.pos.x, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, player->current.pos.y, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, player->current.pos.z, 0.4f, 300.0f); + } + break; + case 20: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 21; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(0x17, 0, 0, 0); + + i_this->mDemoCamCenter.x = -371.0f; + i_this->mDemoCamCenter.y = KREG_F(11) + -23869.0; + i_this->mDemoCamCenter.z = -1247.0f; + i_this->mDemoCamEye.x = -473.0f; + i_this->mDemoCamEye.y = -23869.0f; + i_this->mDemoCamEye.z = -1581.0f; + i_this->field_0x5cd0 = 0; + + Z2GetAudioMgr()->bgmStop(30, 0); + Z2GetAudioMgr()->subBgmStart(Z2BGM_BOSS_OCTAEEL_D02); + + fpcM_Search(s_bfdel_sub, i_this); + dComIfGs_onOneZoneSwitch(8, -1); + /* fallthrough */ + case 21: + if (i_this->mDemoActionTimer == 290) { + i_this->mBlureRateTarget = 150; + i_this->field_0x5dd8 = 2; + } + + sp64.set(-204.0f, -24000.0f, -1307.0f); + player->setPlayerPosAndAngle(&sp64, 1642, 0); + + if (i_this->mDemoActionTimer > KREG_S(6) + 320) { + cLib_addCalc2(&i_this->mDemoCamCenter.y, KREG_F(12) + -23169.0f, 0.1f, + i_this->field_0x5cd0 * 40.0f); + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, KREG_F(7) + 0.02f); + } + + if (i_this->mDemoActionTimer < KREG_S(7) + 430) { + break; + } + + i_this->mDemoAction = 22; + i_this->mDemoActionTimer = 0; + i_this->field_0x5cd8 = -2000.0f; + i_this->mBlureRateTarget = 0; + /* fallthrough */ + case 22: + sp88 = a_this->eyePos; + sp88.y += i_this->field_0x5cd8; + + if (!(i_this->mDemoActionTimer & 7) && (i_this->mDemoActionTimer >> 3) <= 13) { + i_this->mBodyParts[4 + (i_this->mDemoActionTimer >> 3)].field_0x3e = 1; + } + + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = sp88; + i_this->mDemoCamEye.x = 7180.0f; + i_this->mDemoCamEye.y = BREG_F(8) + -16200.0f + 100.0f; + i_this->mDemoCamEye.z = 100.0f; + } else { + cLib_addCalc2(&i_this->mDemoCamCenter.x, sp88.x, 0.4f, 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, sp88.y, 0.4f, 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, sp88.z, 0.4f, 200.0f); + cLib_addCalc0(&i_this->field_0x5cd8, 0.1f, 15.0f); + } + + if (i_this->mDemoActionTimer >= 250) { + cLib_addCalc2(&i_this->mDemoCamEye.y, -16500.0f, 0.1f, BREG_F(9) + 2.0f); + } + + if (i_this->mDemoActionTimer != 430) { + break; + } + + i_this->mDemoAction = 23; + i_this->mDemoActionTimer = 0; + /* fallthrough */ + case 23: + i_this->mDemoCamEye.set(-1236.0f, -23800.0f, -3470.0f); + sp88 = a_this->eyePos; + + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = sp88; + } else { + cLib_addCalc2(&i_this->mDemoCamCenter.x, sp88.x, 0.2f, 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, sp88.y, 0.2f, 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, sp88.z, 0.2f, 200.0f); + } + + if (i_this->mDemoActionTimer == 120) { + i_this->mDemoAction = 101; + Z2GetAudioMgr()->bgmStart(Z2BGM_BOSS_OCTAEEL_1, 0, 0); + } + break; + case 30: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 31; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(0x17, 0, 0, 0); + + i_this->mDemoCamEye.set(-1705.0f, -23870.0f, -762.0f); + Z2GetAudioMgr()->subBgmStart(Z2BGM_BOSS_OCTAEEL_D01); + mDoAud_seStart(Z2SE_EN_OI_DEMO_APPEAR, NULL, 0, 0); + dComIfGs_onOneZoneSwitch(5, -1); + /* fallthrough */ + case 31: + if (i_this->mDemoActionTimer < 40) { + sp64.set(-1193.0f, -24000.0f, -770.0f); + player->setPlayerPosAndAngle(&sp64, 0x2A02, 0); + } + + if (i_this->mDemoActionTimer == 30) { + dComIfGp_getEvent().startCheckSkipEdge(a_this); + } + + sp88 = a_this->current.pos; + if (sp88.y < i_this->field_0x47a0 + NREG_F(1) + 200.0f) { + sp88.y = i_this->field_0x47a0 + NREG_F(1) + 200.0f; + } + + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = sp88; + } else { + cLib_addCalc2(&i_this->mDemoCamCenter.x, sp88.x, 0.1f, 50.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, sp88.y, 0.1f, 50.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, sp88.z, 0.1f, 50.0f); + } + + if (i_this->mDemoActionTimer >= 90 && i_this->mDemoActionTimer <= 260) { + cLib_addCalc2(&i_this->mDemoCamFovy, 30.0f, 0.2f, i_this->field_0x5cd0); + } else { + cLib_addCalc2(&i_this->mDemoCamFovy, 55.0f, 0.2f, i_this->field_0x5cd0); + } + + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, 0.05f); + + if (i_this->mDemoActionTimer == 390) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[1]); + tentacle->mActionPhase = 1; + dComIfGp_getVibration().StartQuake(2, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (i_this->mDemoActionTimer >= 390 && i_this->mDemoActionTimer <= 525) { + i_this->field_0x5ce4 = WREG_F(12) + 3.0f; + } + + if (i_this->mDemoActionTimer == 410) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[5]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 430) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[3]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 445) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[2]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 460) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[6]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 470) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[4]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 475) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[7]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 570) { + i_this->mDemoAction = 32; + i_this->mDemoActionTimer = 0; + i_this->mBodyParts[0].mpMorf->setPlaySpeed(1.0f); + + sp58.set(0.0f, 0.0f, 0.0f); + dComIfGp_particle_set(0x87FB, &sp58, NULL, NULL); + dComIfGp_getVibration().StartQuake(3, 31, cXyz(0.0f, 1.0f, 0.0f)); + + i_this->field_0x5cd0 = 0; + i_this->mAction = 1; + i_this->mMode = 0; + + for (int i = 1; i < 7; i++) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i]); + tentacle->mActionPhase = 2; + } + + i_this->mBlureRateTarget = 150; + i_this->field_0x5dd8 = 1; + i_this->mZoneSwTimer = 0; + } + break; + case 32: + if (i_this->mDemoActionTimer >= 30) { + if (i_this->mDemoActionTimer == 30) { + i_this->mDemoCamCenterTarget.set(80.0f, -24093.0f, 160.0f); + i_this->mDemoCamEyeTarget.set(-447.0f, -22850.0f, -718.0f); + + i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x); + i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y); + i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z); + i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x); + i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y); + i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z); + i_this->field_0x5cd0 = 0.0f; + + daPy_getPlayerActorClass()->changeDemoMode(0x17, 0, 0, 0); + } + + cam_3d_morf(i_this, BREG_F(17) + 0.1f); + cLib_addCalc2(&i_this->field_0x5cd0, BREG_F(18) + 0.04f, 1.0f, BREG_F(19) + 0.0005f); + } + + cLib_addCalc2(&a_this->home.pos.y, i_this->field_0x47a0, 1.0f, 2.0f); + + if (i_this->mDemoActionTimer <= 70) { + i_this->field_0x5ce4 = WREG_F(10) + 6.0f; + } + + if (i_this->mDemoActionTimer == 70) { + dComIfGp_getVibration().StopQuake(31); + i_this->mBlureRateTarget = 0; + } + + if (i_this->mBodyParts[0].mpMorf->isStop()) { + anm_init(i_this, OB_ANM_WAIT, 0.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + + if (i_this->mDemoActionTimer == 120) { + fopMsgM_messageSetDemo(1153); // Twilit Aquatic MORPHEEL + } + + if (i_this->mDemoActionTimer == 200) { + i_this->mDemoAction = 100; + for (int i = 0; i < 8; i++) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i]); + tentacle->mAction = 1; + tentacle->mActionPhase = 1; + tentacle->mTimers[0] = cM_rndF(50.0f) + 100.0f; + } + + Z2GetAudioMgr()->bgmStart(Z2BGM_BOSS_OCTAEEL_0, 0, 0); + } + break; + case 40: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 41; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + i_this->mDemoCamEye.set(5000.0f, -17000.0f, 5000.0f); + + Z2GetAudioMgr()->bgmStop(30, 0); + Z2GetAudioMgr()->bgmStreamPrepare(0x2000020); + Z2GetAudioMgr()->bgmStreamPlay(); + mDoAud_seStart(Z2SE_EN_OI_ENDDEMO, 0, 0, 0); + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_ENDDEMO, -1); + /* fallthrough */ + case 41: + case 42: + case 43: + case 44: + if (i_this->mDemoAction >= 43) { + var_r27 = 1; + } + + if (i_this->mDemoAction == 43 && i_this->mDemoActionTimer == 60) { + i_this->mDemoCamEye.set(4716.0f, -22925.0f, 1873.0f); + i_this->mDemoAction = 44; + i_this->mDemoActionTimer = 0; + } + + if (i_this->mDemoAction == 42 || i_this->mDemoAction == 43) { + sp88 = a_this->eyePos; + } else { + MTXCopy(i_this->mBodyParts[BREG_S(5) + 8].mpMorf->getModel()->getAnmMtx(0), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp88); + } + + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = sp88; + } else { + f32 var_f31; + if (a_this->speedF < 1.0f) { + var_f31 = 0.1f; + } else { + var_f31 = 0.3f; + } + + cLib_addCalc2(&i_this->mDemoCamCenter.x, sp88.x, var_f31, 400.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, sp88.y, var_f31, 400.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, sp88.z, var_f31, 400.0f); + } + + if (i_this->mDemoAction != 44 || i_this->mDemoActionTimer != 120) { + break; + } + + i_this->mDemoCamCenter.set(4264.0f, -25096.0f, 12114.0f); + i_this->mDemoCamEye.set(-1377.0f, -22866.0f, 9105.0f); + i_this->mDemoAction = 45; + i_this->mDemoActionTimer = 0; + fpcM_Search(s_hasidel_sub, i_this); + fpcM_Search(s_kaisoudel_sub, i_this); + /* fallthrough */ + case 45: + var_r27 = 1; + if (i_this->mDemoActionTimer != 80) { + break; + } + + i_this->mDemoCamCenter.set(-560.0f, -16612.0f, -836.0f); + i_this->mDemoCamEye.set(-600.0f, -16245.0f, -1331.0f); + i_this->mDemoCamCenterTarget.set(-6378.0f, -21886.0f, 7150.0f); + i_this->mDemoCamEyeTarget.set(-6961.0f, -21727.0f, 7278.0f); + + i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x); + i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y); + i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z); + i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x); + i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y); + i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z); + i_this->field_0x5cd0 = 0.0f; + + i_this->mDemoAction = 46; + i_this->mDemoActionTimer = 0; + i_this->field_0x5dd8 = 4; + + obj_lv3WaterB_class* water = (obj_lv3WaterB_class*)fopAcM_SearchByName(PROC_OBJ_LV3WATERB); + water->mAction = LV3WATERB_ACT_END; + water->field_0x586 = 0; + var_r27 = 2; + /* fallthrough */ + case 46: + sp58.set(VREG_F(0) + -1225.0f, -24000.0f, VREG_F(1) + 8678.0f); + player->setPlayerPosAndAngle(&sp58, VREG_S(1) + 10000, 0); + + if (!(i_this->mDemoActionTimer & 7) && (i_this->mDemoActionTimer >> 3) <= 13) { + i_this->mBodyParts[(i_this->mDemoActionTimer >> 3) + 4].field_0x3e = 0; + } + + if (i_this->mDemoActionTimer > 0) { + cam_3d_morf(i_this, BREG_F(17) + 0.05f); + cLib_addCalc2(&i_this->field_0x5cd0, BREG_F(18) + 0.002f, 1.0f, BREG_F(19) + 0.0001f); + } + + if (i_this->mDemoActionTimer != 400) { + break; + } + + i_this->mDemoCamCenter.set(-1031.0f, -23787.0f, 8845.0f); + i_this->mDemoCamEye.set(-1629.0f, -23891.0f, 8958.0f); + i_this->mDemoAction = 47; + i_this->mDemoActionTimer = 0; + /* fallthrough */ + case 47: + if (i_this->mDemoActionTimer >= 50) { + cLib_addCalc2(&i_this->field_0x5d14, TREG_F(11) + -20.0f, 1.0f, TREG_F(12) + 0.25f); + } + + if (i_this->mDemoActionTimer == 50) { + i_this->mHideCore = true; + dComIfGp_particle_set(0x8491, &a_this->eyePos, NULL, NULL); + fopAcM_createDisappear(a_this, &a_this->eyePos, 15, 0, 0xFF); + mDoAud_seStart(Z2SE_EN_BQ_EYE_EXPLODE, NULL, 0, 0); + + cXyz sp94(1.0f, 1.0f, 1.0f); + csXyz sp17C(player->shape_angle); + sp17C.y += KREG_S(3) + -0x7060; + + fopAcM_createItemForBoss(&a_this->eyePos, UTAWA_HEART, fopAcM_GetRoomNo(a_this), &sp17C, + NULL, KREG_F(19) + 10.0f, 10.0f, -1); + dComIfGp_getVibration().StartShock(5, 1, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (i_this->mDemoActionTimer == 100) { + i_this->mDemoCamCenter.set(-2785.0f, -22626.0f, 7614.0f); + i_this->mDemoCamEye.set(-3295.0f, -22459.0f, 7307.0f); + i_this->mDemoCamCenterTarget.set(-2933.0f, -22626.0f, 6829.0f); + i_this->mDemoCamEyeTarget.set(-3295.0f, -22459.0f, 7307.0f); + + i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x); + i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y); + i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z); + i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x); + i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y); + i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z); + i_this->field_0x5cd0 = 0.0f; + + i_this->mDemoAction = 48; + i_this->mDemoActionTimer = 0; + } + break; + case 48: + if (i_this->mDemoActionTimer >= 60) { + i_this->field_0x5cd0 = 0.02f; + cam_3d_morf(i_this, BREG_F(17) + 0.1f); + + if (!(i_this->mDemoActionTimer & 3)) { + int idx = ((i_this->mDemoActionTimer - 60) >> 2); + if (idx < 19) { + i_this->mBodyParts[idx].mHide = true; + + cXyz spA0(i_this->mBodyParts[idx].mSize, + i_this->mBodyParts[idx].mSize, + i_this->mBodyParts[idx].mSize); + + if (idx == 0) { + mDoAud_seStart(Z2SE_EN_OI_EXPLODE, NULL, 0, 0); + for (int i = 0; i < 8; i++) { + fopAc_ac_c* tentacle = fopAcM_SearchByID(i_this->mTentacleActorIDs[i]); + fopAcM_delete(tentacle); + } + + i_this->field_0x5d40[0][idx] = dComIfGp_particle_set( + 0x8627, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + i_this->field_0x5d40[1][idx] = dComIfGp_particle_set( + 0x862A, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + } else if (idx == 18) { + i_this->field_0x5d40[0][idx] = dComIfGp_particle_set( + 0x8628, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + i_this->field_0x5d40[1][idx] = dComIfGp_particle_set( + 0x862B, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + } else { + i_this->field_0x5d40[0][idx] = dComIfGp_particle_set( + 0x8626, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + i_this->field_0x5d40[1][idx] = dComIfGp_particle_set( + 0x8629, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + } + } + } + } + + if (i_this->mDemoActionTimer == 180) { + i_this->mDemoAction = 49; + i_this->mDemoActionTimer = 0; + + for (int i = 0; i < 19; i++) { + for (int j = 0; j < 2; j++) { + if (i_this->field_0x5d40[j][i] != NULL) { + i_this->field_0x5d40[j][i]->becomeDeleteEmitter(); + } + } + } + + static cXyz room_pos(0.0f, 0.0f, 0.0f); + static cXyz sc(10.0f, 10.0f, 10.0f); + + for (int i = 0; i < 5; i++) { + static u16 ex_eff[] = {0x8621, 0x8622, 0x8623, 0x8624, 0x8625}; + dComIfGp_particle_set(ex_eff[i], &room_pos, NULL, &sc); + } + + i_this->mDemoCamEye.set(-4820.0f, -18600.0f, -510.0f); + i_this->mDemoCamCenter.set(-2630.0f, -21620.0f, 4900.0f); + i_this->mDemoCamFovy = 45.0f; + i_this->field_0x5cd0 = 0.0f; + + i_this->mSound.startCreatureSound(Z2SE_EN_BOSS_CONVERGE, 0, 0); + } + break; + case 49: + if (i_this->mDemoActionTimer >= 100) { + cLib_addCalc2(&i_this->mDemoCamFovy, 30.0f, 0.2f, i_this->field_0x5cd0); + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, 0.05f); + } + + if (i_this->mDemoActionTimer == 100) { + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + sp58.set(0.0f, JREG_F(8) + 300.0f, JREG_F(9) + 100.0f); + MtxPosition(&sp58, &sp64); + + sp64 += player->current.pos; + OS_REPORT("///YSTONE POS %d,%d,%d\n", sp64.x, sp64.y, sp64.z); + fopAcM_create(PROC_OBJ_YSTONE, 0, &sp64, fopAcM_GetRoomNo(a_this), NULL, NULL, -1); + } + + if (i_this->mDemoActionTimer == 120) { + obj_ystone_class* ystone = (obj_ystone_class*)fopAcM_SearchByName(PROC_OBJ_YSTONE); + if (ystone != NULL) { + ystone->field_0x59b = 0; + } + } + + if (i_this->mDemoActionTimer >= 180) { + i_this->mDemoCamFovy = 45.0f; + if (i_this->mDemoActionTimer == 180) { + i_this->field_0x5cd8 = JREG_F(8) + 300.0f; + } + + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + + sp58.x = ZREG_F(1); + sp58.y = ZREG_F(2) + 100.0f; + sp58.z = ZREG_F(3) + -200.0f; + MtxPosition(&sp58, &i_this->mDemoCamEye); + + i_this->mDemoCamEye += player->current.pos; + i_this->mDemoCamCenter = player->current.pos; + i_this->mDemoCamCenter.y += ZREG_F(4) + 200.0f; + + sp58.set(0.0f, i_this->field_0x5cd8, JREG_F(9) + 100.0f); + MtxPosition(&sp58, &sp64); + sp64 += player->current.pos; + + cLib_addCalc2(&i_this->field_0x5cd8, 210.0f, 0.05f, 0.5f); + + obj_ystone_class* ystone = (obj_ystone_class*)fopAcM_SearchByName(PROC_OBJ_YSTONE); + if (ystone != NULL) { + ystone->setCurrentPos(sp64); + } + + if (i_this->mDemoActionTimer == 279) { + cXyz spAC(-1520.0f, -23960.0f, 7100.0f); + csXyz sp184(0, 0, 0); + fopAcM_createWarpHole(&spAC, &sp184, fopAcM_GetRoomNo(a_this), 0, 1, 2); + } + + if (i_this->mDemoActionTimer == 290) { + i_this->mDemoAction = 100; + dComIfGs_onStageBossEnemy(); + dComIfGs_onSwitch(a_this->home.angle.z & 0xFF, fopAcM_GetRoomNo(a_this)); + fopAcM_delete(a_this); + } + } + break; + case 50: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 51; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + + i_this->field_0x5cf8 = player->shape_angle.y; + i_this->field_0x5cfc = 0; + i_this->field_0x5d00 = ZREG_F(3) + 300.0f; + + anm_init(i_this, OB_ANM_EAT, 3.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_EAT, -1); + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp64); + dComIfGp_particle_set(0x8803, &sp64, NULL, NULL); + dComIfGp_particle_set(0x8804, &sp64, NULL, NULL); + /* fallthrough */ + case 51: + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0x13), mDoMtx_stack_c::get()); + sp58.x = i_this->field_0x5d00; + sp58.y = 0.0; + sp58.z = 0.0; + mDoMtx_stack_c::multVec(&sp58, &i_this->field_0x5cec); + + i_this->field_0x5cf8 += 0x1000; + cLib_addCalc0(&i_this->field_0x5d00, 1.0f, i_this->field_0x5cfc); + cLib_addCalc2(&i_this->field_0x5cfc, 100.0f, 1.0f, 5.0f); + + player->setPlayerPosAndAngle(&i_this->field_0x5cec, i_this->field_0x5cf8, 0); + + cMtx_YrotS(*calc_mtx, a_this->home.angle.y + -0x2000); + sp58.x = 0.0; + sp58.y = ZREG_F(12) + 1000.0f; + sp58.z = ZREG_F(13) + 900.0f; + MtxPosition(&sp58, &i_this->mDemoCamEye); + i_this->mDemoCamEye += a_this->home.pos; + + if (i_this->mAnmID == OB_ANM_EAT) { + if (i_this->mBodyParts[0].mpMorf->checkFrame(120.0f)) { + daPy_getPlayerActorClass()->changeDemoMode(46, 0, 0, 0); + } + + if (i_this->mBodyParts[0].mpMorf->checkFrame(153.0f)) { + i_this->mDemoAction = 52; + i_this->mDemoActionTimer = 0; + + sp64 = a_this->home.pos; + sp64.y += KREG_F(13) + 400.0f; + player->setPlayerPosAndAngle(&sp64, 0, 0); + + daPy_getPlayerActorClass()->setThrowDamage(a_this->home.angle.y, 10.0f, + KREG_F(14) + 30.0f, 4, 1, 2); + daPy_getPlayerActorClass()->changeDemoMode(1, 0, 0, 0); + } + } + case 52: + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = i_this->field_0x5cec; + } else { + cLib_addCalc2(&i_this->mDemoCamCenter.x, player->current.pos.x, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, player->current.pos.y, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, player->current.pos.z, 0.4f, 300.0f); + } + + if (i_this->mDemoActionTimer > 25) { + cLib_addCalc2(&i_this->mDemoCamFovy, 40.0f, 0.05f, i_this->field_0x5cd0); + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, 0.05f); + } + + if (i_this->mDemoAction == 52 && i_this->mBodyParts[0].mpMorf->isStop()) { + i_this->mDemoAction = 100; + i_this->mCoreAnm = OB_ANM_WAIT; + i_this->mCoreAnmMode = J3DFrameCtrl::LOOP_REPEAT_e; + i_this->field_0x4794 = 100; + } + break; + case 60: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 61; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 40.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + /* fallthrough */ + case 61: + cMtx_YrotS(*calc_mtx, a_this->home.angle.y + 0x2000); + sp58.x = 0.0f; + sp58.y = ZREG_F(15) + 100.0f; + sp58.z = ZREG_F(16) + 1700.0f; + MtxPosition(&sp58, &i_this->mDemoCamEye); + i_this->mDemoCamEye += a_this->home.pos; + + i_this->mDemoCamCenter = a_this->home.pos; + i_this->mDemoCamCenter.y += ZREG_F(17) + 700.0f; + cLib_addCalc2(&i_this->mDemoCamFovy, 55.0f, 0.05f, 0.2f); + } + + if (i_this->mDemoAction != 0) { + if (i_this->mDemoAction >= 100) { + if (i_this->mDemoAction == 101) { + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + sp58.x = 0.0f; + sp58.y = JREG_F(1) + 100.0f; + sp58.z = JREG_F(2) + -250.0f; + MtxPosition(&sp58, &i_this->mDemoCamEye); + i_this->mDemoCamEye += player->current.pos; + + i_this->mDemoCamCenter = player->current.pos; + i_this->mDemoCamCenter.y += 120.0f; + } + + camera->mCamera.Reset(i_this->mDemoCamCenter, i_this->mDemoCamEye); + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + daPy_getPlayerActorClass()->cancelOriginalDemo(); + i_this->mDemoAction = 0; + } + + cXyz cam_center; + cXyz cam_eye; + + cam_center = i_this->mDemoCamCenter; + cam_eye = i_this->mDemoCamEye; + + s16 cam_bank = 0; + if (i_this->field_0x5ce4 > 0.0f) { + int sp38 = i_this->field_0x5ce4 * cM_ssin(i_this->mDemoActionTimer * 0x1B00) * 25.0f; + int sp40 = i_this->field_0x5ce4 * cM_ssin(i_this->mDemoActionTimer * 0x1900) * 25.0f; + sp58 = cam_center - cam_eye; + + s16 temp_r5 = sp38 + cM_atan2s(sp58.x, sp58.z); + s16 temp_r4 = sp40 - cM_atan2s(sp58.y, JMAFastSqrt(sp58.x * sp58.x + sp58.z * sp58.z)); + cMtx_YrotS(*calc_mtx, temp_r5); + cMtx_XrotM(*calc_mtx, temp_r4); + + sp58.x = 0.0; + sp58.y = 0.0; + sp58.z = sp58.abs(); + MtxPosition(&sp58, &cam_center); + cam_center += cam_eye; + + cam_bank = (BREG_F(4) + 30.0f) * + (i_this->field_0x5ce4 * cM_scos(i_this->mDemoActionTimer * 0x1E00)); + cLib_addCalc0(&i_this->field_0x5ce4, 1.0f, BREG_F(5) + 0.5f); + } + + camera->mCamera.Set(cam_center, cam_eye, cam_bank, i_this->mDemoCamFovy); + + i_this->mDemoActionTimer++; + i_this->field_0x4794 = 90; + cLib_addCalcAngleS2(&i_this->mBlureRate, i_this->mBlureRateTarget, 1, 8); + + if (i_this->mDemoAction >= 31 && i_this->mDemoAction < 40) { + if (dComIfGp_getEvent().checkSkipEdge()) { + cDmr_SkipInfo = JREG_S(8) + 30; + dStage_changeScene(1, 0.0f, 0, fopAcM_GetRoomNo(a_this), 0, -1); + } + } + } + + if (var_r27 != 0) { + sp64.set(0.0f, -23580.0f, 10300.0f); + + for (int i = 0; i < 4; i++) { + static u16 iso_eff[] = {0x87F7, 0x87F8, 0x87F9, 0x87FA}; + i_this->field_0x5d24[i] = + dComIfGp_particle_set(i_this->field_0x5d24[i], iso_eff[i], &sp64, NULL, NULL); + + if (var_r27 == 2) { + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0x5d24[i]); + if (emitter != NULL) { + emitter->becomeDeleteEmitter(); + } + } + } + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void demo_camera(b_ob_class* param_0) { +static asm void demo_camera(b_ob_class* i_this) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/demo_camera__FP10b_ob_class.s" } #pragma pop +#endif /* 80618540-80618574 0080C0 0034+00 1/1 0/0 0/0 .text dComIfGp_particle_getEmitter__FUl */ @@ -1871,7 +4709,8 @@ extern "C" asm void checkSkipEdge__14dEvt_control_cFv() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void cM_scos(s16 param_0) { +// static asm void cM_scos(s16 param_0) { +extern "C" asm void cM_scos__Fs() { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/cM_scos__Fs.s" } @@ -1881,7 +4720,7 @@ static asm void cM_scos(s16 param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -//static asm void JMAFastSqrt(f32 param_0) { +// static asm void JMAFastSqrt(f32 param_0) { static asm void JMAFastSqrt__Ff() { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/JMAFastSqrt__Ff.s" @@ -1892,8 +4731,8 @@ static asm void JMAFastSqrt__Ff() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void cM_ssin(s16 param_0) { - nofralloc +// static asm void cM_ssin(s16 param_0) { +extern "C" asm void cM_ssin__Fs(){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/cM_ssin__Fs.s" } #pragma pop @@ -2551,47 +5390,514 @@ COMPILER_STRIP_GATE(0x8061B088, &lit_7348); #pragma pop /* 80618650-806193B4 0081D0 0D64+00 2/1 0/0 0/0 .text daB_OB_Execute__FP10b_ob_class */ +// matches with literals? +#ifdef NONMATCHING +static int daB_OB_Execute(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + if (cDmrNowMidnaTalk()) { + return 1; + } + + fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); + cXyz sp70; + cXyz sp7C; + + if (cDmr_SkipInfo != 0) { + cDmr_SkipInfo--; + } + + i_this->field_0x4750++; + i_this->mYAngleToPlayer = fopAcM_searchPlayerAngleY(a_this); + i_this->mXAngleToPlayer = -fopAcM_searchPlayerAngleX(a_this); + + for (int i = 0; i < 6; i++) { + if (i_this->mTimers[i] != 0) { + i_this->mTimers[i]--; + } + } + + if (i_this->mHitIFrameTimer != 0) { + i_this->mHitIFrameTimer--; + } + + if (i_this->field_0x4794 != 0) { + i_this->field_0x4794--; + } + + if (i_this->mFishBattleMode != 0) { + i_this->attention_info.distances[fopAc_attn_BATTLE_e] = 60; + i_this->mDistToPlayer = fopAcM_searchPlayerDistance(a_this); + + fish_damage_check(i_this); + fish_move(i_this); + + if (i_this->mHideCore) { + cLib_addCalc0(&i_this->mBossLightScale, 1.0f, 0.05f); + } else { + i_this->mBossLightScale = 1.0f; + } + + if (i_this->mBossLightScale > 0.0f) { + GXColor color; + color.r = l_HIO.mLightR; + color.g = l_HIO.mLightG; + color.b = l_HIO.mLightB; + color.a = 0xFF; + + cXyz pos(a_this->current.pos); + dKy_BossLight_set(&pos, &color, l_HIO.mRange * i_this->mBossLightScale, 0); + } + + if (!dComIfGs_isOneZoneSwitch(9, -1) && !dComIfGp_event_runCheck()) { + i_this->mZoneSwTimer++; + + if (i_this->mZoneSwTimer == 600) { + dComIfGs_onOneZoneSwitch(11, -1); + } + } + } + + if (i_this->mCoreBattleMode != 0) { + if (i_this->mAction == OB_ACTION_CORE_START) { + if (player->current.pos.y > -11000.0f) { + if (!dComIfGp_event_runCheck()) { + i_this->mZoneSwTimer++; + } + + if (i_this->mZoneSwTimer == 300) { + dComIfGs_onOneZoneSwitch(4, -1); + } + } else { + i_this->mZoneSwTimer = 0; + } + } else if (dComIfGs_isOneZoneSwitch(5, -1) && !dComIfGs_isOneZoneSwitch(7, -1)) { + if (player->current.pos.y > -20500.0f) { + dComIfGs_onOneZoneSwitch(6, -1); + i_this->mZoneSwTimer = 0; + } else { + dComIfGs_offOneZoneSwitch(6, -1); + i_this->mZoneSwTimer++; + + if (i_this->mZoneSwTimer == 600) { + dComIfGs_onOneZoneSwitch(10, -1); + } + } + } + + i_this->attention_info.distances[fopAc_attn_BATTLE_e] = 4; + i_this->mDistToPlayer = fopAcM_searchPlayerDistanceXZ(a_this); + + core_damage_check(i_this); + core_action(i_this); + + cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 2, 0x400); + cLib_addCalcAngleS2(&a_this->shape_angle.x, a_this->current.angle.x, 2, 0x400); + + mDoMtx_stack_c::transS(a_this->current.pos.x, a_this->current.pos.y + i_this->field_0x479c, + a_this->current.pos.z); + mDoMtx_stack_c::YrotM(a_this->shape_angle.y); + mDoMtx_stack_c::XrotM(a_this->shape_angle.x); + mDoMtx_stack_c::scaleM(l_HIO.mCoreSize, l_HIO.mCoreSize, l_HIO.mCoreSize); + mDoMtx_stack_c::ZrotM(a_this->shape_angle.z); + mDoMtx_stack_c::scaleM(0.9f, 1.1f, 0.9f); + mDoMtx_stack_c::ZrotM(-a_this->shape_angle.z); + + i_this->field_0x4740 = cM_ssin(i_this->field_0x4750 * 1000) * 9.5f + 9.5f; + i_this->mpCoreMorf->setFrame(i_this->field_0x4740); + i_this->mpCoreMorf->modelCalc(); + + i_this->mpCoreMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp7C); + i_this->eyePos = sp7C; + + if (a_this->eyePos.y >= a_this->home.pos.y) { + a_this->attention_info.position = a_this->eyePos; + a_this->attention_info.position.y += 50.0f; + i_this->mDrawShadow = true; + } else { + i_this->mDrawShadow = false; + } + + sp7C = a_this->current.pos; + + if (i_this->mHitIFrameTimer != 0) { + sp7C.x += 22222.0f; + } + + i_this->mCcSph.SetC(sp7C); + i_this->mCcSph.SetR(l_HIO.mCoreSize * 50.0f); + + dComIfG_Ccsp()->Set(&i_this->mCcSph); + i_this->mCcSph.OffAtSetBit(); + + if (!dComIfGp_event_runCheck()) { + i_this->mCcSph.OnCoSetBit(); + i_this->mBodySph.OnCoSetBit(); + } else { + i_this->mCcSph.OffCoSetBit(); + i_this->mBodySph.OffCoSetBit(); + } + + if (i_this->mCoreBattleMode != 0) { + mDoMtx_stack_c::transS(a_this->home.pos.x, a_this->home.pos.y - (KREG_F(17) + 750.0f), + a_this->home.pos.z); + mDoMtx_stack_c::XrotM(-0x4000); + mDoMtx_stack_c::scaleM(l_HIO.mBodySize, l_HIO.mBodySize, l_HIO.mBodySize); + + i_this->mBodyParts[0].mpMorf->play(NULL, 0, 0); + i_this->mBodyParts[0].mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mBodyParts[0].mpMorf->modelCalc(); + + i_this->mBodySph.SetC(a_this->home.pos); + i_this->mBodySph.SetR(TREG_F(17) + 410.0f); + dComIfG_Ccsp()->Set(&i_this->mBodySph); + } + } + + if (i_this->mAnmID == OB_ANM_APPEAR && i_this->mBodyParts[0].mpMorf->getPlaySpeed() >= 0.5f) { + J3DModel* model = i_this->mBodyParts[0].mpMorf->getModel(); + for (int i = 0; i < 5; i++) { + int joint_no = 1; + if (i >= 2) { + joint_no = 0x13; + } + + MTXCopy(model->getAnmMtx(joint_no), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp7C); + + static u16 iso_eff[] = {0x87FC, 0x87FD, 0x87FE, 0x87FF, 0x8800}; + i_this->field_0x5d24[i] = + dComIfGp_particle_set(i_this->field_0x5d24[i], iso_eff[i], &sp7C, NULL, NULL); + } + } else if (i_this->mAnmID == OB_ANM_EAT) { + J3DModel* model = i_this->mBodyParts[0].mpMorf->getModel(); + MTXCopy(model->getAnmMtx(0x13), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp7C); + + for (int i = 0; i < 3; i++) { + static u16 iso_eff[] = {0x8805, 0x8806, 0x8807}; + i_this->field_0x5d24[i] = + dComIfGp_particle_set(i_this->field_0x5d24[i], iso_eff[i], &sp7C, NULL, NULL); + } + } else if (i_this->mAnmID == OB_ANM_THROWUP) { + J3DModel* model = i_this->mBodyParts[0].mpMorf->getModel(); + for (int i = 0; i < 4; i++) { + static u16 iso_eff[] = {0x87EE, 0x87EF, 0x87F0, 0x87F1}; + i_this->field_0x5d24[i] = dComIfGp_particle_set(i_this->field_0x5d24[i], iso_eff[i], + &a_this->current.pos, NULL, NULL); + + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0x5d24[i]); + if (emitter != NULL) { + emitter->setGlobalRTMatrix(model->getAnmMtx(0x13)); + } + } + } + + demo_camera(i_this); + + f32 blend_target = 0.0f; + if (i_this->field_0x5dd8 == 0) { + dKy_custom_colset(0, 1, i_this->mColsetBlend); + } else if (i_this->field_0x5dd8 == 1) { + dKy_custom_colset(0, 1, i_this->mColsetBlend); + blend_target = 1.0f; + } else if (i_this->field_0x5dd8 == 2) { + dKy_custom_colset(2, 1, i_this->mColsetBlend); + } else if (i_this->field_0x5dd8 == 3) { + dKy_custom_colset(2, 3, i_this->mColsetBlend); + blend_target = 1.0f; + } else if (i_this->field_0x5dd8 == 4) { + dKy_custom_colset(4, 4, blend_target); + } + + cLib_addCalc2(&i_this->mColsetBlend, blend_target, 1.0f, 0.05f); + + if (i_this->field_0x5d18 != 0) { + i_this->field_0x5d18--; + i_this->field_0x5d38 = + dComIfGp_particle_set(i_this->field_0x5d38, 0x8809, &a_this->current.pos, NULL, NULL); + + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0x5d38); + if (emitter != 0) { + emitter->setGlobalRTMatrix(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0)); + } + } + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0x13), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[0]); + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(1), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[1]); + + MTXCopy(i_this->mBodyParts[2].mpMorf->getModel()->getBaseTRMtx(), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[2]); + + MTXCopy(i_this->mBodyParts[5].mpMorf->getModel()->getBaseTRMtx(), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[3]); + + MTXCopy(i_this->mBodyParts[18].mpMorf->getModel()->getBaseTRMtx(), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[4]); + + for (int i = 0; i < 8; i++) { + if (i_this->mCoreBattleMode != 0) { + b_oh_class* tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i]); + if (tentacle != NULL) { + MTXCopy(tentacle->mpMorf->getModel()->getAnmMtx(0x19), mDoMtx_stack_c::get()); + sp70 = i_this->field_0x5be4[5 + i]; + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[5 + i]); + sp70 = i_this->field_0x5be4[5 + i] - sp70; + + i_this->mOISound.startTentacleSoundLevel( + Z2SE_EN_OI_TENT_MOVE, i, sp70.abs(), 0, + dComIfGp_getReverb(fopAcM_GetRoomNo(a_this))); + } + } + } + + i_this->mOISound.framework(0, dComIfGp_getReverb(fopAcM_GetRoomNo(a_this))); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void daB_OB_Execute(b_ob_class* param_0) { +static asm int daB_OB_Execute(b_ob_class* i_this) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/daB_OB_Execute__FP10b_ob_class.s" } #pragma pop +#endif /* 806193B4-806193BC 008F34 0008+00 1/0 0/0 0/0 .text daB_OB_IsDelete__FP10b_ob_class */ -static bool daB_OB_IsDelete(b_ob_class* param_0) { - return true; +static int daB_OB_IsDelete(b_ob_class* i_this) { + return 1; } /* 806193BC-80619438 008F3C 007C+00 1/0 0/0 0/0 .text daB_OB_Delete__FP10b_ob_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daB_OB_Delete(b_ob_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/daB_OB_Delete__FP10b_ob_class.s" +static int daB_OB_Delete(b_ob_class* i_this) { + dComIfG_resDelete(&i_this->mPhase, "B_oh"); + + if (i_this->mHIOInit) { + data_8061B4FD = 0; + } + + if (i_this->heap != NULL) { + i_this->mSound.stopAnime(); + i_this->mOISound.deleteObject(); + } + + return 1; } -#pragma pop /* 80619438-80619C14 008FB8 07DC+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ +// matches with literals +#ifdef NONMATCHING +static int useHeapInit(fopAc_ac_c* i_this) { + b_ob_class* a_this = (b_ob_class*)i_this; + + a_this->mpCoreMorf = + new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x2A), NULL, NULL, + (J3DAnmTransform*)dComIfG_getObjectRes("B_oh", 0x11), 2, 1.0f, 0, -1, + &a_this->mSound, 0, 0x11000084); + + for (int i = 0; i < 19; i++) { + static int p_bmd[] = {43, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 38}; + + u32 var_r31 = 0x80000; + if (p_bmd[i] == 43) { + var_r31 = 0; + } + + a_this->mBodyParts[i].mpMorf = + new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", p_bmd[i]), NULL, NULL, + NULL, 2, 1.0f, 0, -1, 1, NULL, var_r31, 0x11000084); + + if (a_this->mBodyParts[i].mpMorf == NULL || + a_this->mBodyParts[i].mpMorf->getModel() == NULL) + { + return 0; + } + + a_this->mBodyParts[i].mpMorf->getModel()->setUserArea((u32)i_this); + + for (u16 j = 0; j < a_this->mBodyParts[i].mpMorf->getModel()->getModelData()->getJointNum(); + j++) + { + if (p_bmd[i] == 0x2B) { + a_this->mBodyParts[i] + .mpMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(HeadCallBack); + } else if (p_bmd[i] == 0x26) { + a_this->mBodyParts[i] + .mpMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(TailCallBack); + } + } + + if (i >= 4 && i <= 17) { + a_this->mBodyParts[i].mpFinMorf = + new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x23), NULL, NULL, + NULL, 2, 1.0f, 0, -1, 1, NULL, 0x80000, 0x11000084); + + if (a_this->mBodyParts[i].mpFinMorf == NULL || + a_this->mBodyParts[i].mpFinMorf->getModel() == NULL) + { + return 0; + } + + a_this->mBodyParts[i].mpFinMorf->getModel()->setUserArea((u32)i_this); + + for (u16 j = 0; + j < a_this->mBodyParts[i].mpFinMorf->getModel()->getModelData()->getJointNum(); + j++) + { + a_this->mBodyParts[i] + .mpFinMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(FinACallBack); + } + + if (dComIfGs_isSwitch(0x1C, fopAcM_GetRoomNo(i_this))) { + a_this->mBodyParts[i].field_0x3e = 1; + } else { + a_this->mBodyParts[i].mFinARot.x = 0xF060; + } + } + + if (i >= 7 && i <= 15) { + a_this->mBodyParts[i].mpFinUnkMorf = + new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x23), NULL, NULL, + NULL, 2, 1.0f, 0, -1, 1, NULL, 0x80000, 0x11000084); + + if (a_this->mBodyParts[i].mpFinUnkMorf == NULL || + a_this->mBodyParts[i].mpFinUnkMorf->getModel() == NULL) + { + return 0; + } + + a_this->mBodyParts[i].mpFinUnkMorf->getModel()->setUserArea((u32)i_this); + + for (u16 j = 0; + j < a_this->mBodyParts[i].mpFinUnkMorf->getModel()->getModelData()->getJointNum(); + j++) + { + a_this->mBodyParts[i] + .mpFinUnkMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(FinACallBack); + } + } + + if (i == 8) { + a_this->mBodyParts[i].mpFinBMorf = + new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x24), NULL, NULL, + NULL, 2, 1.0f, 0, -1, 1, NULL, 0x80000, 0x11000084); + + if (a_this->mBodyParts[i].mpFinBMorf == NULL || + a_this->mBodyParts[i].mpFinBMorf->getModel() == NULL) + { + return 0; + } + + a_this->mBodyParts[i].mpFinBMorf->getModel()->setUserArea((u32)i_this); + + for (u16 j = 0; + j < a_this->mBodyParts[i].mpFinBMorf->getModel()->getModelData()->getJointNum(); + j++) + { + a_this->mBodyParts[i] + .mpFinBMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(FinBCallBack); + } + } + + if (i == 17) { + a_this->mBodyParts[i].mpFinCMorf = + new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x25), NULL, NULL, + NULL, 2, 1.0f, 0, -1, 1, NULL, 0x80000, 0x11000084); + + if (a_this->mBodyParts[i].mpFinCMorf == NULL || + a_this->mBodyParts[i].mpFinCMorf->getModel() == NULL) + { + return 0; + } + + a_this->mBodyParts[i].mpFinCMorf->getModel()->setUserArea((u32)i_this); + + for (u16 j = 0; + j < a_this->mBodyParts[i].mpFinCMorf->getModel()->getModelData()->getJointNum(); + j++) + { + a_this->mBodyParts[i] + .mpFinCMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(FinCCallBack); + } + } + } + + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("B_oh", 0x21); + JUT_ASSERT(modelData != 0); + + a_this->mpSuiModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000284); + if (a_this->mpSuiModel == NULL) { + return 0; + } + + a_this->mpSuiModel->setUserArea((u32)i_this); + + for (u16 j = 0; j < modelData->getJointNum(); j++) { + modelData->getJointNodePointer(j)->setCallBack(sui_nodeCallBack); + } + + a_this->mpSuiBrk = new mDoExt_brkAnm(); + if (a_this->mpSuiBrk == NULL) { + return 0; + } + + if (!a_this->mpSuiBrk->init(modelData, (J3DAnmTevRegKey*)dComIfG_getObjectRes("B_oh", 0x2E), TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1)) { + return 0; + } + + a_this->mpSuiBtk = new mDoExt_btkAnm(); + if (a_this->mpSuiBtk == NULL) { + return 0; + } + + if (!a_this->mpSuiBtk->init(modelData, (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("B_oh", 0x35), TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1)) { + return 0; + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void useHeapInit(fopAc_ac_c* param_0) { +static asm int useHeapInit(fopAc_ac_c* i_this) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/useHeapInit__FP10fopAc_ac_c.s" } #pragma pop +#endif /* 80619C14-80619C5C 009794 0048+00 1/0 0/0 0/0 .text __dt__12J3DFrameCtrlFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off // asm J3DFrameCtrl::~J3DFrameCtrl() { -extern "C" asm void __dt__12J3DFrameCtrlFv() { - nofralloc +extern "C" asm void __dt__12J3DFrameCtrlFv(){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/__dt__12J3DFrameCtrlFv.s" } #pragma pop @@ -2626,20 +5932,187 @@ COMPILER_STRIP_GATE(0x8061B098, &lit_7870); #pragma pop /* 80619C5C-8061A0C0 0097DC 0464+00 1/0 0/0 0/0 .text daB_OB_Create__FP10fopAc_ac_c */ +// matches with literals? +#ifdef NONMATCHING +static int daB_OB_Create(fopAc_ac_c* i_this) { + b_ob_class* a_this = (b_ob_class*)i_this; + fopAcM_SetupActor(i_this, b_ob_class); + + OS_REPORT("B_OB//////////////B_OB SET 0 !!\n"); + + int phase_state = dComIfG_resLoad(&a_this->mPhase, "B_oh"); + if (phase_state == cPhs_COMPLEATE_e) { + if (dComIfGs_isStageBossEnemy()) { + // "After B_OB defeated, so not re-setting\n" + OS_REPORT("B_OB やられ後なので再セットしません\n"); + cXyz pos(-1520.0f, -23960.0f, 7100.0f); + csXyz angle(0, 0, 0); + + fopAcM_createWarpHole(&pos, &angle, fopAcM_GetRoomNo(a_this), 0, 0, 2); + + if (!dComIfGs_isStageLife()) { + cXyz scale(1.0f, 1.0f, 1.0f); + pos.set(-916.0f, -23954.0f, 8916.0f); + fopAcM_createItemForBoss(&pos, UTAWA_HEART, fopAcM_GetRoomNo(a_this), + &a_this->shape_angle, &scale, 0.0f, 0.0f, -1); + } + + return cPhs_ERROR_e; + } + + OS_REPORT("B_OB PARAM %x\n", fopAcM_GetParam(a_this)); + a_this->shape_angle.z = 0; + a_this->current.angle.z = 0; + OS_REPORT("B_OB//////////////B_OB SET 1 !!\n"); + + if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0x1F6A0)) { + OS_REPORT("//////////////B_OB SET NON !!\n"); + return cPhs_ERROR_e; + } + + OS_REPORT("//////////////B_OB SET 2 !!\n"); + + if (!data_8061B4FD) { + a_this->mHIOInit = 1; + data_8061B4FD = true; + l_HIO.field_0x04 = -1; + } + + a_this->health = 30; + a_this->field_0x560 = 30; + a_this->mTimers[0] = 30; + a_this->field_0x4790 = 1; + + static dCcD_SrcSph cc_sph_src = { + { + {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_METAL, 0x0, 0x2, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 50.0f} // mSph + } // mSphAttr + }; + + static dCcD_SrcSph body_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x3}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 60.0f} // mSph + } // mSphAttr + }; + + static dCcD_SrcSph parts_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x3}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 60.0f} // mSph + } // mSphAttr + }; + + static dCcD_SrcSph core_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0x4002, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 50.0f} // mSph + } // mSphAttr + }; + + a_this->mCoreCcStts.Init(100, 0, i_this); + a_this->mCcSph.Set(cc_sph_src); + a_this->mCcSph.SetStts(&a_this->mCoreCcStts); + + a_this->mCoreSph.Set(core_sph_src); + a_this->mCoreSph.SetStts(&a_this->mCoreCcStts); + + a_this->mBodyCcStts.Init(0xFF, 0, i_this); + a_this->mBodySph.Set(body_sph_src); + a_this->mBodySph.SetStts(&a_this->mBodyCcStts); + + for (int i = 0; i < 19; i++) { + a_this->mBodyParts[i].mSph.Set(parts_sph_src); + a_this->mBodyParts[i].mSph.SetStts(&a_this->mBodyCcStts); + a_this->mBodyParts[i].mSph.OnTgShield(); + a_this->mBodyParts[i].mSph.SetTgHitMark(CcG_Tg_UNK_MARK_2); + } + + a_this->mFishHeadSph.Set(parts_sph_src); + a_this->mFishHeadSph.SetStts(&a_this->mBodyCcStts); + a_this->mFishHeadSph.OnTgShield(); + a_this->mFishHeadSph.SetTgHitMark(CcG_Tg_UNK_MARK_2); + + a_this->mAcch.Set(fopAcM_GetPosition_p(i_this), fopAcM_GetOldPosition_p(i_this), i_this, 1, + &a_this->mAcchCir, fopAcM_GetSpeed_p(i_this), NULL, NULL); + a_this->mAcchCir.SetWall(300.0f, KREG_F(12) + 950.0f); + a_this->mCoreBattleMode = 1; + + if (cDmr_SkipInfo != 0) { + a_this->mAction = OB_ACTION_CORE_HAND_MOVE; + Z2GetAudioMgr()->bgmStart(Z2BGM_BOSS_OCTAEEL_0, 0, 0); + dComIfGs_onOneZoneSwitch(5, -1); + } else { + a_this->mAction = OB_ACTION_CORE_START; + } + + for (int i = 0; i < 8; i++) { + a_this->mTentacleActorIDs[i] = + fopAcM_createChild(PROC_B_OH, fopAcM_GetID(i_this), i, &i_this->current.pos, + fopAcM_GetRoomNo(i_this), NULL, NULL, -1, NULL); + } + + for (int i = 0; i < 0x200; i++) { + a_this->field_0x2324[i].set(0.0f, i_this->home.pos.y - 10000.0f, 0.0f); + } + + moveSW = true; + moveSW2 = false; + a_this->field_0x47a0 = i_this->home.pos.y; + + a_this->mSound.init(&i_this->current.pos, &i_this->eyePos, 3, 1); + a_this->mAtInfo.mpSound = &a_this->mSound; + a_this->mOISound.init( + &a_this->field_0x5be4[0], &a_this->field_0x5be4[1], &a_this->field_0x5be4[2], + &a_this->field_0x5be4[3], &a_this->field_0x5be4[4], &a_this->field_0x5be4[5], + &a_this->field_0x5be4[6], &a_this->field_0x5be4[7], &a_this->field_0x5be4[8], + &a_this->field_0x5be4[9], &a_this->field_0x5be4[10], &a_this->field_0x5be4[11], + &a_this->field_0x5be4[12]); + a_this->field_0x5d04 = 0.7f; + + daB_OB_Execute(a_this); + } + + return phase_state; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void daB_OB_Create(fopAc_ac_c* param_0) { +static asm int daB_OB_Create(fopAc_ac_c* i_this) { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/daB_OB_Create__FP10fopAc_ac_c.s" } #pragma pop +#endif /* 8061A0C0-8061A3A0 009C40 02E0+00 1/1 0/0 0/0 .text __ct__10b_ob_classFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm b_ob_class::b_ob_class() { +// asm b_ob_class::b_ob_class() { +extern "C" asm void __ct__10b_ob_classFv() { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/__ct__10b_ob_classFv.s" } @@ -2649,7 +6122,8 @@ asm b_ob_class::b_ob_class() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm ob_ke_s::~ob_ke_s() { +// asm ob_ke_s::~ob_ke_s() { +extern "C" asm void __dt__7ob_ke_sFv() { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/__dt__7ob_ke_sFv.s" } @@ -2659,7 +6133,8 @@ asm ob_ke_s::~ob_ke_s() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm ob_ke_s::ob_ke_s() { +// asm ob_ke_s::ob_ke_s() { +extern "C" asm void __ct__7ob_ke_sFv() { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/__ct__7ob_ke_sFv.s" } @@ -2736,7 +6211,8 @@ extern "C" void __ct__4cXyzFv() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm ob_part_s::~ob_part_s() { +// asm ob_part_s::~ob_part_s() { +extern "C" asm void __dt__9ob_part_sFv() { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/__dt__9ob_part_sFv.s" } @@ -2746,7 +6222,8 @@ asm ob_part_s::~ob_part_s() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm ob_part_s::ob_part_s() { +// asm ob_part_s::ob_part_s() { +extern "C" asm void __ct__9ob_part_sFv() { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/__ct__9ob_part_sFv.s" } @@ -2767,7 +6244,8 @@ extern "C" asm void __dt__10cCcD_GSttsFv() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm daB_OB_HIO_c::~daB_OB_HIO_c() { +// asm daB_OB_HIO_c::~daB_OB_HIO_c() { +extern "C" asm void __dt__12daB_OB_HIO_cFv() { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/__dt__12daB_OB_HIO_cFv.s" } @@ -2777,8 +6255,7 @@ asm daB_OB_HIO_c::~daB_OB_HIO_c() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void __sinit_d_a_b_ob_cpp() { - nofralloc +asm void __sinit_d_a_b_ob_cpp(){nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/__sinit_d_a_b_ob_cpp.s" } #pragma pop @@ -2930,7 +6407,8 @@ extern "C" asm void daPy_getPlayerActorClass__Fv() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dEvt_info_c::onCondition(u16 param_0) { +// asm void dEvt_info_c::onCondition(u16 param_0) { +extern "C" asm void onCondition__11dEvt_info_cFUs() { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/onCondition__11dEvt_info_cFUs.s" } @@ -2984,7 +6462,8 @@ extern "C" asm void dComIfGp_getPlayer__Fi() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void obj_ystone_class::setCurrentPos(cXyz param_0) { +// asm void obj_ystone_class::setCurrentPos(cXyz param_0) { +extern "C" asm void setCurrentPos__16obj_ystone_classF4cXyz() { nofralloc #include "asm/rel/d/a/b/d_a_b_ob/d_a_b_ob/setCurrentPos__16obj_ystone_classF4cXyz.s" } @@ -3347,5 +6826,3 @@ static u8 data_8061B638[4]; #pragma force_active on static u8 data_8061B63C[4]; #pragma pop - -/* 8061B09C-8061B09C 000318 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ diff --git a/rel/d/a/b/d_a_b_ob/d_a_b_ob_NONMATCHING.cpp b/rel/d/a/b/d_a_b_ob/d_a_b_ob_NONMATCHING.cpp new file mode 100644 index 00000000000..910165b5fa0 --- /dev/null +++ b/rel/d/a/b/d_a_b_ob/d_a_b_ob_NONMATCHING.cpp @@ -0,0 +1,4229 @@ +// +// Generated By: dol2asm +// Translation Unit: d_a_b_ob +// + +#include "rel/d/a/b/d_a_b_ob/d_a_b_ob.h" +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "SSystem/SComponent/c_math.h" +#include "c/c_damagereaction.h" +#include "cmath.h" +#include "d/a/d_a_player.h" +#include "d/com/d_com_inf_game.h" +#include "d/s/d_s_play.h" +#include "dol2asm.h" +#include "f_op/f_op_msg_mng.h" +#include "m_Do/m_Do_controller_pad.h" +#include "m_Do/m_Do_graphic.h" +#include "rel/d/a/b/d_a_b_oh/d_a_b_oh.h" +#include "rel/d/a/obj/d_a_obj_lv3WaterB/d_a_obj_lv3WaterB.h" +#include "rel/d/a/obj/d_a_obj_ystone/d_a_obj_ystone.h" + +// +// Types: +// + +class daB_OB_HIO_c { +public: + /* 8061056C */ daB_OB_HIO_c(); + /* 8061A808 */ virtual ~daB_OB_HIO_c() {} + + /* 0x04 */ s8 field_0x04; + /* 0x08 */ f32 mCoreSize; + /* 0x0C */ f32 mCoreMoveSpeed; + /* 0x10 */ f32 mBodySize; + /* 0x14 */ s16 mLightR; + /* 0x16 */ s16 mLightG; + /* 0x18 */ s16 mLightB; + /* 0x1C */ f32 mRange; +}; + +// +// Forward References: +// + +extern "C" void __ct__12daB_OB_HIO_cFv(); +extern "C" static void anm_init__FP10b_ob_classifUcf(); +extern "C" static void HeadCallBack__FP8J3DJointi(); +extern "C" static void TailCallBack__FP8J3DJointi(); +extern "C" static void FinACallBack__FP8J3DJointi(); +extern "C" static void FinBCallBack__FP8J3DJointi(); +extern "C" static void FinCCallBack__FP8J3DJointi(); +extern "C" static void sui_nodeCallBack__FP8J3DJointi(); +extern "C" static void dark__FP12J3DModelDatas(); +extern "C" static void daB_OB_Draw__FP10b_ob_class(); +extern "C" void __dt__4cXyzFv(); +extern "C" static void core_start__FP10b_ob_class(); +extern "C" static void core_hand_move__FP10b_ob_class(); +extern "C" static void s_bf_sub__FPvPv(); +extern "C" static void s_bfdel_sub__FPvPv(); +extern "C" static void s_kaisoudel_sub__FPvPv(); +extern "C" static void bombfishset__FP10b_ob_class(); +extern "C" void __dt__5csXyzFv(); +extern "C" static void core_hook__FP10b_ob_class(); +extern "C" static void core_chance__FP10b_ob_class(); +extern "C" static void core_end__FP10b_ob_class(); +extern "C" static void core_action__FP10b_ob_class(); +extern "C" static void core_damage_check__FP10b_ob_class(); +extern "C" static void fish_damage_check__FP10b_ob_class(); +extern "C" static void pl_check__FP10b_ob_classfs(); +extern "C" static void fish_normal__FP10b_ob_class(); +extern "C" static void fish_vacume__FP10b_ob_class(); +extern "C" static void fish_end__FP10b_ob_class(); +extern "C" static void dmcalc__FP10b_ob_class(); +extern "C" static void fish_move__FP10b_ob_class(); +extern "C" static void cam_3d_morf__FP10b_ob_classf(); +extern "C" static void s_hasidel_sub__FPvPv(); +extern "C" static void demo_camera__FP10b_ob_class(); +extern "C" static void dComIfGp_particle_getEmitter__FUl(); +extern "C" static void dComIfGp_particle_set__FUlUsPC4cXyzPC5csXyzPC4cXyz(); +extern "C" void checkSkipEdge__14dEvt_control_cFv(); +extern "C" static void cM_scos__Fs(); +extern "C" static void JMAFastSqrt__Ff(); +extern "C" static void cM_ssin__Fs(); +extern "C" static void daB_OB_Execute__FP10b_ob_class(); +extern "C" static bool daB_OB_IsDelete__FP10b_ob_class(); +extern "C" static void daB_OB_Delete__FP10b_ob_class(); +extern "C" static void useHeapInit__FP10fopAc_ac_c(); +extern "C" void __dt__12J3DFrameCtrlFv(); +extern "C" static void daB_OB_Create__FP10fopAc_ac_c(); +extern "C" void __ct__10b_ob_classFv(); +extern "C" void __dt__7ob_ke_sFv(); +extern "C" void __ct__7ob_ke_sFv(); +extern "C" void __dt__12dBgS_ObjAcchFv(); +extern "C" void __dt__12dBgS_AcchCirFv(); +extern "C" void __dt__8cM3dGSphFv(); +extern "C" void __dt__8cM3dGAabFv(); +extern "C" void __dt__10dCcD_GSttsFv(); +extern "C" void __ct__5csXyzFv(); +extern "C" void __ct__4cXyzFv(); +extern "C" void __dt__9ob_part_sFv(); +extern "C" void __ct__9ob_part_sFv(); +extern "C" void __dt__10cCcD_GSttsFv(); +extern "C" void __dt__12daB_OB_HIO_cFv(); +extern "C" void __sinit_d_a_b_ob_cpp(); +extern "C" static void func_8061A88C(); +extern "C" static void func_8061A894(); +extern "C" void cancelOriginalDemo__9daPy_py_cFv(); +extern "C" static void dComIfGp_event_reset__Fv(); +extern "C" static void dComIfGs_onStageBossEnemy__Fv(); +extern "C" void multVecZero__14mDoMtx_stack_cFP3Vec(); +extern "C" void getAnmMtx__8J3DModelFi(); +extern "C" void __apl__4cXyzFRC3Vec(); +extern "C" void __as__5csXyzFRC5csXyz(); +extern "C" void __as__4cXyzFRC4cXyz(); +extern "C" void changeDemoMode__9daPy_py_cFUliis(); +extern "C" void changeOriginalDemo__9daPy_py_cFv(); +extern "C" static void daPy_getPlayerActorClass__Fv(); +extern "C" void onCondition__11dEvt_info_cFUs(); +extern "C" void checkCommandDemoAccrpt__11dEvt_info_cFv(); +extern "C" static void dComIfGp_getCamera__Fi(); +extern "C" static void dComIfGp_getPlayerCameraID__Fi(); +extern "C" static void dComIfGp_getPlayer__Fi(); +extern "C" void setCurrentPos__16obj_ystone_classF4cXyz(); +extern "C" void __ct__4cXyzFRC4cXyz(); +extern "C" void becomeDeleteEmitter__14JPABaseEmitterFv(); +extern "C" void __ct__5csXyzFRC5csXyz(); +extern "C" void fabsf__3stdFf(); +extern "C" static void dComIfGp_particle_set__FUsPC4cXyzPC5csXyzPC4cXyz(); +extern "C" void setPlaySpeed__13mDoExt_morf_cFf(); +extern "C" void startCheckSkipEdge__14dEvt_control_cFPv(); +extern "C" static void dComIfGp_getEvent__Fv(); +extern "C" static void mDoAud_seStart__FUlPC3VecUlSc(); +extern "C" void set__4cXyzFfff(); +extern "C" void __ct__10JAISoundIDFUl(JAISoundID* this_, u32 param_0); +extern "C" void abs__4cXyzCFv(); +extern "C" void isStop__13mDoExt_morf_cFv(); +extern "C" static void dComIfGp_getVibration__Fv(); +extern "C" void __ct__4cXyzFfff(); +extern "C" extern char const* const d_a_b_ob__stringBase0; + +// +// External References: +// + +extern "C" void onBlure__13mDoGph_gInf_cFv(); +extern "C" void mDoMtx_XrotM__FPA4_fs(); +extern "C" void mDoMtx_YrotS__FPA4_fs(); +extern "C" void mDoMtx_YrotM__FPA4_fs(); +extern "C" void mDoMtx_ZrotM__FPA4_fs(); +extern "C" void mDoMtx_MtxToRot__FPA4_CfP5csXyz(); +extern "C" void push__14mDoMtx_stack_cFv(); +extern "C" void pop__14mDoMtx_stack_cFv(); +extern "C" void transM__14mDoMtx_stack_cFfff(); +extern "C" void scaleM__14mDoMtx_stack_cFfff(); +extern "C" void play__14mDoExt_baseAnmFv(); +extern "C" void init__13mDoExt_btkAnmFP16J3DMaterialTableP19J3DAnmTextureSRTKeyiifss(); +extern "C" void entry__13mDoExt_btkAnmFP16J3DMaterialTablef(); +extern "C" void init__13mDoExt_brkAnmFP16J3DMaterialTableP15J3DAnmTevRegKeyiifss(); +extern "C" void entry__13mDoExt_brkAnmFP16J3DMaterialTablef(); +extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); +extern "C" void +__ct__14mDoExt_McaMorfFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiiPvUlUl(); +extern "C" void setAnm__14mDoExt_McaMorfFP15J3DAnmTransformiffffPv(); +extern "C" void play__14mDoExt_McaMorfFP3VecUlSc(); +extern "C" void entryDL__14mDoExt_McaMorfFv(); +extern "C" void modelCalc__14mDoExt_McaMorfFv(); +extern "C" void +__ct__16mDoExt_McaMorfSOFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiP10Z2CreatureUlUl(); +extern "C" void entryDL__16mDoExt_McaMorfSOFv(); +extern "C" void modelCalc__16mDoExt_McaMorfSOFv(); +extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); +extern "C" void cDmrNowMidnaTalk__Fv(); +extern "C" void __ct__10fopAc_ac_cFv(); +extern "C" void fopAc_IsActor__FPv(); +extern "C" void fopAcIt_Judge__FPFPvPv_PvPv(); +extern "C" void fopAcM_delete__FP10fopAc_ac_c(); +extern "C" void fopAcM_create__FsUlPC4cXyziPC5csXyzPC4cXyzSc(); +extern "C" void fopAcM_createChild__FsUiUlPC4cXyziPC5csXyzPC4cXyzScPFPv_i(); +extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); +extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); +extern "C" void fopAcM_searchActorAngleX__FPC10fopAc_ac_cPC10fopAc_ac_c(); +extern "C" void fopAcM_searchActorDistance__FPC10fopAc_ac_cPC10fopAc_ac_c(); +extern "C" void fopAcM_searchActorDistanceXZ__FPC10fopAc_ac_cPC10fopAc_ac_c(); +extern "C" void fopAcM_orderPotentialEvent__FP10fopAc_ac_cUsUsUs(); +extern "C" void fopAcM_createItemForBoss__FPC4cXyziiPC5csXyzPC4cXyzffi(); +extern "C" void fopAcM_createWarpHole__FPC4cXyzPC5csXyziUcUcUc(); +extern "C" void fopAcM_createDisappear__FPC10fopAc_ac_cPC4cXyzUcUcUc(); +extern "C" void fopAcM_otherBgCheck__FPC10fopAc_ac_cPC10fopAc_ac_c(); +extern "C" void fopMsgM_messageSetDemo__FUl(); +extern "C" void fpcEx_Search__FPFPvPv_PvPv(); +extern "C" void fpcSch_JudgeForPName__FPvPv(); +extern "C" void fpcSch_JudgeByID__FPvPv(); +extern "C" void dStage_changeScene__FifUlScsi(); +extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); +extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); +extern "C" void dComIfGp_getReverb__Fi(); +extern "C" void dComIfGs_onOneZoneSwitch__Fii(); +extern "C" void dComIfGs_offOneZoneSwitch__Fii(); +extern "C" void dComIfGs_isOneZoneSwitch__Fii(); +extern "C" void +dComIfGd_setShadow__FUlScP8J3DModelP4cXyzffffR13cBgS_PolyInfoP12dKy_tevstr_csfP9_GXTexObj(); +extern "C" void onDungeonItem__12dSv_memBit_cFi(); +extern "C" void isDungeonItem__12dSv_memBit_cCFi(); +extern "C" void onSwitch__10dSv_info_cFii(); +extern "C" void isSwitch__10dSv_info_cCFii(); +extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); +extern "C" void reset__14dEvt_control_cFv(); +extern "C" void dEv_noFinishSkipProc__FPvi(); +extern "C" void setSkipProc__14dEvt_control_cFPvPFPvi_ii(); +extern "C" void getEmitter__Q213dPa_control_c7level_cFUl(); +extern "C" void +set__13dPa_control_cFUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); +extern "C" void +set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); +extern "C" void StartShock__12dVibration_cFii4cXyz(); +extern "C" void StartQuake__12dVibration_cFii4cXyz(); +extern "C" void StopQuake__12dVibration_cFi(); +extern "C" void __ct__12dBgS_AcchCirFv(); +extern "C" void SetWall__12dBgS_AcchCirFff(); +extern "C" void __dt__9dBgS_AcchFv(); +extern "C" void __ct__9dBgS_AcchFv(); +extern "C" void Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz(); +extern "C" void CrrPos__9dBgS_AcchFR4dBgS(); +extern "C" void SetObj__16dBgS_PolyPassChkFv(); +extern "C" void __ct__10dCcD_GSttsFv(); +extern "C" void Move__10dCcD_GSttsFv(); +extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); +extern "C" void __ct__12dCcD_GObjInfFv(); +extern "C" void __dt__12dCcD_GObjInfFv(); +extern "C" void ChkTgHit__12dCcD_GObjInfFv(); +extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); +extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph(); +extern "C" void def_se_set__FP10Z2CreatureP8cCcD_ObjUlP10fopAc_ac_c(); +extern "C" void cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo(); +extern "C" void Start__9dCamera_cFv(); +extern "C" void Stop__9dCamera_cFv(); +extern "C" void SetTrimSize__9dCamera_cFl(); +extern "C" void Set__9dCamera_cF4cXyz4cXyzsf(); +extern "C" void Reset__9dCamera_cF4cXyz4cXyz(); +extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); +extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); +extern "C" void dKy_custom_colset__FUcUcf(); +extern "C" void dKy_BossLight_set__FP4cXyzP8_GXColorfUc(); +extern "C" void Set__4cCcSFP8cCcD_Obj(); +extern "C" void __pl__4cXyzCFRC3Vec(); +extern "C" void __mi__4cXyzCFRC3Vec(); +extern "C" void __ml__4cXyzCFf(); +extern "C" void __ct__5csXyzFsss(); +extern "C" void cM_atan2s__Fff(); +extern "C" void cM_rndF__Ff(); +extern "C" void cM_rndFX__Ff(); +extern "C" void __dt__13cBgS_PolyInfoFv(); +extern "C" void __dt__8cM3dGCirFv(); +extern "C" void SetC__8cM3dGSphFRC4cXyz(); +extern "C" void SetR__8cM3dGSphFf(); +extern "C" void cLib_addCalc2__FPffff(); +extern "C" void cLib_addCalc0__FPfff(); +extern "C" void cLib_addCalcAngleS2__FPssss(); +extern "C" void MtxPosition__FP4cXyzP4cXyz(); +extern "C" void func_802807E0(); +extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); +extern "C" void bgmStart__8Z2SeqMgrFUlUll(); +extern "C" void bgmStop__8Z2SeqMgrFUll(); +extern "C" void subBgmStart__8Z2SeqMgrFUl(); +extern "C" void bgmStreamPrepare__8Z2SeqMgrFUl(); +extern "C" void bgmStreamPlay__8Z2SeqMgrFv(); +extern "C" void changeBgmStatus__8Z2SeqMgrFl(); +extern "C" void stopAnime__10Z2CreatureFv(); +extern "C" void __ct__15Z2CreatureEnemyFv(); +extern "C" void init__15Z2CreatureEnemyFP3VecP3VecUcUc(); +extern "C" void __ct__12Z2CreatureOIFv(); +extern "C" void +init__12Z2CreatureOIFP3VecP3VecP3VecP3VecP3VecP3VecP3VecP3VecP3VecP3VecP3VecP3VecP3Vec(); +extern "C" void startTentacleSoundLevel__12Z2CreatureOIF10JAISoundIDUcfUlSc(); +extern "C" void* __nw__FUl(); +extern "C" void __dl__FPv(); +extern "C" void init__12J3DFrameCtrlFs(); +extern "C" void checkPass__12J3DFrameCtrlFf(); +extern "C" void __destroy_arr(); +extern "C" void __construct_array(); +extern "C" void __cvt_fp2unsigned(); +extern "C" void _savegpr_15(); +extern "C" void _savegpr_21(); +extern "C" void _savegpr_22(); +extern "C" void _savegpr_24(); +extern "C" void _savegpr_25(); +extern "C" void _savegpr_26(); +extern "C" void _savegpr_27(); +extern "C" void _savegpr_28(); +extern "C" void _savegpr_29(); +extern "C" void _restgpr_15(); +extern "C" void _restgpr_21(); +extern "C" void _restgpr_22(); +extern "C" void _restgpr_24(); +extern "C" void _restgpr_25(); +extern "C" void _restgpr_26(); +extern "C" void _restgpr_27(); +extern "C" void _restgpr_28(); +extern "C" void _restgpr_29(); +extern "C" extern void* __vt__19mDoExt_3DlineMat0_c[5]; +extern "C" extern void* __vt__8dCcD_Sph[36]; +extern "C" extern void* __vt__9dCcD_Stts[11]; +extern "C" extern void* __vt__12cCcD_SphAttr[25]; +extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; +extern "C" extern void* __vt__9cCcD_Stts[8]; +extern "C" u8 now__14mDoMtx_stack_c[48]; +extern "C" u8 mSimpleTexObj__21dDlst_shadowControl_c[32]; +extern "C" u8 mCurrentMtx__6J3DSys[48]; +extern "C" u8 sincosTable___5JMath[65536]; +extern "C" extern u8 struct_80450C98[4]; +extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; +extern "C" void __register_global_object(); + +// +// Declarations: +// + +/* 8061B0A4-8061B0B0 000000 000C+00 2/2 0/0 0/0 .data cNullVec__6Z2Calc */ +SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +/* 8061B0B0-8061B0C4 00000C 0004+10 0/0 0/0 0/0 .data @1787 */ +#pragma push +#pragma force_active on +SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = { + 0x02000201, + /* padding */ + 0x40080000, + 0x00000000, + 0x3FE00000, + 0x00000000, +}; +#pragma pop + +/* 8061056C-806105BC 0000EC 0050+00 1/1 0/0 0/0 .text __ct__12daB_OB_HIO_cFv */ +daB_OB_HIO_c::daB_OB_HIO_c() { + field_0x04 = -1; + mCoreSize = 1.0f; + mCoreMoveSpeed = 0.2f; + mBodySize = 1.0f; + mLightR = 0xA3; + mLightG = 0xFF; + mLightB = 0xFF; + mRange = 3.0f; +} + +/* 806105BC-8061066C 00013C 00B0+00 8/8 0/0 0/0 .text anm_init__FP10b_ob_classifUcf */ +static void anm_init(b_ob_class* i_this, int i_anmID, f32 i_morf, u8 i_mode, f32 i_speed) { + J3DAnmTransform* pbck = (J3DAnmTransform*)dComIfG_getObjectRes("B_oh", i_anmID); + i_this->mBodyParts[0].mpMorf->setAnm(pbck, i_mode, i_morf, i_speed, 0.0f, -1.0f, NULL); + i_this->mAnmID = i_anmID; +} + +/* 8061066C-806107B4 0001EC 0148+00 1/1 0/0 0/0 .text HeadCallBack__FP8J3DJointi */ +static int HeadCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no >= 2 && joint_no <= 4) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->field_0x47ae); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } else if (joint_no >= 5 && joint_no <= 7) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->field_0x47ae); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; +} + +/* 806107B4-806109AC 000334 01F8+00 1/1 0/0 0/0 .text TailCallBack__FP8J3DJointi */ +static int TailCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no == 3) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->field_0x47aa); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } else if (joint_no == 6) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, -a_this->field_0x47aa); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } else if (joint_no == 2 || joint_no == 4 || joint_no == 5) { + int idx = joint_no; + if (joint_no == 2) { + idx = 0; + } else if (joint_no >= 4) { + idx = joint_no - 3; + } + + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->field_0x47a4[idx] + a_this->field_0x47ac); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; +} + +/* ############################################################################################## */ +/* 8061B4C0-8061B4C4 000008 0001+03 4/4 0/0 0/0 .bss @1109 */ +static u8 lit_1109[1 + 3 /* padding */]; + +/* 8061B4C4-8061B4C8 00000C 0001+03 0/0 0/0 0/0 .bss @1107 */ +#pragma push +#pragma force_active on +static u8 lit_1107[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4C8-8061B4CC 000010 0001+03 0/0 0/0 0/0 .bss @1105 */ +#pragma push +#pragma force_active on +static u8 lit_1105[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4CC-8061B4D0 000014 0001+03 0/0 0/0 0/0 .bss @1104 */ +#pragma push +#pragma force_active on +static u8 lit_1104[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4D0-8061B4D4 000018 0001+03 0/0 0/0 0/0 .bss @1099 */ +#pragma push +#pragma force_active on +static u8 lit_1099[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4D4-8061B4D8 00001C 0001+03 0/0 0/0 0/0 .bss @1097 */ +#pragma push +#pragma force_active on +static u8 lit_1097[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4D8-8061B4DC 000020 0001+03 0/0 0/0 0/0 .bss @1095 */ +#pragma push +#pragma force_active on +static u8 lit_1095[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4DC-8061B4E0 000024 0001+03 0/0 0/0 0/0 .bss @1094 */ +#pragma push +#pragma force_active on +static u8 lit_1094[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4E0-8061B4E4 000028 0001+03 0/0 0/0 0/0 .bss @1057 */ +#pragma push +#pragma force_active on +static u8 lit_1057[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4E4-8061B4E8 00002C 0001+03 0/0 0/0 0/0 .bss @1055 */ +#pragma push +#pragma force_active on +static u8 lit_1055[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4E8-8061B4EC 000030 0001+03 0/0 0/0 0/0 .bss @1053 */ +#pragma push +#pragma force_active on +static u8 lit_1053[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4EC-8061B4F0 000034 0001+03 0/0 0/0 0/0 .bss @1052 */ +#pragma push +#pragma force_active on +static u8 lit_1052[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4F0-8061B4F4 000038 0001+03 0/0 0/0 0/0 .bss @1014 */ +#pragma push +#pragma force_active on +static u8 lit_1014[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4F4-8061B4F8 00003C 0001+03 0/0 0/0 0/0 .bss @1012 */ +#pragma push +#pragma force_active on +static u8 lit_1012[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4F8-8061B4FC 000040 0001+03 0/0 0/0 0/0 .bss @1010 */ +#pragma push +#pragma force_active on +static u8 lit_1010[1 + 3 /* padding */]; +#pragma pop + +/* 8061B4FC-8061B500 -00001 0004+00 1/2 0/0 0/0 .bss None */ +/* 8061B4FC 0001+00 data_8061B4FC @1009 */ +/* 8061B4FD 0003+00 data_8061B4FD None */ +#pragma push +#pragma force_active on +static u8 struct_8061B4FC; +#pragma pop + +#pragma push +#pragma force_active on +static u8 data_8061B4FD; +#pragma pop + +/* 8061B500-8061B504 000048 0004+00 0/2 0/0 0/0 .bss moveSW */ +#pragma push +#pragma force_active on +static BOOL moveSW; +#pragma pop + +/* 8061B504-8061B508 00004C 0004+00 1/4 0/0 0/0 .bss moveSW2 */ +static BOOL moveSW2; + +/* 8061B514-8061B534 00005C 0020+00 4/7 0/0 0/0 .bss l_HIO */ +static daB_OB_HIO_c l_HIO; + +/* 8061B534-8061B538 00007C 0004+00 3/4 0/0 0/0 .bss pno */ +static int pno; + +/* 8061B538-8061B53C 000080 0004+00 1/2 0/0 0/0 .bss fin */ +static int fin; + +/* 806109AC-80610B3C 00052C 0190+00 1/1 0/0 0/0 .text FinACallBack__FP8J3DJointi */ +static int FinACallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no == 2 || joint_no == 1) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + + if (fin == 0) { + cMtx_YrotM(*calc_mtx, a_this->mBodyParts[pno].mFinARot.y); + cMtx_XrotM(*calc_mtx, a_this->mBodyParts[pno].mFinARot.y); + } else { + cMtx_YrotM(*calc_mtx, -a_this->mBodyParts[pno].mFinARot.y); + cMtx_XrotM(*calc_mtx, -a_this->mBodyParts[pno].mFinARot.y); + } + + cMtx_ZrotM(*calc_mtx, a_this->mBodyParts[pno].mFinARot.x); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; +} + +/* 80610B3C-80610C24 0006BC 00E8+00 1/1 0/0 0/0 .text FinBCallBack__FP8J3DJointi */ +static int FinBCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no == 2 || joint_no == 3 || joint_no == 5 || joint_no == 6) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->mBodyParts[pno].mFinBRot.y); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; +} + +/* 80610C24-80610D24 0007A4 0100+00 1/1 0/0 0/0 .text FinCCallBack__FP8J3DJointi */ +static int FinCCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no == 1) { + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_YrotM(*calc_mtx, a_this->mBodyParts[pno].mFinCRot.y); + cMtx_XrotM(*calc_mtx, -a_this->mBodyParts[pno].mFinCRot.y); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; +} + +/* 80610D24-80610E2C 0008A4 0108+00 1/1 0/0 0/0 .text sui_nodeCallBack__FP8J3DJointi */ +static int sui_nodeCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + int joint_no = i_joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + b_ob_class* a_this = (b_ob_class*)model->getUserArea(); + + if (a_this != NULL) { + if (joint_no >= 2 && joint_no <= 4) { + f32 rot = a_this->field_0x47c4 * (TREG_F(8) + 1.0f); + + MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); + cMtx_ZrotM(*calc_mtx, rot); + model->setAnmMtx(joint_no, *calc_mtx); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + } + } + } + + return 1; +} + +/* 80610E2C-80610EE4 0009AC 00B8+00 1/1 0/0 0/0 .text dark__FP12J3DModelDatas */ +static void dark(J3DModelData* i_modelData, s16 i_color) { + if (i_color != 0) { + for (u16 i = 0; i < i_modelData->getMaterialNum(); i++) { + J3DMaterial* material = i_modelData->getMaterialNodePointer(i); + material->getTevColor(0)->r = i_color; + material->getTevColor(0)->g = i_color; + material->getTevColor(0)->b = i_color; + } + } +} + +/* 80610EE4-80611408 000A64 0524+00 1/0 0/0 0/0 .text daB_OB_Draw__FP10b_ob_class */ +static int daB_OB_Draw(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + g_env_light.settingTevStruct(0, &a_this->current.pos, &a_this->tevStr); + BOOL var_r28 = true; + + if (i_this->mFishBattleMode == 2) { + camera_class* camera = (camera_class*)dComIfGp_getCamera(0); + var_r28 = false; + + for (int i = 0; i < 19; i++) { + if (!i_this->mBodyParts[i].mHide) { + if ((i_this->mBodyParts[i].mPos - camera->mLookat.mEye).abs() > + i_this->mBodyParts[i].mSize * (JREG_F(17) + 500.0f)) + { + g_env_light.setLightTevColorType_MAJI(i_this->mBodyParts[i].mpMorf->getModel(), + &a_this->tevStr); + dark(i_this->mBodyParts[i].mpMorf->getModel()->getModelData(), + i_this->field_0x5d14); + i_this->mBodyParts[i].mpMorf->entryDL(); + + if (i == 0) { + var_r28 = true; + } + + if (i_this->mBodyParts[i].mpFinMorf != NULL) { + g_env_light.setLightTevColorType_MAJI( + i_this->mBodyParts[i].mpFinMorf->getModel(), &a_this->tevStr); + dark(i_this->mBodyParts[i].mpFinMorf->getModel()->getModelData(), + i_this->field_0x5d14); + i_this->mBodyParts[i].mpFinMorf->entryDL(); + } + + if (i_this->mBodyParts[i].mpFinUnkMorf != NULL) { + g_env_light.setLightTevColorType_MAJI( + i_this->mBodyParts[i].mpFinUnkMorf->getModel(), &a_this->tevStr); + dark(i_this->mBodyParts[i].mpFinUnkMorf->getModel()->getModelData(), + i_this->field_0x5d14); + i_this->mBodyParts[i].mpFinUnkMorf->entryDL(); + } + + if (i_this->mBodyParts[i].mpFinBMorf != NULL) { + g_env_light.setLightTevColorType_MAJI( + i_this->mBodyParts[i].mpFinBMorf->getModel(), &a_this->tevStr); + dark(i_this->mBodyParts[i].mpFinBMorf->getModel()->getModelData(), + i_this->field_0x5d14); + i_this->mBodyParts[i].mpFinBMorf->entryDL(); + } + + if (i_this->mBodyParts[i].mpFinCMorf != NULL) { + g_env_light.setLightTevColorType_MAJI( + i_this->mBodyParts[i].mpFinCMorf->getModel(), &a_this->tevStr); + dark(i_this->mBodyParts[i].mpFinCMorf->getModel()->getModelData(), + i_this->field_0x5d14); + i_this->mBodyParts[i].mpFinCMorf->entryDL(); + } + } + } + } + + if (!i_this->mHideCore) { + g_env_light.setLightTevColorType_MAJI(i_this->mpCoreMorf->getModel(), &a_this->tevStr); + i_this->mpCoreMorf->entryDL(); + } + } + + if (i_this->mCoreBattleMode != 0 && var_r28) { + g_env_light.setLightTevColorType_MAJI(i_this->mpCoreMorf->getModel(), &a_this->tevStr); + + if (i_this->mAction == OB_ACTION_CORE_START || i_this->mAction == OB_ACTION_CORE_HAND_MOVE) + { + i_this->mpCoreMorf->getModel() + ->getModelData() + ->getMaterialNodePointer(1) + ->getShape() + ->hide(); + } else { + i_this->mpCoreMorf->getModel() + ->getModelData() + ->getMaterialNodePointer(1) + ->getShape() + ->show(); + } + + i_this->mpCoreMorf->entryDL(); + + if (i_this->mDrawShadow) { + cXyz pos; + pos.set(a_this->current.pos.x, a_this->current.pos.y + 100.0f, a_this->current.pos.z); + + i_this->mShadowKey = dComIfGd_setShadow( + i_this->mShadowKey, 1, i_this->mpCoreMorf->getModel(), &pos, BREG_F(19) + 1300.0f, 0.0f, + a_this->current.pos.y, i_this->mAcch.GetGroundH(), i_this->mAcch.m_gnd, + &a_this->tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); + } + + g_env_light.settingTevStruct(0, &a_this->home.pos, &a_this->tevStr); + g_env_light.setLightTevColorType_MAJI(i_this->mBodyParts[0].mpMorf->getModel(), + &a_this->tevStr); + i_this->mBodyParts[0].mpMorf->entryDL(); + } + + if (i_this->mSuiBrkFrame > 0.0f) { + g_env_light.setLightTevColorType_MAJI(i_this->mpSuiModel, &a_this->tevStr); + i_this->mpSuiBrk->entry(i_this->mpSuiModel->getModelData()); + i_this->mpSuiBtk->entry(i_this->mpSuiModel->getModelData()); + mDoExt_modelUpdateDL(i_this->mpSuiModel); + } + + if (i_this->mBlureRate > 2) { + mDoGph_gInf_c::setBlureRate(i_this->mBlureRate); + mDoGph_gInf_c::onBlure(); + } else { + mDoGph_gInf_c::offBlure(); + } + + return 1; +} + +/* 80611444-80611824 000FC4 03E0+00 1/1 0/0 0/0 .text core_start__FP10b_ob_class */ +static void core_start(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz sp28; + cXyz sp34; + + i_this->mDistToPlayer = fopAcM_searchPlayerDistance(i_this); + + switch (i_this->mMode) { + case 0: + if (i_this->mTimers[0] == 0) { + b_oh_class* tentacle = + (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i_this->mCoreHandNo]); + if (tentacle != NULL) { + i_this->mMode = 1; + i_this->field_0x478c = 0; + + anm_init(i_this, OB_ANM_APPEAR, 0.0f, 0, 0.0f); + a_this->home.pos.y = (i_this->field_0x47a0 - 200.0f) + KREG_F(11); + a_this->current.pos.y = a_this->home.pos.y - 500.0f; + } + } + break; + case 1: +#ifdef DEBUG + if (mDoCPd_c::getTrigY(PAD_2)) { + i_this->mMode = 2; + i_this->mDemoAction = 30; + } +#endif + + if (i_this->mDistToPlayer < 1600.0f) { + i_this->mMode = 2; + i_this->mDemoAction = 30; + } + break; + case 2: + b_oh_class* tentacle = + (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i_this->mCoreHandNo]); + MTXCopy(tentacle->mpMorf->getModel()->getAnmMtx(i_this->field_0x478c), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp28); + + MTXCopy( + tentacle->mpMorf->getModel()->getAnmMtx(i_this->field_0x478c + i_this->field_0x4790), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp34); + + a_this->current.pos = sp28 + ((sp34 - sp28) * i_this->field_0x4798); + + int var_r4; + if (i_this->mTimers[0] == 0) { + if (i_this->field_0x4790 > 0) { + i_this->field_0x4798 += l_HIO.mCoreMoveSpeed; + var_r4 = i_this->field_0x478c + i_this->field_0x4790; + a_this->current.angle.y += 0x200; + } else { + i_this->field_0x4798 += l_HIO.mCoreMoveSpeed * 2.0f; + var_r4 = i_this->field_0x478c + i_this->field_0x4790 + i_this->field_0x4790; + + if (var_r4 < tentacle->field_0xca8) { + var_r4 = tentacle->field_0xca8; + } + } + + cLib_addCalc2(&tentacle->field_0x9dc[var_r4], BREG_F(9) + 2.0f, 0.5f, l_HIO.mCoreMoveSpeed * (BREG_F(12) + 2.0f)); + } else { + int var_r27 = i_this->field_0x478c; + cLib_addCalc2(&tentacle->field_0x9dc[var_r27], BREG_F(9) + 1.5f, 0.5f, l_HIO.mCoreMoveSpeed * (BREG_F(12) + 2.0f)); + + if (i_this->field_0x4790 > 0) { + var_r27 -= i_this->field_0x4790; + } else { + var_r27 += i_this->field_0x4790; + } + + if (var_r27 < tentacle->field_0xca8) { + var_r27 = tentacle->field_0xca8; + } + + cLib_addCalc2(&tentacle->field_0x9dc[var_r27], BREG_F(9) + 1.5f, 0.5f, l_HIO.mCoreMoveSpeed * (BREG_F(12) + 2.0f)); + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 2, 0x800); + cLib_addCalcAngleS2(&a_this->current.angle.x, i_this->mXAngleToPlayer, 2, 0x800); + } + + if (i_this->field_0x4798 >= 1.0f) { + i_this->field_0x4798--; + i_this->field_0x478c += i_this->field_0x4790; + + if (i_this->field_0x478c >= 28) { + i_this->field_0x4790 *= -1; + i_this->mTimers[0] = 110; + } else if (i_this->field_0x478c <= tentacle->field_0xca8) { + i_this->mMode = 3; + } + } + break; + case 3: + break; + } + + a_this->shape_angle.z += 0xA00; +} + +/* 80611824-80611C20 0013A4 03FC+00 1/1 0/0 0/0 .text core_hand_move__FP10b_ob_class */ +static void core_hand_move(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz sp38; + cXyz sp44; + + switch (i_this->mMode) { + case 0: + if (i_this->mTimers[0] == 0) { + b_oh_class* tentacle = + (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i_this->mCoreHandNo]); + if (tentacle == NULL || (tentacle != NULL && tentacle->mAction == OH_ACTION_END)) { + i_this->mCoreHandNo += cM_rndF(7.0f) + 1.0f; + if (i_this->mCoreHandNo >= 8) { + i_this->mCoreHandNo -= 8; + } + } else { + i_this->mMode = 1; + i_this->field_0x478c = tentacle->field_0xca8; + } + } + break; + case 1: + b_oh_class* tentacle = + (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i_this->mCoreHandNo]); + if (tentacle == NULL || (tentacle != NULL && tentacle->mAction == OH_ACTION_END)) { + i_this->mMode = 0; + return; + } + + MTXCopy(tentacle->mpMorf->getModel()->getAnmMtx(i_this->field_0x478c), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp38); + + MTXCopy( + tentacle->mpMorf->getModel()->getAnmMtx(i_this->field_0x478c + i_this->field_0x4790), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp44); + + a_this->current.pos = sp38 + ((sp44 - sp38) * i_this->field_0x4798); + + if (tentacle->mAction == OH_ACTION_ATTACK || tentacle->mAction == OH_ACTION_CAUGHT) { + if (i_this->field_0x4790 > 0) { + i_this->field_0x4790 = -1; + } + + i_this->field_0x4798 += l_HIO.mCoreMoveSpeed * 2.0f; + } else { + i_this->field_0x4798 += l_HIO.mCoreMoveSpeed; + } + + int var_r4; + if (i_this->field_0x4790 > 0) { + var_r4 = i_this->field_0x478c + i_this->field_0x4790; + } else { + var_r4 = i_this->field_0x478c + i_this->field_0x4790 + i_this->field_0x4790; + if (var_r4 < tentacle->field_0xca8) { + var_r4 = tentacle->field_0xca8; + } + } + + cLib_addCalc2(&tentacle->field_0x9dc[var_r4], BREG_F(9) + 2.0f, 0.5f, l_HIO.mCoreMoveSpeed * (BREG_F(12) + 2.0f)); + + if (i_this->field_0x4798 >= 1.0f) { + i_this->field_0x4798--; + i_this->field_0x478c += i_this->field_0x4790; + + if (i_this->field_0x478c >= 29) { + i_this->field_0x4790 *= -1; + } else if (i_this->field_0x478c <= tentacle->field_0xca8) { + i_this->mMode = 2; + } + } + + cLib_addCalc0(&i_this->field_0x479c, 1.0f, 10.0f); + break; + case 2: + cLib_addCalc2(&i_this->field_0x479c, -200.0f, 1.0f, 10.0f); + + if (i_this->mTimers[0] == 0) { + i_this->mMode = 0; + i_this->field_0x478c = 0; + i_this->field_0x4790 = 1; + + i_this->mCoreHandNo += cM_rndF(7.0f) + 1.0f; + if (i_this->mCoreHandNo >= 8) { + i_this->mCoreHandNo -= 8; + } + } + break; + } + + a_this->shape_angle.z += 0xA00; +} + +/* 8061B53C-8061B540 000084 0004+00 2/2 0/0 0/0 .bss bf_ct */ +static int bf_ct; + +/* 80611C20-80611C78 0017A0 0058+00 1/1 0/0 0/0 .text s_bf_sub__FPvPv */ +static void* s_bf_sub(void* i_this, void* i_data) { + if (fopAcM_IsActor(i_this) && fopAcM_GetName(i_this) == PROC_E_OctBg) { + bf_ct++; + } + + return NULL; +} + +/* 80611C78-80611CC4 0017F8 004C+00 1/1 0/0 0/0 .text s_bfdel_sub__FPvPv */ +static void* s_bfdel_sub(void* i_this, void* i_data) { + if (fopAcM_IsActor(i_this) && fopAcM_GetName(i_this) == PROC_E_OctBg) { + fopAcM_delete((fopAc_ac_c*)i_this); + } + + return NULL; +} + +/* 80611CC4-80611D10 001844 004C+00 1/1 0/0 0/0 .text s_kaisoudel_sub__FPvPv */ +static void* s_kaisoudel_sub(void* i_this, void* i_data) { + if (fopAcM_IsActor(i_this) && fopAcM_GetName(i_this) == PROC_Obj_Kaisou) { + fopAcM_delete((fopAc_ac_c*)i_this); + } + + return NULL; +} + +/* 80611D10-80611EF8 001890 01E8+00 1/1 0/0 0/0 .text bombfishset__FP10b_ob_class */ +static void bombfishset(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz pos; + i_this->mHitIFrameTimer = 20; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, OB_ANM_WAIT, 5.0f, J3DFrameCtrl::LOOP_REPEAT_e, 3.0f); + i_this->mMode = 1; + + if (a_this->field_0x567 == 0 && i_this->mDemoAction == 0) { + i_this->mDemoAction = 60; + a_this->field_0x567 = 1; + } + + i_this->mTimers[0] = 150; + break; + case 1: + if (i_this->mTimers[0] < 100 && !(i_this->mTimers[0] & 15)) { + bf_ct = 0; + fpcM_Search(s_bf_sub, i_this); + + if (bf_ct < 10) { + pos = a_this->home.pos; + pos.y += (JREG_F(6) + 350.0f); + + csXyz angle(-0x3800, 0, 0); + angle.y = cM_rndF(0x10000); + + fopAcM_createChild(PROC_E_OctBg, fopAcM_GetID(a_this), 0xFFFFFFFF, &pos, + fopAcM_GetRoomNo(a_this), &angle, NULL, -1, NULL); + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_BG_APPEAR, -1); + } + } + + if (i_this->mTimers[0] == 0) { + if (i_this->mDemoAction != 0) { + i_this->mDemoAction = 101; + } + + i_this->mAction = OB_ACTION_CORE_HAND_MOVE; + i_this->mMode = 0; + anm_init(i_this, OB_ANM_WAIT, 5.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + break; + } +} + +/* 80611F34-80611FAC 001AB4 0078+00 1/1 0/0 0/0 .text core_hook__FP10b_ob_class */ +static void core_hook(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + i_this->mHitIFrameTimer = 20; + + switch (i_this->mMode) { + case 0: + i_this->mMode = 1; + a_this->speedF = 0.0f; + i_this->mTimers[0] = 3; + break; + case 1: + break; + } + + if (i_this->mTimers[0] == 0 && !fopAcM_checkHookCarryNow(a_this)) { + i_this->mAction = OB_ACTION_CORE_CHANCE; + i_this->mMode = 0; + } + + a_this->shape_angle.z += 0xA00; +} + +/* 80611FAC-80612484 001B2C 04D8+00 1/1 0/0 0/0 .text core_chance__FP10b_ob_class */ +static int core_chance(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + cXyz sp68; + cXyz sp74; + int var_r30 = 1; + + switch (i_this->mMode) { + case 0: + a_this->current.angle.x = 0; + a_this->speedF = 0.0f; + a_this->speed.y = 0.0f; + + sp68.x = a_this->home.pos.x - a_this->current.pos.x; + sp68.z = a_this->home.pos.z - a_this->current.pos.z; + if (JMAFastSqrt(sp68.x * sp68.x + sp68.z * sp68.z) < (NREG_F(4) + 500.0f)) { + i_this->mMode = 2; + } else { + i_this->mMode = 1; + i_this->mTimers[0] = 150; + } + break; + case 1: + if (i_this->mAcch.i_ChkGroundHit()) { + if (i_this->mTimers[0] == 0) { + i_this->mMode = 2; + } else { + a_this->speed.y = VREG_F(1) + cM_rndF(10.0f) + 10.0f + 10.0f; + a_this->current.angle.y = cM_rndF(0x10000); + a_this->speedF = VREG_F(2) + cM_rndF(3.0f) + 3.0f + 5.0f; + } + } + + if (a_this->speedF >= 20.0f) { + i_this->mTimers[0] = 2; + cLib_addCalc2(&a_this->speedF, 6.0f, 1.0f, 1.0f); + } + break; + case 2: + i_this->mHitIFrameTimer = 20; + var_r30 = 2; + + cLib_addCalc2(&a_this->speedF, 50.0f, 1.0f, 5.0f); + i_this->mTargetMovePos = a_this->home.pos; + i_this->mTargetMovePos.y += (VREG_F(6) + 350.0f); + sp68 = i_this->mTargetMovePos - a_this->current.pos; + + f32 var_f31 = JMAFastSqrt(sp68.x * sp68.x + sp68.z * sp68.z); + + f32 var_f30 = var_f31 * 10.0f; + if (var_f30 > 7000.0f) { + var_f30 = 7000.0f; + } + + f32 var_f29 = var_f31 * 20.0f; + if (var_f29 > 10000.0f) { + var_f29 = 10000.0f; + } + + s16 sp58 = var_f30 * cM_ssin(i_this->field_0x4750 * 1000); + s16 sp50 = var_f30 * cM_ssin(i_this->field_0x4750 * 800) - var_f29; + + a_this->current.angle.y = sp58 + cM_atan2s(sp68.x, sp68.z); + a_this->current.angle.x = sp50 - cM_atan2s(sp68.y, var_f31); + + if (sp68.abs() < 100.0f) { + if (i_this->field_0x4744 != 0) { + i_this->mAction = OB_ACTION_CORE_END; + i_this->mMode = 0; + } else { + if (i_this->field_0x5d13 && i_this->mDemoAction == 0) { + i_this->mAction = OB_ACTION_BOMBFISH_SET; + i_this->mMode = 0; + i_this->field_0x5d13 = 1; + } else { + i_this->mAction = OB_ACTION_CORE_HAND_MOVE; + i_this->mMode = 0; + } + + i_this->field_0x478c = 0; + i_this->field_0x4790 = 1; + i_this->field_0x479c = -200.0f; + + i_this->mCoreHandNo += (cM_rndF(7.0f) + 1.0f); + if (i_this->mCoreHandNo >= 8) { + i_this->mCoreHandNo -= 8; + } + } + } + break; + } + + a_this->shape_angle.z += 0xA00; + return var_r30; +} + +/* 80612484-8061285C 002004 03D8+00 1/1 0/0 0/0 .text core_end__FP10b_ob_class */ +static void core_end(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + int frame = i_this->mBodyParts[0].mpMorf->getFrame(); + i_this->mHitIFrameTimer = 10; + + cXyz particle_pos; + switch (i_this->mMode) { + case 0: + i_this->mMode = 1; + a_this->gravity = 0.0f; + i_this->mDemoAction = 20; + i_this->field_0x479c = -1000.0f; + anm_init(i_this, OB_ANM_TENTACLE_END, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + + particle_pos.set(0.0f, 0.0f, 0.0f); + dComIfGp_particle_set(0x880A, &particle_pos, NULL, NULL); + mDoAud_seStart(Z2SE_EN_OI_DEMO_APPEAR2, NULL, 0, 0); + break; + case 1: + if (frame == 100) { + dComIfGp_getVibration().StartQuake(3, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (frame >= 100) { + i_this->field_0x5ce4 = WREG_F(11) + 6.0f; + } + + if (i_this->mBodyParts[0].mpMorf->isStop()) { + i_this->mMode = 2; + i_this->mTimers[0] = 120; + dComIfGp_getVibration().StopQuake(31); + a_this->home.pos.y = i_this->field_0x47a0 - 900.0f; + } + break; + case 2: + if (i_this->mTimers[0] == 60) { + for (int i = 0; i < 8; i++) { + fopAc_ac_c* tentacle = fopAcM_SearchByID(i_this->mTentacleActorIDs[i]); + fopAcM_delete(tentacle); + } + } + + if (i_this->mTimers[0] <= 50) { + i_this->field_0x5ce4 = WREG_F(11) + 6.0f; + + if (i_this->mTimers[0] == 50) { + dComIfGp_getVibration().StartQuake(4, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + } + + if (i_this->mTimers[0] == 0) { + i_this->mCoreBattleMode = 0; + i_this->mFishBattleMode = 1; + i_this->mZoneSwTimer = 0; + a_this->home.pos.y = i_this->field_0x47a0; + a_this->health = 2; + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getBaseTRMtx(), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&a_this->current.pos); + a_this->current.angle.y = 0; + a_this->current.angle.x = -0x4000; + a_this->shape_angle.x = -0x4000; + + i_this->mAction = OB_ACTION_FISH_NORMAL; + i_this->mMode = 1; + + i_this->mMoveAngle.y = a_this->current.angle.y; + i_this->mMoveAngle.x = -0x4000; + i_this->field_0x4750 = 0; + i_this->mTimers[0] = 110; + anm_init(i_this, OB_ANM_APPEAR_2, 1.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + + fopAcM_OffStatus(a_this, 0x80000); + fopAcM_OnStatus(a_this, 0x200000); + i_this->mTimers[3] = VREG_S(8) + 220; + + for (int i = 0; i < 8; i++) { + i_this->mTentacleActorIDs[i] = + fopAcM_createChild(PROC_B_OH2, fopAcM_GetID(a_this), i, &a_this->current.pos, + fopAcM_GetRoomNo(a_this), NULL, NULL, -1, NULL); + } + } + break; + } +} + +/* 8061285C-80612CC8 0023DC 046C+00 1/1 0/0 0/0 .text core_action__FP10b_ob_class */ +static void core_action(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + cXyz sp30; + cXyz sp3C; + + if (i_this->mCoreAnm != 0) { + anm_init(i_this, i_this->mCoreAnm, 10.0f, i_this->mCoreAnmMode, 1.0f); + i_this->mCoreAnm = 0; + } + + BOOL attn_ON = true; + BOOL look_at_player = true; + int var_r26 = 0; + BOOL check_eat = false; + BOOL play_move_sound = true; + + switch (i_this->mAction) { + case OB_ACTION_CORE_START: + core_start(i_this); + look_at_player = false; + break; + case OB_ACTION_CORE_HAND_MOVE: + core_hand_move(i_this); + check_eat = true; + break; + case OB_ACTION_BOMBFISH_SET: + bombfishset(i_this); + play_move_sound = false; + break; + case OB_ACTION_CORE_HOOK: + core_hook(i_this); + look_at_player = false; + play_move_sound = false; + break; + case OB_ACTION_CORE_CHANCE: + var_r26 = core_chance(i_this); + look_at_player = false; + break; + case OB_ACTION_CORE_END: + core_end(i_this); + var_r26 = 0; + look_at_player = false; + attn_ON = false; + break; + } + + if (check_eat && i_this->mDemoAction == 0) { + sp30 = dComIfGp_getPlayer(0)->current.pos - a_this->home.pos; + if (JMAFastSqrt(sp30.x * sp30.x + sp30.z * sp30.z) < (VREG_F(17) + 300.0f) && sp30.y < (VREG_F(18) + 800.0f)) { + i_this->mDemoAction = 50; + } + } + + if (attn_ON && i_this->field_0x479c > -1.0f && a_this->eyePos.y >= a_this->home.pos.y) { + fopAcM_OnStatus(a_this, 0); + a_this->attention_info.flags = 4; + } else { + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; + } + + if (look_at_player) { + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mYAngleToPlayer, 2, 0x800); + cLib_addCalcAngleS2(&a_this->current.angle.x, i_this->mXAngleToPlayer, 2, 0x800); + } + + if (var_r26 == 1) { + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + + sp30.x = 0.0f; + sp30.y = 0.0f; + sp30.z = a_this->speedF; + MtxPosition(&sp30, &sp3C); + a_this->speed.x = sp3C.x; + a_this->speed.z = sp3C.z; + + a_this->current.pos += a_this->speed; + a_this->speed.y -= (VREG_F(0) + 3.0f); + + f32 temp_y_offset = VREG_F(11) + 20.0f; + a_this->current.pos.y -= temp_y_offset; + a_this->old.pos.y -= temp_y_offset; + + i_this->mAcch.CrrPos(dComIfG_Bgsp()); + a_this->current.pos.y += temp_y_offset; + a_this->old.pos.y += temp_y_offset; + } else if (var_r26 == 2) { + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + cMtx_XrotM(*calc_mtx, a_this->current.angle.x); + + sp30.x = 0.0f; + sp30.y = 0.0f; + sp30.z = a_this->speedF; + MtxPosition(&sp30, &a_this->speed); + a_this->current.pos += a_this->speed; + } + + if (play_move_sound) { + f32 dist_to_oldpos = (a_this->current.pos - a_this->old.pos).abs(); + i_this->mSound.startCreatureSoundLevel(Z2SE_EN_OI_CORE_MOVE, dist_to_oldpos, -1); + } +} + +/* 80612CC8-80612ED4 002848 020C+00 1/1 0/0 0/0 .text core_damage_check__FP10b_ob_class + */ +static void core_damage_check(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + if (fopAcM_checkStatus(a_this, 0x100000)) { + i_this->field_0x5d38 = + dComIfGp_particle_set(i_this->field_0x5d38, 0x8802, &a_this->current.pos, NULL, NULL); + } + + i_this->mCoreCcStts.Move(); + + if (i_this->mHitIFrameTimer == 0 && i_this->mCcSph.ChkTgHit()) { + i_this->mAtInfo.mpCollider = i_this->mCcSph.GetTgHitObj(); + cc_at_check(a_this, &i_this->mAtInfo); + + dComIfGp_particle_set(0x8801, &a_this->current.pos, NULL, NULL); + + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) { + i_this->mAction = OB_ACTION_CORE_HOOK; + i_this->mMode = 0; + i_this->mSound.startCreatureSound(Z2SE_EN_OI_CORE_PULLOUT, 0, -1); + dComIfGs_onOneZoneSwitch(7, -1); + } else { + a_this->current.angle.y = i_this->mYAngleToPlayer + 0x8000; + a_this->speedF = 30.0f; + a_this->speed.y = 7.0f; + + i_this->mSound.startCreatureVoice(Z2SE_EN_OI_V_CORE_DAMAGE, -1); + + if (a_this->health <= 0 && !dComIfGp_event_runCheck()) { + i_this->field_0x4744 = 1; + } else { + i_this->field_0x5d13 = 1; + } + } + + i_this->mHitIFrameTimer = 10; + } +} + +/* 80612ED4-806131A8 002A54 02D4+00 1/1 0/0 0/0 .text fish_damage_check__FP10b_ob_class + */ +static void fish_damage_check(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + i_this->mBodyCcStts.Move(); + + if (i_this->mHitIFrameTimer == 0) { + for (int i = 0; i < 19; i++) { + if (i_this->mBodyParts[i].mSph.ChkTgHit()) { + i_this->mHitIFrameTimer = 10; + def_se_set(&i_this->mOISound, i_this->mBodyParts[i].mSph.GetTgHitObj(), 0x2A, NULL); + } + } + + if (i_this->field_0x4756 == 0 && i_this->mCoreSph.ChkTgHit()) { + i_this->mAtInfo.mpCollider = i_this->mCoreSph.GetTgHitObj(); + cc_at_check(a_this, &i_this->mAtInfo); + + if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) { + i_this->mTimers[1] = 40; + i_this->field_0x4756 = 1; + + if (i_this->mAction != OB_ACTION_FISH_NORMAL) { + i_this->mAction = OB_ACTION_FISH_NORMAL; + i_this->mMode = 0; + OS_REPORT("B_OB HOOK VAC OFF !!\n"); + } + } + } + + fopEn_enemy_c* e_this = (fopEn_enemy_c*)a_this; + if (e_this->checkCutDownHitFlg()) { + e_this->offCutDownHitFlg(); + i_this->field_0x5d18 = 125; + + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0x5d38); + if (emitter != NULL) { + emitter->becomeDeleteEmitter(); + } + + i_this->field_0x5d38 = 0; + dComIfGp_getVibration().StartShock(5, 31, cXyz(0.0f, 1.0f, 0.0f)); + i_this->mHangHitCount++; + dComIfGs_onOneZoneSwitch(9, -1); + + if (player->getCutType() == daPy_py_c::CUT_TYPE_FINISH_STAB) { + i_this->mHangHitCount = 4; + i_this->mHangFinishCount = 3; + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_TODOME, -1); + i_this->mSound.startCollisionSE(Z2SE_HIT_SWORD_STAB, 0x20); + } else { + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_DAMAGE, -1); + i_this->mSound.startCollisionSE(Z2SE_HIT_SWORD_STAB, 0x1F); + } + + if (i_this->mHangHitCount >= 4) { + i_this->mHangFinishCount++; + if (i_this->mHangFinishCount >= 2) { + e_this->onDownFlg(); + } + + i_this->mTimers[2] = 100; + + if (i_this->mHangFinishCount >= 3) { + i_this->mHangTimer = 250; + } else { + i_this->mHangTimer = 210; + } + } + + i_this->field_0x47b0 = (JREG_S(2) + 20); + } + } +} + +/* 806131A8-80613270 002D28 00C8+00 2/2 0/0 0/0 .text pl_check__FP10b_ob_classfs */ +static BOOL pl_check(b_ob_class* i_this, f32 i_range, s16 i_maxAngle) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); + + if (fopAcM_searchPlayerDistance(a_this) < i_range) { + s16 y_diff = a_this->current.angle.y - i_this->mYAngleToPlayer; + s16 x_diff = a_this->current.angle.x - i_this->mXAngleToPlayer; + + if (y_diff < i_maxAngle && y_diff > (s16)-i_maxAngle && x_diff < i_maxAngle && + x_diff > (s16)-i_maxAngle) + { + if (!fopAcM_otherBgCheck(a_this, player)) { + return true; + } + } + } + + return false; +} + +/* 80613270-80613E00 002DF0 0B90+00 1/1 0/0 0/0 .text fish_normal__FP10b_ob_class */ +static int fish_normal(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + cXyz sp64; + f32 dist_to_ground = fabsf(i_this->mAcch.GetGroundH() - a_this->current.pos.y); + BOOL throw_player = false; + f32 dist_to_player = (a_this->eyePos - player->current.pos).abs(); + + if (i_this->field_0x4756 == 1) { + if (dist_to_player < KREG_F(11) + 150.0f) { + Z2GetAudioMgr()->changeBgmStatus(2); + i_this->field_0x4756 = 2; + } + } else if (i_this->field_0x4756 == 2) { + if (dist_to_player >= KREG_F(11) + 150.0f) { + i_this->field_0x4756 = 0; + Z2GetAudioMgr()->changeBgmStatus(1); + } + } + + BOOL player_hang_on; + if (dist_to_player < KREG_F(11) + 150.0f) { + player_hang_on = true; + i_this->field_0x47b4 = 0; + moveSW2 = false; + } else { + player_hang_on = false; + } + + int ret = 0; + BOOL in_opening_demo = false; + if (i_this->mDemoAction >= 20 && i_this->mDemoAction < 30) { + in_opening_demo = true; + } + + static cXyz sdemo_p[4] = { + cXyz(2000.0f, 3500.0f, 0.0f), + cXyz(-1000.0f, 2000.0f, 1000.0f), + cXyz(0.0f, 3500.0f, 2000.0f), + cXyz(1000.0f, 2000.0f, -1000.0f), + }; + + switch (i_this->mMode) { + case 0: + if (in_opening_demo) { + i_this->mTargetMovePos = a_this->home.pos + sdemo_p[i_this->mDemoMovePosIdx]; + i_this->mDemoMovePosIdx++; + i_this->mDemoMovePosIdx &= 3; + + i_this->mTimers[0] = 30; + i_this->field_0x47b4 = 0; + } else { + i_this->mTargetMovePos.x = a_this->home.pos.x + cM_rndFX(2000.0f); + i_this->mTargetMovePos.y = a_this->home.pos.y + 1000.0f + cM_rndFX(2000.0f); + i_this->mTargetMovePos.z = a_this->home.pos.z + cM_rndFX(2000.0f); + i_this->mTimers[0] = cM_rndF(30.0f) + 30.0f; + } + + sp64 = i_this->mTargetMovePos - a_this->current.pos; + i_this->mMoveAngle.y = cM_atan2s(sp64.x, sp64.z); + i_this->mMoveAngle.x = -cM_atan2s(sp64.y, JMAFastSqrt(sp64.x * sp64.x + sp64.z * sp64.z)); + + if (i_this->mMoveAngle.x > 0x1000) { + i_this->mMoveAngle.x = 0x1000; + } else if (i_this->mMoveAngle.x < -0x1000) { + i_this->mMoveAngle.x = -0x1000; + } + + i_this->mMode = 1; + i_this->field_0x476a = 0; + /* fallthrough */ + case 1: + if (in_opening_demo && i_this->mTimers[0] > 60) { + ret = 4; + } + + if (i_this->mAnmID != OB_ANM_SWIM_WAIT) { + anm_init(i_this, OB_ANM_SWIM_WAIT, 10.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + + if (dist_to_ground < l_HIO.mBodySize * (ZREG_F(8) + 1200.0f)) { + if (i_this->mMoveAngle.x > 0) { + cLib_addCalcAngleS2(&i_this->mMoveAngle.x, 0, 4, 0x40); + } + + if (a_this->current.angle.x > 0) { + cLib_addCalcAngleS2(&a_this->current.angle.x, 0, 4, 0x40); + } + } + + s16 y_diff = a_this->current.angle.y - i_this->mMoveAngle.y; + s16 x_diff = a_this->current.angle.x - i_this->mMoveAngle.x; + if (i_this->mTimers[0] == 0 && y_diff <= 0x100 && y_diff >= (s16)-0x100 && + x_diff <= 0x100 && x_diff >= (s16)-0x100) + { + i_this->mMode = 0; + i_this->field_0x47b4++; + } + + if (!player_hang_on && i_this->field_0x47b4 >= 3 && pl_check(i_this, 5000.0f, 0x2000)) { + i_this->mMode = 2; + i_this->mTimers[0] = cM_rndF(50.0f) + 200.0f; + i_this->field_0x47b4 = 0; + i_this->field_0x476a = 0; + i_this->mTimers[4] = 30; + } + break; + case 2: + ret = 1; + i_this->mTargetMovePos.x = player->current.pos.x; + + if (dist_to_ground < l_HIO.mBodySize * (ZREG_F(8) + 1200.0f)) { + i_this->mTargetMovePos.y = player->current.pos.y + 300.0f + AREG_F(7); + } else { + i_this->mTargetMovePos.y = player->current.pos.y; + } + + i_this->mTargetMovePos.z = player->current.pos.z; + + sp64 = i_this->mTargetMovePos - a_this->current.pos; + i_this->mMoveAngle.y = cM_atan2s(sp64.x, sp64.z); + i_this->mMoveAngle.x = -cM_atan2s(sp64.y, JMAFastSqrt(sp64.x * sp64.x + sp64.z * sp64.z)); + sp64.abs(); + + if (!daPy_getPlayerActorClass()->checkHookshotShootReturnMode() && + i_this->mTimers[4] == 0 && pl_check(i_this, BREG_F(17) + 3000.0f, 0x3000)) + { + i_this->mAction = OB_ACTION_FISH_VACUME; + i_this->mMode = 0; + moveSW2 = true; + return 1; + } + + if (player_hang_on || daPy_getPlayerActorClass()->checkEquipHeavyBoots() || + !pl_check(i_this, 10000.0f, 0x3000) || i_this->mTimers[0] == 0) + { + i_this->mMode = 1; + + if (dist_to_ground < l_HIO.mBodySize * (ZREG_F(8) + 1200.0f)) { + i_this->mMoveAngle.x = -0x2000; + i_this->mTimers[0] = cM_rndF(30.0f) + 30.0f; + } else { + i_this->mMoveAngle.x = -0x1000; + i_this->mTimers[0] = cM_rndF(10.0f) + 20.0f; + } + } + break; + case 10: + ret = 1; + i_this->mMoveAngle.y += 0x200; + i_this->field_0x476a = 0x200; + i_this->mMoveAngle.x = -0x1000; + + if (i_this->mTimers[2] == 0) { + i_this->mMode = 1; + } + break; + } + + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mMoveAngle.y, 0x10, i_this->field_0x476a); + cLib_addCalcAngleS2(&a_this->current.angle.x, i_this->mMoveAngle.x, 0x10, i_this->field_0x476a); + + if (in_opening_demo) { + cLib_addCalcAngleS2(&i_this->field_0x476a, 0x100, 1, 2); + } else { + cLib_addCalcAngleS2(&i_this->field_0x476a, 0x180, 1, 8); + } + + cLib_addCalc0(&i_this->mSuiBrkFrame, 1.0f, 0.5f); + cLib_addCalc2(&i_this->field_0x5d04, 0.7f, 1.0f, 0.05f); + + a_this->speedF = TREG_F(0) + 100.0f; + + if (player_hang_on) { + ret = 3; + i_this->mHangTimer++; + + if (i_this->mHangTimer == (JREG_S(5) + 210)) { + i_this->field_0x47b0 = (JREG_S(3) + 35); + } + + if (i_this->mHangTimer == (JREG_S(6) + 230)) { + player->setOctaIealWildHang(); + } + + if (i_this->mHangTimer == (JREG_S(7) + 284)) { + throw_player = true; + + if (i_this->mTimers[2] != 0) { + if (i_this->mHangFinishCount >= 3) { + i_this->mAction = OB_ACTION_FISH_END; + i_this->mMode = 0; + i_this->mDemoAction = 40; + } else { + i_this->mMode = 10; + i_this->mTimers[2] = 80; + } + } + } + + if (i_this->mHangTimer >= 230 || i_this->mHangHitCount >= 4) { + i_this->field_0x47b0 = (JREG_S(3) + 25); + } + } else { + i_this->mHangTimer = 0; + i_this->mHangHitCount = 0; + } + + if (i_this->mTimers[3] != 0) { + i_this->field_0x5ce4 = JREG_F(11) + 6.0f; + + cXyz sp70; + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp70); + + i_this->field_0x5d24[0] = + dComIfGp_particle_set(i_this->field_0x5d24[0], 0x87EC, &sp70, NULL, NULL); + + sp64.set(0.0f, 0.0f, 0.0f); + i_this->field_0x5d24[1] = + dComIfGp_particle_set(i_this->field_0x5d24[1], 0x87ED, &sp64, NULL, NULL); + + if (i_this->mTimers[3] == 1) { + dComIfGp_getVibration().StopQuake(31); + } + } + + if (i_this->mAnmID == OB_ANM_APPEAR_2 && i_this->mBodyParts[0].mpMorf->isStop()) { + anm_init(i_this, OB_ANM_SWIM_WAIT, 10.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + + if (throw_player) { + player->cancelOctaIealHang(); + daPy_getPlayerActorClass()->setThrowDamage(a_this->current.angle.y + 0x8000, 40.0f, KREG_F(14) + 50.0f, + 0, 0, 2); + i_this->mAttnOffTimer = 70; + } + + return ret; +} + +/* 80613E00-80614228 003980 0428+00 1/1 0/0 0/0 .text fish_vacume__FP10b_ob_class */ +static int fish_vacume(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + + cXyz sp3C; + int var_r30 = 0; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, OB_ANM_OPEN_MOUTH, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mMode = 1; + i_this->field_0x476a = 0; + break; + case 1: + if (i_this->mBodyParts[0].mpMorf->isStop()) { + anm_init(i_this, OB_ANM_OPEN_MOUTH_WAIT, 3.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + i_this->mMode = 2; + i_this->mTimers[0] = 200; + } + break; + case 2: + i_this->mMoveAngle.y = i_this->mYAngleToPlayer; + i_this->mMoveAngle.x = 0; + var_r30 = 1; + + cLib_addCalc2(&a_this->current.pos.x, 0.0f, 0.05f, 5.0f); + cLib_addCalc2(&a_this->current.pos.z, 0.0f, 0.05f, 5.0f); + + if (i_this->mTimers[0] == 0) { + i_this->mAction = OB_ACTION_FISH_NORMAL; + i_this->mMode = 0; + } else if ((a_this->eyePos - player->current.pos).abs() > (KREG_F(11) + 150.0f) && + i_this->mTimers[0] < 100) + { + if (!daPy_getPlayerActorClass()->checkEquipHeavyBoots() && + pl_check(i_this, 3000.0f, 0x4000)) + { + i_this->mDemoAction = 10; + i_this->mMode = 3; + } + } + break; + case 3: + if (i_this->mDemoActionTimer < 30) { + var_r30 = 1; + } + + i_this->mBodyParts[0].mSph.OffCoSetBit(); + + if (i_this->mBodyParts[0].mpMorf->isStop()) { + if (i_this->mAnmID == OB_ANM_SWALLOW) { + anm_init(i_this, OB_ANM_EAT_2, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } else if (i_this->mAnmID == OB_ANM_EAT_2) { + anm_init(i_this, OB_ANM_THROWUP, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_THROWUP, -1); + } else if (i_this->mAnmID == OB_ANM_THROWUP) { + i_this->mAction = OB_ACTION_FISH_NORMAL; + i_this->mMode = 0; + } + } + break; + } + + if (var_r30) { + cLib_addCalc2(&i_this->mSuiBrkFrame, 29.0f, 1.0f, 0.5f); + i_this->mOISound.startCreatureVoiceLevel(Z2SE_EN_OI_V_DRAWIN, -1); + } else { + cLib_addCalc0(&i_this->mSuiBrkFrame, 1.0f, 0.5f); + } + + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mMoveAngle.y, 0x10, i_this->field_0x476a); + cLib_addCalcAngleS2(&a_this->current.angle.x, i_this->mMoveAngle.x, 0x10, i_this->field_0x476a); + cLib_addCalcAngleS2(&i_this->field_0x476a, 0x180, 1, 8); + cLib_addCalc2(&i_this->field_0x5d04, 0.0f, 1.0f, 0.05f); + return 2; +} + +/* 80614228-806147D4 003DA8 05AC+00 1/1 0/0 0/0 .text fish_end__FP10b_ob_class */ +static int fish_end(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + cXyz sp68; + + f32 speed_f = 100.0f; + s16 angleX_max_step = 0x300; + + switch (i_this->mMode) { + case 0: + i_this->mMode = 1; + i_this->mTargetMovePos.set(0.0f, -16000.0f, 6500.0f); + i_this->mTimers[0] = 100; + i_this->field_0x5d04 = KREG_F(8) + 1.5f; + i_this->mBlureRateTarget = 150; + i_this->field_0x5dd8 = 3; + anm_init(i_this, OB_ANM_LAST_DAMAGE, 0.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + break; + case 1: + if (i_this->mBodyParts[0].mpMorf->isStop()) { + anm_init(i_this, OB_ANM_SWIM_WAIT, 5.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + + if (i_this->mTimers[0] == 0) { + i_this->mMode = 2; + i_this->mTargetMovePos.set(0.0f, -19000.0f, -6500.0f); + i_this->mTimers[0] = 150; + i_this->mDemoCamEye.set(-6000.0f, -22000.0f, 2000.0f); + anm_init(i_this, OB_ANM_LAST_DAMAGE, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } + break; + case 2: + sp68.set(VREG_F(0) + -1325.0f, -24000.0f, VREG_F(1) + 9178.0f); + player->setPlayerPosAndAngle(&sp68, VREG_S(1) + 10000, 0); + + if (i_this->mTimers[0] == 0) { + i_this->mMode = 3; + i_this->mTargetMovePos.set(0.0f, TREG_F(14) + -23550.0f, 10200.0f); + i_this->mTimers[0] = 120; + i_this->mDemoCamEye.set(2130.0f, -23071.0f, 7383.0f); + i_this->mDemoAction = 42; + i_this->mDemoActionTimer = 0; + i_this->mBlureRateTarget = 0; + anm_init(i_this, OB_ANM_LAST_DAMAGE, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + } + break; + case 3: + if (i_this->mAcch.ChkWallHit() && i_this->mTimers[0] == 0) { + anm_init(i_this, OB_ANM_DEAD, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + dComIfGp_getVibration().StartShock(8, 31, cXyz(0.0f, 1.0f, 0.0f)); + mDoAud_seStart(Z2SE_OBJ_BOMB_EXPLODE, NULL, 0, 0); + + i_this->mMode = 10; + i_this->field_0x5ce4 = WREG_F(14) + 20.0f; + i_this->mTimers[0] = 0; + a_this->current.angle.x = 0x1000; + i_this->mMoveAngle.x = 0; + i_this->mMoveAngle.y = 0; + i_this->field_0x5d08 = 50; + + moveSW2 = true; + i_this->mDemoAction = 43; + i_this->mDemoActionTimer = 1; + + obj_lv3WaterB_class* water = + (obj_lv3WaterB_class*)fopAcM_SearchByName(PROC_OBJ_LV3WATERB); + water->mAction = LV3WATERB_ACT_REMOVE; + a_this->home.pos.set(0.0f, -23580.0f, 10300.0f); + + for (int i = 0; i < 5; i++) { + static u16 iso_eff[] = {0x87F2, 0x87F3, 0x87F4, 0x87F5, 0x87F6}; + dComIfGp_particle_set(iso_eff[i], &a_this->home.pos, NULL, NULL); + } + + mDoAud_seStart(Z2SE_EN_OI_HIT_WALL, &a_this->home.pos, 0, 0); + speed_f = 0.0f; + } + break; + case 10: + cLib_addCalc2(&a_this->current.pos.x, i_this->mTargetMovePos.x, 0.1f, 10.0f); + cLib_addCalc2(&a_this->current.pos.y, VREG_F(7) + -23550.0f, 0.1f, 10.0f); + cLib_addCalc2(&a_this->current.pos.z, (VREG_F(8) + 9128.0f) - 500.0f, 0.1f, 10.0f); + speed_f = 0.0f; + + i_this->field_0x4750--; + cLib_addCalcAngleS2(&a_this->current.angle.z, 0x4000, 0x20, 0x80); + break; + } + + s16 angleY_offset = 0; + s16 angleX_offset = 0; + + if (speed_f > 1.0f) { + sp68 = i_this->mTargetMovePos - a_this->current.pos; + f32 var_f30 = JMAFastSqrt(sp68.x * sp68.x + sp68.z * sp68.z); + + i_this->mMoveAngle.y = cM_atan2s(sp68.x, sp68.z); + i_this->mMoveAngle.x = -cM_atan2s(sp68.y, var_f30); + + f32 temp_f2 = var_f30 * 2.0f; + if (temp_f2 > 12000.0f) { + temp_f2 = 12000.0f; + } + + angleY_offset = temp_f2 * cM_ssin(i_this->field_0x4750 * 1300); + angleX_offset = (temp_f2 / 2) * cM_ssin(i_this->field_0x4750 * 1100); + } else { + angleX_max_step = 0x20; + } + + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mMoveAngle.y + angleY_offset, 0x10, 0x300); + cLib_addCalcAngleS2(&a_this->current.angle.x, i_this->mMoveAngle.x + angleX_offset, 0x20, angleX_max_step); + a_this->speedF = speed_f; + return 4; +} + +/* 8061B0D0-8061B11C 00002C 004C+00 1/1 0/0 0/0 .data buf_p */ +SECTION_DATA static f32 buf_p[] = { + 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 8.8f, + 9.6f, 10.4f, 11.2f, 12.0f, 12.6f, 13.2f, 13.8f, 14.4f, 15.0f, +}; + +/* 8061B11C-8061B168 000078 004C+00 1/1 0/0 0/0 .data size_p */ +SECTION_DATA static f32 size_p[] = {1.0f, 1.05f, 1.075f, 1.1f, 1.1f, 1.075f, 1.05f, + 1.0f, 0.9f, 0.85f, 0.8f, 0.75f, 0.7f, 0.65f, + 0.6f, 0.55f, 0.5f, 0.45f, 1.0f}; + +/* 806147D4-80614B70 004354 039C+00 1/1 0/0 0/0 .text dmcalc__FP10b_ob_class */ +static void dmcalc(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + int i; + ob_part_s* part; + + cXyz sp2C; + cXyz sp20; + cXyz sp14; + + f32 var_f29; + f32 var_f28 = 0.0f; + + cMtx_YrotS(*calc_mtx, a_this->shape_angle.y); + cMtx_XrotM(*calc_mtx, a_this->shape_angle.x); + cMtx_YrotM(*calc_mtx, i_this->field_0x47c4); + + sp2C.x = 0.0f; + sp2C.y = 0.0f; + + if (i_this->mAction == OB_ACTION_FISH_END) { + sp2C.z = WREG_F(3) + -40.0f; + var_f28 = NREG_F(11) + -5.0f; + } else { + sp2C.z = AREG_F(15) + -20.0f; + } + + MtxPosition(&sp2C, &sp14); + sp2C.x = 0.0f; + sp2C.y = 0.0f; + f32 temp_f30 = 1.0f; + + part = i_this->mBodyParts; + + i_this->mBodyParts[0].field_0x26 = i_this->mBodyParts[0].mAngle.y; + i_this->mBodyParts[0].mPos = a_this->current.pos; + i_this->mBodyParts[0].mAngle = a_this->shape_angle; + i_this->mBodyParts[0].mAngle.z = i_this->field_0x47c4; + part++; + + if (i_this->field_0x5d08 != 0) { + i_this->field_0x5d08--; + } + + f32 var_f27 = (f32)i_this->field_0x5d08 * 0.6f; + + f32 var_f26; + if (a_this->speedF < 1.0f) { + var_f26 = JREG_F(19) + -10.0f; + } else { + var_f26 = 0.0f; + } + + for (i = 1; i < 20; i++, part++) { + // this block is almost certainly fake, but cant figure out a better way to fix instruction + // order + int var_r27 = i * (JREG_S(6) + 5000); + int temp_r3 = (JREG_S(4) + i_this->field_0x5d08 * (JREG_S(5) + 1200)); + int temp_r0 = (temp_r3 + var_r27); + temp_r0 = temp_r0; + + f32 temp_f2 = var_f27 * cM_ssin(temp_r0 + 3000); + f32 temp_f3 = var_f26 * cM_ssin(JREG_S(7) + var_r27 + 3000); + + f32 temp_f4; + if (i == (KREG_S(7) + 18)) { + sp2C.z = part->mSize * (WREG_F(17) + 250.0f); + temp_f4 = part->mSize * (WREG_F(9) + 0.4f); + } else { + sp2C.z = part->mSize * (WREG_F(14) + 450.0f); + temp_f4 = part->mSize; + } + + f32 temp_f1 = part->mPos.x; + temp_f1 -= part[-1].mPos.x; + + var_f29 = temp_f3 + (temp_f1 + (sp14.x * temp_f30)); + f32 temp_f2_2 = temp_f2 + (var_f28 + (part->mPos.y + (sp14.y * temp_f30))); + + if (temp_f2_2 < i_this->field_0x47a0 + (temp_f4 * (NREG_F(12) + 350.0f))) { + temp_f2_2 = i_this->field_0x47a0 + (temp_f4 * (NREG_F(12) + 350.0f)); + } + + temp_f30 *= (WREG_F(15) + 1.0f); + + f32 var_f24 = temp_f2_2 - part[-1].mPos.y; + f32 var_f23 = (part->mPos.z - part[-1].mPos.z) + (sp14.z * temp_f30); + part[-1].field_0x26 = part[-1].mAngle.y; + part->mAngle.y = cM_atan2s(var_f29, var_f23); + part->mAngle.x = + -cM_atan2s(var_f24, JMAFastSqrt(var_f29 * var_f29 + var_f23 * var_f23)); + + cMtx_YrotS(*calc_mtx, part->mAngle.y); + cMtx_XrotM(*calc_mtx, part->mAngle.x); + MtxPosition(&sp2C, &sp20); + part->mPos = part[-1].mPos + sp20; + part->mAngle.y += -0x8000; + part->mAngle.x *= -1; + } +} + +/* 80614B70-806158E0 0046F0 0D70+00 1/1 0/0 0/0 .text fish_move__FP10b_ob_class */ +static void fish_move(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + cXyz sp84; + cXyz sp90; + + if (moveSW) { + int var_r16 = 0; + BOOL attn_ON = true; + + i_this->mBodyParts[0].mSph.OnCoSetBit(); + + switch (i_this->mAction) { + case OB_ACTION_FISH_NORMAL: + var_r16 = fish_normal(i_this); + break; + case OB_ACTION_FISH_VACUME: + var_r16 = fish_vacume(i_this); + break; + case OB_ACTION_FISH_END: + var_r16 = fish_end(i_this); + attn_ON = false; + break; + } + + if (i_this->mAttnOffTimer != 0) { + i_this->mAttnOffTimer--; + } + + if (attn_ON && i_this->mAttnOffTimer == 0) { + fopAcM_OnStatus(a_this, 0); + a_this->attention_info.flags = 4; + } else { + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; + } + + cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 2, 0x800); + cLib_addCalcAngleS2(&a_this->shape_angle.x, a_this->current.angle.x, 2, 0x800); + cLib_addCalcAngleS2(&a_this->shape_angle.z, a_this->current.angle.z, 2, 0x800); + + s16 var_r17_2 = 0; + f32 temp_f1 = 0.0f; + + if (var_r16 == 0) { + var_r17_2 = VREG_S(5) + 700; + temp_f1 = 30.0f; + } else if (var_r16 == 1) { + var_r17_2 = VREG_S(6) + 1600; + temp_f1 = 30.0f; + } else if (var_r16 == 2) { + var_r17_2 = VREG_S(5) + 1000; + temp_f1 = 15.0f; + } else if (var_r16 == 3) { + var_r17_2 = VREG_S(7) + 1600; + temp_f1 = VREG_F(18) + 30.0f; + } else if (var_r16 == 4) { + var_r17_2 = VREG_S(5) + 700; + } else if (var_r16 == 5) { + var_r17_2 = VREG_S(8) + 1000; + temp_f1 = KREG_F(18) + 30.0f; + } else if (var_r16 == 6) { + var_r17_2 = VREG_S(8) + 1200; + temp_f1 = KREG_F(18) + 40.0f; + } + + cLib_addCalc2(&i_this->field_0x47c0, temp_f1, 0.5f, 1.0f); + cLib_addCalcAngleS2(&i_this->field_0x47bc, var_r17_2, 1, 20); + i_this->field_0x47ba += i_this->field_0x47bc; + + s16 temp_r16 = i_this->field_0x47c0 * (a_this->speedF * cM_ssin(i_this->field_0x47ba)); + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + cMtx_XrotM(*calc_mtx, a_this->current.angle.x); + cMtx_YrotM(*calc_mtx, temp_r16); + + sp84.x = 0.0f; + sp84.y = 0.0f; + sp84.z = i_this->field_0x5d04 * (a_this->speedF * 0.6f * l_HIO.mBodySize); + MtxPosition(&sp84, &a_this->speed); + a_this->current.pos += a_this->speed; + + i_this->mOISound.startCreatureSoundLevel( + Z2SE_EN_OI_MOVE, i_this->field_0x5d04 * (a_this->speedF * 0.6f * l_HIO.mBodySize), + dComIfGp_getReverb(fopAcM_GetRoomNo(a_this))); + i_this->field_0x3b24[i_this->field_0x2320].z = temp_r16; + i_this->field_0x47c4 = temp_r16; + } + + i_this->field_0x2324[i_this->field_0x2320] = a_this->current.pos; + i_this->field_0x3b24[i_this->field_0x2320].y = a_this->current.angle.y; + i_this->field_0x3b24[i_this->field_0x2320].x = a_this->current.angle.x; + + ob_part_s* part = i_this->mBodyParts; + int var_r22 = 0; + s16 var_r17_2; + + f32 var_f31; + if (!moveSW2) { + var_f31 = (TREG_F(1) + 7.5f) / i_this->field_0x5d04; + } else { + dmcalc(i_this); + } + + for (int i = 0; i < 19 && !part->mHide; i++, part++) { + s16 var_r25; + + if (!moveSW2) { + if (i >= 1) { + var_r22 = XREG_S(0) + 4; + var_r17_2 = 0; + } else { + if (i_this->field_0x47b0 == 100) { + var_r17_2 = cM_ssin(i_this->field_0x47b0 * 3000) * JREG_F(15); + } else { + var_r17_2 = + i_this->field_0x47b0 * cM_ssin(i_this->field_0x4750 * 3000) * (JREG_F(12) + 170.0f); + if (i_this->field_0x47b0 != 0) { + i_this->field_0x47b0--; + } + } + } + + int sp48 = var_f31 * buf_p[i]; + int temp_r4 = ((i_this->field_0x2320 - (s16)var_r22) - sp48) & 0x1FF; + part->mPos = i_this->field_0x2324[temp_r4]; + part->field_0x26 = part->mAngle.y + part->mAngle.z; + part->mAngle = i_this->field_0x3b24[temp_r4]; + part->mSize = l_HIO.mBodySize * size_p[i]; + var_r25 = (s16)(part->field_0x26 - (part->mAngle.y + part->mAngle.z)); + } else { + var_r17_2 = 0; + var_r25 = (s16) - (part->field_0x26 - part->mAngle.y); + } + + mDoMtx_stack_c::transS(part->mPos.x, part->mPos.y, part->mPos.z); + mDoMtx_stack_c::scaleM(part->mSize, part->mSize, part->mSize); + mDoMtx_stack_c::YrotM(part->mAngle.y); + mDoMtx_stack_c::XrotM(part->mAngle.x + var_r17_2); + mDoMtx_stack_c::YrotM(part->mAngle.z); + mDoMtx_stack_c::ZrotM(a_this->shape_angle.z); + + if (i == 0) { + mDoMtx_stack_c::push(); + cLib_addCalcAngleS2(&i_this->field_0x47ae, var_r25 * (VREG_S(4) + 7), 4, 0x400); + mDoMtx_stack_c::pop(); + } else if (i == 18) { + f32 temp_f28 = YREG_F(0) + 1000.0f; + f32 temp_f27 = YREG_F(1) + 4000.0f; + + for (int j = 0; j < 3; j++) { + i_this->field_0x47a4[j] = + temp_f28 * cM_ssin(i_this->field_0x4750 * (YREG_S(1) + 1000) + (j * (YREG_S(2) + -12000))); + } + + i_this->field_0x47aa = temp_f27 * cM_ssin(i_this->field_0x4750 * (YREG_S(2) + 1200)); + cLib_addCalcAngleS2(&i_this->field_0x47ac, var_r25 * (VREG_S(3) + 4), 4, 0x400); + } + + if (!moveSW2) { + if (i == 18) { + mDoMtx_stack_c::transM(0.0f, 0.0f, XREG_F(1) + 250.0f); + } else if (i != 0) { + mDoMtx_stack_c::transM(0.0f, 0.0f, XREG_F(0) + 600.0f); + } + } else if (i == 18) { + mDoMtx_stack_c::transM(0.0f, 0.0f, (XREG_F(1) + 250.0f) - 150.0f); + } else if (i != 0) { + mDoMtx_stack_c::transM(0.0f, 0.0f, (XREG_F(0) + 600.0f) - 250.0f); + } + + if (i == 0) { + part->mpMorf->play(NULL, 0, 0); + + if (i_this->mAnmID == OB_ANM_EAT_2 && i_this->mBodyParts[0].mpMorf->checkFrame(1.0f)) { + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_EAT02, -1); + } + } + + part->mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + part->mpMorf->modelCalc(); + + if (i == 0 && i_this->mSuiBrkFrame > 0.0f) { + i_this->mpSuiBrk->setFrame(i_this->mSuiBrkFrame); + i_this->mpSuiBtk->play(); + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0), mDoMtx_stack_c::get()); + mDoMtx_stack_c::XrotM(VREG_S(1) + 0x4000); + mDoMtx_stack_c::transM(0.0f, VREG_F(0) + 1300.0f, 0.0f); + i_this->mpSuiModel->setBaseTRMtx(mDoMtx_stack_c::get()); + } + + if (i >= 4 && i <= 17) { + pno = i; + fin = 0; + + if (part->field_0x3e == 0) { + cLib_addCalcAngleS2(&part->mFinARot.x, -4000, 0x20, 0x28); + } else { + cLib_addCalcAngleS2(&part->mFinARot.x, 0, 8, 100); + } + + cLib_addCalcAngleS2(&part->mFinARot.y, var_r25 * (TREG_S(9) + 7), 4, 0x400); + + mDoMtx_stack_c::push(); + mDoMtx_stack_c::transM(KREG_F(0), KREG_F(1) + 510.00003f, KREG_F(2) + -390.00003f); + part->mpFinMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + part->mpFinMorf->modelCalc(); + mDoMtx_stack_c::pop(); + } + + if (i >= 7 && i <= 15) { + pno = i; + fin = 1; + + mDoMtx_stack_c::push(); + mDoMtx_stack_c::transM(ZREG_F(0), ZREG_F(1) + -500.00003f, ZREG_F(2) + -290.00003f); + mDoMtx_stack_c::ZrotM(-0x8000); + part->mpFinUnkMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + part->mpFinUnkMorf->modelCalc(); + mDoMtx_stack_c::pop(); + } + + if (i == 8) { + pno = i; + + cLib_addCalcAngleS2(&part->mFinBRot.y, var_r25 * (VREG_S(8) + 7), 4, 0x400); + + mDoMtx_stack_c::push(); + mDoMtx_stack_c::transM(KREG_F(3), KREG_F(4) + -360.0f, KREG_F(5) + -360.0f); + part->mpFinBMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + part->mpFinBMorf->modelCalc(); + mDoMtx_stack_c::pop(); + } + + if (i == 17) { + pno = i; + + cLib_addCalcAngleS2(&part->mFinCRot.y, var_r25 * (TREG_S(8) + 13), 4, 0x400); + + mDoMtx_stack_c::push(); + mDoMtx_stack_c::transM(KREG_F(6), KREG_F(7) + -480.00003f, KREG_F(8) + -120.00001f); + part->mpFinCMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + part->mpFinCMorf->modelCalc(); + mDoMtx_stack_c::pop(); + } + + if (i == 0) { + MTXCopy(part->mpMorf->getModel()->getBaseTRMtx(), *calc_mtx); + + sp84.set(0.0f, 0.0f, VREG_F(2) + 700.0f); + MtxPosition(&sp84, &sp90); + part->mSph.SetC(sp90); + part->mSph.SetR(part->mSize * (TREG_F(16) + 400.0f)); + + sp84.set(0.0f, 0.0f, VREG_F(1)); + MtxPosition(&sp84, &sp90); + i_this->mFishHeadSph.SetC(sp90); + i_this->mFishHeadSph.SetR(part->mSize * (TREG_F(16) + 450.0f)); + + dComIfG_Ccsp()->Set(&i_this->mFishHeadSph); + } else { + part->mSph.SetC(part->mPos); + + if (i != 18) { + part->mSph.SetR(part->mSize * (TREG_F(18) + 450.0f)); + } else { + part->mSph.SetR(part->mSize * (TREG_F(17) + 200.0f)); + } + } + + dComIfG_Ccsp()->Set(&part->mSph); + } + + if (moveSW) { + i_this->field_0x2320++; + i_this->field_0x2320 &= 0x1FF; + } + + f32 var_f31_2 = l_HIO.mBodySize * ((VREG_F(17) + 360.0f) * 0.6f); + a_this->current.pos.y -= var_f31_2; + a_this->old.pos.y -= var_f31_2; + i_this->mAcch.CrrPos(dComIfG_Bgsp()); + a_this->current.pos.y += var_f31_2; + a_this->old.pos.y += var_f31_2; + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getBaseTRMtx(), mDoMtx_stack_c::get()); + mDoMtx_stack_c::transM(XREG_F(5), XREG_F(6) + 390.0f, XREG_F(7) + 400.0f + 11.0f); + mDoMtx_stack_c::multVecZero(&sp90); + a_this->eyePos = sp90; + a_this->attention_info.position = a_this->eyePos; + a_this->attention_info.position.y += 50.0f; + + if (i_this->mDemoAction == 21 || i_this->mDemoAction == 22) { + sp84 = dComIfGp_getCamera(0)->mLookat.mEye - sp90; + } else { + sp84 = player->eyePos - sp90; + } + + s16 temp_r15_2 = -cM_atan2s(sp84.y, sp84.z); + int temp_r16_2 = cM_atan2s(sp84.x, JMAFastSqrt(sp84.y * sp84.y + sp84.z * sp84.z)); + + mDoMtx_stack_c::transS(sp90.x, sp90.y, sp90.z); + mDoMtx_stack_c::XrotM(temp_r15_2); + mDoMtx_stack_c::YrotM(temp_r16_2); + + i_this->field_0x4740 = cM_ssin(i_this->field_0x4750 * 1000) * 9.5f + 9.5f; + i_this->mpCoreMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpCoreMorf->setFrame(i_this->field_0x4740); + i_this->mpCoreMorf->modelCalc(); + + i_this->mCoreSph.SetC(sp90); + i_this->mCoreSph.SetR(l_HIO.mCoreSize * 80.0f); + dComIfG_Ccsp()->Set(&i_this->mCoreSph); + i_this->mFishBattleMode = 2; +} + +/* 806158E0-806159C4 005460 00E4+00 1/1 0/0 0/0 .text cam_3d_morf__FP10b_ob_classf */ +static void cam_3d_morf(b_ob_class* i_this, f32 i_scale) { + cLib_addCalc2(&i_this->mDemoCamCenter.x, i_this->mDemoCamCenterTarget.x, i_scale, + i_this->field_0x5cc0 * i_this->field_0x5cd0); + cLib_addCalc2(&i_this->mDemoCamCenter.y, i_this->mDemoCamCenterTarget.y, i_scale, + i_this->field_0x5cc4 * i_this->field_0x5cd0); + cLib_addCalc2(&i_this->mDemoCamCenter.z, i_this->mDemoCamCenterTarget.z, i_scale, + i_this->field_0x5cc8 * i_this->field_0x5cd0); + + cLib_addCalc2(&i_this->mDemoCamEye.x, i_this->mDemoCamEyeTarget.x, i_scale, + i_this->field_0x5cb4 * i_this->field_0x5cd0); + cLib_addCalc2(&i_this->mDemoCamEye.y, i_this->mDemoCamEyeTarget.y, i_scale, + i_this->field_0x5cb8 * i_this->field_0x5cd0); + cLib_addCalc2(&i_this->mDemoCamEye.z, i_this->mDemoCamEyeTarget.z, i_scale, + i_this->field_0x5cbc * i_this->field_0x5cd0); +} + +/* 806159C4-80615A10 005544 004C+00 1/1 0/0 0/0 .text s_hasidel_sub__FPvPv */ +static void* s_hasidel_sub(void* i_this, void* i_data) { + if (fopAcM_IsActor(i_this) && fopAcM_GetName(i_this) == PROC_OCTHASHI) { + fopAcM_delete((fopAc_ac_c*)i_this); + } + + return NULL; +} + +/* 80615A10-80618540 005590 2B30+00 2/1 0/0 0/0 .text demo_camera__FP10b_ob_class */ +static void demo_camera(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); + camera_class* camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + camera_class* camera0 = dComIfGp_getCamera(0); + + cXyz sp58; + cXyz sp64; + cXyz sp70; + cXyz sp7C; + cXyz sp88; + + b_oh_class* tentacle = + (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i_this->field_0x5ce8]); + int var_r27 = 0; + + switch (i_this->mDemoAction) { + case 1: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFEF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 2; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(46, 0, 0, 0); + + i_this->mDemoCamEye = camera0->mLookat.mEye; + i_this->mDemoCamCenter = camera0->mLookat.mCenter; + sp58 = i_this->mDemoCamEye - tentacle->current.pos; + + i_this->field_0x5ce0 = cM_atan2s(sp58.x, sp58.z); + + tentacle->field_0x1f68 = player->current.pos; + tentacle->field_0x1f74 = player->shape_angle; + tentacle->field_0x1f7c = 0.1f; + + i_this->field_0x5cd8 = 300.0f; + i_this->field_0x5cdc = 1500.0f; + /* fallthrough */ + case 2: + cLib_addCalc2(&i_this->mDemoCamCenter.x, player->current.pos.x, 0.3f, + i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, player->current.pos.y + 150.0f, 0.3f, + i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, player->current.pos.z, 0.3f, + i_this->field_0x5cd0 * 200.0f); + + cMtx_YrotS(*calc_mtx, i_this->field_0x5ce0); + + sp58.x = 0.0f; + sp58.y = i_this->field_0x5cd8; + sp58.z = i_this->field_0x5cdc; + MtxPosition(&sp58, &sp64); + + if (i_this->mDemoActionTimer > 30) { + cLib_addCalc2(&i_this->field_0x5cd8, 1050.0f, 0.2f, 15.0f); + cLib_addCalc2(&i_this->field_0x5cdc, 1000.0f, 0.2f, 10.0f); + } + + sp64 += tentacle->current.pos; + + cLib_addCalc2(&i_this->mDemoCamEye.x, sp64.x, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamEye.y, sp64.y, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamEye.z, sp64.z, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, TREG_F(7) + 0.1f); + + MTXCopy(tentacle->mpMorf->getModel()->getAnmMtx(29), mDoMtx_stack_c::get()); + + mDoMtx_stack_c::transM(ZREG_F(0) + 50.0f, ZREG_F(1) + -100.0f, + -(ZREG_F(2) + 80.0f) * (f32)tentacle->field_0xc88); + + if (tentacle->mAction == OH_ACTION_CAUGHT) { + player->setPlayerPosAndAngle(mDoMtx_stack_c::get()); + } else { + csXyz sp174; + + mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &sp174); + cLib_addCalcAngleS2(&tentacle->field_0x1f74.y, sp174.y, 1, 0x800); + mDoMtx_stack_c::multVecZero(&sp64); + + cLib_addCalc2(&tentacle->field_0x1f7c, 1.0f, 1.0f, 0.1f); + cLib_addCalc2(&tentacle->field_0x1f68.x, sp64.x, 1.0f, tentacle->field_0x1f7c * 100.0f); + cLib_addCalc2(&tentacle->field_0x1f68.y, sp64.y, 1.0f, tentacle->field_0x1f7c * 100.0f); + cLib_addCalc2(&tentacle->field_0x1f68.z, sp64.z, 1.0f, tentacle->field_0x1f7c * 100.0f); + player->setPlayerPosAndAngle(&tentacle->field_0x1f68, &tentacle->field_0x1f74); + } + break; + case 3: + player->setPlayerPosAndAngle(&a_this->home.pos, &tentacle->field_0x1f74); + + cMtx_YrotS(*calc_mtx, i_this->field_0x5ce0); + sp58.x = 0.0f; + sp58.y = i_this->field_0x5cd8; + sp58.z = i_this->field_0x5cdc; + MtxPosition(&sp58, &sp64); + + cLib_addCalc2(&i_this->field_0x5cd8, 800.0f, 0.2f, 10.0f); + cLib_addCalc2(&i_this->field_0x5cdc, 1000.0f, 0.2f, 10.0f); + + sp64 += tentacle->current.pos; + cLib_addCalc2(&i_this->mDemoCamEye.x, sp64.x, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamEye.y, sp64.y, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->mDemoCamEye.z, sp64.z, 0.1f, i_this->field_0x5cd0 * 200.0f); + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, TREG_F(7) + 0.1f); + + if (!(i_this->field_0x4750 & 15)) { + dComIfGp_getVibration().StartShock(4, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (i_this->mAnmID == OB_ANM_EAT && i_this->mBodyParts[0].mpMorf->checkFrame(153.0f)) { + i_this->mDemoAction = 4; + i_this->mDemoActionTimer = 0; + + sp64 = a_this->home.pos; + sp64.y += KREG_F(13) + 400.0f; + player->setPlayerPosAndAngle(&sp64, &tentacle->field_0x1f74); + + daPy_getPlayerActorClass()->setThrowDamage(a_this->home.angle.y, 10.0f, + KREG_F(14) + 30.0f, 4, 1, 2); + daPy_getPlayerActorClass()->changeDemoMode(1, 0, 0, 0); + } + break; + case 4: + cLib_addCalc2(&i_this->mDemoCamCenter.x, player->current.pos.x, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, player->current.pos.y, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, player->current.pos.z, 0.4f, 300.0f); + + if (i_this->mBodyParts[0].mpMorf->isStop()) { + i_this->mDemoAction = 100; + i_this->mCoreAnm = OB_ANM_WAIT; + i_this->mCoreAnmMode = J3DFrameCtrl::LOOP_REPEAT_e; + i_this->field_0x4794 = 100; + } + break; + case 10: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFEF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 11; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + + i_this->field_0x5cf8 = player->shape_angle.y; + i_this->field_0x5cfc = 0; + i_this->field_0x5d00 = ZREG_F(3) + 1000.0; + + anm_init(i_this, OB_ANM_OPEN_MOUTH_WAIT, 3.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + + if (cM_rndF(1.0f) < 0.5f) { + i_this->field_0x5cd4 = 500.0f; + } else { + i_this->field_0x5cd4 = -500.0f; + } + /* fallthrough */ + case 11: + f32 temp_f31 = (a_this->eyePos - player->current.pos).abs(); + if (temp_f31 < KREG_F(11) + 150.0f) { + i_this->mDemoAction = 100; + break; + } + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0x13), mDoMtx_stack_c::get()); + + sp58.x = i_this->field_0x5d00; + sp58.y = 0.0; + sp58.z = 0.0; + mDoMtx_stack_c::multVec(&sp58, &i_this->field_0x5cec); + + if (i_this->field_0x5cec.y < a_this->home.pos.y) { + i_this->field_0x5cec.y = a_this->home.pos.y; + } + + if (i_this->mDemoActionTimer >= 118) { + daPy_getPlayerActorClass()->changeDemoMode(46, 0, 0, 0); + } + + if (i_this->mDemoActionTimer < 75) { + if (!(i_this->field_0x4750 & 7)) { + dComIfGp_getVibration().StartShock(1, 0x1f, cXyz(0.0f, 1.0f, 0.0f)); + } + } else if (i_this->mDemoActionTimer < 146 && !(i_this->field_0x4750 & 15)) { + dComIfGp_getVibration().StartShock(4, 0x1f, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (i_this->mDemoActionTimer >= 138) { + cLib_addCalc2(&i_this->field_0x5d00, 700.0f, 0.1f, 200.0f); + + if (i_this->mDemoActionTimer > 170) { + i_this->mDemoAction = 100; + } + + if (i_this->mDemoActionTimer == 138) { + daPy_getPlayerActorClass()->setThrowDamage(a_this->current.angle.y, 0.0f, 0.0f, 4, + 1, 2); + daPy_getPlayerActorClass()->changeDemoMode(1, 0, 0, 0); + } + } else { + i_this->field_0x5cf8 += 0x300; + + if (i_this->mDemoActionTimer >= 15) { + if (i_this->mDemoActionTimer == 30) { + anm_init(i_this, OB_ANM_SWALLOW, 2.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_SWALLOW, -1); + } + + cLib_addCalc0(&i_this->field_0x5d00, 1.0f, i_this->field_0x5cfc); + cLib_addCalc2(&i_this->field_0x5cfc, 100.0f, 1.0f, 2.0f); + } + } + + player->setPlayerPosAndAngle(&i_this->field_0x5cec, i_this->field_0x5cf8, 0); + + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); + sp58.x = i_this->field_0x5cd4; + sp58.y = ZREG_F(12) + 500.0f; + sp58.z = ZREG_F(13) + 2000.0f; + MtxPosition(&sp58, &i_this->mDemoCamEye); + i_this->mDemoCamEye += a_this->current.pos; + + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = i_this->field_0x5cec; + } else { + cLib_addCalc2(&i_this->mDemoCamCenter.x, player->current.pos.x, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, player->current.pos.y, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, player->current.pos.z, 0.4f, 300.0f); + } + break; + case 20: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 21; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(0x17, 0, 0, 0); + + i_this->mDemoCamCenter.x = -371.0f; + i_this->mDemoCamCenter.y = KREG_F(11) + -23869.0; + i_this->mDemoCamCenter.z = -1247.0f; + i_this->mDemoCamEye.x = -473.0f; + i_this->mDemoCamEye.y = -23869.0f; + i_this->mDemoCamEye.z = -1581.0f; + i_this->field_0x5cd0 = 0; + + Z2GetAudioMgr()->bgmStop(30, 0); + Z2GetAudioMgr()->subBgmStart(Z2BGM_BOSS_OCTAEEL_D02); + + fpcM_Search(s_bfdel_sub, i_this); + dComIfGs_onOneZoneSwitch(8, -1); + /* fallthrough */ + case 21: + if (i_this->mDemoActionTimer == 290) { + i_this->mBlureRateTarget = 150; + i_this->field_0x5dd8 = 2; + } + + sp64.set(-204.0f, -24000.0f, -1307.0f); + player->setPlayerPosAndAngle(&sp64, 1642, 0); + + if (i_this->mDemoActionTimer > KREG_S(6) + 320) { + cLib_addCalc2(&i_this->mDemoCamCenter.y, KREG_F(12) + -23169.0f, 0.1f, + i_this->field_0x5cd0 * 40.0f); + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, KREG_F(7) + 0.02f); + } + + if (i_this->mDemoActionTimer < KREG_S(7) + 430) { + break; + } + + i_this->mDemoAction = 22; + i_this->mDemoActionTimer = 0; + i_this->field_0x5cd8 = -2000.0f; + i_this->mBlureRateTarget = 0; + /* fallthrough */ + case 22: + sp88 = a_this->eyePos; + sp88.y += i_this->field_0x5cd8; + + if (!(i_this->mDemoActionTimer & 7) && (i_this->mDemoActionTimer >> 3) <= 13) { + i_this->mBodyParts[4 + (i_this->mDemoActionTimer >> 3)].field_0x3e = 1; + } + + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = sp88; + i_this->mDemoCamEye.x = 7180.0f; + i_this->mDemoCamEye.y = BREG_F(8) + -16200.0f + 100.0f; + i_this->mDemoCamEye.z = 100.0f; + } else { + cLib_addCalc2(&i_this->mDemoCamCenter.x, sp88.x, 0.4f, 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, sp88.y, 0.4f, 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, sp88.z, 0.4f, 200.0f); + cLib_addCalc0(&i_this->field_0x5cd8, 0.1f, 15.0f); + } + + if (i_this->mDemoActionTimer >= 250) { + cLib_addCalc2(&i_this->mDemoCamEye.y, -16500.0f, 0.1f, BREG_F(9) + 2.0f); + } + + if (i_this->mDemoActionTimer != 430) { + break; + } + + i_this->mDemoAction = 23; + i_this->mDemoActionTimer = 0; + /* fallthrough */ + case 23: + i_this->mDemoCamEye.set(-1236.0f, -23800.0f, -3470.0f); + sp88 = a_this->eyePos; + + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = sp88; + } else { + cLib_addCalc2(&i_this->mDemoCamCenter.x, sp88.x, 0.2f, 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, sp88.y, 0.2f, 200.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, sp88.z, 0.2f, 200.0f); + } + + if (i_this->mDemoActionTimer == 120) { + i_this->mDemoAction = 101; + Z2GetAudioMgr()->bgmStart(Z2BGM_BOSS_OCTAEEL_1, 0, 0); + } + break; + case 30: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 31; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(0x17, 0, 0, 0); + + i_this->mDemoCamEye.set(-1705.0f, -23870.0f, -762.0f); + Z2GetAudioMgr()->subBgmStart(Z2BGM_BOSS_OCTAEEL_D01); + mDoAud_seStart(Z2SE_EN_OI_DEMO_APPEAR, NULL, 0, 0); + dComIfGs_onOneZoneSwitch(5, -1); + /* fallthrough */ + case 31: + if (i_this->mDemoActionTimer < 40) { + sp64.set(-1193.0f, -24000.0f, -770.0f); + player->setPlayerPosAndAngle(&sp64, 0x2A02, 0); + } + + if (i_this->mDemoActionTimer == 30) { + dComIfGp_getEvent().startCheckSkipEdge(a_this); + } + + sp88 = a_this->current.pos; + if (sp88.y < i_this->field_0x47a0 + NREG_F(1) + 200.0f) { + sp88.y = i_this->field_0x47a0 + NREG_F(1) + 200.0f; + } + + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = sp88; + } else { + cLib_addCalc2(&i_this->mDemoCamCenter.x, sp88.x, 0.1f, 50.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, sp88.y, 0.1f, 50.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, sp88.z, 0.1f, 50.0f); + } + + if (i_this->mDemoActionTimer >= 90 && i_this->mDemoActionTimer <= 260) { + cLib_addCalc2(&i_this->mDemoCamFovy, 30.0f, 0.2f, i_this->field_0x5cd0); + } else { + cLib_addCalc2(&i_this->mDemoCamFovy, 55.0f, 0.2f, i_this->field_0x5cd0); + } + + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, 0.05f); + + if (i_this->mDemoActionTimer == 390) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[1]); + tentacle->mActionPhase = 1; + dComIfGp_getVibration().StartQuake(2, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (i_this->mDemoActionTimer >= 390 && i_this->mDemoActionTimer <= 525) { + i_this->field_0x5ce4 = WREG_F(12) + 3.0f; + } + + if (i_this->mDemoActionTimer == 410) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[5]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 430) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[3]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 445) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[2]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 460) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[6]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 470) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[4]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 475) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[7]); + tentacle->mActionPhase = 1; + } + + if (i_this->mDemoActionTimer == 570) { + i_this->mDemoAction = 32; + i_this->mDemoActionTimer = 0; + i_this->mBodyParts[0].mpMorf->setPlaySpeed(1.0f); + + sp58.set(0.0f, 0.0f, 0.0f); + dComIfGp_particle_set(0x87FB, &sp58, NULL, NULL); + dComIfGp_getVibration().StartQuake(3, 31, cXyz(0.0f, 1.0f, 0.0f)); + + i_this->field_0x5cd0 = 0; + i_this->mAction = 1; + i_this->mMode = 0; + + for (int i = 1; i < 7; i++) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i]); + tentacle->mActionPhase = 2; + } + + i_this->mBlureRateTarget = 150; + i_this->field_0x5dd8 = 1; + i_this->mZoneSwTimer = 0; + } + break; + case 32: + if (i_this->mDemoActionTimer >= 30) { + if (i_this->mDemoActionTimer == 30) { + i_this->mDemoCamCenterTarget.set(80.0f, -24093.0f, 160.0f); + i_this->mDemoCamEyeTarget.set(-447.0f, -22850.0f, -718.0f); + + i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x); + i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y); + i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z); + i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x); + i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y); + i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z); + i_this->field_0x5cd0 = 0.0f; + + daPy_getPlayerActorClass()->changeDemoMode(0x17, 0, 0, 0); + } + + cam_3d_morf(i_this, BREG_F(17) + 0.1f); + cLib_addCalc2(&i_this->field_0x5cd0, BREG_F(18) + 0.04f, 1.0f, BREG_F(19) + 0.0005f); + } + + cLib_addCalc2(&a_this->home.pos.y, i_this->field_0x47a0, 1.0f, 2.0f); + + if (i_this->mDemoActionTimer <= 70) { + i_this->field_0x5ce4 = WREG_F(10) + 6.0f; + } + + if (i_this->mDemoActionTimer == 70) { + dComIfGp_getVibration().StopQuake(31); + i_this->mBlureRateTarget = 0; + } + + if (i_this->mBodyParts[0].mpMorf->isStop()) { + anm_init(i_this, OB_ANM_WAIT, 0.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + } + + if (i_this->mDemoActionTimer == 120) { + fopMsgM_messageSetDemo(1153); // Twilit Aquatic MORPHEEL + } + + if (i_this->mDemoActionTimer == 200) { + i_this->mDemoAction = 100; + for (int i = 0; i < 8; i++) { + tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i]); + tentacle->mAction = 1; + tentacle->mActionPhase = 1; + tentacle->mTimers[0] = cM_rndF(50.0f) + 100.0f; + } + + Z2GetAudioMgr()->bgmStart(Z2BGM_BOSS_OCTAEEL_0, 0, 0); + } + break; + case 40: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 41; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + i_this->mDemoCamEye.set(5000.0f, -17000.0f, 5000.0f); + + Z2GetAudioMgr()->bgmStop(30, 0); + Z2GetAudioMgr()->bgmStreamPrepare(0x2000020); + Z2GetAudioMgr()->bgmStreamPlay(); + mDoAud_seStart(Z2SE_EN_OI_ENDDEMO, 0, 0, 0); + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_ENDDEMO, -1); + /* fallthrough */ + case 41: + case 42: + case 43: + case 44: + if (i_this->mDemoAction >= 43) { + var_r27 = 1; + } + + if (i_this->mDemoAction == 43 && i_this->mDemoActionTimer == 60) { + i_this->mDemoCamEye.set(4716.0f, -22925.0f, 1873.0f); + i_this->mDemoAction = 44; + i_this->mDemoActionTimer = 0; + } + + if (i_this->mDemoAction == 42 || i_this->mDemoAction == 43) { + sp88 = a_this->eyePos; + } else { + MTXCopy(i_this->mBodyParts[BREG_S(5) + 8].mpMorf->getModel()->getAnmMtx(0), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp88); + } + + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = sp88; + } else { + f32 var_f31; + if (a_this->speedF < 1.0f) { + var_f31 = 0.1f; + } else { + var_f31 = 0.3f; + } + + cLib_addCalc2(&i_this->mDemoCamCenter.x, sp88.x, var_f31, 400.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, sp88.y, var_f31, 400.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, sp88.z, var_f31, 400.0f); + } + + if (i_this->mDemoAction != 44 || i_this->mDemoActionTimer != 120) { + break; + } + + i_this->mDemoCamCenter.set(4264.0f, -25096.0f, 12114.0f); + i_this->mDemoCamEye.set(-1377.0f, -22866.0f, 9105.0f); + i_this->mDemoAction = 45; + i_this->mDemoActionTimer = 0; + fpcM_Search(s_hasidel_sub, i_this); + fpcM_Search(s_kaisoudel_sub, i_this); + /* fallthrough */ + case 45: + var_r27 = 1; + if (i_this->mDemoActionTimer != 80) { + break; + } + + i_this->mDemoCamCenter.set(-560.0f, -16612.0f, -836.0f); + i_this->mDemoCamEye.set(-600.0f, -16245.0f, -1331.0f); + i_this->mDemoCamCenterTarget.set(-6378.0f, -21886.0f, 7150.0f); + i_this->mDemoCamEyeTarget.set(-6961.0f, -21727.0f, 7278.0f); + + i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x); + i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y); + i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z); + i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x); + i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y); + i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z); + i_this->field_0x5cd0 = 0.0f; + + i_this->mDemoAction = 46; + i_this->mDemoActionTimer = 0; + i_this->field_0x5dd8 = 4; + + obj_lv3WaterB_class* water = (obj_lv3WaterB_class*)fopAcM_SearchByName(PROC_OBJ_LV3WATERB); + water->mAction = LV3WATERB_ACT_END; + water->field_0x586 = 0; + var_r27 = 2; + /* fallthrough */ + case 46: + sp58.set(VREG_F(0) + -1225.0f, -24000.0f, VREG_F(1) + 8678.0f); + player->setPlayerPosAndAngle(&sp58, VREG_S(1) + 10000, 0); + + if (!(i_this->mDemoActionTimer & 7) && (i_this->mDemoActionTimer >> 3) <= 13) { + i_this->mBodyParts[(i_this->mDemoActionTimer >> 3) + 4].field_0x3e = 0; + } + + if (i_this->mDemoActionTimer > 0) { + cam_3d_morf(i_this, BREG_F(17) + 0.05f); + cLib_addCalc2(&i_this->field_0x5cd0, BREG_F(18) + 0.002f, 1.0f, BREG_F(19) + 0.0001f); + } + + if (i_this->mDemoActionTimer != 400) { + break; + } + + i_this->mDemoCamCenter.set(-1031.0f, -23787.0f, 8845.0f); + i_this->mDemoCamEye.set(-1629.0f, -23891.0f, 8958.0f); + i_this->mDemoAction = 47; + i_this->mDemoActionTimer = 0; + /* fallthrough */ + case 47: + if (i_this->mDemoActionTimer >= 50) { + cLib_addCalc2(&i_this->field_0x5d14, TREG_F(11) + -20.0f, 1.0f, TREG_F(12) + 0.25f); + } + + if (i_this->mDemoActionTimer == 50) { + i_this->mHideCore = true; + dComIfGp_particle_set(0x8491, &a_this->eyePos, NULL, NULL); + fopAcM_createDisappear(a_this, &a_this->eyePos, 15, 0, 0xFF); + mDoAud_seStart(Z2SE_EN_BQ_EYE_EXPLODE, NULL, 0, 0); + + cXyz sp94(1.0f, 1.0f, 1.0f); + csXyz sp17C(player->shape_angle); + sp17C.y += KREG_S(3) + -0x7060; + + fopAcM_createItemForBoss(&a_this->eyePos, UTAWA_HEART, fopAcM_GetRoomNo(a_this), &sp17C, + NULL, KREG_F(19) + 10.0f, 10.0f, -1); + dComIfGp_getVibration().StartShock(5, 1, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (i_this->mDemoActionTimer == 100) { + i_this->mDemoCamCenter.set(-2785.0f, -22626.0f, 7614.0f); + i_this->mDemoCamEye.set(-3295.0f, -22459.0f, 7307.0f); + i_this->mDemoCamCenterTarget.set(-2933.0f, -22626.0f, 6829.0f); + i_this->mDemoCamEyeTarget.set(-3295.0f, -22459.0f, 7307.0f); + + i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x); + i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y); + i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z); + i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x); + i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y); + i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z); + i_this->field_0x5cd0 = 0.0f; + + i_this->mDemoAction = 48; + i_this->mDemoActionTimer = 0; + } + break; + case 48: + if (i_this->mDemoActionTimer >= 60) { + i_this->field_0x5cd0 = 0.02f; + cam_3d_morf(i_this, BREG_F(17) + 0.1f); + + if (!(i_this->mDemoActionTimer & 3)) { + int idx = ((i_this->mDemoActionTimer - 60) >> 2); + if (idx < 19) { + i_this->mBodyParts[idx].mHide = true; + + cXyz spA0(i_this->mBodyParts[idx].mSize, + i_this->mBodyParts[idx].mSize, + i_this->mBodyParts[idx].mSize); + + if (idx == 0) { + mDoAud_seStart(Z2SE_EN_OI_EXPLODE, NULL, 0, 0); + for (int i = 0; i < 8; i++) { + fopAc_ac_c* tentacle = fopAcM_SearchByID(i_this->mTentacleActorIDs[i]); + fopAcM_delete(tentacle); + } + + i_this->field_0x5d40[0][idx] = dComIfGp_particle_set( + 0x8627, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + i_this->field_0x5d40[1][idx] = dComIfGp_particle_set( + 0x862A, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + } else if (idx == 18) { + i_this->field_0x5d40[0][idx] = dComIfGp_particle_set( + 0x8628, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + i_this->field_0x5d40[1][idx] = dComIfGp_particle_set( + 0x862B, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + } else { + i_this->field_0x5d40[0][idx] = dComIfGp_particle_set( + 0x8626, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + i_this->field_0x5d40[1][idx] = dComIfGp_particle_set( + 0x8629, &i_this->mBodyParts[idx].mPos, NULL, &spA0); + } + } + } + } + + if (i_this->mDemoActionTimer == 180) { + i_this->mDemoAction = 49; + i_this->mDemoActionTimer = 0; + + for (int i = 0; i < 19; i++) { + for (int j = 0; j < 2; j++) { + if (i_this->field_0x5d40[j][i] != NULL) { + i_this->field_0x5d40[j][i]->becomeDeleteEmitter(); + } + } + } + + static cXyz room_pos(0.0f, 0.0f, 0.0f); + static cXyz sc(10.0f, 10.0f, 10.0f); + + for (int i = 0; i < 5; i++) { + static u16 ex_eff[] = {0x8621, 0x8622, 0x8623, 0x8624, 0x8625}; + dComIfGp_particle_set(ex_eff[i], &room_pos, NULL, &sc); + } + + i_this->mDemoCamEye.set(-4820.0f, -18600.0f, -510.0f); + i_this->mDemoCamCenter.set(-2630.0f, -21620.0f, 4900.0f); + i_this->mDemoCamFovy = 45.0f; + i_this->field_0x5cd0 = 0.0f; + + i_this->mSound.startCreatureSound(Z2SE_EN_BOSS_CONVERGE, 0, 0); + } + break; + case 49: + if (i_this->mDemoActionTimer >= 100) { + cLib_addCalc2(&i_this->mDemoCamFovy, 30.0f, 0.2f, i_this->field_0x5cd0); + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, 0.05f); + } + + if (i_this->mDemoActionTimer == 100) { + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + sp58.set(0.0f, JREG_F(8) + 300.0f, JREG_F(9) + 100.0f); + MtxPosition(&sp58, &sp64); + + sp64 += player->current.pos; + OS_REPORT("///YSTONE POS %d,%d,%d\n", sp64.x, sp64.y, sp64.z); + fopAcM_create(PROC_OBJ_YSTONE, 0, &sp64, fopAcM_GetRoomNo(a_this), NULL, NULL, -1); + } + + if (i_this->mDemoActionTimer == 120) { + obj_ystone_class* ystone = (obj_ystone_class*)fopAcM_SearchByName(PROC_OBJ_YSTONE); + if (ystone != NULL) { + ystone->field_0x59b = 0; + } + } + + if (i_this->mDemoActionTimer >= 180) { + i_this->mDemoCamFovy = 45.0f; + if (i_this->mDemoActionTimer == 180) { + i_this->field_0x5cd8 = JREG_F(8) + 300.0f; + } + + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + + sp58.x = ZREG_F(1); + sp58.y = ZREG_F(2) + 100.0f; + sp58.z = ZREG_F(3) + -200.0f; + MtxPosition(&sp58, &i_this->mDemoCamEye); + + i_this->mDemoCamEye += player->current.pos; + i_this->mDemoCamCenter = player->current.pos; + i_this->mDemoCamCenter.y += ZREG_F(4) + 200.0f; + + sp58.set(0.0f, i_this->field_0x5cd8, JREG_F(9) + 100.0f); + MtxPosition(&sp58, &sp64); + sp64 += player->current.pos; + + cLib_addCalc2(&i_this->field_0x5cd8, 210.0f, 0.05f, 0.5f); + + obj_ystone_class* ystone = (obj_ystone_class*)fopAcM_SearchByName(PROC_OBJ_YSTONE); + if (ystone != NULL) { + ystone->setCurrentPos(sp64); + } + + if (i_this->mDemoActionTimer == 279) { + cXyz spAC(-1520.0f, -23960.0f, 7100.0f); + csXyz sp184(0, 0, 0); + fopAcM_createWarpHole(&spAC, &sp184, fopAcM_GetRoomNo(a_this), 0, 1, 2); + } + + if (i_this->mDemoActionTimer == 290) { + i_this->mDemoAction = 100; + dComIfGs_onStageBossEnemy(); + dComIfGs_onSwitch(a_this->home.angle.z & 0xFF, fopAcM_GetRoomNo(a_this)); + fopAcM_delete(a_this); + } + } + break; + case 50: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 51; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 55.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + + i_this->field_0x5cf8 = player->shape_angle.y; + i_this->field_0x5cfc = 0; + i_this->field_0x5d00 = ZREG_F(3) + 300.0f; + + anm_init(i_this, OB_ANM_EAT, 3.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + + i_this->mOISound.startCreatureVoice(Z2SE_EN_OI_V_EAT, -1); + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp64); + dComIfGp_particle_set(0x8803, &sp64, NULL, NULL); + dComIfGp_particle_set(0x8804, &sp64, NULL, NULL); + /* fallthrough */ + case 51: + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0x13), mDoMtx_stack_c::get()); + sp58.x = i_this->field_0x5d00; + sp58.y = 0.0; + sp58.z = 0.0; + mDoMtx_stack_c::multVec(&sp58, &i_this->field_0x5cec); + + i_this->field_0x5cf8 += 0x1000; + cLib_addCalc0(&i_this->field_0x5d00, 1.0f, i_this->field_0x5cfc); + cLib_addCalc2(&i_this->field_0x5cfc, 100.0f, 1.0f, 5.0f); + + player->setPlayerPosAndAngle(&i_this->field_0x5cec, i_this->field_0x5cf8, 0); + + cMtx_YrotS(*calc_mtx, a_this->home.angle.y + -0x2000); + sp58.x = 0.0; + sp58.y = ZREG_F(12) + 1000.0f; + sp58.z = ZREG_F(13) + 900.0f; + MtxPosition(&sp58, &i_this->mDemoCamEye); + i_this->mDemoCamEye += a_this->home.pos; + + if (i_this->mAnmID == OB_ANM_EAT) { + if (i_this->mBodyParts[0].mpMorf->checkFrame(120.0f)) { + daPy_getPlayerActorClass()->changeDemoMode(46, 0, 0, 0); + } + + if (i_this->mBodyParts[0].mpMorf->checkFrame(153.0f)) { + i_this->mDemoAction = 52; + i_this->mDemoActionTimer = 0; + + sp64 = a_this->home.pos; + sp64.y += KREG_F(13) + 400.0f; + player->setPlayerPosAndAngle(&sp64, 0, 0); + + daPy_getPlayerActorClass()->setThrowDamage(a_this->home.angle.y, 10.0f, + KREG_F(14) + 30.0f, 4, 1, 2); + daPy_getPlayerActorClass()->changeDemoMode(1, 0, 0, 0); + } + } + case 52: + if (i_this->mDemoActionTimer == 0) { + i_this->mDemoCamCenter = i_this->field_0x5cec; + } else { + cLib_addCalc2(&i_this->mDemoCamCenter.x, player->current.pos.x, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.y, player->current.pos.y, 0.4f, 300.0f); + cLib_addCalc2(&i_this->mDemoCamCenter.z, player->current.pos.z, 0.4f, 300.0f); + } + + if (i_this->mDemoActionTimer > 25) { + cLib_addCalc2(&i_this->mDemoCamFovy, 40.0f, 0.05f, i_this->field_0x5cd0); + cLib_addCalc2(&i_this->field_0x5cd0, 1.0f, 1.0f, 0.05f); + } + + if (i_this->mDemoAction == 52 && i_this->mBodyParts[0].mpMorf->isStop()) { + i_this->mDemoAction = 100; + i_this->mCoreAnm = OB_ANM_WAIT; + i_this->mCoreAnmMode = J3DFrameCtrl::LOOP_REPEAT_e; + i_this->field_0x4794 = 100; + } + break; + case 60: + if (!a_this->eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(a_this, 2, 0xFFFF, 0); + a_this->eventInfo.i_onCondition(2); + return; + } + + camera->mCamera.Stop(); + i_this->mDemoAction = 61; + i_this->mDemoActionTimer = 0; + i_this->mDemoCamFovy = 40.0f; + i_this->field_0x5cd0 = 0.0f; + camera->mCamera.SetTrimSize(3); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + /* fallthrough */ + case 61: + cMtx_YrotS(*calc_mtx, a_this->home.angle.y + 0x2000); + sp58.x = 0.0f; + sp58.y = ZREG_F(15) + 100.0f; + sp58.z = ZREG_F(16) + 1700.0f; + MtxPosition(&sp58, &i_this->mDemoCamEye); + i_this->mDemoCamEye += a_this->home.pos; + + i_this->mDemoCamCenter = a_this->home.pos; + i_this->mDemoCamCenter.y += ZREG_F(17) + 700.0f; + cLib_addCalc2(&i_this->mDemoCamFovy, 55.0f, 0.05f, 0.2f); + } + + if (i_this->mDemoAction != 0) { + if (i_this->mDemoAction >= 100) { + if (i_this->mDemoAction == 101) { + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + sp58.x = 0.0f; + sp58.y = JREG_F(1) + 100.0f; + sp58.z = JREG_F(2) + -250.0f; + MtxPosition(&sp58, &i_this->mDemoCamEye); + i_this->mDemoCamEye += player->current.pos; + + i_this->mDemoCamCenter = player->current.pos; + i_this->mDemoCamCenter.y += 120.0f; + } + + camera->mCamera.Reset(i_this->mDemoCamCenter, i_this->mDemoCamEye); + camera->mCamera.Start(); + camera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + daPy_getPlayerActorClass()->cancelOriginalDemo(); + i_this->mDemoAction = 0; + } + + cXyz cam_center; + cXyz cam_eye; + + cam_center = i_this->mDemoCamCenter; + cam_eye = i_this->mDemoCamEye; + + s16 cam_bank = 0; + if (i_this->field_0x5ce4 > 0.0f) { + int sp38 = i_this->field_0x5ce4 * cM_ssin(i_this->mDemoActionTimer * 0x1B00) * 25.0f; + int sp40 = i_this->field_0x5ce4 * cM_ssin(i_this->mDemoActionTimer * 0x1900) * 25.0f; + sp58 = cam_center - cam_eye; + + s16 temp_r5 = sp38 + cM_atan2s(sp58.x, sp58.z); + s16 temp_r4 = sp40 - cM_atan2s(sp58.y, JMAFastSqrt(sp58.x * sp58.x + sp58.z * sp58.z)); + cMtx_YrotS(*calc_mtx, temp_r5); + cMtx_XrotM(*calc_mtx, temp_r4); + + sp58.x = 0.0; + sp58.y = 0.0; + sp58.z = sp58.abs(); + MtxPosition(&sp58, &cam_center); + cam_center += cam_eye; + + cam_bank = (BREG_F(4) + 30.0f) * + (i_this->field_0x5ce4 * cM_scos(i_this->mDemoActionTimer * 0x1E00)); + cLib_addCalc0(&i_this->field_0x5ce4, 1.0f, BREG_F(5) + 0.5f); + } + + camera->mCamera.Set(cam_center, cam_eye, cam_bank, i_this->mDemoCamFovy); + + i_this->mDemoActionTimer++; + i_this->field_0x4794 = 90; + cLib_addCalcAngleS2(&i_this->mBlureRate, i_this->mBlureRateTarget, 1, 8); + + if (i_this->mDemoAction >= 31 && i_this->mDemoAction < 40) { + if (dComIfGp_getEvent().checkSkipEdge()) { + cDmr_SkipInfo = JREG_S(8) + 30; + dStage_changeScene(1, 0.0f, 0, fopAcM_GetRoomNo(a_this), 0, -1); + } + } + } + + if (var_r27 != 0) { + sp64.set(0.0f, -23580.0f, 10300.0f); + + for (int i = 0; i < 4; i++) { + static u16 iso_eff[] = {0x87F7, 0x87F8, 0x87F9, 0x87FA}; + i_this->field_0x5d24[i] = + dComIfGp_particle_set(i_this->field_0x5d24[i], iso_eff[i], &sp64, NULL, NULL); + + if (var_r27 == 2) { + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0x5d24[i]); + if (emitter != NULL) { + emitter->becomeDeleteEmitter(); + } + } + } + } +} + +/* 80618650-806193B4 0081D0 0D64+00 2/1 0/0 0/0 .text daB_OB_Execute__FP10b_ob_class */ +static int daB_OB_Execute(b_ob_class* i_this) { + fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; + + if (cDmrNowMidnaTalk()) { + return 1; + } + + fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); + cXyz sp70; + cXyz sp7C; + + if (cDmr_SkipInfo != 0) { + cDmr_SkipInfo--; + } + + i_this->field_0x4750++; + i_this->mYAngleToPlayer = fopAcM_searchPlayerAngleY(a_this); + i_this->mXAngleToPlayer = -fopAcM_searchPlayerAngleX(a_this); + + for (int i = 0; i < 6; i++) { + if (i_this->mTimers[i] != 0) { + i_this->mTimers[i]--; + } + } + + if (i_this->mHitIFrameTimer != 0) { + i_this->mHitIFrameTimer--; + } + + if (i_this->field_0x4794 != 0) { + i_this->field_0x4794--; + } + + if (i_this->mFishBattleMode != 0) { + i_this->attention_info.distances[fopAc_attn_BATTLE_e] = 60; + i_this->mDistToPlayer = fopAcM_searchPlayerDistance(a_this); + + fish_damage_check(i_this); + fish_move(i_this); + + if (i_this->mHideCore) { + cLib_addCalc0(&i_this->mBossLightScale, 1.0f, 0.05f); + } else { + i_this->mBossLightScale = 1.0f; + } + + if (i_this->mBossLightScale > 0.0f) { + GXColor color; + color.r = l_HIO.mLightR; + color.g = l_HIO.mLightG; + color.b = l_HIO.mLightB; + color.a = 0xFF; + + cXyz pos(a_this->current.pos); + dKy_BossLight_set(&pos, &color, l_HIO.mRange * i_this->mBossLightScale, 0); + } + + if (!dComIfGs_isOneZoneSwitch(9, -1) && !dComIfGp_event_runCheck()) { + i_this->mZoneSwTimer++; + + if (i_this->mZoneSwTimer == 600) { + dComIfGs_onOneZoneSwitch(11, -1); + } + } + } + + if (i_this->mCoreBattleMode != 0) { + if (i_this->mAction == OB_ACTION_CORE_START) { + if (player->current.pos.y > -11000.0f) { + if (!dComIfGp_event_runCheck()) { + i_this->mZoneSwTimer++; + } + + if (i_this->mZoneSwTimer == 300) { + dComIfGs_onOneZoneSwitch(4, -1); + } + } else { + i_this->mZoneSwTimer = 0; + } + } else if (dComIfGs_isOneZoneSwitch(5, -1) && !dComIfGs_isOneZoneSwitch(7, -1)) { + if (player->current.pos.y > -20500.0f) { + dComIfGs_onOneZoneSwitch(6, -1); + i_this->mZoneSwTimer = 0; + } else { + dComIfGs_offOneZoneSwitch(6, -1); + i_this->mZoneSwTimer++; + + if (i_this->mZoneSwTimer == 600) { + dComIfGs_onOneZoneSwitch(10, -1); + } + } + } + + i_this->attention_info.distances[fopAc_attn_BATTLE_e] = 4; + i_this->mDistToPlayer = fopAcM_searchPlayerDistanceXZ(a_this); + + core_damage_check(i_this); + core_action(i_this); + + cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 2, 0x400); + cLib_addCalcAngleS2(&a_this->shape_angle.x, a_this->current.angle.x, 2, 0x400); + + mDoMtx_stack_c::transS(a_this->current.pos.x, a_this->current.pos.y + i_this->field_0x479c, + a_this->current.pos.z); + mDoMtx_stack_c::YrotM(a_this->shape_angle.y); + mDoMtx_stack_c::XrotM(a_this->shape_angle.x); + mDoMtx_stack_c::scaleM(l_HIO.mCoreSize, l_HIO.mCoreSize, l_HIO.mCoreSize); + mDoMtx_stack_c::ZrotM(a_this->shape_angle.z); + mDoMtx_stack_c::scaleM(0.9f, 1.1f, 0.9f); + mDoMtx_stack_c::ZrotM(-a_this->shape_angle.z); + + i_this->field_0x4740 = cM_ssin(i_this->field_0x4750 * 1000) * 9.5f + 9.5f; + i_this->mpCoreMorf->setFrame(i_this->field_0x4740); + i_this->mpCoreMorf->modelCalc(); + + i_this->mpCoreMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp7C); + i_this->eyePos = sp7C; + + if (a_this->eyePos.y >= a_this->home.pos.y) { + a_this->attention_info.position = a_this->eyePos; + a_this->attention_info.position.y += 50.0f; + i_this->mDrawShadow = true; + } else { + i_this->mDrawShadow = false; + } + + sp7C = a_this->current.pos; + + if (i_this->mHitIFrameTimer != 0) { + sp7C.x += 22222.0f; + } + + i_this->mCcSph.SetC(sp7C); + i_this->mCcSph.SetR(l_HIO.mCoreSize * 50.0f); + + dComIfG_Ccsp()->Set(&i_this->mCcSph); + i_this->mCcSph.OffAtSetBit(); + + if (!dComIfGp_event_runCheck()) { + i_this->mCcSph.OnCoSetBit(); + i_this->mBodySph.OnCoSetBit(); + } else { + i_this->mCcSph.OffCoSetBit(); + i_this->mBodySph.OffCoSetBit(); + } + + if (i_this->mCoreBattleMode != 0) { + mDoMtx_stack_c::transS(a_this->home.pos.x, a_this->home.pos.y - (KREG_F(17) + 750.0f), + a_this->home.pos.z); + mDoMtx_stack_c::XrotM(-0x4000); + mDoMtx_stack_c::scaleM(l_HIO.mBodySize, l_HIO.mBodySize, l_HIO.mBodySize); + + i_this->mBodyParts[0].mpMorf->play(NULL, 0, 0); + i_this->mBodyParts[0].mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mBodyParts[0].mpMorf->modelCalc(); + + i_this->mBodySph.SetC(a_this->home.pos); + i_this->mBodySph.SetR(TREG_F(17) + 410.0f); + dComIfG_Ccsp()->Set(&i_this->mBodySph); + } + } + + if (i_this->mAnmID == OB_ANM_APPEAR && i_this->mBodyParts[0].mpMorf->getPlaySpeed() >= 0.5f) { + J3DModel* model = i_this->mBodyParts[0].mpMorf->getModel(); + for (int i = 0; i < 5; i++) { + int joint_no = 1; + if (i >= 2) { + joint_no = 0x13; + } + + MTXCopy(model->getAnmMtx(joint_no), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp7C); + + static u16 iso_eff[] = {0x87FC, 0x87FD, 0x87FE, 0x87FF, 0x8800}; + i_this->field_0x5d24[i] = + dComIfGp_particle_set(i_this->field_0x5d24[i], iso_eff[i], &sp7C, NULL, NULL); + } + } else if (i_this->mAnmID == OB_ANM_EAT) { + J3DModel* model = i_this->mBodyParts[0].mpMorf->getModel(); + MTXCopy(model->getAnmMtx(0x13), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp7C); + + for (int i = 0; i < 3; i++) { + static u16 iso_eff[] = {0x8805, 0x8806, 0x8807}; + i_this->field_0x5d24[i] = + dComIfGp_particle_set(i_this->field_0x5d24[i], iso_eff[i], &sp7C, NULL, NULL); + } + } else if (i_this->mAnmID == OB_ANM_THROWUP) { + J3DModel* model = i_this->mBodyParts[0].mpMorf->getModel(); + for (int i = 0; i < 4; i++) { + static u16 iso_eff[] = {0x87EE, 0x87EF, 0x87F0, 0x87F1}; + i_this->field_0x5d24[i] = dComIfGp_particle_set(i_this->field_0x5d24[i], iso_eff[i], + &a_this->current.pos, NULL, NULL); + + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0x5d24[i]); + if (emitter != NULL) { + emitter->setGlobalRTMatrix(model->getAnmMtx(0x13)); + } + } + } + + demo_camera(i_this); + + f32 blend_target = 0.0f; + if (i_this->field_0x5dd8 == 0) { + dKy_custom_colset(0, 1, i_this->mColsetBlend); + } else if (i_this->field_0x5dd8 == 1) { + dKy_custom_colset(0, 1, i_this->mColsetBlend); + blend_target = 1.0f; + } else if (i_this->field_0x5dd8 == 2) { + dKy_custom_colset(2, 1, i_this->mColsetBlend); + } else if (i_this->field_0x5dd8 == 3) { + dKy_custom_colset(2, 3, i_this->mColsetBlend); + blend_target = 1.0f; + } else if (i_this->field_0x5dd8 == 4) { + dKy_custom_colset(4, 4, blend_target); + } + + cLib_addCalc2(&i_this->mColsetBlend, blend_target, 1.0f, 0.05f); + + if (i_this->field_0x5d18 != 0) { + i_this->field_0x5d18--; + i_this->field_0x5d38 = + dComIfGp_particle_set(i_this->field_0x5d38, 0x8809, &a_this->current.pos, NULL, NULL); + + JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0x5d38); + if (emitter != 0) { + emitter->setGlobalRTMatrix(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0)); + } + } + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0x13), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[0]); + + MTXCopy(i_this->mBodyParts[0].mpMorf->getModel()->getAnmMtx(1), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[1]); + + MTXCopy(i_this->mBodyParts[2].mpMorf->getModel()->getBaseTRMtx(), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[2]); + + MTXCopy(i_this->mBodyParts[5].mpMorf->getModel()->getBaseTRMtx(), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[3]); + + MTXCopy(i_this->mBodyParts[18].mpMorf->getModel()->getBaseTRMtx(), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[4]); + + for (int i = 0; i < 8; i++) { + if (i_this->mCoreBattleMode != 0) { + b_oh_class* tentacle = (b_oh_class*)fopAcM_SearchByID(i_this->mTentacleActorIDs[i]); + if (tentacle != NULL) { + MTXCopy(tentacle->mpMorf->getModel()->getAnmMtx(0x19), mDoMtx_stack_c::get()); + sp70 = i_this->field_0x5be4[5 + i]; + mDoMtx_stack_c::multVecZero(&i_this->field_0x5be4[5 + i]); + sp70 = i_this->field_0x5be4[5 + i] - sp70; + + i_this->mOISound.startTentacleSoundLevel( + Z2SE_EN_OI_TENT_MOVE, i, sp70.abs(), 0, + dComIfGp_getReverb(fopAcM_GetRoomNo(a_this))); + } + } + } + + i_this->mOISound.framework(0, dComIfGp_getReverb(fopAcM_GetRoomNo(a_this))); + return 1; +} + +/* 806193B4-806193BC 008F34 0008+00 1/0 0/0 0/0 .text daB_OB_IsDelete__FP10b_ob_class */ +static int daB_OB_IsDelete(b_ob_class* i_this) { + return 1; +} + +/* 806193BC-80619438 008F3C 007C+00 1/0 0/0 0/0 .text daB_OB_Delete__FP10b_ob_class */ +static int daB_OB_Delete(b_ob_class* i_this) { + dComIfG_resDelete(&i_this->mPhase, "B_oh"); + + if (i_this->mHIOInit) { + data_8061B4FD = 0; + } + + if (i_this->heap != NULL) { + i_this->mSound.stopAnime(); + i_this->mOISound.deleteObject(); + } + + return 1; +} + +/* 80619438-80619C14 008FB8 07DC+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ +static int useHeapInit(fopAc_ac_c* i_this) { + b_ob_class* a_this = (b_ob_class*)i_this; + + a_this->mpCoreMorf = + new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x2A), NULL, NULL, + (J3DAnmTransform*)dComIfG_getObjectRes("B_oh", 0x11), 2, 1.0f, 0, -1, + &a_this->mSound, 0, 0x11000084); + + for (int i = 0; i < 19; i++) { + static int p_bmd[] = {43, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 38}; + + u32 var_r31 = 0x80000; + if (p_bmd[i] == 43) { + var_r31 = 0; + } + + a_this->mBodyParts[i].mpMorf = + new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", p_bmd[i]), NULL, NULL, + NULL, 2, 1.0f, 0, -1, 1, NULL, var_r31, 0x11000084); + + if (a_this->mBodyParts[i].mpMorf == NULL || + a_this->mBodyParts[i].mpMorf->getModel() == NULL) + { + return 0; + } + + a_this->mBodyParts[i].mpMorf->getModel()->setUserArea((u32)i_this); + + for (u16 j = 0; j < a_this->mBodyParts[i].mpMorf->getModel()->getModelData()->getJointNum(); + j++) + { + if (p_bmd[i] == 0x2B) { + a_this->mBodyParts[i] + .mpMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(HeadCallBack); + } else if (p_bmd[i] == 0x26) { + a_this->mBodyParts[i] + .mpMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(TailCallBack); + } + } + + if (i >= 4 && i <= 17) { + a_this->mBodyParts[i].mpFinMorf = + new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x23), NULL, NULL, + NULL, 2, 1.0f, 0, -1, 1, NULL, 0x80000, 0x11000084); + + if (a_this->mBodyParts[i].mpFinMorf == NULL || + a_this->mBodyParts[i].mpFinMorf->getModel() == NULL) + { + return 0; + } + + a_this->mBodyParts[i].mpFinMorf->getModel()->setUserArea((u32)i_this); + + for (u16 j = 0; + j < a_this->mBodyParts[i].mpFinMorf->getModel()->getModelData()->getJointNum(); + j++) + { + a_this->mBodyParts[i] + .mpFinMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(FinACallBack); + } + + if (dComIfGs_isSwitch(0x1C, fopAcM_GetRoomNo(i_this))) { + a_this->mBodyParts[i].field_0x3e = 1; + } else { + a_this->mBodyParts[i].mFinARot.x = 0xF060; + } + } + + if (i >= 7 && i <= 15) { + a_this->mBodyParts[i].mpFinUnkMorf = + new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x23), NULL, NULL, + NULL, 2, 1.0f, 0, -1, 1, NULL, 0x80000, 0x11000084); + + if (a_this->mBodyParts[i].mpFinUnkMorf == NULL || + a_this->mBodyParts[i].mpFinUnkMorf->getModel() == NULL) + { + return 0; + } + + a_this->mBodyParts[i].mpFinUnkMorf->getModel()->setUserArea((u32)i_this); + + for (u16 j = 0; + j < a_this->mBodyParts[i].mpFinUnkMorf->getModel()->getModelData()->getJointNum(); + j++) + { + a_this->mBodyParts[i] + .mpFinUnkMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(FinACallBack); + } + } + + if (i == 8) { + a_this->mBodyParts[i].mpFinBMorf = + new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x24), NULL, NULL, + NULL, 2, 1.0f, 0, -1, 1, NULL, 0x80000, 0x11000084); + + if (a_this->mBodyParts[i].mpFinBMorf == NULL || + a_this->mBodyParts[i].mpFinBMorf->getModel() == NULL) + { + return 0; + } + + a_this->mBodyParts[i].mpFinBMorf->getModel()->setUserArea((u32)i_this); + + for (u16 j = 0; + j < a_this->mBodyParts[i].mpFinBMorf->getModel()->getModelData()->getJointNum(); + j++) + { + a_this->mBodyParts[i] + .mpFinBMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(FinBCallBack); + } + } + + if (i == 17) { + a_this->mBodyParts[i].mpFinCMorf = + new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x25), NULL, NULL, + NULL, 2, 1.0f, 0, -1, 1, NULL, 0x80000, 0x11000084); + + if (a_this->mBodyParts[i].mpFinCMorf == NULL || + a_this->mBodyParts[i].mpFinCMorf->getModel() == NULL) + { + return 0; + } + + a_this->mBodyParts[i].mpFinCMorf->getModel()->setUserArea((u32)i_this); + + for (u16 j = 0; + j < a_this->mBodyParts[i].mpFinCMorf->getModel()->getModelData()->getJointNum(); + j++) + { + a_this->mBodyParts[i] + .mpFinCMorf->getModel() + ->getModelData() + ->getJointNodePointer(j) + ->setCallBack(FinCCallBack); + } + } + } + + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("B_oh", 0x21); + JUT_ASSERT(modelData != 0); + + a_this->mpSuiModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000284); + if (a_this->mpSuiModel == NULL) { + return 0; + } + + a_this->mpSuiModel->setUserArea((u32)i_this); + + for (u16 j = 0; j < modelData->getJointNum(); j++) { + modelData->getJointNodePointer(j)->setCallBack(sui_nodeCallBack); + } + + a_this->mpSuiBrk = new mDoExt_brkAnm(); + if (a_this->mpSuiBrk == NULL) { + return 0; + } + + if (!a_this->mpSuiBrk->init(modelData, (J3DAnmTevRegKey*)dComIfG_getObjectRes("B_oh", 0x2E), TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1)) { + return 0; + } + + a_this->mpSuiBtk = new mDoExt_btkAnm(); + if (a_this->mpSuiBtk == NULL) { + return 0; + } + + if (!a_this->mpSuiBtk->init(modelData, (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("B_oh", 0x35), TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1)) { + return 0; + } + + return 1; +} + +/* 80619C5C-8061A0C0 0097DC 0464+00 1/0 0/0 0/0 .text daB_OB_Create__FP10fopAc_ac_c */ +static int daB_OB_Create(fopAc_ac_c* i_this) { + b_ob_class* a_this = (b_ob_class*)i_this; + fopAcM_SetupActor(i_this, b_ob_class); + + OS_REPORT("B_OB//////////////B_OB SET 0 !!\n"); + + int phase_state = dComIfG_resLoad(&a_this->mPhase, "B_oh"); + if (phase_state == cPhs_COMPLEATE_e) { + if (dComIfGs_isStageBossEnemy()) { + // "After B_OB defeated, so not re-setting\n" + OS_REPORT("B_OB やられ後なので再セットしません\n"); + cXyz pos(-1520.0f, -23960.0f, 7100.0f); + csXyz angle(0, 0, 0); + + fopAcM_createWarpHole(&pos, &angle, fopAcM_GetRoomNo(a_this), 0, 0, 2); + + if (!dComIfGs_isStageLife()) { + cXyz scale(1.0f, 1.0f, 1.0f); + pos.set(-916.0f, -23954.0f, 8916.0f); + fopAcM_createItemForBoss(&pos, UTAWA_HEART, fopAcM_GetRoomNo(a_this), + &a_this->shape_angle, &scale, 0.0f, 0.0f, -1); + } + + return cPhs_ERROR_e; + } + + OS_REPORT("B_OB PARAM %x\n", fopAcM_GetParam(a_this)); + a_this->shape_angle.z = 0; + a_this->current.angle.z = 0; + OS_REPORT("B_OB//////////////B_OB SET 1 !!\n"); + + if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0x1F6A0)) { + OS_REPORT("//////////////B_OB SET NON !!\n"); + return cPhs_ERROR_e; + } + + OS_REPORT("//////////////B_OB SET 2 !!\n"); + + if (!data_8061B4FD) { + a_this->mHIOInit = 1; + data_8061B4FD = true; + l_HIO.field_0x04 = -1; + } + + a_this->health = 30; + a_this->field_0x560 = 30; + a_this->mTimers[0] = 30; + a_this->field_0x4790 = 1; + + static dCcD_SrcSph cc_sph_src = { + { + {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_METAL, 0x0, 0x2, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 50.0f} // mSph + } // mSphAttr + }; + + static dCcD_SrcSph body_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x3}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 60.0f} // mSph + } // mSphAttr + }; + + static dCcD_SrcSph parts_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x3}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 60.0f} // mSph + } // mSphAttr + }; + + static dCcD_SrcSph core_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0x4002, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 50.0f} // mSph + } // mSphAttr + }; + + a_this->mCoreCcStts.Init(100, 0, i_this); + a_this->mCcSph.Set(cc_sph_src); + a_this->mCcSph.SetStts(&a_this->mCoreCcStts); + + a_this->mCoreSph.Set(core_sph_src); + a_this->mCoreSph.SetStts(&a_this->mCoreCcStts); + + a_this->mBodyCcStts.Init(0xFF, 0, i_this); + a_this->mBodySph.Set(body_sph_src); + a_this->mBodySph.SetStts(&a_this->mBodyCcStts); + + for (int i = 0; i < 19; i++) { + a_this->mBodyParts[i].mSph.Set(parts_sph_src); + a_this->mBodyParts[i].mSph.SetStts(&a_this->mBodyCcStts); + a_this->mBodyParts[i].mSph.OnTgShield(); + a_this->mBodyParts[i].mSph.SetTgHitMark(CcG_Tg_UNK_MARK_2); + } + + a_this->mFishHeadSph.Set(parts_sph_src); + a_this->mFishHeadSph.SetStts(&a_this->mBodyCcStts); + a_this->mFishHeadSph.OnTgShield(); + a_this->mFishHeadSph.SetTgHitMark(CcG_Tg_UNK_MARK_2); + + a_this->mAcch.Set(fopAcM_GetPosition_p(i_this), fopAcM_GetOldPosition_p(i_this), i_this, 1, + &a_this->mAcchCir, fopAcM_GetSpeed_p(i_this), NULL, NULL); + a_this->mAcchCir.SetWall(300.0f, KREG_F(12) + 950.0f); + a_this->mCoreBattleMode = 1; + + if (cDmr_SkipInfo != 0) { + a_this->mAction = OB_ACTION_CORE_HAND_MOVE; + Z2GetAudioMgr()->bgmStart(Z2BGM_BOSS_OCTAEEL_0, 0, 0); + dComIfGs_onOneZoneSwitch(5, -1); + } else { + a_this->mAction = OB_ACTION_CORE_START; + } + + for (int i = 0; i < 8; i++) { + a_this->mTentacleActorIDs[i] = + fopAcM_createChild(PROC_B_OH, fopAcM_GetID(i_this), i, &i_this->current.pos, + fopAcM_GetRoomNo(i_this), NULL, NULL, -1, NULL); + } + + for (int i = 0; i < 0x200; i++) { + a_this->field_0x2324[i].set(0.0f, i_this->home.pos.y - 10000.0f, 0.0f); + } + + moveSW = true; + moveSW2 = false; + a_this->field_0x47a0 = i_this->home.pos.y; + + a_this->mSound.init(&i_this->current.pos, &i_this->eyePos, 3, 1); + a_this->mAtInfo.mpSound = &a_this->mSound; + a_this->mOISound.init( + &a_this->field_0x5be4[0], &a_this->field_0x5be4[1], &a_this->field_0x5be4[2], + &a_this->field_0x5be4[3], &a_this->field_0x5be4[4], &a_this->field_0x5be4[5], + &a_this->field_0x5be4[6], &a_this->field_0x5be4[7], &a_this->field_0x5be4[8], + &a_this->field_0x5be4[9], &a_this->field_0x5be4[10], &a_this->field_0x5be4[11], + &a_this->field_0x5be4[12]); + a_this->field_0x5d04 = 0.7f; + + daB_OB_Execute(a_this); + } + + return phase_state; +} + +/* 8061B5DC-8061B5E0 000124 0004+00 0/0 0/0 0/0 .bss + * sInstance__40JASGlobalInstance<19JASDefaultBankTable> */ +#pragma push +#pragma force_active on +static u8 data_8061B5DC[4]; +#pragma pop + +/* 8061B5E0-8061B5E4 000128 0004+00 0/0 0/0 0/0 .bss + * sInstance__35JASGlobalInstance<14JASAudioThread> */ +#pragma push +#pragma force_active on +static u8 data_8061B5E0[4]; +#pragma pop + +/* 8061B5E4-8061B5E8 00012C 0004+00 0/0 0/0 0/0 .bss sInstance__27JASGlobalInstance<7Z2SeMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061B5E4[4]; +#pragma pop + +/* 8061B5E8-8061B5EC 000130 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8Z2SeqMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061B5E8[4]; +#pragma pop + +/* 8061B5EC-8061B5F0 000134 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SceneMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061B5EC[4]; +#pragma pop + +/* 8061B5F0-8061B5F4 000138 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2StatusMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061B5F0[4]; +#pragma pop + +/* 8061B5F4-8061B5F8 00013C 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2DebugSys> + */ +#pragma push +#pragma force_active on +static u8 data_8061B5F4[4]; +#pragma pop + +/* 8061B5F8-8061B5FC 000140 0004+00 0/0 0/0 0/0 .bss + * sInstance__36JASGlobalInstance<15JAISoundStarter> */ +#pragma push +#pragma force_active on +static u8 data_8061B5F8[4]; +#pragma pop + +/* 8061B5FC-8061B600 000144 0004+00 0/0 0/0 0/0 .bss + * sInstance__35JASGlobalInstance<14Z2SoundStarter> */ +#pragma push +#pragma force_active on +static u8 data_8061B5FC[4]; +#pragma pop + +/* 8061B600-8061B604 000148 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12Z2SpeechMgr2> */ +#pragma push +#pragma force_active on +static u8 data_8061B600[4]; +#pragma pop + +/* 8061B604-8061B608 00014C 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8JAISeMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061B604[4]; +#pragma pop + +/* 8061B608-8061B60C 000150 0004+00 0/0 0/0 0/0 .bss sInstance__29JASGlobalInstance<9JAISeqMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061B608[4]; +#pragma pop + +/* 8061B60C-8061B610 000154 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12JAIStreamMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061B60C[4]; +#pragma pop + +/* 8061B610-8061B614 000158 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SoundMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061B610[4]; +#pragma pop + +/* 8061B614-8061B618 00015C 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12JAISoundInfo> */ +#pragma push +#pragma force_active on +static u8 data_8061B614[4]; +#pragma pop + +/* 8061B618-8061B61C 000160 0004+00 0/0 0/0 0/0 .bss + * sInstance__34JASGlobalInstance<13JAUSoundTable> */ +#pragma push +#pragma force_active on +static u8 data_8061B618[4]; +#pragma pop + +/* 8061B61C-8061B620 000164 0004+00 0/0 0/0 0/0 .bss + * sInstance__38JASGlobalInstance<17JAUSoundNameTable> */ +#pragma push +#pragma force_active on +static u8 data_8061B61C[4]; +#pragma pop + +/* 8061B620-8061B624 000168 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12JAUSoundInfo> */ +#pragma push +#pragma force_active on +static u8 data_8061B620[4]; +#pragma pop + +/* 8061B624-8061B628 00016C 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SoundInfo> + */ +#pragma push +#pragma force_active on +static u8 data_8061B624[4]; +#pragma pop + +/* 8061B628-8061B62C 000170 0004+00 0/0 0/0 0/0 .bss + * sInstance__34JASGlobalInstance<13Z2SoundObjMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061B628[4]; +#pragma pop + +/* 8061B62C-8061B630 000174 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2Audience> + */ +#pragma push +#pragma force_active on +static u8 data_8061B62C[4]; +#pragma pop + +/* 8061B630-8061B634 000178 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2FxLineMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061B630[4]; +#pragma pop + +/* 8061B634-8061B638 00017C 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2EnvSeMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061B634[4]; +#pragma pop + +/* 8061B638-8061B63C 000180 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SpeechMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061B638[4]; +#pragma pop + +/* 8061B63C-8061B640 000184 0004+00 0/0 0/0 0/0 .bss + * sInstance__34JASGlobalInstance<13Z2WolfHowlMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061B63C[4]; +#pragma pop + +/* 8061B09C-8061B09C 000318 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ + +/* 8061B3DC-8061B3FC -00001 0020+00 1/0 0/0 0/0 .data l_daB_OB_Method */ +static actor_method_class l_daB_OB_Method = { + (process_method_func)daB_OB_Create, + (process_method_func)daB_OB_Delete, + (process_method_func)daB_OB_Execute, + (process_method_func)daB_OB_IsDelete, + (process_method_func)daB_OB_Draw, +}; + +/* 8061B3FC-8061B42C -00001 0030+00 0/0 0/0 1/0 .data g_profile_B_OB */ +extern actor_process_profile_definition g_profile_B_OB = { + fpcLy_CURRENT_e, + 4, + fpcPi_CURRENT_e, + PROC_B_OB, + &g_fpcLf_Method.mBase, + sizeof(b_ob_class), + 0, + 0, + &g_fopAc_Method.base, + 217, + &l_daB_OB_Method, + 0xC4000, + fopAc_ENEMY_e, + fopAc_CULLBOX_CUSTOM_e, +}; \ No newline at end of file diff --git a/rel/d/a/b/d_a_b_oh/d_a_b_oh.cpp b/rel/d/a/b/d_a_b_oh/d_a_b_oh.cpp index b675bd83867..107c746dea0 100644 --- a/rel/d/a/b/d_a_b_oh/d_a_b_oh.cpp +++ b/rel/d/a/b/d_a_b_oh/d_a_b_oh.cpp @@ -9,13 +9,6 @@ #include "dol2asm.h" #include "rel/d/a/b/d_a_b_ob/d_a_b_ob.h" -#define ACTION_START 0 -#define ACTION_WAIT 1 -#define ACTION_ATTACK 2 -#define ACTION_CAUGHT 3 -#define ACTION_END 10 -#define ACTION_NON 11 - // // Forward References: // @@ -288,7 +281,7 @@ static asm int nodeCallBack(J3DJoint* param_0, int param_1) { /* 8061B8B0-8061B960 000270 00B0+00 1/0 0/0 0/0 .text daB_OH_Draw__FP10b_oh_class */ static int daB_OH_Draw(b_oh_class* i_this) { - if (i_this->mAction == ACTION_NON) { + if (i_this->mAction == OH_ACTION_NON) { return 1; } @@ -555,7 +548,7 @@ static void wait(b_oh_class* i_this) { i_this->mDistToPlayer < 1300.0f && i_this->mTimers[0] == 0 && boss->field_0x4744 == 0 && boss->field_0x4794 == 0) { - i_this->mAction = ACTION_ATTACK; + i_this->mAction = OH_ACTION_ATTACK; i_this->mActionPhase = 0; i_this->field_0xc98 = 0; boss->field_0x4794 = 3; @@ -705,7 +698,7 @@ static void attack(b_oh_class* i_this) { case 1: case 2: if (i_this->mTimers[0] == 0) { - i_this->mAction = ACTION_WAIT; + i_this->mAction = OH_ACTION_WAIT; i_this->mActionPhase = 0; i_this->field_0xc98 = 0; i_this->field_0xca2 = 0; @@ -769,8 +762,8 @@ static void attack(b_oh_class* i_this) { boss->field_0x5ce8 = i_this->field_0x5c8; i_this->mTimers[1] = 20; - if (boss->field_0x4752 != 1) { - boss->field_0x4752 = 1; + if (boss->mAction != OB_ACTION_CORE_HAND_MOVE) { + boss->mAction = OB_ACTION_CORE_HAND_MOVE; boss->field_0x4754 = 0; boss->field_0x4738 = 30; boss->field_0x473c = 2; @@ -790,7 +783,7 @@ static void attack(b_oh_class* i_this) { cLib_addCalcAngleS2(&i_this->field_0xc94, 22500, 1, 2000); cLib_addCalc2(&i_this->field_0xc8c, 4000.0f, 1.0f, 400.0f); if (i_this->mTimers[1] == 1) { - i_this->mAction = ACTION_CAUGHT; + i_this->mAction = OH_ACTION_CAUGHT; i_this->mActionPhase = 0; i_this->field_0xc98 = 0; } @@ -848,7 +841,7 @@ static void caught(b_oh_class* i_this) { boss->field_0x5c82 = 0; } - i_this->mAction = ACTION_WAIT; + i_this->mAction = OH_ACTION_WAIT; i_this->mActionPhase = 0; i_this->field_0xc98 = 0; } @@ -941,35 +934,35 @@ static void action(b_oh_class* i_this) { cLib_addCalcAngleS2(&a_this->field_0xc98, 0x800, 1, 0x10); switch (a_this->mAction) { - case ACTION_START: + case OH_ACTION_START: start(a_this); var_r28 = 1; break; - case ACTION_WAIT: + case OH_ACTION_WAIT: wait(a_this); var_r28 = 1; break; - case ACTION_ATTACK: + case OH_ACTION_ATTACK: attack(a_this); var_r28 = 2; boss->field_0x4794 = 180; break; - case ACTION_CAUGHT: + case OH_ACTION_CAUGHT: caught(a_this); var_r27 = false; var_r28 = 3; boss->field_0x4794 = 180; break; - case ACTION_END: + case OH_ACTION_END: end(a_this); var_r28 = 1; break; - case ACTION_NON: + case OH_ACTION_NON: non(a_this); return; } - if (boss->field_0x4752 == 2) { + if (boss->mAction == OB_ACTION_BOMBFISH_SET) { cLib_addCalc2(&a_this->field_0x60c, 500.0f, 1.0f, 80.0f); } @@ -1072,7 +1065,7 @@ static void action(b_oh_class* i_this) { cLib_addCalc2(&a_this->mTentacleLength, l_HIO.mLength, 0.1f, 0.5f); } - MTXCopy(boss->mParts[0].field_0x0->getModel()->getAnmMtx(a_this->field_0x5c8 + 8), + MTXCopy(boss->mBodyParts[0].field_0x0->getModel()->getAnmMtx(a_this->field_0x5c8 + 8), mDoMtx_stack_c::get()); mDoMtx_stack_c::multVecZero(&a_this->current.pos); @@ -1207,7 +1200,7 @@ static void damage_check(b_oh_class* i_this) { } } - if (i_this->mAction == ACTION_ATTACK && boss->field_0x5d10) { + if (i_this->mAction == OH_ACTION_ATTACK && boss->field_0x5d10) { boss->field_0x5d10 = 0; bvar = true; } @@ -1216,8 +1209,8 @@ static void damage_check(b_oh_class* i_this) { i_this->field_0x60c = 2000.0f; i_this->field_0x610 = 0.5f; - if (i_this->mAction != ACTION_WAIT) { - i_this->mAction = ACTION_WAIT; + if (i_this->mAction != OH_ACTION_WAIT) { + i_this->mAction = OH_ACTION_WAIT; i_this->mActionPhase = 0; i_this->field_0xc98 = 0; i_this->field_0xca2 = 0; @@ -1270,8 +1263,8 @@ static int daB_OH_Execute(b_oh_class* i_this) { return 1; } - if (boss->field_0x4752 == 5 && i_this->mAction != ACTION_END) { - i_this->mAction = ACTION_END; + if (boss->mAction == OB_ACTION_CORE_END && i_this->mAction != OH_ACTION_END) { + i_this->mAction = OH_ACTION_END; i_this->mActionPhase = 0; } @@ -1306,7 +1299,7 @@ static int daB_OH_Execute(b_oh_class* i_this) { i_this->mpMorf->modelCalc(); int tmp = 1; - if (i_this->mDistToPlayer > 150.0f && i_this->mAction == ACTION_WAIT) { + if (i_this->mDistToPlayer > 150.0f && i_this->mAction == OH_ACTION_WAIT) { tmp = i_this->field_0x5cc & 1; } @@ -1314,13 +1307,13 @@ static int daB_OH_Execute(b_oh_class* i_this) { MTXCopy(model_p->getAnmMtx(tmp + i * 2), mDoMtx_stack_c::get()); mDoMtx_stack_c::multVecZero(&collider_center); - if (i_this->mAction >= ACTION_END) { + if (i_this->mAction >= OH_ACTION_END) { collider_center.z -= 20000.0f; } i_this->mColliders[i].SetC(collider_center); - if (i_this->mAction == ACTION_ATTACK) { + if (i_this->mAction == OH_ACTION_ATTACK) { i_this->mColliders[i].SetR(l_HIO.mModelSize * 70.0f); } else { i_this->mColliders[i].SetR(l_HIO.mModelSize * 50.0f); @@ -1493,14 +1486,14 @@ static int daB_OH_Create(fopAc_ac_c* i_this) { this_->current.angle.x = -0x3448; if (cDmr_SkipInfo) { - this_->mAction = ACTION_WAIT; + this_->mAction = OH_ACTION_WAIT; this_->mActionPhase = 1; this_->mTimers[0] = cM_rndF(100.0f) + 200.0f; this_->mTentacleLength = l_HIO.mLength; this_->field_0x608 = 1.0f; Cinit = 1; } else { - this_->mAction = ACTION_START; + this_->mAction = OH_ACTION_START; Cinit = 0; } diff --git a/rel/d/a/b/d_a_b_oh/d_a_b_oh_NONMATCHING.cpp b/rel/d/a/b/d_a_b_oh/d_a_b_oh_NONMATCHING.cpp index f7ad1f40bbf..631a664c7c4 100644 --- a/rel/d/a/b/d_a_b_oh/d_a_b_oh_NONMATCHING.cpp +++ b/rel/d/a/b/d_a_b_oh/d_a_b_oh_NONMATCHING.cpp @@ -13,13 +13,6 @@ #include "rel/d/a/b/d_a_b_ob/d_a_b_ob.h" #include "rel/d/a/b/d_a_b_oh/d_a_b_oh.h" -#define ACTION_START 0 -#define ACTION_WAIT 1 -#define ACTION_ATTACK 2 -#define ACTION_CAUGHT 3 -#define ACTION_END 10 -#define ACTION_NON 11 - // // Forward References: // @@ -183,7 +176,7 @@ static int nodeCallBack(J3DJoint* param_0, int param_1) { /* 8061B8B0-8061B960 000270 00B0+00 1/0 0/0 0/0 .text daB_OH_Draw__FP10b_oh_class */ static int daB_OH_Draw(b_oh_class* i_this) { - if (i_this->mAction == ACTION_NON) { + if (i_this->mAction == OH_ACTION_NON) { return 1; } @@ -360,7 +353,7 @@ static void wait(b_oh_class* i_this) { i_this->mDistToPlayer < 1300.0f && i_this->mTimers[0] == 0 && boss->field_0x4744 == 0 && boss->field_0x4794 == 0) { - i_this->mAction = ACTION_ATTACK; + i_this->mAction = OH_ACTION_ATTACK; i_this->mActionPhase = 0; i_this->field_0xc98 = 0; boss->field_0x4794 = 3; @@ -394,7 +387,7 @@ static void attack(b_oh_class* i_this) { case 1: case 2: if (i_this->mTimers[0] == 0) { - i_this->mAction = ACTION_WAIT; + i_this->mAction = OH_ACTION_WAIT; i_this->mActionPhase = 0; i_this->field_0xc98 = 0; i_this->field_0xca2 = 0; @@ -458,14 +451,14 @@ static void attack(b_oh_class* i_this) { boss->field_0x5ce8 = i_this->field_0x5c8; i_this->mTimers[1] = 20; - if (boss->field_0x4752 != 1) { - boss->field_0x4752 = 1; - boss->field_0x4754 = 0; + if (boss->mAction != OB_ACTION_CORE_HAND_MOVE) { + boss->mAction = OB_ACTION_CORE_HAND_MOVE; + boss->mMode = 0; boss->field_0x4738 = 30; boss->field_0x473c = 2; } - boss->field_0x59e0.startTentacleSound( + boss->mOISound.startTentacleSound( Z2SE_EN_OI_TENT_SWING, i_this->field_0x5c8, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); break; @@ -479,7 +472,7 @@ static void attack(b_oh_class* i_this) { cLib_addCalcAngleS2(&i_this->field_0xc94, 22500, 1, 2000); cLib_addCalc2(&i_this->field_0xc8c, 4000.0f, 1.0f, 400.0f); if (i_this->mTimers[1] == 1) { - i_this->mAction = ACTION_CAUGHT; + i_this->mAction = OH_ACTION_CAUGHT; i_this->mActionPhase = 0; i_this->field_0xc98 = 0; } @@ -504,7 +497,7 @@ static void caught(b_oh_class* i_this) { if (i_this->mTimers[0] == 1) { boss->field_0x4738 = 21; boss->field_0x473c = 0; - boss->field_0x59e0.startCreatureVoice(Z2SE_EN_OI_V_EAT, -1); + boss->mOISound.startCreatureVoice(Z2SE_EN_OI_V_EAT, -1); } if (!(i_this->field_0x5cc & 0xF)) { @@ -517,7 +510,7 @@ static void caught(b_oh_class* i_this) { boss->field_0x5c82 = 0; } - i_this->mAction = ACTION_WAIT; + i_this->mAction = OH_ACTION_WAIT; i_this->mActionPhase = 0; i_this->field_0xc98 = 0; } @@ -578,35 +571,35 @@ static void action(b_oh_class* i_this) { cLib_addCalcAngleS2(&a_this->field_0xc98, 0x800, 1, 0x10); switch (a_this->mAction) { - case ACTION_START: + case OH_ACTION_START: start(a_this); var_r28 = 1; break; - case ACTION_WAIT: + case OH_ACTION_WAIT: wait(a_this); var_r28 = 1; break; - case ACTION_ATTACK: + case OH_ACTION_ATTACK: attack(a_this); var_r28 = 2; boss->field_0x4794 = 180; break; - case ACTION_CAUGHT: + case OH_ACTION_CAUGHT: caught(a_this); var_r27 = false; var_r28 = 3; boss->field_0x4794 = 180; break; - case ACTION_END: + case OH_ACTION_END: end(a_this); var_r28 = 1; break; - case ACTION_NON: + case OH_ACTION_NON: non(a_this); return; } - if (boss->field_0x4752 == 2) { + if (boss->mAction == OB_ACTION_BOMBFISH_SET) { cLib_addCalc2(&a_this->field_0x60c, 500.0f, 1.0f, 80.0f); } @@ -711,7 +704,7 @@ static void action(b_oh_class* i_this) { cLib_addCalc2(&a_this->mTentacleLength, l_HIO.mLength, 0.1f, 0.5f); } - MTXCopy(boss->mParts[0].field_0x0->getModel()->getAnmMtx(a_this->field_0x5c8 + 8), + MTXCopy(boss->mBodyParts[0].mpMorf->getModel()->getAnmMtx(a_this->field_0x5c8 + 8), mDoMtx_stack_c::get()); mDoMtx_stack_c::multVecZero(&a_this->current.pos); @@ -774,7 +767,7 @@ static void damage_check(b_oh_class* i_this) { } } - if (i_this->mAction == ACTION_ATTACK && boss->field_0x5d10) { + if (i_this->mAction == OH_ACTION_ATTACK && boss->field_0x5d10) { boss->field_0x5d10 = 0; bvar = true; } @@ -783,8 +776,8 @@ static void damage_check(b_oh_class* i_this) { i_this->field_0x60c = 2000.0f; i_this->field_0x610 = 0.5f; - if (i_this->mAction != ACTION_WAIT) { - i_this->mAction = ACTION_WAIT; + if (i_this->mAction != OH_ACTION_WAIT) { + i_this->mAction = OH_ACTION_WAIT; i_this->mActionPhase = 0; i_this->field_0xc98 = 0; i_this->field_0xca2 = 0; @@ -798,7 +791,7 @@ static void damage_check(b_oh_class* i_this) { } i_this->field_0x5f4 = 6; - boss->field_0x59e0.startCreatureVoice(Z2SE_EN_OI_V_TENT_DAMAGE, -1); + boss->mOISound.startCreatureVoice(Z2SE_EN_OI_V_TENT_DAMAGE, -1); } } } @@ -817,8 +810,8 @@ static int daB_OH_Execute(b_oh_class* i_this) { return 1; } - if (boss->field_0x4752 == 5 && i_this->mAction != ACTION_END) { - i_this->mAction = ACTION_END; + if (boss->mAction == OB_ACTION_CORE_END && i_this->mAction != OH_ACTION_END) { + i_this->mAction = OH_ACTION_END; i_this->mActionPhase = 0; } @@ -853,7 +846,7 @@ static int daB_OH_Execute(b_oh_class* i_this) { i_this->mpMorf->modelCalc(); int tmp = 1; - if (i_this->mDistToPlayer > 150.0f && i_this->mAction == ACTION_WAIT) { + if (i_this->mDistToPlayer > 150.0f && i_this->mAction == OH_ACTION_WAIT) { tmp = i_this->field_0x5cc & 1; } @@ -861,13 +854,13 @@ static int daB_OH_Execute(b_oh_class* i_this) { MTXCopy(model_p->getAnmMtx(tmp + i * 2), mDoMtx_stack_c::get()); mDoMtx_stack_c::multVecZero(&collider_center); - if (i_this->mAction >= ACTION_END) { + if (i_this->mAction >= OH_ACTION_END) { collider_center.z -= 20000.0f; } i_this->mColliders[i].SetC(collider_center); - if (i_this->mAction == ACTION_ATTACK) { + if (i_this->mAction == OH_ACTION_ATTACK) { i_this->mColliders[i].SetR(l_HIO.mModelSize * 70.0f); } else { i_this->mColliders[i].SetR(l_HIO.mModelSize * 50.0f); @@ -997,14 +990,14 @@ static int daB_OH_Create(fopAc_ac_c* i_this) { this_->current.angle.x = -0x3448; if (cDmr_SkipInfo) { - this_->mAction = ACTION_WAIT; + this_->mAction = OH_ACTION_WAIT; this_->mActionPhase = 1; this_->mTimers[0] = cM_rndF(100.0f) + 200.0f; this_->mTentacleLength = l_HIO.mLength; this_->field_0x608 = 1.0f; Cinit = 1; } else { - this_->mAction = ACTION_START; + this_->mAction = OH_ACTION_START; Cinit = 0; } diff --git a/rel/d/a/b/d_a_b_oh2/d_a_b_oh2.cpp b/rel/d/a/b/d_a_b_oh2/d_a_b_oh2.cpp index 35bc3aa374a..695c91f1110 100644 --- a/rel/d/a/b/d_a_b_oh2/d_a_b_oh2.cpp +++ b/rel/d/a/b/d_a_b_oh2/d_a_b_oh2.cpp @@ -4,6 +4,7 @@ */ #include "rel/d/a/b/d_a_b_oh2/d_a_b_oh2.h" +#include "rel/d/a/b/d_a_b_ob/d_a_b_ob.h" #include "SSystem/SComponent/c_math.h" #include "c/c_damagereaction.h" #include "d/com/d_com_inf_game.h" @@ -67,7 +68,7 @@ static void dmcalc(b_oh2_class* i_this) { sp20.y = 0.0f; if (i_this->field_0x5d2[3] != 0) { sp20.z = 200.0f; - } else if (boss->field_0x4752 == 101) { + } else if (boss->mAction == OB_ACTION_FISH_VACUME) { sp20.z = 100.0f; } else { sp20.z = boss->field_0x5d04 * 123.0f; @@ -140,10 +141,10 @@ static void action(b_oh2_class* i_this) { break; } - MTXCopy(boss->mParts[0].field_0x0->getModel()->getAnmMtx(i_this->field_0x5c8 + 8), + MTXCopy(boss->mBodyParts[0].mpMorf->getModel()->getAnmMtx(i_this->field_0x5c8 + 8), mDoMtx_stack_c::get()); mDoMtx_stack_c::multVecZero(&i_this->current.pos); - MTXCopy(boss->mParts[0].field_0x0->getModel()->getAnmMtx(0), mDoMtx_stack_c::get()); + MTXCopy(boss->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0), mDoMtx_stack_c::get()); local_20.set(0.0f, 0.0f, i_this->field_0x5c8 * 20.0f + 650.0f); mDoMtx_stack_c::multVec(&local_20, &vstack_2C); diff --git a/rel/d/a/obj/d_a_obj_lv3WaterB/d_a_obj_lv3WaterB.cpp b/rel/d/a/obj/d_a_obj_lv3WaterB/d_a_obj_lv3WaterB.cpp index 9643fc4f378..c49cd21cf11 100644 --- a/rel/d/a/obj/d_a_obj_lv3WaterB/d_a_obj_lv3WaterB.cpp +++ b/rel/d/a/obj/d_a_obj_lv3WaterB/d_a_obj_lv3WaterB.cpp @@ -45,14 +45,14 @@ static int daObj_Lv3waterB_Draw(obj_lv3WaterB_class* i_this) { /* 80C5B71C-80C5B89C 00021C 0180+00 1/1 0/0 0/0 .text action__FP19obj_lv3WaterB_class */ static void action(obj_lv3WaterB_class* i_this) { switch (i_this->mAction) { - case 0: + case LV3WATERB_ACT_WAIT: break; - case 1: + case LV3WATERB_ACT_REMOVE: dComIfG_Bgsp().Release(i_this->mpOctHibiBgW); i_this->mpOctHibiModel = NULL; - i_this->mAction = 0; + i_this->mAction = LV3WATERB_ACT_WAIT; break; - case 2: + case LV3WATERB_ACT_END: dKy_custom_colset(4, 4, 0.0f); if (i_this->field_0x586 == 0) { @@ -193,7 +193,7 @@ static int daObj_Lv3waterB_Create(fopAc_ac_c* i_this) { if (dComIfGs_isStageBossEnemy()) { a_this->current.pos.y = (a_this->home.pos.y - 14450.0f) + 160.0f; - a_this->mAction = 2; + a_this->mAction = LV3WATERB_ACT_END; a_this->field_0x586 = 1; a_this->mpOctHibiModel = NULL; } diff --git a/src/d/a/d_a_alink_hang.inc b/src/d/a/d_a_alink_hang.inc index 62ff6f757c3..5367a39c948 100644 --- a/src/d/a/d_a_alink_hang.inc +++ b/src/d/a/d_a_alink_hang.inc @@ -482,12 +482,12 @@ asm void daAlink_c::setDragonHangPos() { /* 800FC6B4-800FC748 0F6FF4 0094+00 1/1 0/0 0/0 .text setOctaIealHangPos__9daAlink_cFv */ int daAlink_c::setOctaIealHangPos() { - b_ob_class* ob_p = (b_ob_class*)field_0x280c.getActor(); - if (ob_p == NULL) { + b_ob_class* boss = (b_ob_class*)field_0x280c.getActor(); + if (boss == NULL) { return 0; } - mDoMtx_stack_c::copy(ob_p->mParts[0].field_0x0->getModel()->getAnmMtx(0)); + mDoMtx_stack_c::copy(boss->mBodyParts[0].mpMorf->getModel()->getAnmMtx(0)); mDoMtx_stack_c::transM(FLOAT_LABEL(lit_6108), lit_24400, lit_24401); mDoMtx_stack_c::multVecZero(¤t.pos); mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &shape_angle);