This commit is contained in:
ThePlayerRolo
2025-06-05 13:31:20 -04:00
parent d621a4f2d4
commit 6fc82634e5
3 changed files with 92 additions and 6 deletions
+1 -1
View File
@@ -1338,7 +1338,7 @@ config.libs = [
Object(NonMatching, "effect/ef_takurami.c"),
Object(NonMatching, "effect/ef_takurami_kira.c"),
Object(NonMatching, "effect/ef_tamaire.c"),
Object(NonMatching, "effect/ef_tape.c"),
Object(Matching, "effect/ef_tape.c"),
Object(Matching, "effect/ef_tent_lamp.c"),
Object(NonMatching, "effect/ef_tumble.c"),
Object(NonMatching, "effect/ef_tumble_bodyprint.c"),
+76 -4
View File
@@ -1,4 +1,9 @@
#include "ef_effect_control.h"
#include "graph.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
#include "m_debug.h"
static void eTape_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eTape_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
@@ -16,19 +21,86 @@ eEC_PROFILE_c iam_ef_tape = {
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
extern Gfx ef_tape01_01_model[];
static void eTape_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_TAPE, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eTape_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
s16 temp;
f32 dVar2;
f32 fVar3;
xyz_t local_28;
f32 local_24;
f32 local_20;
temp = *(s16*)ct_arg;
effect->timer = 80;
effect->effect_specific[0] = 3640;
effect->effect_specific[1] = temp;
fVar3 = sin_s(effect->effect_specific[0]);
dVar2 = fVar3 * 2.0f;
fVar3 = sin_s(effect->effect_specific[1]);
local_28.x = (dVar2 * fVar3);
fVar3 = cos_s(effect->effect_specific[1]);
local_28.z = dVar2 * fVar3;
local_24 = cos_s(effect->effect_specific[0]);
local_28.y = local_24 * 2.0f;
Matrix_RotateY(effect->arg0, 0);
Matrix_RotateX(effect->arg1 ,1);
Matrix_Position(&local_28,&effect->velocity);
effect->acceleration = ZeroVec;
effect->acceleration.y = -0.025f;
}
static void eTape_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
if (effect->timer < 74) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
effect->velocity.x *= sqrtf(0.9f);
effect->velocity.y *= sqrtf(0.9f);
effect->velocity.z *= sqrtf(0.9f);
}
}
static void eTape_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
s16 now_timer = effect->timer;
f32 scale_y;
f32 scale_z;
f32 scale;
u8 a;
if (now_timer > 68) {
scale_y = eEC_CLIP->calc_adjust_proc(now_timer,0x44, 0x50, 1.0f, 0.0f) * 0.01f;
scale_z = 0.0f;
} else if (now_timer > 0x38) {
scale_y = 0.01f;
scale_z = 0.0f;
} else {
scale_y = eEC_CLIP->calc_adjust_proc(now_timer,0, 56, 0.7f, 1.0f) * 0.01f;
scale_z = eEC_CLIP->calc_adjust_proc(effect->timer,0, 56, 1.0f, 0.0f) * 0.01f;
}
if (effect->timer > 14) {
a = 255;
} else {
a = (int)eEC_CLIP->calc_adjust_proc(effect->timer,0, 28, 0.0f, 255.0f);
}
OPEN_DISP(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, 0);
Matrix_RotateY(effect->arg0, 1);
Matrix_RotateX(effect->arg1, 1);
Matrix_rotateXYZ(effect->effect_specific[0], effect->effect_specific[1], 0, 1);
scale = GETREG(MYKREG, 27) * 0.01f + 1.0f;
Matrix_scale(0.01f * scale, scale_y * scale, scale_z * scale, 1);
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, 255, 155, 155, 0, a);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_tape01_01_model);
CLOSE_DISP(game->graph);
}
+15 -1
View File
@@ -1,9 +1,15 @@
#include "ef_effect_control.h"
#include "game_h.h"
#include "libc64/qrand.h"
#include "libu64/u64types.h"
#include "m_common_data.h"
#include <string.h>
static void eTM_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eTM_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eTM_mv(eEC_Effect_c* effect, GAME* game);
static void eTM_dw(eEC_Effect_c* effect, GAME* game);
static void eTM_CallEffect(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
eEC_PROFILE_c iam_ef_turi_mizu = {
// clang-format off
@@ -17,8 +23,13 @@ eEC_PROFILE_c iam_ef_turi_mizu = {
// clang-format on
};
static void eTM_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
if (eEC_CLIP != NULL) {
eTM_CallEffect(pos, prio, angle, game, item_name, arg0, arg1);
}
eEC_CLIP->make_effect_proc(eEC_EFFECT_TURI_MIZU, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eTM_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
@@ -32,3 +43,6 @@ static void eTM_mv(eEC_Effect_c* effect, GAME* game) {
static void eTM_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eTM_CallEffect(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}