Skip to content

Commit

Permalink
Implement & link ef_kasamizutama
Browse files Browse the repository at this point in the history
  • Loading branch information
Reaperoe committed Dec 25, 2024
1 parent b732556 commit 9cac166
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ def MatchingFor(*versions):
Object(NonMatching, "effect/ef_kangaeru.c"),
Object(NonMatching, "effect/ef_kantanhu.c"),
Object(Matching, "effect/ef_kasamizu.c"),
Object(NonMatching, "effect/ef_kasamizutama.c"),
Object(Matching, "effect/ef_kasamizutama.c"),
Object(NonMatching, "effect/ef_kaze.c"),
Object(NonMatching, "effect/ef_kaze_happa.c"),
Object(NonMatching, "effect/ef_kigae.c"),
Expand Down
44 changes: 40 additions & 4 deletions src/effect/ef_kasamizutama.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#include "ef_effect_control.h"

#include "m_common_data.h"
#include "sys_matrix.h"
#include "m_rcp.h"


static f32 eKasamizutama_scale_table;
extern Gfx ef_koke_suiteki01_0_int_i4[];
extern Gfx ef_koke_suiteki01_00_modelT[];

static void eKasamizutama_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKasamizutama_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKasamizutama_mv(eEC_Effect_c* effect, GAME* game);
Expand All @@ -18,17 +27,44 @@ eEC_PROFILE_c iam_ef_kasamizutama = {
};

static void eKasamizutama_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_KASAMIZUTAMA, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}

static void eKasamizutama_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
s16 angle = *(s16*)ct_arg;
s16 rand = qrand();
s16 rand_angle = DEG2SHORT_ANGLE2(45.0f) + DEG2SHORT_ANGLE2(RANDOM_F(45.0f));
xyz_t pos;
f32 sin = 2.5f * sin_s(rand_angle);

Matrix_RotateY(angle, 0);
Matrix_RotateX(-0x2000, 1);

pos.x = (sin) * sin_s(rand);
pos.y = 2.5f * cos_s(rand_angle);
pos.z = (sin) * cos_s(rand);

Matrix_Position(&pos, &effect->velocity);

effect->acceleration = ZeroVec;
effect->acceleration.y = -0.105f;
effect->timer = 20;
}

static void eKasamizutama_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
}

static void eKasamizutama_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
effect->scale.x = effect->scale.y = effect->scale.z = *(f32*)(&eKasamizutama_scale_table + (s16) ((s16)(20 - effect->timer) >> 1)) * 0.005f;
_texture_z_light_fog_prim_xlu(game->graph);

OPEN_DISP(game->graph);

eEC_CLIP->auto_matrix_xlu_proc(game, &effect->position, &effect->scale);
gSPSegment(NEXT_POLY_XLU_DISP, 8, ef_koke_suiteki01_0_int_i4);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_koke_suiteki01_00_modelT);

CLOSE_DISP(game->graph);
}

0 comments on commit 9cac166

Please sign in to comment.