From 20de35ba4ba61104a42ec990794fb65078e0cf87 Mon Sep 17 00:00:00 2001 From: Norgesnerd <5824576+Norgesnerd@users.noreply.github.com> Date: Sat, 17 May 2025 02:53:04 +0200 Subject: [PATCH] Implement & link ef_hirameki_hikari --- configure.py | 2 +- src/effect/ef_hirameki_hikari.c | 41 +++++++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/configure.py b/configure.py index dcf6bb4d..0dbed869 100644 --- a/configure.py +++ b/configure.py @@ -1269,7 +1269,7 @@ config.libs = [ Object(NonMatching, "effect/ef_hanabira.c"), Object(Matching, "effect/ef_hanatiri.c"), Object(NonMatching, "effect/ef_hirameki_den.c"), - Object(NonMatching, "effect/ef_hirameki_hikari.c"), + Object(Matching, "effect/ef_hirameki_hikari.c"), Object(Matching, "effect/ef_ikigire.c"), Object(Matching, "effect/ef_impact_star.c"), Object(NonMatching, "effect/ef_kagu_happa.c"), diff --git a/src/effect/ef_hirameki_hikari.c b/src/effect/ef_hirameki_hikari.c index 167af0a6..6fab7655 100644 --- a/src/effect/ef_hirameki_hikari.c +++ b/src/effect/ef_hirameki_hikari.c @@ -1,5 +1,9 @@ #include "ef_effect_control.h" +#include "m_common_data.h" + +extern Gfx ef_hirameki01_hikari_modelT[]; + static void eHiramekiH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1); static void eHiramekiH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg); static void eHiramekiH_mv(eEC_Effect_c* effect, GAME* game); @@ -18,17 +22,46 @@ eEC_PROFILE_c iam_ef_hirameki_hikari = { }; static void eHiramekiH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) { - // TODO + pos.y += 24.0f; + eEC_CLIP->make_effect_proc(eEC_EFFECT_HIRAMEKI_HIKARI, pos, NULL, game, NULL, item_name, prio, 0, 0); } static void eHiramekiH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + effect->timer = 12; + effect->offset.x = effect->offset.y = effect->offset.z = 0.0f; } static void eHiramekiH_mv(eEC_Effect_c* effect, GAME* game) { - // TODO + return; } static void eHiramekiH_dw(eEC_Effect_c* effect, GAME* game) { - // TODO + u8 alpha; + s16 timer = 12 - effect->timer; + xyz_t* pos = &effect->position; + xyz_t* offset = &effect->offset; + xyz_t* scale = &effect->scale; + + scale->z = scale->y = scale->x = eEC_CLIP->calc_adjust_proc(timer, 0, 12, 0.014f, 0.0175f); + + switch (timer) { + case 0: + case 1: + case 2: + case 3: + alpha = timer * 50; + break; + + default: + alpha = (s8)eEC_CLIP->calc_adjust_proc(timer, 4, 12, 255.0f, 0.0f); + break; + } + + OPEN_DISP(game->graph); + + eEC_CLIP->auto_matrix_xlu_offset_proc(game, pos, scale, offset); + gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 255, 100, alpha); + gSPDisplayList(NEXT_POLY_XLU_DISP, ef_hirameki01_hikari_modelT); + + CLOSE_DISP(game->graph); }