Merge pull request #494 from Norgesnerd/master

Implement & link 7 effects
This commit is contained in:
Cuyler36
2025-06-14 10:06:18 -04:00
committed by GitHub
8 changed files with 547 additions and 35 deletions
+7 -7
View File
@@ -1320,10 +1320,10 @@ config.libs = [
Object(Matching, "effect/ef_shooting.c"),
Object(Matching, "effect/ef_shooting_kira.c"),
Object(Matching, "effect/ef_shooting_set.c"),
Object(NonMatching, "effect/ef_siawase_hana.c"),
Object(NonMatching, "effect/ef_siawase_hana_ch.c"),
Object(NonMatching, "effect/ef_siawase_hikari.c"),
Object(NonMatching, "effect/ef_sibuki.c"),
Object(Matching, "effect/ef_siawase_hana.c"),
Object(Matching, "effect/ef_siawase_hana_ch.c"),
Object(Matching, "effect/ef_siawase_hikari.c"),
Object(Matching, "effect/ef_sibuki.c"),
Object(NonMatching, "effect/ef_situren.c"),
Object(NonMatching, "effect/ef_slip.c"),
Object(NonMatching, "effect/ef_slip_footprint.c"),
@@ -1335,9 +1335,9 @@ config.libs = [
Object(NonMatching, "effect/ef_swing_net.c"),
Object(NonMatching, "effect/ef_swing_rod.c"),
Object(NonMatching, "effect/ef_taberu.c"),
Object(NonMatching, "effect/ef_takurami.c"),
Object(NonMatching, "effect/ef_takurami_kira.c"),
Object(NonMatching, "effect/ef_tamaire.c"),
Object(Matching, "effect/ef_takurami.c"),
Object(Matching, "effect/ef_takurami_kira.c"),
Object(Matching, "effect/ef_tamaire.c"),
Object(Matching, "effect/ef_tape.c"),
Object(Matching, "effect/ef_tent_lamp.c"),
Object(NonMatching, "effect/ef_tumble.c"),
+33 -4
View File
@@ -1,5 +1,7 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eSSHN_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSSHN_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSSHN_mv(eEC_Effect_c* effect, GAME* game);
@@ -18,17 +20,44 @@ eEC_PROFILE_c iam_ef_siawase_hana = {
};
static void eSSHN_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
pos.y -= 10.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_SIAWASE_HANA, pos, NULL, game, NULL, item_name, prio, 0, 0);
}
static void eSSHN_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
int i;
xyz_t pos;
effect->timer = 22;
if ((eEC_CLIP != NULL) && ((effect->timer & 1) != 0)) {
pos = effect->position;
pos.y -= 5.0f;
for (i = 0; i < 5; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_SIAWASE_HANA_CH, pos, effect->prio, 0, game, effect->item_name, i * 4,
0);
};
}
}
static void eSSHN_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
int prio;
u16 item_name;
xyz_t pos;
eEC_CLIP->set_continious_env_proc(effect, 22, 122);
if ((effect->timer & 3) == 0) {
item_name = effect->item_name;
prio = effect->prio;
if (eEC_CLIP != NULL) {
pos = effect->position;
pos.y -= 5.0f;
eEC_CLIP->effect_make_proc(eEC_EFFECT_SIAWASE_HANA_CH, pos, prio, 0, game, item_name, 0, 0);
}
}
}
static void eSSHN_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
return;
}
+92 -4
View File
@@ -1,5 +1,11 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
extern Gfx ef_siawase01_01_modelT[];
static void eSSHNC_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSSHNC_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSSHNC_mv(eEC_Effect_c* effect, GAME* game);
@@ -17,18 +23,100 @@ eEC_PROFILE_c iam_ef_siawase_hana_ch = {
// clang-format on
};
static u8 eSSHNC_pink_prim[] = { 255, 255, 255, 255 };
static u8 eSSHNC_pink_env[] = { 255, 0, 255, 255 };
static u8 eSSHNC_yellow_prim[] = { 255, 255, 0, 255 };
static u8 eSSHNC_yellow_env[] = { 255, 0, 0, 255 };
static u8* eSSHNC_color_info[] = { eSSHNC_pink_prim, eSSHNC_pink_env, eSSHNC_yellow_prim, eSSHNC_yellow_env };
static void eSSHNC_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_SIAWASE_HANA_CH, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eSSHNC_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
int i;
int rand = RANDOM(10.0f);
effect->timer = 92;
eEC_CLIP->random_first_speed_proc(&effect->velocity, 0.4f, 180.0f, 0.0f);
effect->acceleration.x = 0.0f;
effect->acceleration.y = 0.01f;
effect->acceleration.z = 0.0f;
effect->scale.x = 0.0f;
effect->scale.y = 0.0f;
effect->scale.z = 0.0f;
effect->effect_specific[0] = rand & 1;
effect->effect_specific[1] = 0;
if (effect->velocity.x > 0.0f) {
effect->effect_specific[2] = DEG2SHORT_ANGLE2(6.96f);
} else {
effect->effect_specific[2] = DEG2SHORT_ANGLE2(-6.96f);
}
if (effect->arg0 != 0) {
i = effect->arg0;
effect->timer -= effect->arg0 << 1;
while (i-- != 0) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
};
}
}
static void eSSHNC_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
f32 scale;
s16 timer = 92 - effect->timer;
if (timer >= 58) {
effect->acceleration.y = 0.01f;
} else {
effect->acceleration.y = eEC_CLIP->calc_adjust_proc(timer, 40, 58, 0.0f, 0.01f);
}
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
effect->effect_specific[1] += effect->effect_specific[2];
scale = eEC_CLIP->calc_adjust_proc(timer, 40, 58, 0.0f, 0.005f);
effect->scale.x = scale;
effect->scale.y = scale;
effect->scale.z = scale;
}
static void eSSHNC_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
GRAPH* graph;
u8 prim_a;
s16 timer = 92 - effect->timer;
u8* prim = eSSHNC_color_info[2 * effect->effect_specific[0]];
u8* env = eSSHNC_color_info[2 * effect->effect_specific[0] + 1];
if (timer >= 66) {
prim_a = (int)eEC_CLIP->calc_adjust_proc(timer, 66, 92, 255.0f, 0.0f);
} else {
prim_a = 255;
}
graph = game->graph;
OPEN_DISP(graph);
_texture_z_light_fog_prim_xlu(graph);
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, FALSE);
Matrix_mult(&((GAME_PLAY*)game)->billboard_matrix, TRUE);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, TRUE);
Matrix_RotateZ(effect->effect_specific[1], TRUE);
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, prim[0], prim[1], prim[2], prim_a);
gDPSetEnvColor(NEXT_POLY_XLU_DISP, env[0], env[1], env[2], env[3]);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_siawase01_01_modelT);
CLOSE_DISP(graph);
}
+50 -4
View File
@@ -1,5 +1,10 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
extern Gfx ef_siawase01_00_modelT[];
extern EVW_ANIME_DATA ef_siawase01_00_evw_anime;
static void eSSHKR_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSSHKR_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSSHKR_mv(eEC_Effect_c* effect, GAME* game);
@@ -18,17 +23,58 @@ eEC_PROFILE_c iam_ef_siawase_hikari = {
};
static void eSSHKR_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
xyz_t ofs;
eEC_CLIP->effect_make_proc(eEC_EFFECT_SIAWASE_HANA, pos, prio, angle, game, item_name, 0, 0);
ofs = ZeroVec;
ofs.z = -22.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_SIAWASE_HIKARI, pos, &ofs, game, NULL, item_name, prio, 0, 0);
}
static void eSSHKR_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
effect->scale.x = 0.0f;
effect->scale.y = 0.0f;
effect->scale.z = 0.0f;
effect->effect_specific[0] = 150;
effect->timer = 22;
}
static void eSSHKR_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
f32 scale;
sAdo_OngenPos((u32)effect, 14, &effect->position);
eEC_CLIP->set_continious_env_proc(effect, 22, 122);
if (effect->state == eEC_STATE_NORMAL) {
scale = eEC_CLIP->calc_adjust_proc(22 - effect->timer, 0, 21, 0.0f, 0.015f);
effect->scale.x = scale;
effect->scale.y = scale;
effect->scale.z = scale;
effect->effect_specific[0] = 150;
} else if (effect->state == eEC_STATE_CONTINUOUS) {
effect->scale.x = 0.015f;
effect->scale.y = 0.015f;
effect->scale.z = 0.015f;
effect->effect_specific[0] = 150;
} else if (effect->state == eEC_STATE_FINISHED) {
effect->effect_specific[0] = eEC_CLIP->calc_adjust_proc(72 - effect->timer, 0, 72, 150.0f, 0.0f);
}
}
static void eSSHKR_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
u8 alpha = effect->effect_specific[0];
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, &effect->scale, &effect->offset);
Evw_Anime_Set((GAME_PLAY*)game, &ef_siawase01_00_evw_anime);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 50, 255, 255, 200, alpha);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_siawase01_00_modelT);
CLOSE_DISP(game->graph);
}
+67 -4
View File
@@ -1,5 +1,17 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_debug.h"
#include "m_rcp.h"
#include "sys_matrix.h"
extern Gfx ef_sibuki01_00_modelT[];
extern u8 ef_sibuki01_1_int_i4[];
extern u8 ef_sibuki01_2_int_i4[];
extern u8 ef_sibuki01_3_int_i4[];
extern u8 ef_sibuki01_4_int_i4[];
static void eSibuki_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSibuki_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSibuki_mv(eEC_Effect_c* effect, GAME* game);
@@ -17,18 +29,69 @@ eEC_PROFILE_c iam_ef_sibuki = {
// clang-format on
};
static u8* eSibuki_DrawSibukiPtn[] = {
NULL, NULL, ef_sibuki01_1_int_i4, ef_sibuki01_2_int_i4, ef_sibuki01_3_int_i4, ef_sibuki01_4_int_i4,
};
static void eSibuki_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
pos.y -= 3.0f;
pos.z += 5.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_SIBUKI, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eSibuki_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
if (effect->arg1 == 0) {
effect->scale.x = 0.011f;
effect->scale.y = 0.011f;
effect->scale.z = 0.011f;
} else {
effect->scale.x = 0.011f;
effect->scale.y = 0.011f;
effect->scale.z = 0.011f;
}
effect->timer = 12;
effect->effect_specific[0] = 12;
}
static void eSibuki_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
return;
}
static void eSibuki_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
GRAPH* graph;
Mtx* mtx;
f32 scale_mult;
xyz_t pos = effect->position;
xyz_t scale = effect->scale;
s16 idx = (12 - effect->timer) >> 1;
idx = CLAMP(idx, 0, 5);
if (eSibuki_DrawSibukiPtn[idx] != NULL) {
mtx = (Mtx*)GRAPH_ALLOC_TYPE(game->graph, Mtx, 1);
graph = game->graph;
OPEN_DISP(graph);
_texture_z_light_fog_prim_xlu(graph);
scale_mult = GETREG(MYKREG, 27) * 0.01f + 1.0f;
suMtxMakeSRT(mtx, scale.x * scale_mult, scale.y * scale_mult, scale.z * scale_mult, DEG2SHORT_ANGLE2(-30.0f), 0,
0, pos.x, pos.y, pos.z);
gSPMatrix(NEXT_POLY_XLU_DISP, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (effect->arg0 == 0) {
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 200, 255, 255, 155);
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 0, 0, 0, 255);
} else {
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 200, 255, 255, 235);
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 0, 0, 0, 255);
}
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_8, eSibuki_DrawSibukiPtn[idx]);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_sibuki01_00_modelT);
CLOSE_DISP(graph);
}
}
+98 -4
View File
@@ -1,5 +1,10 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
extern Gfx ef_takurami01_yoko_modelT[];
extern Gfx ef_takurami01_yoko_modelT2[];
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);
@@ -17,18 +22,107 @@ eEC_PROFILE_c iam_ef_takurami = {
// clang-format on
};
static Gfx* eTM_direct2disp[] = { ef_takurami01_yoko_modelT, ef_takurami01_yoko_modelT2 };
typedef struct {
int prio;
s16 angle;
u16 item_name;
} eTM_data_c;
static void eTM_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
eTM_data_c ct_arg;
xyz_t ofs;
xyz_t vec = { 0.0f, 0.0f, 6.9f };
sMath_RotateY(&vec, SHORT2RAD_ANGLE2(angle));
pos.x += vec.x;
pos.y += vec.y;
pos.z += vec.z;
ofs.x = 0.0f;
ofs.y = 0.0f;
ofs.z = 0.0f;
ct_arg.angle = angle;
ct_arg.prio = prio;
ct_arg.item_name = item_name;
eEC_CLIP->make_effect_proc(eEC_EFFECT_TAKURAMI, pos, &ofs, game, &ct_arg, item_name, prio, 0, 0);
}
static void eTM_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
s16 angle_y, angle;
u16 angle_diff;
angle_y = (s16)getCamera2AngleY((GAME_PLAY*)game) + DEG2SHORT_ANGLE(180.0f);
angle = ((eTM_data_c*)ct_arg)->angle;
angle_diff = angle - angle_y;
effect->acceleration.x = effect->position.x;
effect->acceleration.y = effect->position.y;
effect->acceleration.z = effect->position.z;
effect->position.y += -3.0f;
effect->position.z += 10.0f;
effect->scale.x = 0.0f;
effect->scale.y = 0.020000001f;
effect->scale.z = 0.017f;
effect->timer = 54;
effect->effect_specific[2] = ((eTM_data_c*)ct_arg)->prio;
effect->effect_specific[1] = ((eTM_data_c*)ct_arg)->angle;
effect->effect_specific[3] = ((eTM_data_c*)ct_arg)->item_name;
if (angle_diff >= DEG2SHORT_ANGLE2(180.0f)) {
effect->effect_specific[0] = 0;
effect->offset.x += 15.0f;
} else {
effect->effect_specific[0] = 1;
effect->offset.x += -15.0f;
}
effect->offset.z = 15.0f;
}
static void eTM_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
int prio;
s16 angle;
u16 item_name;
s16 timer = 54 - effect->timer;
if (timer == 0) {
sAdo_OngenTrgStart(0x117, &effect->position);
}
if (timer == 10) {
angle = effect->effect_specific[1];
prio = effect->effect_specific[2];
item_name = effect->effect_specific[3];
if (eEC_CLIP != NULL) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_TAKURAMI_KIRA, effect->acceleration, prio, angle, game, item_name, 0,
0);
}
}
}
static void eTM_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
s16 timer = 54 - effect->timer;
s16 idx = effect->effect_specific[0];
u8 alpha;
effect->scale.x = eEC_CLIP->calc_adjust_proc(timer, 0, 8, 0.0f, 0.017f);
alpha = (int)eEC_CLIP->calc_adjust_proc(timer, 46, 54, 200.0f, 0.0f);
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, &effect->scale, &effect->offset);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 0, 0, 0, alpha);
gSPDisplayList(NEXT_POLY_XLU_DISP, eTM_direct2disp[idx]);
CLOSE_DISP(game->graph);
}
+64 -4
View File
@@ -1,5 +1,10 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
extern Gfx ef_takurami01_kira_modelT[];
extern Gfx ef_takurami01_normal_render_mode[];
static void eTMK_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eTMK_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eTMK_mv(eEC_Effect_c* effect, GAME* game);
@@ -18,17 +23,72 @@ eEC_PROFILE_c iam_ef_takurami_kira = {
};
static void eTMK_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
xyz_t ofs;
s16 angle_y = (s16)getCamera2AngleY((GAME_PLAY*)game) + DEG2SHORT_ANGLE2(180.0f);
u16 angle_diff = DIFF_USHORT_ANGLE(angle, angle_y);
if (angle_diff <= DEG2SHORT_ANGLE2(60.0f)) {
ofs.x = 6.0f;
ofs.z = 14.0f;
ofs.y = -8.0f;
} else if (angle_diff <= DEG2SHORT_ANGLE2(120.005f)) {
ofs.x = 13.0f;
ofs.z = 14.0f;
ofs.y = -8.0f;
} else if (angle_diff <= DEG2SHORT_ANGLE2(180.0f)) {
ofs.x = 13.0f;
ofs.z = -14.0f;
ofs.y = -3.0f;
} else if (angle_diff <= DEG2SHORT_ANGLE2(240.0f)) {
ofs.x = -13.0f;
ofs.z = -14.0f;
ofs.y = -3.0f;
} else if (angle_diff <= DEG2SHORT_ANGLE2(300.005f)) {
ofs.x = -13.0f;
ofs.z = 14.0f;
ofs.y = -8.0f;
} else {
ofs.x = 7.0f;
ofs.z = 14.0f;
ofs.y = -8.0f;
}
eEC_CLIP->make_effect_proc(eEC_EFFECT_TAKURAMI_KIRA, pos, &ofs, game, NULL, item_name, prio, 0, 0);
}
static void eTMK_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
effect->timer = 30;
effect->scale.x = 0.0f;
effect->scale.y = 0.0f;
effect->scale.z = 0.0f;
}
static void eTMK_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
f32 scale;
s16 timer = 30 - effect->timer;
if (timer < 10) {
scale = eEC_CLIP->calc_adjust_proc(timer, 0, 10, 0.0f, 0.009f);
effect->scale.x = scale;
effect->scale.y = scale;
effect->scale.z = scale;
} else {
scale = eEC_CLIP->calc_adjust_proc(timer, 11, 29, 0.009f, 0.0f);
effect->scale.x = scale;
effect->scale.y = scale;
effect->scale.z = scale;
}
}
static void eTMK_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, &effect->scale, &effect->offset);
OPEN_DISP(game->graph);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 255, 255, 255);
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_8, ef_takurami01_normal_render_mode);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_takurami01_kira_modelT);
CLOSE_DISP(game->graph);
}
+136 -4
View File
@@ -1,5 +1,15 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
extern Gfx ef_tamaire_shadow_modelT[];
extern Gfx ef_tamaire01_r_modelT[];
extern Gfx ef_tamaire01_w_modelT[];
static Gfx* tamaire_model[] = { ef_tamaire01_r_modelT, ef_tamaire01_w_modelT };
static void eTamaire_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eTamaire_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eTamaire_mv(eEC_Effect_c* effect, GAME* game);
@@ -18,17 +28,139 @@ eEC_PROFILE_c iam_ef_tamaire = {
};
static void eTamaire_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_TAMAIRE, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eTamaire_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
s16 angle = *(s16*)ct_arg;
effect->timer = 200;
effect->scale.x = effect->scale.y = effect->scale.z = 0.005f;
effect->velocity.x = cos_s(effect->arg1) * sin_s(angle);
effect->velocity.y = sin_s(effect->arg1);
effect->velocity.z = cos_s(effect->arg1) * cos_s(angle);
xyz_t_mult_v(&effect->velocity, RANDOM_F(1.5f) + 4.9f);
effect->acceleration = ZeroVec;
effect->acceleration.y = -0.15f;
effect->offset.y = effect->offset.z = mCoBG_GetBgY_AngleS_FromWpos(NULL, effect->position, 0.0f) + 3.0f;
effect->offset.x = effect->position.y;
effect->effect_specific[0] = qrand();
effect->effect_specific[1] = DEG2SHORT_ANGLE(RANDOM2_F(7.5f) + 2.5f);
effect->effect_specific[2] = 0;
if (effect->arg0 != 0) {
effect->arg0 = 1;
}
sAdo_OngenTrgStart(0x152, &effect->position);
}
static void eTamaire_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
mActor_name_t* item_p;
xyz_t pos;
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
effect->offset.z = effect->offset.y;
effect->offset.y = mCoBG_GetBgY_AngleS_FromWpos(NULL, effect->position, 0.0f) + 3.0f;
if (effect->position.y < effect->offset.y) {
if (effect->offset.y > effect->offset.z) {
effect->position.x -= effect->velocity.x;
effect->position.z -= effect->velocity.z;
effect->velocity.x *= -RANDOM_F(0.8f);
effect->velocity.y *= -0.5f;
effect->velocity.z *= -RANDOM_F(0.8f);
effect->offset.y = effect->offset.z;
sAdo_OngenTrgStart(0x153, &effect->position);
} else {
item_p = mFI_GetUnitFG(effect->position);
if ((item_p != NULL) && (*item_p == DUMMY_TURI)) {
mFI_Wpos2UtCenterWpos(&pos, effect->position);
pos.y = mCoBG_GetBgY_OnlyCenter_FromWpos2(effect->position, 0.0f) + 60.0f;
add_calc2(&effect->position.x, pos.x, CALC_EASE(0.5f), 1.0f);
add_calc2(&effect->position.y, pos.y, CALC_EASE(0.5f), 0.5f);
add_calc2(&effect->position.z, pos.z, CALC_EASE(0.5f), 1.0f);
add_calc0(&effect->velocity.x, CALC_EASE(0.5f), 0.25f);
add_calc0(&effect->velocity.y, CALC_EASE(0.5f), 0.25f);
add_calc0(&effect->velocity.z, CALC_EASE(0.5f), 0.25f);
effect->position.y = MAX(pos.y, effect->position.y);
if ((effect->effect_specific[2] & 2) == 0) {
sAdo_OngenTrgStart(0x154, &effect->position);
effect->effect_specific[2] |= 2;
}
effect->effect_specific[2] |= 1;
if (search_position_distance(&effect->position, &pos) < 1.0f) {
effect->timer = 0;
}
} else {
effect->position.y = effect->offset.y;
effect->velocity.y *= -0.5f;
effect->velocity.x *= 0.5f;
effect->velocity.z *= 0.5f;
effect->effect_specific[1] >>= 1;
if (effect->velocity.y > 2.0f) {
sAdo_OngenTrgStart(0x155, &effect->position);
}
}
}
}
effect->effect_specific[0] += effect->effect_specific[1];
effect->scale.y = (ABS(effect->velocity.y) * 0.1f + 0.9f) * 0.005f;
}
static void eTamaire_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
GAME_PLAY* play = (GAME_PLAY*)game;
GRAPH* graph;
f32 adjust, alpha, temp;
u8 shadow_alpha;
adjust = eEC_CLIP->calc_adjust_proc(effect->timer, 0, 20, 0.0f, 1.0f);
temp = ((effect->offset.y - effect->position.y + 300.0f) / 300.0f) * 0.5f;
temp = (temp < 0.0f ? 0.0f : temp);
temp = (temp > 0.5f ? 0.5f : temp) * play->kankyo.shadow_alpha;
shadow_alpha = (int)(adjust * temp);
alpha = adjust * 255.0f;
graph = game->graph;
OPEN_DISP(graph);
_texture_z_light_fog_prim_xlu(graph);
if ((effect->effect_specific[2] & 1) == 0) {
Matrix_translate(effect->position.x, effect->offset.y - 3.0f, effect->position.z, FALSE);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, TRUE);
gDPSetPrimColor(NEXT_SHADOW_DISP, 0, 255, 0, 0, 0, shadow_alpha);
gSPMatrix(NEXT_SHADOW_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_SHADOW_DISP, ef_tamaire_shadow_modelT);
}
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, FALSE);
Matrix_mult(&play->billboard_matrix, TRUE);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, TRUE);
Matrix_RotateZ(effect->effect_specific[0], TRUE);
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, 255, 255, 255, (int)alpha);
gSPDisplayList(NEXT_POLY_XLU_DISP, tamaire_model[effect->arg0]);
CLOSE_DISP(graph);
}