From 5be815ad57fe33b3b785fc2150db44c26973d727 Mon Sep 17 00:00:00 2001 From: roeming Date: Sun, 22 Dec 2024 19:24:14 -0500 Subject: [PATCH] match kurage --- include/ac_museum_fish.h | 8 +- src/actor/ac_museum_fish.c | 2 +- src/actor/ac_museum_fish_afish.c_inc | 27 ++-- src/actor/ac_museum_fish_aroana.c_inc | 35 ++-- src/actor/ac_museum_fish_base.c_inc | 78 ++++----- src/actor/ac_museum_fish_bass.c_inc | 28 ++-- src/actor/ac_museum_fish_kaseki.c_inc | 27 ++-- src/actor/ac_museum_fish_koi.c_inc | 44 ++--- src/actor/ac_museum_fish_kurage.c_inc | 212 +++++++++++++++++++++++-- src/actor/ac_museum_fish_seafish.c_inc | 25 +-- 10 files changed, 339 insertions(+), 147 deletions(-) diff --git a/include/ac_museum_fish.h b/include/ac_museum_fish.h index fe1a255e..c591a4a2 100644 --- a/include/ac_museum_fish.h +++ b/include/ac_museum_fish.h @@ -94,9 +94,7 @@ typedef struct _FISH_PRIVATE_DATA { xyz_t _5AC; xyz_t _5B8; artificial_padding(0x5B8, 0x5D0, xyz_t); - f32 _5D0; - f32 _5D4; - f32 _5D8; + xyz_t _5D0; xyz_t _5DC; f32 _5E8; f32 _5EC; @@ -109,9 +107,7 @@ typedef struct _FISH_PRIVATE_DATA { f32 _608; s_xyz _60C; s_xyz _612; - s16 _618; - s16 _61A; - s16 _61C; + s_xyz _618; s16 _61E; s16 _620; s16 _622; diff --git a/src/actor/ac_museum_fish.c b/src/actor/ac_museum_fish.c index f514ac13..b4642eb2 100644 --- a/src/actor/ac_museum_fish.c +++ b/src/actor/ac_museum_fish.c @@ -202,7 +202,7 @@ #define MY_CLAMP(v, l, h) MIN(MY_MAX((l), (v)), (h)) #define ARRAY_LEN(a) (sizeof(a) / sizeof(*a)) -#define CALC_EASE(x) (1 - sqrtf(1 - (x))) +#define CALC_EASE(x) (1.0f - sqrtf(1.0f - (x))) #define CALC_EASE2(x) CALC_EASE(CALC_EASE(x)) #define SHORT2DEG_ANGLE2(x) ((x) * (360.0f / 65536.0f)) #define RANDOMF_RANGE(min, max) ((f32)(min) + (f32)RANDOM_F((f32)(max) - (f32)(min))) diff --git a/src/actor/ac_museum_fish_afish.c_inc b/src/actor/ac_museum_fish_afish.c_inc index 1554d374..1fb11029 100644 --- a/src/actor/ac_museum_fish_afish.c_inc +++ b/src/actor/ac_museum_fish_afish.c_inc @@ -28,7 +28,7 @@ void mfish_afish_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { DEG2SHORT_ANGLE(0.25f)); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(5), DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(5), DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(5), DEG2SHORT_ANGLE(0.25f)); } void mfish_afish_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) { @@ -41,7 +41,7 @@ void mfish_afish_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) { actor->_5F4 = Rnd_EX_fx(10.0f) * v2; actor->_612.x = DEG2SHORT_ANGLE((actor->_5F4 + actor->init_data._0C - actor->_5A0.y) * -12.0f); actor->_612.x = CLAMP(actor->_612.x, DEG2SHORT_ANGLE(-60), DEG2SHORT_ANGLE(60)); - actor->_5D4 = 0.0f; + actor->_5D0.y = 0.0f; if (RANDOM_F(1.0f) > actor->init_data._1C) { actor->_612.y += (s16)Rnd_EX_fx(actor->init_data._30 * 2.0f); @@ -86,7 +86,8 @@ void mfish_afish_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_636 += temp; actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(actor->_632 * sin_s(actor->_636)), CALC_EASE2(0.2f), DEG2SHORT_ANGLE(3.75f), DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.1f), DEG2SHORT_ANGLE(3.75f), DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.1f), DEG2SHORT_ANGLE(3.75f), + DEG2SHORT_ANGLE(0.25f)); if (actor->_5E8 < 0.01f && actor->_632 < DEG2SHORT_ANGLE(1)) { mfish_afish_dummy_process_init(actor); @@ -102,7 +103,7 @@ void mfish_afish_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { void mfish_afish_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) { s16 s3 = DEG2SHORT_ANGLE(RANDOM_F(75.0f)) + DEG2SHORT_ANGLE(45.0f); - actor->_61A = ABS(DEG2SHORT_ANGLE2(((s3 * (360.0f / 0x10000)) / 120.0f) * 4.0f + 2.5f)); + actor->_618.y = ABS(DEG2SHORT_ANGLE2(((s3 * (360.0f / 0x10000)) / 120.0f) * 4.0f + 2.5f)); if (actor->_62E & 0x1e) { if ((s16)(actor->_60C.y - actor->_62C) < 0) { s3 = -s3; @@ -145,8 +146,8 @@ void mfish_afish_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { add_calc2(&actor->_5F0, MAX(actor->init_data._10, 0.0f), 0.15f, 0.2f); add_calc_short_angle2(&actor->_632, 0, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f)); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(actor->_632 * sin_s(actor->_636)), - CALC_EASE(0.2f), actor->_61A >> 1, DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f)); + CALC_EASE(0.2f), actor->_618.y >> 1, DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f)); if (ABS((s16)(actor->_60C.y - actor->_612.y)) < DEG2SHORT_ANGLE(2) && actor->_5E8 < 0.1f) { if (actor->_63E > 0) { if (mfish_WallCheck(actor)) { @@ -171,14 +172,14 @@ void mfish_afish_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { add_calc2(&actor->_5E8, 0.05f, 1.0f - actor->init_data._18, 0.001f); } add_calc0(&actor->_5EC, 0.5f, 0.01f); - actor->_5D0 = actor->_5E8 * cos_s(actor->_60C.x) * sin_s(actor->_60C.y); - actor->_5D8 = actor->_5E8 * cos_s(actor->_60C.x) * cos_s(actor->_60C.y); - add_calc(&actor->_5D4, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.001f); - add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D4); + actor->_5D0.x = actor->_5E8 * cos_s(actor->_60C.x) * sin_s(actor->_60C.y); + actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.x) * cos_s(actor->_60C.y); + add_calc(&actor->_5D0.y, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.001f); + add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y); mfish_move_smooth(actor, gamex); mfish_get_flow_vec(&p, actor, gamex); - actor->_5A0.x += actor->_5D0 + actor->_5DC.x; - actor->_5A0.z += actor->_5D8 + actor->_5DC.z; + actor->_5A0.x += actor->_5D0.x + actor->_5DC.x; + actor->_5A0.z += actor->_5D0.z + actor->_5DC.z; actor->_5A0.y += actor->_5DC.y; actor->_5A0.y = MAX(110.f, MIN(60.f, actor->_5A0.y)); } @@ -213,7 +214,7 @@ void mfish_afish_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_5AC.y = 0.0f; actor->_638 += DEG2SHORT_ANGLE(10); actor->_34(actor, gamex); - if (ABS(actor->_61C) > ABS(actor->_622) && ABS(actor->_622) > DEG2SHORT_ANGLE(2)) { + if (ABS(actor->_618.z) > ABS(actor->_622) && ABS(actor->_622) > DEG2SHORT_ANGLE(2)) { add_calc2(&actor->_5E8, MIN(0.2f, actor->_5E8), 0.2f, 0.5f); } add_calc_short_angle2(&actor->_60C.x, actor->_612.x, CALC_EASE(0.1f), DEG2SHORT_ANGLE(2.5), DEG2SHORT_ANGLE(0.5)); diff --git a/src/actor/ac_museum_fish_aroana.c_inc b/src/actor/ac_museum_fish_aroana.c_inc index a013377f..aa873826 100644 --- a/src/actor/ac_museum_fish_aroana.c_inc +++ b/src/actor/ac_museum_fish_aroana.c_inc @@ -13,7 +13,7 @@ void mfish_aroana_dummy_process_init() { void mfish_aroana_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor) { actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.0f), DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.0f), DEG2SHORT_ANGLE(0.25f)); add_calc2(&actor->_5EC, 0.05f, 0.25f, 0.025f); add_calc2(&actor->_5E8, actor->_5F0, 0.1f, actor->_5EC); add_calc0(&actor->_5F0, 0.01f, 0.001f); @@ -30,7 +30,7 @@ void mfish_aroana_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) { } actor->_5F4 = Rnd_EX_fx(10.0f) * v2; actor->_612.x = atans_table(actor->_5E8, actor->_5F4 + actor->init_data._0C - actor->_5A0.y) >> 4; - actor->_5D4 = 0.0f; + actor->_5D0.y = 0.0f; if (RANDOM_F(1.0f) > actor->init_data._1C) { actor->_612.y += (s16)Rnd_EX_fx(actor->init_data._30 * 2.0f); @@ -79,7 +79,8 @@ void mfish_aroana_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(actor->_632 * sin_s(actor->_636)), CALC_EASE2(0.2f), DEG2SHORT_ANGLE(3.75f), DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.1f), DEG2SHORT_ANGLE(3.75f), DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.1f), DEG2SHORT_ANGLE(3.75f), + DEG2SHORT_ANGLE(0.25f)); if (actor->_5E8 < 0.01f && actor->_632 < DEG2SHORT_ANGLE(1)) { if (fqrand() < 0.01f) { @@ -99,7 +100,7 @@ void mfish_aroana_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { void mfish_aroana_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) { s16 s3 = DEG2SHORT_ANGLE(RANDOM_F(55.0f)) + DEG2SHORT_ANGLE(45.0f); - actor->_61A = ABS(DEG2SHORT_ANGLE2(((s3 * (360.0f / 0x10000)) / 120.0f) * 2.5f + 2.0f)); + actor->_618.y = ABS(DEG2SHORT_ANGLE2(((s3 * (360.0f / 0x10000)) / 120.0f) * 2.5f + 2.0f)); if (actor->_62E & 0x1e) { if ((s16)(actor->_60C.y - actor->_62C) < 0) { s3 = -s3; @@ -142,8 +143,9 @@ void mfish_aroana_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { add_calc2(&actor->_5F0, MAX(actor->init_data._10, 0.0f), 0.15f, 0.2f); add_calc_short_angle2(&actor->_632, 0, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f)); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(actor->_632 * sin_s(actor->_636)), - CALC_EASE(0.2f), actor->_61A >> 1, DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(1.25f), DEG2SHORT_ANGLE(0.125f)); + CALC_EASE(0.2f), actor->_618.y >> 1, DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(1.25f), + DEG2SHORT_ANGLE(0.125f)); if (ABS((s16)(actor->_60C.y - actor->_612.y)) < DEG2SHORT_ANGLE(2) && actor->_5E8 < 0.1f) { if (actor->_63E > 0) { if (mfish_WallCheck(actor)) { @@ -173,7 +175,8 @@ void mfish_aroana_long_move_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) GAME_PLAY* play = (GAME_PLAY*)game; actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.1f), DEG2SHORT_ANGLE(1.25f), DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.25f), DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.25f), + DEG2SHORT_ANGLE(0.25f)); add_calc2(&actor->_5EC, 0.05f, 0.25f, 0.025f); add_calc2(&actor->_5E8, actor->_5F0, 0.1f, actor->_5EC); if ((play->game_frame & 0x3f) == 0 && RANDOM_F(1.0f) > 0.25f) { @@ -191,14 +194,14 @@ void mfish_aroana_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { } add_calc0(&actor->_5EC, 0.5f, 0.01f); - actor->_5D0 = actor->_5E8 * sin_s(actor->_60C.y); - actor->_5D8 = actor->_5E8 * cos_s(actor->_60C.y); - add_calc(&actor->_5D4, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f); - add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D4); + actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y); + actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y); + add_calc(&actor->_5D0.y, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f); + add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y); mfish_move_smooth(actor, game); mfish_get_flow_vec(&p, actor, game); - actor->_5A0.x += actor->_5D0 + actor->_5DC.x; - actor->_5A0.z += actor->_5D8 + actor->_5DC.z; + actor->_5A0.x += actor->_5D0.x + actor->_5DC.x; + actor->_5A0.z += actor->_5D0.z + actor->_5DC.z; actor->_5A0.y += actor->_5DC.y; actor->_5A0.y = MAX(110.f, MIN(60.f, actor->_5A0.y)); } @@ -230,7 +233,7 @@ void mfish_aroana_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_5AC.y = 0.0f; actor->_638 += DEG2SHORT_ANGLE(5); actor->_34(actor, gamex); - if (ABS(actor->_61C) > ABS(actor->_622) && ABS(actor->_622) > DEG2SHORT_ANGLE(2)) { + if (ABS(actor->_618.z) > ABS(actor->_622) && ABS(actor->_622) > DEG2SHORT_ANGLE(2)) { add_calc2(&actor->_5E8, MIN(0.2f, actor->_5E8), 0.2f, 0.5f); } add_calc_short_angle2(&actor->_60C.x, actor->_612.x, CALC_EASE(0.1f), DEG2SHORT_ANGLE(5), DEG2SHORT_ANGLE(0.5f)); @@ -251,10 +254,10 @@ BOOL mfish_aroana_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int jo if (joint_num == 1) { Matrix_scale(1.0, sin_s(actor->_63A + actor->_63C) * 0.025f + 1.0f, sin_s(actor->_63A) * 0.025f + 1.0f, 1); } else if (joint_num == 2) { - v = joint1->y - (actor->_61C << 1); + v = joint1->y - (actor->_618.z << 1); joint1->y = MIN(MAX(v, DEG2SHORT_ANGLE(-40)), DEG2SHORT_ANGLE(40)); - v = joint1->x - (actor->_61C >> 2); + v = joint1->x - (actor->_618.z >> 2); joint1->x = MIN(MAX(v, DEG2SHORT_ANGLE(-20)), DEG2SHORT_ANGLE(20)); Matrix_scale(1.0f, sin_s(actor->_63A + DEG2SHORT_ANGLE(270)) * 0.05f + 1.0f, diff --git a/src/actor/ac_museum_fish_base.c_inc b/src/actor/ac_museum_fish_base.c_inc index 7ba03e97..690af7ab 100644 --- a/src/actor/ac_museum_fish_base.c_inc +++ b/src/actor/ac_museum_fish_base.c_inc @@ -37,16 +37,16 @@ void mfish_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { add_calc0(&actor->_5E8, 1.0f - actor->init_data._18, 0.025f); } - actor->_5D0 = actor->_5E8 * sin_s(actor->_60C.y); - actor->_5D8 = actor->_5E8 * cos_s(actor->_60C.y); + actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y); + actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y); - add_calc(&actor->_5D4, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f); - add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D4); + add_calc(&actor->_5D0.y, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f); + add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y); mfish_move_smooth(actor, game); mfish_get_flow_vec(&pos, actor, game); - actor->_5A0.x += actor->_5D0 + actor->_5DC.x; - actor->_5A0.z += actor->_5D8 + actor->_5DC.z; + actor->_5A0.x += actor->_5D0.x + actor->_5DC.x; + actor->_5A0.z += actor->_5D0.z + actor->_5DC.z; actor->_5A0.y = actor->_5A0.y + actor->_5DC.y; actor->_5A0.y = MAX(60, MIN(110, actor->_5A0.y)); } @@ -126,7 +126,7 @@ void mfish_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { // no clue what's going on here add_calc_short_angle2(&actor->_612.y, actor->_634, CALC_EASE2(0.0f), DEG2SHORT_ANGLE(3.75f), 0x2d); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(5.0f), 0x2d); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(5.0f), 0x2d); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(5.0f), 0x2d); if (actor->_630 == 2) { if (actor->_612.y < 0) { @@ -154,7 +154,7 @@ void mfish_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* fishActor) { fishActor->_612.x = atans_table(fishActor->_5E8, fishActor->_5F4 + fishActor->init_data._0C - fishActor->_5A0.y) >> 4; - fishActor->_5D4 = 0; + fishActor->_5D0.y = 0; if (RANDOM_F(1) > fishActor->init_data._1C) { int diff; @@ -200,7 +200,7 @@ void mfish_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { actor->_636 += DEG2SHORT_ANGLE(10.0f); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(actor->_632 * sin_s(actor->_636)), CALC_EASE2(0.5f), DEG2SHORT_ANGLE(6.25f), 45); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(3.75f), 45); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(3.75f), 45); if (actor->_5E8 < 0.01f || actor->_630 == 2 && actor->_5E8 < 0.05f) { mfish_dummy_process_init(actor); @@ -216,7 +216,7 @@ void mfish_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { void mfish_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) { s16 v = DEG2SHORT_ANGLE(RANDOM_F(75.0f)) + DEG2SHORT_ANGLE(45); - actor->_61A = + actor->_618.y = DEG2SHORT_ANGLE(((actor->_5E8 + 0.5f) / (actor->init_data._10 + actor->init_data._14 + 0.5f)) * 7.5f + 7.5f); if (actor->_62E & 0xC0) { @@ -273,8 +273,9 @@ void mfish_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { add_calc2(&actor->_5F0, MAX(actor->init_data._10, 0.0f), 0.5f, 0.2f); add_calc_short_angle2(&actor->_632, 0, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f)); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(actor->_632 * sin_s(actor->_636)), - CALC_EASE(0.2f), actor->_61A >> 1, DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.4f), DEG2SHORT_ANGLE(3.75f), DEG2SHORT_ANGLE(0.25f)); + CALC_EASE(0.2f), actor->_618.y >> 1, DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.4f), DEG2SHORT_ANGLE(3.75f), + DEG2SHORT_ANGLE(0.25f)); if (ABS((s16)(actor->_60C.y - actor->_612.y)) < DEG2SHORT_ANGLE(2) && actor->_5E8 < 0.1f) { if (actor->_63E > 0) { @@ -298,7 +299,7 @@ void mfish_peck_process_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { s16 atany; f32 dist; - actor->_5D4 = 0.0f; + actor->_5D0.y = 0.0f; mfish_get_player_angle(actor, game, &atanx, &atany, &dist); fVar9 = (actor->init_data)._14 + (actor->init_data)._10; @@ -362,7 +363,8 @@ void mfish_peck_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_636 += DEG2SHORT_ANGLE(10); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(sin_s(actor->_636) * actor->_632), CALC_EASE2(0.5f), DEG2SHORT_ANGLE(6.25f), DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(3.75f), DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(3.75f), + DEG2SHORT_ANGLE(0.25f)); if (mfish_peck_wall_check(actor, gamex)) { if (fqrand() < 0.9f) { @@ -433,8 +435,8 @@ void mfish_base_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { f32 s; s16 q = qrand(); actor->_5E8 = f; - actor->_5D0 = cos_s(q) * f; - actor->_5D8 = sin_s(q) * f; + actor->_5D0.x = cos_s(q) * f; + actor->_5D0.z = sin_s(q) * f; actor->_60C.y = q; actor->_612.y = actor->_60C.y; if (actor->_59C == 4 || actor->_59C == 9) { @@ -444,7 +446,7 @@ void mfish_base_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { } else { actor->_5F4 = fqrand2() * 10.0f; } - actor->_5D4 = 0.0; + actor->_5D0.y = 0.0; actor->_5AC = ZeroVec; actor->_638 = qrand(); actor->_622 = actor->_60C.y; @@ -494,7 +496,7 @@ void mfish_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_638 += DEG2SHORT_ANGLE(10); actor->_34(actor, gamex); - if (ABS(actor->_61C) > ABS(actor->_622)) { + if (ABS(actor->_618.z) > ABS(actor->_622)) { add_calc2(&actor->_5E8, MIN(GETREG(TAKREG, 19) * 0.1f + 0.2f, actor->_5E8), 0.2f, 0.5f); } @@ -537,9 +539,9 @@ int mfish_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_num, v = 3; } - t = joint1->y - (actor->_61C * v); + t = joint1->y - (actor->_618.z * v); joint1->y = MY_CLAMP(t, DEG2SHORT_ANGLE(-60), DEG2SHORT_ANGLE(60)); - t = joint1->x - (actor->_61C >> 1); + t = joint1->x - (actor->_618.z >> 1); joint1->x = MY_CLAMP(t, DEG2SHORT_ANGLE(-25), DEG2SHORT_ANGLE(25)); } return 1; @@ -567,7 +569,7 @@ void mfish_onefish_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { Matrix_translate(0.0f, 0.25f * actor->init_data._04, 1.5f * actor->init_data._24, 1); Matrix_RotateX(actor->_60C.x, 1); - Matrix_RotateZ(MY_CLAMP(-(actor->_61C >> 1), DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20)), 1); + Matrix_RotateZ(MY_CLAMP(-(actor->_618.z >> 1), DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20)), 1); Matrix_translate(0.0f, 0.25f * -actor->init_data._04, 0.5f * -actor->init_data._24, 1); Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1); @@ -769,8 +771,8 @@ void Museum_Fish_DonkoBGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { f32 f25; f32 f26; xyz_t p = suisou_pos[actor->_630]; - f32 v = (sin_s(actor->_60C.y) * 0.7f) * (ABS(cos_s(actor->_61C)) * 0.5f + 0.5f) + 0.3f; - f32 v2 = (cos_s(actor->_60C.y) * 0.7f) * (ABS(cos_s(actor->_61C)) * 0.5f + 0.5f) + 0.3f; + f32 v = (sin_s(actor->_60C.y) * 0.7f) * (ABS(cos_s(actor->_618.z)) * 0.5f + 0.5f) + 0.3f; + f32 v2 = (cos_s(actor->_60C.y) * 0.7f) * (ABS(cos_s(actor->_618.z)) * 0.5f + 0.5f) + 0.3f; actor->_62E &= ~0x1e; actor->_62C = 0; Museum_Fish_objchk_pos_set(actor, gamex); @@ -858,7 +860,7 @@ void Museum_Fish_DonkoBGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_612.x = atans_table(1.0f, -f26); if (f27 > 0.0f) { actor->_5A0.y += f27; - actor->_5D4 *= 0.95f; + actor->_5D0.y *= 0.95f; } } @@ -875,19 +877,19 @@ void Museum_Fish_BGCheck(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { if ((actor->_624 == 0 || actor->_624 == 0xb || actor->_624 == 0x1 || actor->_624 == 0x2) && actor->init_data._28 < 0) { - f26 = - GETREG(TAKREG, 0x52) * 0.01f + 0.3f + - (0.7f - GETREG(TAKREG, 0x52) * 0.01f) * ABS(sin_s(actor->_60C.y)) * (ABS(cos_s(actor->_61C)) * 0.5f + 0.5f); - f25 = - GETREG(TAKREG, 0x52) * 0.01f + 0.3f + - (0.7f - GETREG(TAKREG, 0x52) * 0.01f) * ABS(cos_s(actor->_60C.y)) * (ABS(cos_s(actor->_61C)) * 0.5f + 0.5f); + f26 = GETREG(TAKREG, 0x52) * 0.01f + 0.3f + + (0.7f - GETREG(TAKREG, 0x52) * 0.01f) * ABS(sin_s(actor->_60C.y)) * + (ABS(cos_s(actor->_618.z)) * 0.5f + 0.5f); + f25 = GETREG(TAKREG, 0x52) * 0.01f + 0.3f + + (0.7f - GETREG(TAKREG, 0x52) * 0.01f) * ABS(cos_s(actor->_60C.y)) * + (ABS(cos_s(actor->_618.z)) * 0.5f + 0.5f); } else if (actor->_624 == 10 || actor->_624 == 7 || actor->_624 == 9) { - f26 = - GETREG(TAKREG, 0x52) * 0.01f + 0.6f + - (0.4f - GETREG(TAKREG, 0x52) * 0.01f) * ABS(sin_s(actor->_60C.y)) * (ABS(cos_s(actor->_61C)) * 0.4f + 0.6f); - f25 = - GETREG(TAKREG, 0x52) * 0.01f + 0.6f + - (0.4f - GETREG(TAKREG, 0x52) * 0.01f) * ABS(cos_s(actor->_60C.y)) * (ABS(cos_s(actor->_61C)) * 0.4f + 0.6f); + f26 = GETREG(TAKREG, 0x52) * 0.01f + 0.6f + + (0.4f - GETREG(TAKREG, 0x52) * 0.01f) * ABS(sin_s(actor->_60C.y)) * + (ABS(cos_s(actor->_618.z)) * 0.4f + 0.6f); + f25 = GETREG(TAKREG, 0x52) * 0.01f + 0.6f + + (0.4f - GETREG(TAKREG, 0x52) * 0.01f) * ABS(cos_s(actor->_60C.y)) * + (ABS(cos_s(actor->_618.z)) * 0.4f + 0.6f); } else { f26 = 1.0f; f25 = 1.0f; @@ -1341,8 +1343,8 @@ void mfish_get_flow_vec(xyz_t* pos, MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) p2.z *= ABS(sin_s(actor->_60C.y) * cos_s(actor->_60C.x)); if (actor->_624 != 3) { - p2.x *= cos_s(actor->_61C); - p2.z *= cos_s(actor->_61C); + p2.x *= cos_s(actor->_618.z); + p2.z *= cos_s(actor->_618.z); } if (actor->_630 == 4) { diff --git a/src/actor/ac_museum_fish_bass.c_inc b/src/actor/ac_museum_fish_bass.c_inc index 582b8a6b..dd379e18 100644 --- a/src/actor/ac_museum_fish_bass.c_inc +++ b/src/actor/ac_museum_fish_bass.c_inc @@ -14,19 +14,19 @@ void mfish_bass_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { f32 t; xyz_t pos; add_calc2(&actor->_5E8, actor->_5AC.x, 1 - actor->init_data._18, 0.01f + 0.001f * GETREG(TAKREG, 20)); - actor->_5D0 = actor->_5E8 * sin_s(actor->_60C.y); - actor->_5D8 = actor->_5E8 * cos_s(actor->_60C.y); + actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y); + actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y); - add_calc(&actor->_5D4, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f); - t = add_calc(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D4, 0); + add_calc(&actor->_5D0.y, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f); + t = add_calc(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y, 0); if (fabsf(t) < 0.08f) { add_calc_short_angle2(&actor->_612.x, 0, CALC_EASE(0.03f), DEG2SHORT_ANGLE(1.0f + (0.5f * actor->_5AC.y)) >> 1, 9); } mfish_move_smooth(actor, game); mfish_get_flow_vec(&pos, actor, game); - actor->_5A0.x += actor->_5D0 + actor->_5DC.x; - actor->_5A0.z += actor->_5D8 + actor->_5DC.z; + actor->_5A0.x += actor->_5D0.x + actor->_5DC.x; + actor->_5A0.z += actor->_5D0.z + actor->_5DC.z; actor->_5A0.y = actor->_5A0.y + actor->_5DC.y; actor->_5A0.y = MAX(60, MIN(110, actor->_5A0.y)); } @@ -55,7 +55,7 @@ void mfish_bass_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { // no clue what's going on here add_calc_short_angle2(&actor->_612.y, actor->_634, CALC_EASE2(0.0f), 0x1c7, 0x2d); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.25f), 0xe3, 0x2d); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.25f), 0xe3, 0x2d); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.25f), 0xe3, 0x2d); } void mfish_bass_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* fishActor) { @@ -84,7 +84,7 @@ void mfish_bass_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* fishActor) { fishActor->_612.x = DEG2SHORT_ANGLE2(temp * -(2 * fishActor->_5AC.y + 10)); fishActor->_612.x = CLAMP(fishActor->_612.x, DEG2SHORT_ANGLE(-50), DEG2SHORT_ANGLE(50)); - fishActor->_5D4 = 0; + fishActor->_5D0.y = 0; if (RANDOM_F(1) > fishActor->init_data._1C) { int diff; @@ -148,7 +148,7 @@ void mfish_bass_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(actor->_632 * sin_s(actor->_636)), CALC_EASE2(actor->_5AC.y * 0.25f + 0.25f), (s16)(DEG2SHORT_ANGLE(actor->_5AC.y * 15.0f + 10.0f) >> 1) >> 1, 22); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(actor->_5AC.y * 0.25f + 0.25f), + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(actor->_5AC.y * 0.25f + 0.25f), (s16)(DEG2SHORT_ANGLE(actor->_5AC.y * 8.0f + 7.0f) >> 1) >> 1, 22); if (actor->_5E8 < 0.01f) { @@ -168,7 +168,7 @@ void mfish_bass_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) { s16 b; b = a = 0x2000 + DEG2SHORT_ANGLE(RANDOM_F(75)); - actor->_61A = + actor->_618.y = DEG2SHORT_ANGLE((actor->_5AC.y * 4.0f + 4.0f) * (SHORT2DEG_ANGLE2(a) / 120.0f) + 2.0f + actor->_5AC.y); if (actor->_62E & 0x1e) { if ((s16)(actor->_60C.y - actor->_62C) < 0) { @@ -236,9 +236,9 @@ void mfish_bass_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { add_calc_short_angle2(&actor->_632, 0, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(2.5f), 45); actor->_622 = add_calc_short_angle2(&actor->_60C.y, ((s16)(sin_s(actor->_636) * actor->_632) + actor->_612.y), - CALC_EASE(0.2f), actor->_61A >> 1, 45); + CALC_EASE(0.2f), actor->_618.y >> 1, 45); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.25f), DEG2SHORT_ANGLE(2.5f), 22); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.25f), DEG2SHORT_ANGLE(2.5f), 22); if (ABS((s16)(actor->_60C.y - actor->_612.y)) < DEG2SHORT_ANGLE(2.0f) && actor->_5E8 < 0.1f) { if (actor->_63E > 0) { @@ -309,7 +309,7 @@ void mfish_bass_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_638 += DEG2SHORT_ANGLE(10); actor->_34(actor, gamex); - if (ABS(actor->_61C) > ABS(actor->_622)) { + if (ABS(actor->_618.z) > ABS(actor->_622)) { add_calc2(&actor->_5E8, MIN(GETREG(TAKREG, 19) * 0.01f + 1.0f, actor->_5E8), GETREG(TAKREG, 18) * 0.01f + 0.2f, GETREG(TAKREG, 17) * 0.01f + 0.5f); } @@ -358,7 +358,7 @@ void mfish_bass_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { Matrix_translate(0, 0.25f * actor->init_data._04, 0.5f * actor->init_data._24, 1); Matrix_RotateX(actor->_60C.x, 1); - Matrix_RotateZ(MY_CLAMP(-(actor->_61C >> 1), DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20)), 1); + Matrix_RotateZ(MY_CLAMP(-(actor->_618.z >> 1), DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20)), 1); Matrix_translate(0, 0.25f * -actor->init_data._04, 0.5f * -actor->init_data._24, 1); Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1); diff --git a/src/actor/ac_museum_fish_kaseki.c_inc b/src/actor/ac_museum_fish_kaseki.c_inc index 06d9a860..d611a08a 100644 --- a/src/actor/ac_museum_fish_kaseki.c_inc +++ b/src/actor/ac_museum_fish_kaseki.c_inc @@ -9,7 +9,7 @@ void mfish_kaseki_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_60C.y = DEG2SHORT_ANGLE(-90); } actor->_612.y = actor->_60C.y; - actor->_5D4 = 0; + actor->_5D0.y = 0.0f; actor->_5AC = ZeroVec; actor->_638 = qrand(); actor->_622 = 0; @@ -35,7 +35,7 @@ void mfish_kaseki_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(actor->_632 * sin_s(actor->_636)), CALC_EASE2(GETREG(TAKREG, 0x1e) * 0.01f + 0.15f), (s16)(s >> 1) >> 1, DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(GETREG(TAKREG, 0x1f) * 0.01f + 0.1f), + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(GETREG(TAKREG, 0x1f) * 0.01f + 0.1f), (s16)(DEG2SHORT_ANGLE(GETREG(TAKREG, 0x20) * 0.1f + 4.0f) >> 1) >> 1, DEG2SHORT_ANGLE(0.25f)); if (actor->_5FC < 10.0f - actor->init_data._28 * 0.5f) { if (actor->_612.y < 0) { @@ -83,7 +83,7 @@ void mfish_kaseki_move_wall_smooth(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) s16 s; s16 a, b; s16 diff; - if (MIN(actor->_5FC, actor->_600) < 40.0f && ABS(actor->_61C) > DEG2SHORT_ANGLE(5)) { + if (MIN(actor->_5FC, actor->_600) < 40.0f && ABS(actor->_618.z) > DEG2SHORT_ANGLE(5)) { return; } @@ -115,7 +115,8 @@ void mfish_kaseki_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { } if (MIN(actor->_5FC, actor->_600) < 20.0f) { - if (ABS(actor->_61C) > ABS(actor->_622) && ABS(actor->_61C) < DEG2SHORT_ANGLE2(GETREG(TAKREG, 0x36) + 20.0f)) { + if (ABS(actor->_618.z) > ABS(actor->_622) && + ABS(actor->_618.z) < DEG2SHORT_ANGLE2(GETREG(TAKREG, 0x36) + 20.0f)) { add_calc2(&actor->_5E8, GETREG(TAKREG, 0x30) * 0.01f + 0.8f, GETREG(TAKREG, 0x31) * 0.01f + 0.25f, GETREG(TAKREG, 0x32) * 0.01f + 0.1f); } else { @@ -129,11 +130,11 @@ void mfish_kaseki_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { add_calc2(&actor->_5E8, actor->_5F0, 0.3f, 0.02f); } } - v = actor->_5E8 * (1.0f - ((sin_s(actor->_63A) * 0.2f + 0.2f) * MAX(cos_s(actor->_61C), 0.5f))); - actor->_5D0 = v * sin_s(actor->_60C.y); - actor->_5D8 = v * cos_s(actor->_60C.y); - actor->_5A0.x += actor->_5D0; - actor->_5A0.z += actor->_5D8; + v = actor->_5E8 * (1.0f - ((sin_s(actor->_63A) * 0.2f + 0.2f) * MAX(cos_s(actor->_618.z), 0.5f))); + actor->_5D0.x = v * sin_s(actor->_60C.y); + actor->_5D0.z = v * cos_s(actor->_60C.y); + actor->_5A0.x += actor->_5D0.x; + actor->_5A0.z += actor->_5D0.z; mfish_onefish_mv(actor, game); actor->_38._00.frame_control.speed = actor->_5E8 * 0.75f + 0.25f; mfish_body_wind_anime_play(actor, game); @@ -149,19 +150,19 @@ BOOL mfish_kaseki_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int jo MUSEUM_FISH_PRIVATE_DATA* actor = (MUSEUM_FISH_PRIVATE_DATA*)arg; int i; if (joint_num == 1) { - i = joint1->x + (int)(actor->_61C * (GETREG(TAKREG, 0x47) * 0.01f + 0.5f)); + i = joint1->x + (int)(actor->_618.z * (GETREG(TAKREG, 0x47) * 0.01f + 0.5f)); joint1->x = MIN(MAX(i, DEG2SHORT_ANGLE(-10)), DEG2SHORT_ANGLE(10)); Matrix_scale(1.0f, (GETREG(TAKREG, 0x36) * 0.001f + 0.02f) * sin_s(actor->_63A + actor->_63C) + 1.0f, (GETREG(TAKREG, 0x36) * 0.001f + 0.02f) * sin_s(actor->_63A) + 1.0f, 1); } else if (joint_num == 2) { - i = joint1->y - (int)(actor->_61C * (GETREG(TAKREG, 0x46) * 0.01f + 1.25f)); + i = joint1->y - (int)(actor->_618.z * (GETREG(TAKREG, 0x46) * 0.01f + 1.25f)); joint1->y = MIN(MAX(i, DEG2SHORT_ANGLE(-50)), DEG2SHORT_ANGLE(50)); - i = joint1->x - (int)(actor->_61C * (GETREG(TAKREG, 0x48) * 0.01f + 0.25f)); + i = joint1->x - (int)(actor->_618.z * (GETREG(TAKREG, 0x48) * 0.01f + 0.25f)); joint1->x = MIN(MAX(i, DEG2SHORT_ANGLE(-10)), DEG2SHORT_ANGLE(10)); Matrix_scale(1.0f, (GETREG(TAKREG, 0x37) * 0.001f + 0.045f) * sin_s(actor->_63A + DEG2SHORT_ANGLE(270)) + 1.0f, (GETREG(TAKREG, 0x37) * 0.001f + 0.045f) * sin_s(actor->_63A + DEG2SHORT_ANGLE(90)) + 1.0f, 1); } else if (joint_num == 3) { - i = joint1->y - (int)(actor->_61C * (GETREG(TAKREG, 0x47) * 0.01f + 1.25f)); + i = joint1->y - (int)(actor->_618.z * (GETREG(TAKREG, 0x47) * 0.01f + 1.25f)); joint1->y = MIN(MAX(i, DEG2SHORT_ANGLE(-50)), DEG2SHORT_ANGLE(50)); i = joint1->x + DEG2SHORT_ANGLE2(GETREG(TAKREG, 0x2d) * sin_s(actor->_63A)); joint1->x = MIN(MAX(i, DEG2SHORT_ANGLE(-40)), DEG2SHORT_ANGLE(40)); diff --git a/src/actor/ac_museum_fish_koi.c_inc b/src/actor/ac_museum_fish_koi.c_inc index bd99a55a..9b43ca2a 100644 --- a/src/actor/ac_museum_fish_koi.c_inc +++ b/src/actor/ac_museum_fish_koi.c_inc @@ -108,7 +108,8 @@ void mfish_koi_dummy_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { DEG2SHORT_ANGLE(0.25f)); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.25f), DEG2SHORT_ANGLE(3.75f), DEG2SHORT_ANGLE(0.125f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.125f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.5f), + DEG2SHORT_ANGLE(0.125f)); add_calc2(&actor->_5EC, 0.05f, 0.25f, 0.025f); add_calc2(&actor->_5E8, actor->_5F0, 0.1f, actor->_5EC); add_calc0(&actor->_5F0, 0.02f, 0.01f); @@ -126,7 +127,7 @@ void mfish_koi_normal_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) { actor->_612.x = DEG2SHORT_ANGLE(-10 * (actor->_5F4 + actor->init_data._0C - actor->_5A0.y)); actor->_612.x = CLAMP(actor->_612.x, DEG2SHORT_ANGLE(-50), DEG2SHORT_ANGLE(50)); - actor->_5D4 = 0.0f; + actor->_5D0.y = 0.0f; if (RANDOM_F(1.0f) > actor->init_data._1C) { actor->_612.y += (s16)Rnd_EX_fx(actor->init_data._30 * 2.0f); @@ -172,7 +173,8 @@ void mfish_koi_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(actor->_632 * sin_s(actor->_636)), CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.125f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.1f), DEG2SHORT_ANGLE(2.0f), DEG2SHORT_ANGLE(0.125f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.1f), DEG2SHORT_ANGLE(2.0f), + DEG2SHORT_ANGLE(0.125f)); if (actor->_5E8 < 0.01f && actor->_632 < DEG2SHORT_ANGLE(1)) { if (fqrand() < 0.01f) { @@ -192,7 +194,7 @@ void mfish_koi_normal_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { void mfish_koi_turn_process_init(MUSEUM_FISH_PRIVATE_DATA* actor) { s16 s3 = DEG2SHORT_ANGLE(RANDOM_F(55.0f)) + DEG2SHORT_ANGLE(60.0f); - actor->_61A = ABS(DEG2SHORT_ANGLE2(((s3 * (360.0f / 0x10000)) / 120.0f) * 2.5f + 2.0f)); + actor->_618.y = ABS(DEG2SHORT_ANGLE2(((s3 * (360.0f / 0x10000)) / 120.0f) * 2.5f + 2.0f)); if (actor->_62E & 0x1e) { if ((s16)(actor->_60C.y - actor->_62C) < 0) { s3 = -s3; @@ -236,10 +238,11 @@ void mfish_koi_turn_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { add_calc2(&actor->_5F0, MAX(actor->init_data._10, 0.0f), 0.15f, 0.2f); add_calc_short_angle2(&actor->_632, 0, CALC_EASE2(0.5f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f)); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(actor->_632 * sin_s(actor->_636)), - CALC_EASE(0.2f), actor->_61A >> 1, DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(1.25f), DEG2SHORT_ANGLE(0.25f)); + CALC_EASE(0.2f), actor->_618.y >> 1, DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(1.25f), + DEG2SHORT_ANGLE(0.25f)); if (ABS(actor->_622) < DEG2SHORT_ANGLE(2) && actor->_5E8 < 0.1f) { - if (actor->_63E > 0 && ABS(actor->_61C) < DEG2SHORT_ANGLE(2)) { + if (actor->_63E > 0 && ABS(actor->_618.z) < DEG2SHORT_ANGLE(2)) { if (mfish_WallCheck(actor)) { mfish_koi_tail_anim_set(actor, 1); mfish_aroana_turn_process_init(actor); @@ -265,7 +268,7 @@ void mfish_koi_peck_process_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { s16 atany; f32 dist; - actor->_5D4 = 0.0f; + actor->_5D0.y = 0.0f; mfish_get_player_angle(actor, game, &atanx, &atany, &dist); fVar9 = (actor->init_data)._10 + RANDOM_F(actor->init_data._14); @@ -330,7 +333,7 @@ void mfish_koi_peck_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_636 += DEG2SHORT_ANGLE(3.f); actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y + (s16)(sin_s(actor->_636) * actor->_632), CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.125f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.f), DEG2SHORT_ANGLE(0.125f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.f), DEG2SHORT_ANGLE(0.125f)); if (mfish_peck_wall_check(actor, gamex)) { if (fqrand() < 0.9f) { @@ -357,7 +360,8 @@ void mfish_koi_long_move_process(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { GAME_PLAY* play = (GAME_PLAY*)game; actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.1f), DEG2SHORT_ANGLE(2.f), DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.25f), DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.25f), + DEG2SHORT_ANGLE(0.25f)); add_calc2(&actor->_5EC, 0.05f, 0.25f, 0.025f); add_calc2(&actor->_5E8, actor->_5F0, 0.1f, actor->_5EC); } @@ -372,14 +376,14 @@ void mfish_koi_base_FishMove(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { } add_calc0(&actor->_5EC, 0.5f, 0.01f); - actor->_5D0 = actor->_5E8 * sin_s(actor->_60C.y) * cos_s(actor->_60C.x); - actor->_5D8 = actor->_5E8 * cos_s(actor->_60C.y) * cos_s(actor->_60C.x); - add_calc(&actor->_5D4, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f); - add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D4); + actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y) * cos_s(actor->_60C.x); + actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y) * cos_s(actor->_60C.x); + add_calc(&actor->_5D0.y, MAX(ABS(actor->_5E8 * sin_s(actor->_60C.x)), 0.1f), 0.1f, 0.1f, 0.005f); + add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.1f, actor->_5D0.y); mfish_move_smooth(actor, game); mfish_get_flow_vec(&p, actor, game); - actor->_5A0.x += actor->_5D0 + actor->_5DC.x; - actor->_5A0.z += actor->_5D8 + actor->_5DC.z; + actor->_5A0.x += actor->_5D0.x + actor->_5DC.x; + actor->_5A0.z += actor->_5D0.z + actor->_5DC.z; actor->_5A0.y += actor->_5DC.y * 0.05f; actor->_5A0.y = MAX(110.f, MIN(60.f, actor->_5A0.y)); } @@ -419,7 +423,7 @@ void mfish_koi_base_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { // actor->_5AC.y = 0.0f; actor->_638 += DEG2SHORT_ANGLE(10); actor->_34(actor, gamex); - if (ABS(actor->_61C) < ABS(actor->_622) && ABS(actor->_622) > DEG2SHORT_ANGLE(2)) { + if (ABS(actor->_618.z) < ABS(actor->_622) && ABS(actor->_622) > DEG2SHORT_ANGLE(2)) { add_calc2(&actor->_5E8, MAX(0.2f, actor->_5E8), 0.2f, 0.5f); } add_calc_short_angle2(&actor->_60C.x, actor->_612.x, CALC_EASE(0.1f), DEG2SHORT_ANGLE(1.5f), @@ -477,10 +481,10 @@ BOOL mfish_koi_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint } else if (joint_num == 2) { int i; - i = joint1->y - (int)(actor->_61C * (GETREG(TAKREG, 0x47) * 0.1f + 2.0f)); + i = joint1->y - (int)(actor->_618.z * (GETREG(TAKREG, 0x47) * 0.1f + 2.0f)); joint1->y = MY_CLAMP(i, DEG2SHORT_ANGLE(-80), DEG2SHORT_ANGLE(80)); - i = joint1->x - (actor->_61C >> 3); + i = joint1->x - (actor->_618.z >> 3); joint1->x = MY_CLAMP(i, DEG2SHORT_ANGLE(-25), DEG2SHORT_ANGLE(25)); } @@ -500,7 +504,7 @@ void mfish_koi_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { Matrix_RotateY(actor->_60C.y, 1); Matrix_translate(0.0f, actor->init_data._04 * 0.25f, actor->init_data._24 * 1.5f, 1); Matrix_RotateY(actor->_60C.x, 1); - Matrix_RotateZ(MY_CLAMP(-(actor->_61C >> 2), DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20)), 1); + Matrix_RotateZ(MY_CLAMP(-(actor->_618.z >> 2), DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20)), 1); Matrix_translate(0.0f, -actor->init_data._04 * 0.25f, -actor->init_data._24 * 0.5f, 1); Matrix_scale(actor->init_data._00, actor->init_data._00, actor->init_data._00, 1); gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/actor/ac_museum_fish_kurage.c_inc b/src/actor/ac_museum_fish_kurage.c_inc index 4db0864f..294bbb0a 100644 --- a/src/actor/ac_museum_fish_kurage.c_inc +++ b/src/actor/ac_museum_fish_kurage.c_inc @@ -1,33 +1,217 @@ void mfish_kurage_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { - GAME_PLAY* game = (GAME_PLAY*)gamex; - return; + s16 s = qrand(); + actor->_5E8 = actor->init_data._10 + RANDOM_F(actor->init_data._14); + actor->_5F0 = actor->_5E8; + actor->_60C.y = s; + actor->_612.y = actor->_60C.y; + actor->_60C.x = DEG2SHORT_ANGLE2(RANDOM2_F(100.0f)); + actor->_612.x = actor->_60C.x; + actor->_5F4 = 0.05f; + actor->_5D0 = ZeroVec; + actor->_5AC = ZeroVec; + actor->_5AC.y = actor->_5E8; + actor->_638 = qrand(); + actor->_618 = ZeroSVec; + actor->_622 = 0; + actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E); + actor->_628 = actor->_626; + actor->_594 = NULL; + actor->_598 = NULL; + actor->_624 = 3; + mfish_kurage_normal_init(actor, gamex); } -void mfish_kurage_normal_init() { - return; +void mfish_kurage_normal_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { + actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E); + actor->_628 = actor->_626; + actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14); + actor->_34 = mfish_kurage_normal; } -void mfish_kurage_normal() { - return; +void mfish_kurage_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { + if (actor->_62E & 0x1e) { + mfish_kurage_turn_init(actor, gamex); + } else if (actor->_626 < 0) { + actor->_612.y = qrand(); + actor->_612.x = qrand(); + + if (actor->_612.x > 0) { + actor->_612.x = MIN(DEG2SHORT_ANGLE(120), actor->_612.x); + } else { + actor->_612.x = MAX(DEG2SHORT_ANGLE(-120), actor->_612.x); + } + + if (actor->_60C.x > DEG2SHORT_ANGLE(90) && actor->_612.x < (s16)(actor->_60C.x + DEG2SHORT_ANGLE(180))) { + //! BUG: should this be 179 degrees? + actor->_612.x = actor->_60C.x + (DEG2SHORT_ANGLE(180) - 1); + } else if (actor->_60C.x < DEG2SHORT_ANGLE(-90) && + actor->_612.x > (s16)(actor->_60C.x + DEG2SHORT_ANGLE(180))) { + actor->_612.x = actor->_60C.x - (DEG2SHORT_ANGLE(180) - 1); + } + actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E); + actor->_628 = actor->_626; + actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14); + } else if (actor->_5F8 > actor->init_data._08 * 10.0f) { + f32 v = RANDOM_F(0.5f) + 0.5f; + actor->_5F8 = 0.0f; + if (RANDOM_F(1.0f) < 0.5) { + actor->_612.y += DEG2SHORT_ANGLE(v * 90.f); + } else { + actor->_612.y -= DEG2SHORT_ANGLE(v * 90.f); + } + + if (actor->_612.x > 0) { + actor->_612.x = DEG2SHORT_ANGLE(90.0f + RANDOM2_F(60.0f)); + } else { + actor->_612.x = DEG2SHORT_ANGLE(-90.0f + RANDOM2_F(60.0f)); + } + + actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E); + actor->_626 >>= 1; + actor->_628 = actor->_626; + actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14); + } } -void mfish_kurage_turn_init() { - return; +void mfish_kurage_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { + //! BUG: cast needed to match? maybe i've been making assumptions about what these functions have taken as args + MUSEUM_FISH_PRIVATE_DATA* actor2 = (MUSEUM_FISH_PRIVATE_DATA*)actor; + if (actor->_60C.x * (s16)(actor2->_60C.y - actor2->_62C) > 0) { + actor->_612.y = actor->_62C + DEG2SHORT_ANGLE(135); + } else { + actor->_612.y = actor->_62C + DEG2SHORT_ANGLE(-135); + } + actor->_5F0 = actor->init_data._14 + actor->init_data._10; + actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E); + actor->_628 = actor->_626; + actor->_34 = mfish_kurage_turn; } -void mfish_kurage_turn() { - return; +void mfish_kurage_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { + if ((s16)(actor->_612.x - actor->_60C.x) == 0 && (s16)(actor->_612.y - actor->_60C.y) == 0) { + mfish_kurage_normal_init(actor, gamex); + } else if (actor->_626 < 0) { + actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E); + actor->_628 = actor->_626; + actor->_5F0 = actor->init_data._14 + actor->init_data._10; + } } void mfish_kurage_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { + f32 v; + xyz_t p; + f32 t; - GAME_PLAY* game = (GAME_PLAY*)gamex; - return; + actor->_34(actor, gamex); + actor->_5F4 = GETREG(TAKREG, 0x55) * 0.001f + 0.035f; + actor->_632 += actor->_63A; + actor->_63C += actor->_618.y; + if (actor->_62E & 0x20) { + add_calc_short_angle2(&actor->_618.y, DEG2SHORT_ANGLE(8), CALC_EASE(0.5f), DEG2SHORT_ANGLE(0.5f), + DEG2SHORT_ANGLE(0.05f)); + } else { + add_calc_short_angle2(&actor->_618.y, DEG2SHORT_ANGLE(2), CALC_EASE(0.5f), DEG2SHORT_ANGLE(0.5f), + DEG2SHORT_ANGLE(0.05f)); + } + actor->_622 = DEG2SHORT_ANGLE(actor->_5E8 * 12.0f + 0.2f + GETREG(TAKREG, 0x1a) * 0.1f); + if (actor->_626 > actor->_628 - 20) { + add_calc2(&actor->_5EC, 0.1f, 0.5f, 0.02f); + } + add_calc2(&actor->_5E8, actor->_5F0, 0.1f, actor->_5EC); + add_calc2(&actor->_5AC.y, actor->_5F0, 0.1f, 0.25f); + add_calc2(&actor->_5F0, 0.1f, 0.1f, 0.01f); + add_calc_short_angle2(&actor->_63A, (s16)DEG2SHORT_ANGLE2((GETREG(TAKREG, 0x56) + 13.0f) * 0.5f), CALC_EASE2(0.1f), + DEG2SHORT_ANGLE(0.25f), DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_60C.x, (s16)actor->_612.x, CALC_EASE2(GETREG(TAKREG, 0x18) * 0.01f + 0.1f), + (s16)(actor->_622 >> 1) >> 1, DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_60C.y, (s16)actor->_612.y, CALC_EASE2(GETREG(TAKREG, 0x18) * 0.01f + 0.1f), + (s16)(actor->_622 >> 1) >> 1, DEG2SHORT_ANGLE(0.25f)); + v = actor->_5E8 * sin_s(actor->_60C.x) * (sin_s(actor->_63A) * 0.1f + 0.9f); + actor->_5D0.x = sin_s(actor->_60C.y) * v; + actor->_5D0.z = cos_s(actor->_60C.y) * v; + actor->_5D0.y = actor->_5E8 * cos_s(actor->_60C.x) * (sin_s(actor->_63A) * 0.1f + 0.9f); + mfish_get_flow_vec(&p, actor, gamex); + + if (actor->_5FC < 120.f) { + add_calc2(&actor->_5DC.x, (120.f - actor->_5FC) * (GETREG(TAKREG, 0x3c) * 0.0001f + 0.01f), + GETREG(TAKREG, 0x3d) * 0.01f + 0.25f, GETREG(TAKREG, 0x3e) * 0.01f + 0.2f); + + } else if (actor->_600 < 120.f) { + add_calc2(&actor->_5DC.x, -(120.f - actor->_600) * (GETREG(TAKREG, 0x3c) * 0.0001f + 0.01f), + GETREG(TAKREG, 0x3d) * 0.01f + 0.25f, GETREG(TAKREG, 0x3e) * 0.01f + 0.2f); + } + + if (actor->_604 < 20.f) { + add_calc2(&actor->_5DC.z, (20.f - actor->_604) * (GETREG(TAKREG, 0x3c) * 0.0001f + 0.01f), + GETREG(TAKREG, 0x3d) * 0.01f + 0.25f, GETREG(TAKREG, 0x3e) * 0.01f + 0.2f); + + } else if (actor->_608 < 20.f) { + add_calc2(&actor->_5DC.z, -(20.f - actor->_608) * (GETREG(TAKREG, 0x3c) * 0.0001f + 0.01f), + GETREG(TAKREG, 0x3d) * 0.01f + 0.25f, GETREG(TAKREG, 0x3e) * 0.01f + 0.2f); + } + + if (actor->_5A0.y < (55.0f + actor->init_data._08) + 10.0f) { + t = (10.f - (actor->_5A0.y - (55.0f + actor->init_data._08))); + t *= (GETREG(TAKREG, 0x3C) * 0.0001f + 0.01f); + + add_calc2(&actor->_5DC.y, t, GETREG(TAKREG, 0x3D) * 0.01f + 0.25f, GETREG(TAKREG, 0x3E) * 0.01f + 0.2f); + } else if (actor->_5A0.y > (110.0f - actor->init_data._08) - 10.0f) { + t = -(10.f - ((110.0f - actor->init_data._08) - actor->_5A0.y)); + t *= (GETREG(TAKREG, 0x3C) * 0.0001f + 0.01f); + + add_calc2(&actor->_5DC.y, t, GETREG(TAKREG, 0x3D) * 0.01f + 0.25f, GETREG(TAKREG, 0x3E) * 0.01f + 0.2f); + } + + actor->_5A0.x += actor->_5D0.x + actor->_5DC.x; + actor->_5A0.y += actor->_5D0.y + actor->_5DC.y; + actor->_5A0.z += actor->_5D0.z + actor->_5DC.z; + + actor->_5B8 = actor->_5A0; + + Museum_Fish_BGCheck(actor, gamex); + if (actor->_5A0.y < 55.0f + actor->init_data._08) { + actor->_5A0.y = 55.0f + actor->init_data._08; + actor->_612.x = DEG2SHORT_ANGLE(-30); + } else if (actor->_5A0.y > 110.f - actor->init_data._08 - actor->_608 * 0.2f) { + actor->_5A0.y = 110.f - actor->init_data._08 - actor->_608 * 0.2f; + if (actor->_612.x > 0) { + actor->_612.x = DEG2SHORT_ANGLE(120); + } else { + actor->_612.x = DEG2SHORT_ANGLE(-120); + } + } + actor->_626--; } +extern Gfx act_mus_kurage_sakana_body_model[]; +extern Gfx act_mus_kurage_sakana_foot_model[]; + void mfish_kurage_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { + f32 a = (actor->_5E8 - 0.1f) * (-0.3f + GETREG(TAKREG, 0x1b) * 0.01f); + a += (actor->_5F4 * sin_s(actor->_632) + 1.0f); - GAME_PLAY* game = (GAME_PLAY*)gamex; - return; + OPEN_DISP(gamex->graph); + Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0); + Matrix_rotateXYZ(actor->_60C.x, actor->_60C.y, actor->_60C.z, 1); + Matrix_scale(actor->init_data._00 * a, actor->init_data._00 * (1.0f / SQ(a)), actor->init_data._00 * a, 1); + Matrix_push(); + + Matrix_RotateY(actor->_63C, 1); + Matrix_scale((GETREG(TAKREG, 0x4b) * 0.01f + 0.1f) * sin_s(actor->_63C) + 1.0f, 1.0f, + (GETREG(TAKREG, 0x4b) * 0.01f + 0.1f) * cos_s(actor->_63C) + 1.0f, 1); + Matrix_RotateY(-actor->_63C, 1); + gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(NEXT_POLY_XLU_DISP, act_mus_kurage_sakana_body_model); + + Matrix_pull(); + + Matrix_RotateY(actor->_63C, 1); + Matrix_scale((GETREG(TAKREG, 0x4b) * 0.01f + 0.1f) * sin_s(actor->_63C) + 1.0f, 1.0f, + (GETREG(TAKREG, 0x4b) * 0.01f + 0.1f) * cos_s(actor->_63C) + 1.0f, 1); + Matrix_RotateY(-actor->_63C, 1); + gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(gamex->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(NEXT_POLY_XLU_DISP, act_mus_kurage_sakana_foot_model); + + CLOSE_DISP(gamex->graph); } diff --git a/src/actor/ac_museum_fish_seafish.c_inc b/src/actor/ac_museum_fish_seafish.c_inc index 8dd55eae..8e81d40c 100644 --- a/src/actor/ac_museum_fish_seafish.c_inc +++ b/src/actor/ac_museum_fish_seafish.c_inc @@ -7,7 +7,7 @@ void mfish_seafish_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { actor->_60C.y = s; actor->_612.y = actor->_60C.y; actor->_5F4 = 0.0f; - actor->_5D4 = 0.0f; + actor->_5D0.y = 0.0f; actor->_5AC = ZeroVec; actor->_638 = qrand(); actor->_622 = 0; @@ -39,7 +39,7 @@ void mfish_seafish_normal(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.5f), (s16)(s >> 1) >> 1, (s16)DEG2SHORT_ANGLE(0.25f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.3f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f)); if (actor->_598 != NULL) { o_5a0_z = actor->_598->_5A0.z; o_5a0_y = actor->_598->_5A0.y; @@ -167,7 +167,8 @@ void mfish_seafish_turn_init(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { void mfish_seafish_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(GETREG(TAKREG, 0x17) * 0.01f + 0.25f), DEG2SHORT_ANGLE(3.75f), DEG2SHORT_ANGLE(0.125f)); - add_calc_short_angle2(&actor->_61C, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.25f), DEG2SHORT_ANGLE(0.25f)); + add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(1.25f), + DEG2SHORT_ANGLE(0.25f)); if (ABS(actor->_622) < DEG2SHORT_ANGLE(3)) { mfish_seafish_normal_init(actor, game); } @@ -176,8 +177,8 @@ void mfish_seafish_turn(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game) { void mfish_seafish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { xyz_t p; actor->_34(actor, gamex); - actor->_618 += DEG2SHORT_ANGLE(actor->_5E8 * RANDOM_F(3.0f)); - actor->_5F4 = sin_s(actor->_618) * 5.0f; + actor->_618.x += DEG2SHORT_ANGLE(actor->_5E8 * RANDOM_F(3.0f)); + actor->_5F4 = sin_s(actor->_618.x) * 5.0f; if (actor->_62E & 0x20) { add_calc2(&actor->_5A0.y, actor->_5F4 + actor->init_data._0C, 0.02f, 0.05f); } else { @@ -185,7 +186,7 @@ void mfish_seafish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { } add_calc0(&actor->_5F8, 0.2f, 0.05f); actor->_5F8 = MIN(1.0f, actor->_5F8); - if (ABS(actor->_61C) > DEG2SHORT_ANGLE(15) && ABS(actor->_622) - ABS(actor->_61C) < 0) { + if (ABS(actor->_618.z) > DEG2SHORT_ANGLE(15) && ABS(actor->_622) - ABS(actor->_618.z) < 0) { add_calc2(&actor->_5E8, MAX(actor->_5F0, 0.8f), 0.5f, 0.25f); } else if (actor->_626 < actor->_628 - 80) { add_calc2(&actor->_5E8, actor->_5EC, 1.0f - actor->init_data._18, 0.0025f); @@ -196,11 +197,11 @@ void mfish_seafish_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) { } actor->_38._00.frame_control.speed = (GETREG(TAKREG, 0x14) * 0.01f + 0.5f) * 0.5f + (GETREG(TAKREG, 0x15) * 0.01f + 1.2f) * actor->_5E8; - actor->_5D0 = actor->_5E8 * sin_s(actor->_60C.y); - actor->_5D8 = actor->_5E8 * cos_s(actor->_60C.y); + actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y); + actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y); mfish_get_flow_vec(&p, actor, gamex); - actor->_5A0.x += actor->_5D0 + p.x; - actor->_5A0.z += actor->_5D8 + p.z; + actor->_5A0.x += actor->_5D0.x + p.x; + actor->_5A0.z += actor->_5D0.z + p.z; mfish_onefish_mv(actor, gamex); mfish_body_wind_anime_play(actor, gamex); Museum_Fish_BGCheck(actor, gamex); @@ -214,12 +215,12 @@ BOOL mfish_seafish_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int j void* arg, s_xyz* joint1, xyz_t* trans) { MUSEUM_FISH_PRIVATE_DATA* actor = (MUSEUM_FISH_PRIVATE_DATA*)arg; if (joint_num == 1) { - int s = joint1->x + (int)(actor->_61C * (GETREG(TAKREG, 0x37) * 0.01f + 0.5f)); + int s = joint1->x + (int)(actor->_618.z * (GETREG(TAKREG, 0x37) * 0.01f + 0.5f)); joint1->x = MIN(MAX(s, DEG2SHORT_ANGLE(-15)), DEG2SHORT_ANGLE(15)); Matrix_scale(1.0f, (GETREG(TAKREG, 0x36) * 0.001f + 0.035f) * sin_s(actor->_63A + actor->_63C) + 1.0f, (GETREG(TAKREG, 0x36) * 0.001f + 0.035f) * sin_s(actor->_63A) + 1.0f, 1); } else if (joint_num == 2) { - int v = joint1->y - (actor->_61C << 1); + int v = joint1->y - (actor->_618.z << 1); joint1->y = MIN(MAX(v, DEG2SHORT_ANGLE(-80)), DEG2SHORT_ANGLE(80)); Matrix_scale(1.0f, sin_s(actor->_63A + DEG2SHORT_ANGLE(270)) * 0.07f + 1.0f, sin_s(actor->_63A + DEG2SHORT_ANGLE(90)) * 0.07f + 1.0f, 1);