mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-06-01 01:08:51 -04:00
match fish_donko
This commit is contained in:
@@ -375,7 +375,7 @@ void mfish_dojou_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game);
|
||||
|
||||
void mfish_donko_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game);
|
||||
void mfish_donko_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game);
|
||||
void mfish_donko_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_num, Gfx** joint_m, u8* joint_f,
|
||||
BOOL mfish_donko_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_num, Gfx** joint_m, u8* joint_f,
|
||||
void* arg, s_xyz* joint1, xyz_t* trans);
|
||||
void mfish_donko_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* game);
|
||||
|
||||
|
||||
@@ -1,23 +1,130 @@
|
||||
|
||||
void mfish_donko_ct(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
GAME_PLAY* game = (GAME_PLAY*)gamex;
|
||||
return;
|
||||
//! BUG: ?
|
||||
qrand();
|
||||
mfish_onefish_ct(actor, gamex);
|
||||
actor->_5A0.x = GETREG(TAKREG, 0x32) + 450.f;
|
||||
actor->_5A0.y = GETREG(TAKREG, 0x33) + 60.f;
|
||||
actor->_5A0.z = GETREG(TAKREG, 0x34) + 180.f;
|
||||
actor->_5E8 = 0.0f;
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_5F0 = actor->_5E8;
|
||||
actor->_60C.y = DEG2SHORT_ANGLE(-90);
|
||||
actor->_612.y = actor->_60C.y;
|
||||
actor->_5F4 = 0.0f;
|
||||
actor->_5D0.y = 0.0f;
|
||||
actor->_5AC = ZeroVec;
|
||||
actor->_622 = 0;
|
||||
actor->_624 = 0;
|
||||
actor->_63A = qrand();
|
||||
actor->_63C = qrand();
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
}
|
||||
|
||||
void mfish_donko_mv(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
xyz_t p;
|
||||
f32 x, z;
|
||||
mfish_onefish_mv(actor, gamex);
|
||||
mfish_body_wind_anime_play(actor, gamex);
|
||||
|
||||
GAME_PLAY* game = (GAME_PLAY*)gamex;
|
||||
return;
|
||||
if (actor->_626 > actor->_628 - 10) {
|
||||
actor->_38._00.frame_control.speed = (actor->_5E8 * 3.0f + 1.0f) * 0.5f;
|
||||
} else {
|
||||
add_calc2(&actor->_38._00.frame_control.speed, actor->_5E8 * 2.0f + 0.125f, 0.2f, 0.1f);
|
||||
}
|
||||
|
||||
actor->_5AC.y = 0.0f;
|
||||
actor->_5D0.x = actor->_5E8 * sin_s(actor->_60C.y);
|
||||
actor->_5D0.z = actor->_5E8 * cos_s(actor->_60C.y);
|
||||
x = (actor->_5A0.x - (suisou_pos[actor->_630].x + 22.5f));
|
||||
z = (actor->_5A0.z - (suisou_pos[actor->_630].z - 31.25f));
|
||||
actor->_5D0.x -= x * 0.002f;
|
||||
actor->_5D0.z -= z * 0.002f;
|
||||
|
||||
actor->_5D0.y -= 0.05f;
|
||||
actor->_5D0.y *= 0.95f;
|
||||
mfish_get_flow_vec(&p, actor, gamex);
|
||||
mfish_move_smooth(actor, gamex);
|
||||
actor->_5A0.x += actor->_5D0.x + actor->_5DC.x * 0.1f;
|
||||
actor->_5A0.z += actor->_5D0.z + actor->_5DC.z * 0.1f;
|
||||
actor->_5A0.y += actor->_5D0.y;
|
||||
actor->_622 = add_calc_short_angle2(&actor->_60C.y, actor->_612.y, CALC_EASE2(0.25f), DEG2SHORT_ANGLE(3.75f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_618.z, actor->_622, CALC_EASE2(0.2f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.25f));
|
||||
add_calc_short_angle2(&actor->_60C.x, actor->_612.x >> 1, CALC_EASE2(0.25f), DEG2SHORT_ANGLE(3.75f),
|
||||
DEG2SHORT_ANGLE(0.25f));
|
||||
|
||||
if (actor->_626-- < 0) {
|
||||
s16 s = RANDOM_F(actor->init_data._30);
|
||||
if (actor->_62E & 0x1e) {
|
||||
if ((s16)(actor->_60C.y - actor->_62C) > 0) {
|
||||
actor->_612.y = actor->_60C.y + s;
|
||||
} else {
|
||||
actor->_612.y = actor->_60C.y - s;
|
||||
}
|
||||
} else {
|
||||
if (RANDOM_F(1.0f) > 0.5f) {
|
||||
actor->_612.y = actor->_60C.y + s;
|
||||
} else {
|
||||
actor->_612.y = actor->_60C.y - s;
|
||||
}
|
||||
}
|
||||
actor->_5F0 = actor->init_data._10 + RANDOM_F(actor->init_data._14);
|
||||
actor->_626 = actor->init_data._2C + (s16)RANDOM_F(actor->init_data._2E);
|
||||
actor->_628 = actor->_626;
|
||||
} else if (actor->_626 > actor->_628 - 20) {
|
||||
add_calc2(&actor->_5E8, actor->_5F0, 0.1f, 0.025f);
|
||||
} else {
|
||||
actor->_5E8 *= actor->init_data._18;
|
||||
}
|
||||
|
||||
if (actor->_62E & 0x1e && actor->_5E8 > 0.05f) {
|
||||
s16 s = actor->_62C;
|
||||
if ((s16)(actor->_612.y - actor->_62C) > DEG2SHORT_ANGLE(-1) &&
|
||||
ABS((s16)(actor->_612.y - actor->_62C)) < DEG2SHORT_ANGLE(95)) {
|
||||
s += DEG2SHORT_ANGLE(90);
|
||||
} else {
|
||||
s -= DEG2SHORT_ANGLE(90);
|
||||
}
|
||||
|
||||
add_calc_short_angle2(&actor->_612.y, s, CALC_EASE(0.2f), DEG2SHORT_ANGLE(2.5f), DEG2SHORT_ANGLE(0.5f));
|
||||
}
|
||||
|
||||
Museum_Fish_DonkoBGCheck(actor, gamex);
|
||||
}
|
||||
|
||||
void mfish_donko_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_num, Gfx** joint_m, u8* joint_f,
|
||||
BOOL mfish_donko_before_disp(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_num, Gfx** joint_m, u8* joint_f,
|
||||
void* arg, s_xyz* joint1, xyz_t* trans) {
|
||||
// NOT BAD
|
||||
return;
|
||||
MUSEUM_FISH_PRIVATE_DATA* actor = (MUSEUM_FISH_PRIVATE_DATA*)arg;
|
||||
if (joint_num == 1) {
|
||||
int i = joint1->x + (actor->_618.z >> 1);
|
||||
joint1->x = MY_CLAMP(i, DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20));
|
||||
} else if (joint_num == 2) {
|
||||
int i = joint1->y - (actor->_618.z << 1);
|
||||
joint1->y = MY_CLAMP(i, DEG2SHORT_ANGLE(-60), DEG2SHORT_ANGLE(60));
|
||||
i = joint1->x - (actor->_618.z >> 1);
|
||||
joint1->x = MY_CLAMP(i, DEG2SHORT_ANGLE(-20), DEG2SHORT_ANGLE(20));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void mfish_donko_dw(MUSEUM_FISH_PRIVATE_DATA* actor, GAME* gamex) {
|
||||
|
||||
GAME_PLAY* game = (GAME_PLAY*)gamex;
|
||||
return;
|
||||
YET_SKELETON* skele = &actor->_38;
|
||||
Mtx* mtxp;
|
||||
if (gamex->frame_counter & 1) {
|
||||
mtxp = &skele->_70;
|
||||
} else {
|
||||
mtxp = &skele->_2b0;
|
||||
}
|
||||
OPEN_DISP(gamex->graph);
|
||||
Matrix_translate(actor->_5A0.x, actor->_5A0.y, actor->_5A0.z, 0);
|
||||
Matrix_RotateY(actor->_60C.y, 1);
|
||||
Matrix_translate(0.0f, 0.0f, actor->init_data._24 * 1.5f, 1);
|
||||
Matrix_RotateX(actor->_60C.x, 1);
|
||||
Matrix_translate(0.0f, 0.0f, -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);
|
||||
cKF_Si3_draw_R_SV(gamex, &skele->_00, mtxp, mfish_sfish_before_disp, NULL, actor);
|
||||
CLOSE_DISP(gamex->graph);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user