From 8418ca564f89627680fa8af87f48cd5087a74e79 Mon Sep 17 00:00:00 2001 From: Norgesnerd <5824576+Norgesnerd@users.noreply.github.com> Date: Sun, 15 Jun 2025 17:01:19 +0200 Subject: [PATCH] Implement & link ef_taberu --- configure.py | 2 +- src/effect/ef_taberu.c | 54 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/configure.py b/configure.py index e9150700..141930ab 100644 --- a/configure.py +++ b/configure.py @@ -1334,7 +1334,7 @@ config.libs = [ Object(NonMatching, "effect/ef_swing_axe.c"), Object(NonMatching, "effect/ef_swing_net.c"), Object(NonMatching, "effect/ef_swing_rod.c"), - Object(NonMatching, "effect/ef_taberu.c"), + Object(Matching, "effect/ef_taberu.c"), Object(Matching, "effect/ef_takurami.c"), Object(Matching, "effect/ef_takurami_kira.c"), Object(Matching, "effect/ef_tamaire.c"), diff --git a/src/effect/ef_taberu.c b/src/effect/ef_taberu.c index d579e518..b37a1b26 100644 --- a/src/effect/ef_taberu.c +++ b/src/effect/ef_taberu.c @@ -1,10 +1,24 @@ #include "ef_effect_control.h" +#include "m_common_data.h" + static void eTaberu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1); static void eTaberu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg); static void eTaberu_mv(eEC_Effect_c* effect, GAME* game); static void eTaberu_dw(eEC_Effect_c* effect, GAME* game); +extern Gfx ef_taberu01_00_modelT[]; +extern Gfx ef_taberu01_01_modelT[]; +extern Gfx ef_taberu01_02_modelT[]; +extern Gfx ef_taberu01_03_modelT[]; + +static Gfx* eTaberu_model_table[] = { + ef_taberu01_00_modelT, + ef_taberu01_01_modelT, + ef_taberu01_02_modelT, + ef_taberu01_03_modelT, +}; + eEC_PROFILE_c iam_ef_taberu = { // clang-format off &eTaberu_init, @@ -18,17 +32,49 @@ eEC_PROFILE_c iam_ef_taberu = { }; static void eTaberu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) { - // TODO + xyz_t ofs; + + ofs.x = 0.0f; + ofs.y = 0.0f; + ofs.z = 0.0f; + + eEC_CLIP->make_effect_proc(eEC_EFFECT_TABERU, pos, &ofs, game, &angle, item_name, prio, 0, 0); } static void eTaberu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + s16 angle = *(s16*)ct_arg; + + if (effect->item_name == SP_NPC_ARTIST) { + effect->position.x += sin_s(angle) * 15.0f; + effect->position.y += -15.0f; + effect->position.z += cos_s(angle) * 15.0f; + } else { + effect->position.x += sin_s(angle) * 13.0f; + effect->position.y += -10.0f; + effect->position.z += cos_s(angle) * 13.0f; + } + + effect->scale.x = 0.0045f; + effect->scale.y = 0.0045f; + effect->scale.z = 0.0045f; + + effect->effect_specific[0] = 0; + + effect->timer = 44; } static void eTaberu_mv(eEC_Effect_c* effect, GAME* game) { - // TODO + effect->effect_specific[0] += 1; } static void eTaberu_dw(eEC_Effect_c* effect, GAME* game) { - // TODO + s16 idx = ((u16)effect->effect_specific[0] >> 2) & 3; + + OPEN_DISP(game->graph); + + eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, &effect->scale, &effect->offset); + + gSPDisplayList(NEXT_POLY_XLU_DISP, eTaberu_model_table[idx]); + + CLOSE_DISP(game->graph); }