From 4835f39db751fecb2ccb4faf4a9806713f199269 Mon Sep 17 00:00:00 2001 From: Norgesnerd <5824576+Norgesnerd@users.noreply.github.com> Date: Fri, 23 May 2025 02:19:56 +0200 Subject: [PATCH] Implement & link ef_naku --- configure.py | 2 +- src/effect/ef_naku.c | 33 +++++++++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/configure.py b/configure.py index e42570d0..3955dc84 100644 --- a/configure.py +++ b/configure.py @@ -1296,7 +1296,7 @@ config.libs = [ Object(NonMatching, "effect/ef_mizutama.c"), Object(NonMatching, "effect/ef_motiyuge.c"), Object(NonMatching, "effect/ef_muka.c"), - Object(NonMatching, "effect/ef_naku.c"), + Object(Matching, "effect/ef_naku.c"), Object(NonMatching, "effect/ef_namida.c"), Object(NonMatching, "effect/ef_neboke.c"), Object(NonMatching, "effect/ef_neboke_akubi.c"), diff --git a/src/effect/ef_naku.c b/src/effect/ef_naku.c index 50e3d831..76b4edc7 100644 --- a/src/effect/ef_naku.c +++ b/src/effect/ef_naku.c @@ -1,5 +1,7 @@ #include "ef_effect_control.h" +#include "m_common_data.h" + static void eNaku_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1); static void eNaku_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg); static void eNaku_mv(eEC_Effect_c* effect, GAME* game); @@ -18,17 +20,40 @@ eEC_PROFILE_c iam_ef_naku = { }; static void eNaku_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) { - // TODO + xyz_t base_ofs = { 0.0f, 0.0f, -6.0f }; + s16 _angle = angle; + + sMath_RotateY(&base_ofs, SHORT2RAD_ANGLE2(_angle)); + pos.x += base_ofs.x; + pos.y += base_ofs.y; + pos.z += base_ofs.z; + eEC_CLIP->make_effect_proc(eEC_EFFECT_NAKU, pos, NULL, game, &_angle, item_name, prio, 0, 0); } static void eNaku_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + effect->effect_specific[0] = *(s16*)ct_arg; + effect->effect_specific[1] = 0; + effect->timer = 32; } static void eNaku_mv(eEC_Effect_c* effect, GAME* game) { - // TODO + s32 prio; + u16 item_name; + GAME_PLAY* play = (GAME_PLAY*)game; + + item_name = effect->item_name; + prio = effect->prio; + eEC_CLIP->set_continious_env_proc(effect, 32, 18); + + if ((effect->timer & 1) && (eEC_CLIP != NULL)) { + eEC_CLIP->effect_make_proc(eEC_EFFECT_NAMIDA, effect->position, prio, effect->effect_specific[0], &play->game, + item_name, effect->effect_specific[1] & 1, 0); + effect->effect_specific[1]++; + } + + sAdo_OngenPos((u32)effect, 0x2E, &effect->position); } static void eNaku_dw(eEC_Effect_c* effect, GAME* game) { - // TODO + return; }