From 7d3202747ebff1029595e82a6c917ecf834947ac Mon Sep 17 00:00:00 2001 From: Cuyler36 Date: Mon, 16 Jun 2025 06:27:54 -0400 Subject: [PATCH] Implement & link ef_motiyuge --- configure.py | 2 +- src/effect/ef_motiyuge.c | 60 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/configure.py b/configure.py index 56e4f762..895f90e3 100644 --- a/configure.py +++ b/configure.py @@ -1294,7 +1294,7 @@ config.libs = [ Object(Matching, "effect/ef_lovelove_heart.c"), Object(Matching, "effect/ef_make_hem.c"), Object(Matching, "effect/ef_mizutama.c"), - Object(NonMatching, "effect/ef_motiyuge.c"), + Object(Matching, "effect/ef_motiyuge.c"), Object(Matching, "effect/ef_muka.c"), Object(Matching, "effect/ef_naku.c"), Object(Matching, "effect/ef_namida.c"), diff --git a/src/effect/ef_motiyuge.c b/src/effect/ef_motiyuge.c index 1db5de11..2dace510 100644 --- a/src/effect/ef_motiyuge.c +++ b/src/effect/ef_motiyuge.c @@ -1,5 +1,17 @@ #include "ef_effect_control.h" +#include "m_common_data.h" +#include "m_rcp.h" +#include "sys_matrix.h" + +extern u8 ef_mitiyuge01_0_int_i4[]; +extern u8 ef_motiyuge01_1_int_i4[]; +extern u8 ef_motiyuge01_2_int_i4[]; + +static u8* eMotiyuge_yuge_texture_table[] = { + ef_mitiyuge01_0_int_i4, ef_motiyuge01_1_int_i4, ef_motiyuge01_2_int_i4, +}; + static void eMotiyuge_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1); static void eMotiyuge_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg); static void eMotiyuge_mv(eEC_Effect_c* effect, GAME* game); @@ -18,17 +30,57 @@ eEC_PROFILE_c iam_ef_motiyuge = { }; static void eMotiyuge_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) { - // TODO + eEC_CLIP->make_effect_proc(eEC_EFFECT_MOTIYUGE, pos, NULL, game, NULL, item_name, prio, arg0, arg1); } static void eMotiyuge_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + effect->effect_specific[0] = DEG2SHORT_ANGLE2(RANDOM2_F(40.0f)); + effect->effect_specific[1] = 0; + effect->scale.x = 0.0006f; + effect->scale.y = 0.0006f; + effect->scale.z = 0.0006f; + effect->timer = 30; } static void eMotiyuge_mv(eEC_Effect_c* effect, GAME* game) { - // TODO + GAME_PLAY* play = (GAME_PLAY*)game; + + if (effect->timer >= 24) { + effect->scale.x = eEC_CLIP->calc_adjust_proc(effect->timer, 24, 30, 0.003f, 0.0006f); + effect->scale.y = eEC_CLIP->calc_adjust_proc(effect->timer, 24, 30, 0.009000001f, 0.0006f); + } else { + effect->scale.x = eEC_CLIP->calc_adjust_proc(effect->timer, 0, 24, 0.0045000003, 0.003f); + effect->scale.y = eEC_CLIP->calc_adjust_proc(effect->timer, 0, 24, 0.0045000003f, 0.009000001f); + } + + if ((play->game_frame & 3) == 0) { + if (effect->effect_specific[1] >= 2) { + effect->effect_specific[1] = 0; + } else { + effect->effect_specific[1]++; + } + } } +extern Gfx ef_motiyuge01_00_modelT[]; + static void eMotiyuge_dw(eEC_Effect_c* effect, GAME* game) { - // TODO + GAME_PLAY* play = (GAME_PLAY*)game; + u8* tex_p = eMotiyuge_yuge_texture_table[effect->effect_specific[1]]; + u8 a = (int)eEC_CLIP->calc_adjust_proc(effect->timer, 0, 16, 0.0f, 100.0f); + + OPEN_DISP(game->graph); + + _texture_z_light_fog_prim_xlu(game->graph); + Matrix_translate(effect->position.x, effect->position.y, effect->position.z, 0); + Matrix_mult(&play->billboard_matrix, 1); + Matrix_RotateZ(effect->effect_specific[0], 1); + Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, 1); + + gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPSegment(NEXT_POLY_XLU_DISP, ANIME_1_TXT_SEG, tex_p); + gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 255, 255, a); + gSPDisplayList(NEXT_POLY_XLU_DISP, ef_motiyuge01_00_modelT); + + CLOSE_DISP(game->graph); }