Implement & link ef_kantanhu

This commit is contained in:
Norgesnerd
2025-05-31 15:25:07 +02:00
parent be40d11f7a
commit 604f4d696d
2 changed files with 71 additions and 7 deletions
+1 -1
View File
@@ -1275,7 +1275,7 @@ config.libs = [
Object(NonMatching, "effect/ef_kagu_happa.c"),
Object(NonMatching, "effect/ef_kamifubuki.c"),
Object(Matching, "effect/ef_kangaeru.c"),
Object(NonMatching, "effect/ef_kantanhu.c"),
Object(Matching, "effect/ef_kantanhu.c"),
Object(Matching, "effect/ef_kasamizu.c"),
Object(Matching, "effect/ef_kasamizutama.c"),
Object(NonMatching, "effect/ef_kaze.c"),
+70 -6
View File
@@ -1,12 +1,18 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
static void eKT_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKT_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKT_mv(eEC_Effect_c* effect, GAME* game);
static void eKT_dw(eEC_Effect_c* effect, GAME* game);
extern Gfx ef_kantanhu01_00_modelT[];
// clang-format off
eEC_PROFILE_c iam_ef_kantanhu = {
// clang-format off
&eKT_init,
&eKT_ct,
&eKT_mv,
@@ -14,21 +20,79 @@ eEC_PROFILE_c iam_ef_kantanhu = {
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
f32 eKT_scale_data[][2] = {
{ 0.5f, 0.5f },
{ 0.5f, 1.2f },
{ 0.5f, 2.0f },
{ 1.2f, 1.4f },
{ 2.0f, 0.7f },
{ 1.5f, 0.8f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f },
{ 1.0f, 1.0f }
};
// clang-format on
static void eKT_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
xyz_t vec = { 0.0f, 15.0f, -3.0f };
sMath_RotateY(&vec, SHORT2RAD_ANGLE2(angle));
pos.x += vec.x;
pos.y += vec.y;
pos.z += vec.z;
eEC_CLIP->make_effect_proc(eEC_EFFECT_KANTANHU, pos, NULL, game, NULL, item_name, prio, 0, 0);
}
static void eKT_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
effect->timer = 72;
sAdo_OngenTrgStart(0x14b, &effect->position);
}
static void eKT_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
return;
}
static void eKT_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
s16 frame_index;
s16 timer = 72 - effect->timer;
u16 alpha = (u8)eEC_CLIP->calc_adjust_proc(timer, 64, 72, 255.0f, 0.0f);
if (timer > 50) {
timer = 50;
}
frame_index = timer >> 1;
effect->scale.x = eKT_scale_data[frame_index][0] * 0.008f;
effect->scale.y = eKT_scale_data[frame_index][1] * 0.008f;
effect->scale.z = 0.008f;
OPEN_DISP(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, &effect->scale, &effect->offset);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 128, 255, 255, 255, alpha);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_kantanhu01_00_modelT);
CLOSE_DISP(game->graph);
}