Migrate to dtk-template

Co-authored-by: NWPlayer123 <NWPlayer123@users.noreply.github.com>
This commit is contained in:
Luke Street
2024-10-28 18:57:33 -06:00
parent b05a6d3ed8
commit 1b0b96665a
1586 changed files with 116505 additions and 84895 deletions
+81
View File
@@ -0,0 +1,81 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
extern Gfx ef_amimizu01_00_modelT[];
static void eAmi_Mizu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
if(arg0 != 1){
pos.x += (-13.0f * sin_s(angle));
pos.z += (-13.0f * cos_s(angle));
pos.y += (2.0f);
}
else{
pos.x += (10.0f * sin_s(angle));
pos.z += (10.0f * cos_s(angle));
pos.y += (2.0f);
}
eEC_CLIP->make_effect_proc(eEC_EFFECT_AMI_MIZU,pos,NULL,game,NULL,item_name,prio, arg0,arg1);
}
static void eAmi_Mizu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = 10;
if ( effect->arg0 != 2) {
effect->offset.x = 0.0126f;
}
else{
effect->offset.x = 0.01f + (0.02f * (0.01f * effect->arg1));
}
}
static void eAmi_Mizu_mv(eEC_Effect_c* effect, GAME* game) {
f32 adjust;
if (effect->timer == 10) {
f32 off_x = effect->offset.x;
effect->scale.z = off_x;
effect->scale.y = off_x;
effect->scale.x = off_x;
}
else{
adjust = eEC_CLIP->calc_adjust_proc(effect->timer,0, 8, 1.3f * effect->offset.x, 1.1f * effect->offset.x);
effect->scale.z = adjust;
effect->scale.x = adjust;
effect->scale.y = eEC_CLIP->calc_adjust_proc(effect->timer, 0, 8, 0.5f * effect->offset.x, 1.2f * effect->offset.x);
}
}
static void eAmi_Mizu_dw(eEC_Effect_c* effect, GAME* game) {
int alpha = (u8)eEC_CLIP->calc_adjust_proc(effect->timer, 0, 6, 50.0f, 155.0f);
GRAPH* graph = game->graph;
_texture_z_light_fog_prim_xlu(graph);
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, FALSE);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, TRUE);
OPEN_DISP(graph);
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, 0, 255, 255, alpha);
gDPSetEnvColor(NEXT_POLY_XLU_DISP,255, 255, 255, 255);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_amimizu01_00_modelT);
CLOSE_DISP(graph);
}
eEC_PROFILE_c iam_ef_ami_mizu = {
// clang-format off
&eAmi_Mizu_init,
&eAmi_Mizu_ct,
&eAmi_Mizu_mv,
&eAmi_Mizu_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
+87
View File
@@ -0,0 +1,87 @@
#include "ef_effect_control.h"
#include "evw_anime.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
extern Gfx ef_anahikari01_01_modelT[];
extern Gfx ef_anahikari01_02_modelT[];
static Gfx* ef_anahikari_model_tbl[] = {
ef_anahikari01_01_modelT,ef_anahikari01_02_modelT,
};
extern EVW_ANIME_DATA ef_anahikari01_01_evw_anime;
extern EVW_ANIME_DATA ef_anahikari01_02_evw_anime;
static EVW_ANIME_DATA* ef_anahikari_anime_tbl[] = {
&ef_anahikari01_01_evw_anime,&ef_anahikari01_02_evw_anime,
};
static void eAnahikari_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
pos.z += 4.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_ANAHIKARI,pos,NULL,game,NULL,item_name,prio, arg0,arg1);
}
static void eAnahikari_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = 60;
if(effect->arg0 == 0){
effect->scale.z = 0.03f;
effect->scale.y = 0.03f;
effect->scale.x = 0.03f;
}
else{
effect->scale.z = 0.037f;
effect->scale.y = 0.037f;
effect->scale.x = 0.037f;
}
}
static void eAnahikari_mv(eEC_Effect_c* effect, GAME* game) {
eEC_CLIP->set_continious_env_proc(effect,60,120);
}
static void eAnahikari_dw(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play;
int idx;
u8 alpha;
idx = effect->arg0;
play = (GAME_PLAY*)game;
if (mEv_CheckTitleDemo() != -9) {
if (effect->state == eEC_STATE_NORMAL) {
alpha = (int)eEC_CLIP->calc_adjust_proc(effect->timer, 0, 60, 200.0f, 0.0f);
} else if (effect->state == eEC_STATE_FINISHED) {
alpha = (int)eEC_CLIP->calc_adjust_proc(effect->timer, 0, 60, 0.0f, 200.0f);
} else {
alpha = 200;
}
OPEN_DISP(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, FALSE);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, TRUE);
Evw_Anime_Set(play, ef_anahikari_anime_tbl[idx]);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 255, 255, alpha);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_anahikari_model_tbl[idx]);
CLOSE_DISP(game->graph);
}
}
eEC_PROFILE_c iam_ef_anahikari = {
// clang-format off
&eAnahikari_init,
&eAnahikari_ct,
&eAnahikari_mv,
&eAnahikari_dw,
60,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
+49
View File
@@ -0,0 +1,49 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eAS_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eAS_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eAS_mv(eEC_Effect_c* effect, GAME* game);
static void eAS_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_ase = {
// clang-format off
&eAS_init,
&eAS_ct,
&eAS_mv,
&eAS_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eAS_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
xyz_t offs;
offs.x = 0.0f;
offs.y = 15.0f;
offs.z = 0.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_ASE,pos,&offs,game,NULL,item_name,prio,0,0);
}
static void eAS_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = 26;
}
static void eAS_mv(eEC_Effect_c* effect, GAME* game) {
int prio;
int name;
GAME_PLAY* play = (GAME_PLAY*)game;
name = effect->item_name;
prio = effect->prio;
eEC_CLIP->set_continious_env_proc(effect,26,52);
if((eEC_CLIP != NULL) && (effect->timer & 1)){
eEC_CLIP->effect_make_proc(eEC_EFFECT_ASE_CH,effect->position,prio,0,&play->game,name,0,0);
}
}
static void eAS_dw(eEC_Effect_c* effect, GAME* game) {
}
+65
View File
@@ -0,0 +1,65 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eAS2_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eAS2_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eAS2_mv(eEC_Effect_c* effect, GAME* game);
static void eAS2_dw(eEC_Effect_c* effect, GAME* game);
extern Gfx ef_ase02_00_modelT[];
extern Gfx ef_ase02_01_modelT[];
extern Gfx ef_ase02_02_modelT[];
extern Gfx ef_ase02_03_modelT[];
static Gfx* eAS2_model_table[] = {
ef_ase02_00_modelT,
ef_ase02_01_modelT,
ef_ase02_02_modelT,
ef_ase02_03_modelT,
};
eEC_PROFILE_c iam_ef_ase2 = {
// clang-format off
&eAS2_init,
&eAS2_ct,
&eAS2_mv,
&eAS2_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eAS2_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
xyz_t offs;
offs.x = 0.0f;
offs.y = 0.0f;
offs.z = 30.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_ASE2, pos, &offs, game, NULL, item_name, prio, 0, 0);
}
static void eAS2_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->scale.x = 0.006f;
effect->scale.y = 0.006f;
effect->scale.z = 0.006f;
effect->effect_specific[0] = 0;
effect->timer = 26;
}
static void eAS2_mv(eEC_Effect_c* effect, GAME* game) {
eEC_CLIP->set_continious_env_proc(effect, 26, 52);
effect->effect_specific[0]++;
sAdo_OngenPos((u32)effect, 0x29, &effect->position);
}
static void eAS2_dw(eEC_Effect_c* effect, GAME* game) {
s16 idx = (s16)((effect->effect_specific[0] & 12) >> 2);
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, &effect->scale, &effect->offset);
gSPDisplayList(NEXT_POLY_XLU_DISP, eAS2_model_table[idx]);
CLOSE_DISP(game->graph);
}
+74
View File
@@ -0,0 +1,74 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eASC_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eASC_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eASC_mv(eEC_Effect_c* effect, GAME* game);
static void eASC_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_ase_ch = {
// clang-format off
&eASC_init,
&eASC_ct,
&eASC_mv,
&eASC_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
extern Gfx ef_ase01_00_modelT[];
static f32 eASC_scale_table[] = {
0.00027000002f, 0.00027000002f, 0.00027000002f, 0.00054000004f, 0.0010800001f,0.0016200001f,
0.0021600001f,0.0027f,0.00135f,0.00054000004f,
};
static void eASC_DecideASCeDirect(xyz_t* vec){
eEC_CLIP->random_first_speed_proc(vec,2.7f, 180.0f, 0.0f);
}
static void eASC_SetAseGravity(xyz_t* acc) {
acc->x = 0.0f;
acc->y = -0.057499997f;
acc->z = 0.0f;
}
static void eASC_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_ASE_CH,pos,NULL,game,NULL,item_name,prio,0,0);
}
static void eASC_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = 20;
eASC_DecideASCeDirect(&effect->velocity);
eASC_SetAseGravity(&effect->acceleration);
effect->scale.x = 0.0027f;
effect->scale.y = 0.0027f;
effect->scale.z = 0.0027f;
}
static void eASC_mv(eEC_Effect_c* effect, GAME* game) {
xyz_t_add(&effect->velocity,&effect->acceleration,&effect->velocity);
xyz_t_add(&effect->position,&effect->velocity,&effect->position);
}
static void eASC_dw(eEC_Effect_c* effect, GAME* game) {
xyz_t* pos = &effect->position;
xyz_t* scale = &effect->scale;
s16 val = (20 - effect->timer) >> 1;
s16 idx = CLAMP(val, 0, 10);
GRAPH* graph = game->graph;
effect->scale.x = eASC_scale_table[idx];
effect->scale.y = eASC_scale_table[idx];
effect->scale.z = eASC_scale_table[idx];
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_proc(game, pos, scale);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_ase01_00_modelT);
CLOSE_DISP(game->graph);
}
+202
View File
@@ -0,0 +1,202 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_debug.h"
#include "m_rcp.h"
#include "sys_matrix.h"
static void eBreak_Axe_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eBreak_Axe_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eBreak_Axe_mv(eEC_Effect_c* effect, GAME* game);
static void eBreak_Axe_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_break_axe = {
// clang-format off
&eBreak_Axe_init,
&eBreak_Axe_ct,
&eBreak_Axe_mv,
&eBreak_Axe_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eBreak_Axe_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_BREAK_AXE, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eBreak_Axe_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
s16 angle = *(s16*)ct_arg + DEG2SHORT_ANGLE2(180.0f);
f32 speed_xz;
f32 speed_y;
f32 tz;
f32 ty;
f32 tx;
s16 add_angle;
effect->timer = RANDOM(10) * 2 + (35 + GETREG(TAKREG, 60)) * 2;
effect->effect_specific[5] = effect->timer;
if (effect->arg0 > 1) {
effect->scale.x = effect->scale.y = effect->scale.z = (1.0f + fqrand()) * 0.01f;
} else {
effect->scale.x = effect->scale.y = effect->scale.z = 0.01f;
}
effect->offset.x = effect->position.y;
effect->offset.y = mCoBG_GetBgY_AngleS_FromWpos(NULL, effect->position, 0.0f);
if (effect->arg0 == 0) {
angle += (int)((40.0f + GETREG(TAKREG, 56) + RANDOM_F(20.0f + GETREG(TAKREG, 57))) * 182.04445f);
effect->offset.y += 10.0f;
} else if (effect->arg0 == 1) {
angle += (int)((20.0f + GETREG(TAKREG, 58) + RANDOM_F(20.0f + GETREG(TAKREG, 59))) * 182.04445f);
effect->offset.y += 15.0f;
} else {
angle += RANDOM_F(14563.0f);
effect->offset.y += 3.0f;
}
effect->effect_specific[4] = *(s16*)ct_arg;
if (effect->arg0 == 0) {
tx = -17.0f + GETREG(TAKREG, 32);
ty = 34.0f + GETREG(TAKREG, 33);
tz = 20.0f + GETREG(TAKREG, 34);
effect->position.x += tz * sin_s(effect->effect_specific[4]) + tx * cos_s(effect->effect_specific[4]);
effect->position.y += ty;
effect->position.z += tz * cos_s(effect->effect_specific[4]) - tx * sin_s(effect->effect_specific[4]);
effect->effect_specific[0] = (-20.0f + GETREG(TAKREG, 35)) * 182.04445f;
add_angle = (int)((-77.0f + GETREG(TAKREG, 36)) * 182.04445f);
effect->effect_specific[4] += add_angle;
effect->effect_specific[2] = (0.0f + GETREG(TAKREG, 37)) * 182.04445f;
effect->effect_specific[1] = qrand() & 0xFFF;
effect->effect_specific[3] = qrand() & 0xFFF;
speed_xz = (0.5f + GETREG(TAKREG, 48) * 0.1f) * 0.5f + RANDOM_F((1.5f + GETREG(TAKREG, 49) * 0.1f) * 0.5f);
speed_y = (8.0f + GETREG(TAKREG, 50) * 0.1f) * 0.5f + RANDOM_F((2.0f + GETREG(TAKREG, 51) * 0.1f) * 0.5f);
} else if (effect->arg0 == 1) {
tz = -4.0f + GETREG(TAKREG, 38);
ty = 27.0f + GETREG(TAKREG, 39);
tx = 17.0f + GETREG(TAKREG, 40);
effect->position.x += tx * sin_s(effect->effect_specific[4]) + tz * cos_s(effect->effect_specific[4]);
effect->position.y += ty;
effect->position.z += tx * cos_s(effect->effect_specific[4]) - tz * sin_s(effect->effect_specific[4]);
effect->effect_specific[0] = (-20.0f + GETREG(TAKREG, 41)) * 182.04445f;
add_angle = (int)((-77.0f + GETREG(TAKREG, 42)) * 182.04445f);
effect->effect_specific[4] += add_angle;
effect->effect_specific[2] = (0.0f + GETREG(TAKREG, 43)) * 182.04445f;
effect->effect_specific[1] = qrand() & 0xFFF;
effect->effect_specific[3] = qrand() & 0xFFF;
speed_xz = (1.5f + GETREG(TAKREG, 52) * 0.1f) * 0.5f + RANDOM_F((1.0f + GETREG(TAKREG, 53) * 0.1f) * 0.5f);
speed_y = (7.5f + GETREG(TAKREG, 54) * 0.1f) * 0.5f + RANDOM_F((3.0f + GETREG(TAKREG, 55) * 0.1f) * 0.5f);
} else {
effect->position.x += RANDOM2_F(10.0f);
effect->position.y += RANDOM2_F(10.0f);
effect->position.z += RANDOM2_F(10.0f);
effect->effect_specific[0] = qrand();
effect->effect_specific[2] = qrand();
effect->effect_specific[1] = qrand() & 0x1FFF;
effect->effect_specific[3] = qrand() & 0x1FFF;
speed_xz = (2.0f + GETREG(TAKREG, 44) * 0.1f) * 0.5f + RANDOM_F((3.5f + GETREG(TAKREG, 45) * 0.1f) * 0.5f);
speed_y = (8.0f + GETREG(TAKREG, 46) * 0.1f) * 0.5f + RANDOM_F((5.0f + GETREG(TAKREG, 47) * 0.1f) * 0.5f);
}
effect->velocity.x = speed_xz * sin_s(angle);
effect->velocity.z = speed_xz * cos_s(angle);
effect->velocity.y = speed_y;
effect->acceleration.y = -0.25f;
}
static void eBreak_Axe_mv(eEC_Effect_c* effect, GAME* game) {
u32 ut_attr = mCoBG_Wpos2Attribute(effect->position, NULL);
effect->offset.x = effect->position.y;
effect->offset.z = effect->offset.y;
effect->offset.y = mCoBG_GetBgY_AngleS_FromWpos(NULL, effect->position, 0.0f);
if (effect->arg0 == 0) {
effect->offset.y += 10.0f;
} else if (effect->arg0 == 1) {
effect->offset.y += 15.0f;
}
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
effect->effect_specific[0] += effect->effect_specific[1];
effect->effect_specific[2] += effect->effect_specific[3];
if (effect->timer <= ((35 + GETREG(TAKREG, 60)) * 2 - 5)) {
if (effect->position.y < effect->offset.y && mCoBG_CheckWaterAttribute(ut_attr)) {
xyz_t_mult_v(&effect->velocity, 0.8f);
add_calc_short_angle2(&effect->effect_specific[1], 0, 1.0f - sqrtf(0.9f), 182, 9);
add_calc_short_angle2(&effect->effect_specific[3], 0, 1.0f - sqrtf(0.9f), 182, 9);
}
if (effect->position.y < effect->offset.y && effect->offset.x >= effect->offset.y &&
effect->velocity.y < 0.0f) {
if (mCoBG_CheckWaterAttribute(ut_attr)) {
if (effect->arg0 < 2) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_AMI_MIZU, effect->position, effect->prio, 0, game,
effect->item_name, 0, 0);
eEC_CLIP->effect_make_proc(eEC_EFFECT_TURI_HAMON, effect->position, effect->prio, 0, game,
effect->item_name, 0, 0);
}
} else {
effect->position.y = effect->offset.y;
effect->velocity.x *= 0.6f;
effect->velocity.y *= -0.6f;
effect->velocity.z *= 0.6f;
effect->effect_specific[1] >>= 1;
effect->effect_specific[3] >>= 1;
}
}
if (effect->position.y < effect->offset.y && effect->position.y >= effect->offset.z) {
effect->position.x -= effect->velocity.x;
effect->position.y -= effect->velocity.y;
effect->position.z -= effect->velocity.z;
effect->velocity.x *= -0.6f;
effect->velocity.z *= -0.6f;
}
}
}
extern Gfx ef_axe1_model[];
extern Gfx ef_axe2_model[];
extern Gfx ef_axe3_model[];
static void eBreak_Axe_dw(eEC_Effect_c* effect, GAME* game) {
u8 a = (int)eEC_CLIP->calc_adjust_proc(effect->timer, 0, (15 + GETREG(TAKREG, 61)) * 2, 0.0f, 255.0f);
_texture_z_light_fog_prim_xlu(game->graph);
OPEN_DISP(game->graph);
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, 0);
Matrix_RotateY(effect->effect_specific[4] + (int)(GETREG(TAKREG, 21) * 182.04445f), 1);
Matrix_rotateXYZ(effect->effect_specific[0] + (int)(GETREG(TAKREG, 20) * 182.04445f), 0,
effect->effect_specific[2] + (int)(GETREG(TAKREG, 22) * 182.04445f), 1);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, 1);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 128, 255, 255, 255, a);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (effect->arg0 == 0) {
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_axe1_model);
} else if (effect->arg0 == 1) {
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_axe2_model);
} else {
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_axe3_model);
}
CLOSE_DISP(game->graph);
}
+50
View File
@@ -0,0 +1,50 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eBubu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eBubu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eBubu_mv(eEC_Effect_c* effect, GAME* game);
static void eBubu_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_bubu = {
// clang-format off
&eBubu_init,
&eBubu_ct,
&eBubu_mv,
&eBubu_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
extern Gfx ef_peke01_00_modelT[];
static void eBubu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
pos.y += 70.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_BUBU,pos,NULL,game,NULL,item_name,prio,0,0);
}
static void eBubu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->scale.x = 0.015f;
effect->scale.y = 0.015f;
effect->scale.z = 0.015f;
sAdo_SysTrgStart(0x100A);
}
static void eBubu_mv(eEC_Effect_c* effect, GAME* game) {
}
static void eBubu_dw(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
GRAPH* graph = game->graph;
eEC_CLIP->auto_matrix_xlu_proc(game, &effect->position, &effect->scale);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP,ef_peke01_00_modelT);
CLOSE_DISP(graph);
}
+69
View File
@@ -0,0 +1,69 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
extern u8 ef_buruburu01_0_int_i4[];
extern u8 ef_buruburu01_1_int_i4[];
extern Gfx ef_buruburu01_00_modelT[];
static void eBR_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eBR_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eBR_mv(eEC_Effect_c* effect, GAME* game);
static void eBR_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_buruburu = {
// clang-format off
&eBR_init,
&eBR_ct,
&eBR_mv,
&eBR_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static f32 eBR_scale_x[] = { 0.015f, 0.016f };
static f32 eBR_scale_z[] = { 0.01f, 0.011f };
static u8* eBR_tex_anime_table[] = {
ef_buruburu01_0_int_i4,ef_buruburu01_1_int_i4,
};
static void eBR_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
xyz_t offs;
offs.x = 0.0f;
offs.y = -10.0f;
offs.z = 0.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_BURUBURU,pos,&offs,game,NULL,item_name,prio,0,0);
}
static void eBR_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->scale.x = 0.01f;
effect->scale.y = 0.01f;
effect->scale.z = 0.01f;
effect->timer = 8;
}
static void eBR_mv(eEC_Effect_c* effect, GAME* game) {
eEC_CLIP->set_continious_env_proc(effect,8,8);
sAdo_OngenPos((u32) effect, 0x2D, &effect->position);
}
static void eBR_dw(eEC_Effect_c* effect, GAME* game) {
s16 idx = (effect->timer >> 1) & 1;
effect->scale.x = eBR_scale_x[idx];
effect->scale.z = eBR_scale_z[idx];
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, &effect->scale, &effect->offset);
gSPSegment(NEXT_POLY_XLU_DISP,G_MWO_SEGMENT_8,eBR_tex_anime_table[idx]);
gSPDisplayList(NEXT_POLY_XLU_DISP,ef_buruburu01_00_modelT);
CLOSE_DISP(game->graph);
}
+206
View File
@@ -0,0 +1,206 @@
#include "ef_effect_control.h"
#include "sys_math.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
static void eBushHappa_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eBushHappa_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eBushHappa_mv(eEC_Effect_c* effect, GAME* game);
static void eBushHappa_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_bush_happa = {
// clang-format off
&eBushHappa_init,
&eBushHappa_ct,
&eBushHappa_mv,
&eBushHappa_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
extern Gfx ef_f_tree01_00_modelT[];
extern Gfx ef_s_cedar_modelT[];
extern Gfx ef_s_palm_modelT[];
extern Gfx ef_s_tree01_00_modelT[];
extern Gfx ef_s_yabu01_00_modelT[];
static void eBushHappa_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
s16 x = ABS(arg0);
s_xz arg;
arg.z = angle;
arg.x = x;
eEC_CLIP->make_effect_proc(eEC_EFFECT_BUSH_HAPPA, pos, NULL, game, &arg, item_name, prio, arg0, arg1);
}
static void eBushHappa_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
f32 VSpeed = 2.5f + RANDOM_F(1.3f);
xyz_t* velocity = &effect->velocity;
f32 HzSpeed = -4.0f + RANDOM_F(8.0f);
effect->position.x += HzSpeed;
effect->position.z += HzSpeed;
effect->offset.x = 0.0f;
effect->offset.y = 0.0f;
effect->offset.z = 0.0f;
if (effect->arg1 & 0x8000) {
effect->timer = 20;
effect->arg1 &= ~0x8000;
} else {
effect->timer = 60;
}
effect->effect_specific[4] = (effect->arg1 >> 13) & 3;
effect->arg1 &= ~0x6000;
if (effect->arg1 & 0x1000) {
effect->arg1 &= ~0x1000;
effect->effect_specific[5] = 1;
} else {
effect->effect_specific[5] = 0;
}
if (effect->arg1 == 1) {
effect->timer += 20;
VSpeed *= 1.5f;
} else if (effect->arg1 == 2 || effect->arg1 == 6) {
effect->timer += 20;
VSpeed *= 1.8f;
} else if (effect->arg1 == 3) {
effect->timer += 20;
VSpeed *= 1.6f;
} else if (effect->arg1 == 4 || effect->arg1 == 5) {
effect->timer += 20;
}
if (effect->arg1 == 2 || effect->arg1 == 3) {
eEC_CLIP->random_first_speed_proc(velocity, VSpeed, 32.0f, 32.0f);
} else if (effect->arg1 == 4 || effect->arg1 == 6) {
velocity->x = RANDOM2_F(2.0f);
velocity->y = fqrand2();
velocity->z = fqrand();
} else if (effect->arg1 == 5 || effect->arg1 == 7) {
eEC_CLIP->random_first_speed_proc(velocity, VSpeed, 32.0f, 32.0f);
} else {
eEC_CLIP->random_first_speed_proc(velocity, VSpeed, 20.0f, 20.0f);
}
effect->effect_specific[2] = 0;
effect->effect_specific[3] = qrand();
effect->effect_specific[0] = qrand();
effect->effect_specific[1] = qrand();
if (effect->arg1 > 3) {
effect->scale.z = 0.010599999f;
effect->scale.y = 0.010599999f;
effect->scale.x = 0.010599999f;
} else {
effect->scale.z = 0.010199999f;
effect->scale.y = 0.010199999f;
effect->scale.x = 0.010199999f;
}
if (effect->effect_specific[5] == 1) {
effect->scale.z = 0.0069999998f;
effect->scale.y = 0.0069999998f;
effect->scale.x = 0.0069999998f;
}
effect->acceleration.x = 0.0f;
effect->acceleration.y = 0.5f * (0.1f * -effect->velocity.y);
effect->acceleration.z = 0.0f;
}
static void eBushHappa_mv(eEC_Effect_c* effect, GAME* game) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
if (effect->effect_specific[2] == 1) {
f32 val = 2.0f * sin_s(effect->effect_specific[3]);
effect->offset.x = val;
effect->offset.y = 0.0f;
effect->offset.z = -val;
effect->velocity.x *= sqrtf(0.95f);
effect->velocity.z *= sqrtf(0.95f);
effect->effect_specific[0] += 0x662;
effect->effect_specific[1] += 0x662;
effect->effect_specific[3] += 0xA00;
} else {
effect->effect_specific[0] += 0x280;
effect->effect_specific[1] += 0x280;
if (effect->velocity.y <= 0.0f) {
effect->effect_specific[2] = 1;
effect->acceleration.y = -0.05f;
}
}
}
static void eBushHappa_dw(eEC_Effect_c* effect, GAME* game) {
mFM_field_pal_c* field_pal = mFI_GetFieldPal();
GRAPH* graph;
u16* cedar_pal;
u16* golden_pal;
u16* palm_pal;
if (field_pal != NULL) {
u8 alpha;
cedar_pal = NULL;
golden_pal = NULL;
palm_pal = NULL;
alpha = (int)eEC_CLIP->calc_adjust_proc(effect->timer, 0, 28, 0.0f, 255.0f);
if (effect->arg1 > 3) {
cedar_pal = field_pal->cedar_tree_pal;
golden_pal = field_pal->golden_tree_pal;
palm_pal = field_pal->palm_tree_pal;
}
if (((cedar_pal != NULL) && (golden_pal != NULL)) || (effect->arg1 <= 3)) {
Mtx* mtx = GRAPH_ALLOC_TYPE(game->graph, Mtx, 1);
graph = game->graph;
_texture_z_light_fog_prim_xlu(graph);
suMtxMakeSRT_ZXY(mtx, effect->scale.x, effect->scale.y, effect->scale.z, effect->effect_specific[0], 0,
effect->effect_specific[1], effect->position.x + effect->offset.x,
effect->position.y + effect->offset.y, effect->position.z + effect->offset.z);
OPEN_DISP(graph);
gSPMatrix(NEXT_POLY_XLU_DISP, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 255, 255, alpha);
if (effect->arg1 > 3) {
if (effect->effect_specific[4] == 3) {
gSPSegment(NEXT_POLY_XLU_DISP,G_MWO_SEGMENT_8, golden_pal);
} else if (effect->effect_specific[4] == 0) {
gSPSegment(NEXT_POLY_XLU_DISP,G_MWO_SEGMENT_8, cedar_pal);
} else {
gSPSegment(NEXT_POLY_XLU_DISP,G_MWO_SEGMENT_8, palm_pal);
}
if (effect->effect_specific[4] == 1) {
gSPDisplayList(NEXT_POLY_XLU_DISP,ef_s_palm_modelT);
} else if (effect->effect_specific[4] == 2) {
gSPDisplayList(NEXT_POLY_XLU_DISP,ef_s_cedar_modelT);
} else if (effect->arg1 > 5) {
gSPDisplayList(NEXT_POLY_XLU_DISP,ef_f_tree01_00_modelT);
} else {
gSPDisplayList(NEXT_POLY_XLU_DISP,ef_s_tree01_00_modelT);
}
}
else{
gSPDisplayList(NEXT_POLY_XLU_DISP,ef_s_yabu01_00_modelT);
}
CLOSE_DISP(graph);
}
}
}
+76
View File
@@ -0,0 +1,76 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
extern Gfx ef_w_yabu01_00_modelT[];
static void eBushYuki_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eBushYuki_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eBushYuki_mv(eEC_Effect_c* effect, GAME* game);
static void eBushYuki_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_bush_yuki = {
// clang-format off
&eBushYuki_init,
&eBushYuki_ct,
&eBushYuki_mv,
&eBushYuki_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eBushYuki_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_BUSH_YUKI, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eBushYuki_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
f32 y = 1.5f + (RANDOM_F(1.5f));
f32 initialPos = -3.0f + (6.0f * fqrand());
effect->timer = 60;
effect->position.x += initialPos;
effect->position.y += initialPos;
eEC_CLIP->random_first_speed_proc(&effect->velocity,y,45.0f,45.0f);
if (effect->arg1 == 1) {
effect->velocity.x = RANDOM2_F(2.0f);
effect->velocity.y = fqrand();
effect->velocity.z = fqrand();
}
effect->scale.x = 0.005f;
effect->scale.y = 0.005f;
effect->scale.z = 0.005f;
effect->acceleration.x = 0.0f;
effect->acceleration.y = -0.125f;
effect->acceleration.z = 0.0f;
}
void eBushYuki_mv(eEC_Effect_c* effect, GAME* game) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
}
static void eBushYuki_dw(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
GRAPH* graph;
u8 alpha = (int)eEC_CLIP->calc_adjust_proc(60 - effect->timer, 32, 60, 200.0f, 0.0f);
graph = game->graph;
_texture_z_light_fog_prim_xlu(game->graph);
eEC_CLIP->auto_matrix_xlu_proc(game, &effect->position, &effect->scale);
OPEN_DISP(graph);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 128, 40, 40, 40, alpha);
gSPDisplayList(NEXT_POLY_XLU_DISP,ef_w_yabu01_00_modelT);
CLOSE_DISP(graph);
}
+133
View File
@@ -0,0 +1,133 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "sys_matrix.h"
#include "m_rcp.h"
#include "m_debug_mode.h"
static void eCar_Blight_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eCar_Blight_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eCar_Blight_mv(eEC_Effect_c* effect, GAME* game);
static void eCar_Blight_dw(eEC_Effect_c* effect, GAME* game);
xyz_t light_make_pos[] = {
{0.0f,30.0f,0.0f},
{20.0f,20.0f,0.0f},
{40.0f,10.0f,0.0f},
{-10.0f, 60.0f, 0.0f},
{10.0f,50.0f,0.0f},
{30.0f,40.0f,0.0f},
{50.0f,30.0f,0.0f},
{0.0f,80.0f,0.0f},
{20.0f,70.0f,0.0f},
{40.0f, 60.0f,0.0f},
{60.0f,50.0f,0.0f},
{30.0f,90.0f,0.0f},
{50.0f,80.0f,0.0f},
{70.0f,70.0f,0.0f},
{90.0f,60.0f,0.0f},
{100.0f, 80.0f,0.0f},
};
eEC_PROFILE_c iam_ef_car_blight = {
// clang-format off
&eCar_Blight_init,
&eCar_Blight_ct,
&eCar_Blight_mv,
&eCar_Blight_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
extern Gfx ef_car01_modelT[];
static void eCar_Blight_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_CAR_BLIGHT, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eCar_Blight_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = 42;
effect->scale.x = 0.01f;
effect->scale.y = 0.01f;
effect->scale.z = 0.01f;
effect->effect_specific[0] = 0;
}
static int eCar_Blight_light_control(eEC_Effect_c* effect){
int base = RANDOM(16.0f);
int i;
int specific = (u8)effect->effect_specific[0];
int check = effect->effect_specific[0];
while (specific == 0){
i = 1 << base;
if((i & check)){
if(base > 15){
base = 0;
}
else{
base++;
}
}
else {
effect->effect_specific[0] &= i;
return base;
}
};
return 0;
}
static void eCar_Blight_mv(eEC_Effect_c* effect, GAME* game) {
if(!(effect->timer & 3)){
xyz_t pos = light_make_pos[eCar_Blight_light_control(effect)];
pos.x += (effect->position.x - 50.0f);
pos.y += (effect->position.y);
pos.z += (effect->position.z + 50.0f);
eEC_CLIP->effect_make_proc(eEC_EFFECT_CAR_LIGHT, pos, effect->prio,0, game, effect->item_name,0,0);
}
}
static void eCar_Blight_dw(eEC_Effect_c* effect, GAME* game) {
GRAPH* graph;
GAME_PLAY* play;
f32 scaleFact;
Gfx* gfx;
int timer;
play = (GAME_PLAY*)game;
timer = 42 - effect->timer;
if(effect->arg0 == 0){
graph = game->graph;
_texture_z_light_fog_prim_xlu(graph);
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, FALSE);
scaleFact = 1.0f + (0.01f * (f32)(int)GETREG(MYKREG,27));
Matrix_scale(effect->scale.x * scaleFact, effect->scale.y * scaleFact, effect->scale.z * scaleFact, TRUE);
Setpos_HiliteReflect_xlu_init(&effect->position, play);
gfx = two_tex_scroll_dolphin(game->graph,0, timer * 3, timer * 7, 16, 16, 1,timer * 3, timer * -7, 16,16);
if(gfx != NULL){
OPEN_DISP(graph);
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_8, gfx);
gfx = two_tex_scroll_dolphin(game->graph,0, timer * 3, timer * 3, 16, 16, 1,timer * 3, timer * -7, 16,16);
if(gfx != NULL){
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_9, gfx);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_car01_modelT);
}
CLOSE_DISP(graph);
}
}
}
+53
View File
@@ -0,0 +1,53 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eCar_Light_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eCar_Light_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eCar_Light_mv(eEC_Effect_c* effect, GAME* game);
static void eCar_Light_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_car_light = {
// clang-format off
&eCar_Light_init,
&eCar_Light_ct,
&eCar_Light_mv,
&eCar_Light_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
extern Gfx ef_carhosi01_00_modelT[];
static void eCar_Light_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1){
eEC_CLIP->make_effect_proc(eEC_EFFECT_CAR_LIGHT, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
};
static void eCar_Light_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg){
effect->timer = 24;
};
static void eCar_Light_mv(eEC_Effect_c* effect, GAME* game){
if(effect->timer > 12){
effect->scale.x = eEC_CLIP->calc_adjust_proc(effect->timer, 12,24, 0.015f, 0.0f);
}
else{
effect->scale.x = eEC_CLIP->calc_adjust_proc(effect->timer, 0,12, 0.0f, 0.015f);
}
effect->scale.y = effect->scale.z = effect->scale.x;
};
static void eCar_Light_dw(eEC_Effect_c* effect, GAME* game){
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_proc(game, &effect->position, &effect->scale);
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 255, 255, 0,255);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_carhosi01_00_modelT);
CLOSE_DISP(game->graph);
};
+85
View File
@@ -0,0 +1,85 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eClacker_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eClacker_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eClacker_mv(eEC_Effect_c* effect, GAME* game);
static void eClacker_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_clacker = {
// clang-format off
&eClacker_init,
&eClacker_ct,
&eClacker_mv,
&eClacker_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
void eClacker_Make_Effect(eEC_Effect_c* effect, GAME* game) {
static s16 angle_tbl[] = {0x071C, 0x58E3, 0xAAAB};
int i;
for (i = 0; i < 3; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_TAPE, effect->position, effect->prio,
effect->effect_specific[0] + angle_tbl[i], game, effect->item_name,
effect->effect_specific[0], 0x1000);
}
for (i = 0; i < 20; i++) {
s16 arg0;
if (i < 5) {
arg0 = 0;
} else if (i < 10) {
arg0 = 1;
} else if (i < 15) {
arg0 = 2;
} else {
arg0 = 3;
}
eEC_CLIP->effect_make_proc(eEC_EFFECT_KAMIFUBUKI, effect->position, effect->prio, effect->effect_specific[0],
game, effect->item_name, arg0, 0x1000);
}
}
static void eClacker_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_DUST, pos, prio, 0, game, item_name, arg0, 3);
eEC_CLIP->make_effect_proc(eEC_EFFECT_CLACKER, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eClacker_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
s16* arg = ct_arg;
effect->effect_specific[0] = arg[0];
effect->timer = 0x50;
effect->velocity.x = 4.6f * sin_s(0x1000) * sin_s(effect->effect_specific[0]);
effect->velocity.y = 4.6f * cos_s(0x1000);
effect->velocity.z = 4.6f * sin_s(0x1000) * cos_s(effect->effect_specific[0]);
effect->acceleration = ZeroVec;
effect->acceleration.y = -0.125f;
}
static void eClacker_mv(eEC_Effect_c* effect, GAME* game) {
if (!(effect->timer & 7) && (effect->timer < 68)) {
xyz_t pos = effect->position;
pos.x += RANDOM2_F(100.0f);
pos.y += RANDOM2_F(30.0f);
pos.z += RANDOM2_F(100.0f);
eEC_CLIP->effect_make_proc(eEC_EFFECT_KIGAE_LIGHT, pos, effect->prio, 0, game, effect->item_name, 0, 0);
}
if (effect->timer == 76) {
eClacker_Make_Effect(effect, game);
}
if (effect->timer < 76) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
xyz_t_mult_v(&effect->velocity, sqrtf(0.9));
}
}
static void eClacker_dw(eEC_Effect_c* effect, GAME* game) {
}
+188
View File
@@ -0,0 +1,188 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
static void eCoin_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eCoin_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eCoin_mv(eEC_Effect_c* effect, GAME* game);
static void eCoin_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_coin = {
// clang-format off
&eCoin_init,
&eCoin_ct,
&eCoin_mv,
&eCoin_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eCoin_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_COIN, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static f32 eCoin_GetFountainHeight(void) {
int bx;
int bz;
if (mFI_BlockKind2BkNum(&bx, &bz, mRF_BLOCKKIND_SHRINE)) {
return 40.0f + mFI_BkNum2BaseHeight(bx, bz);
} else {
return 150.0f;
}
}
static void eCoin_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
s16 rng = RANDOM(10) & 1;
f32 dir;
s16 angle;
if (rng == 1) {
dir = RANDOM_F(768.0f);
} else {
dir = -fqrand() * 1024.0f;
}
angle = (int)dir + DEG2SHORT_ANGLE(192.65625f);
effect->position.x += 9.0f;
effect->position.y += 11.0f;
effect->position.z -= 15.0f;
effect->timer = 100;
effect->effect_specific[0] = FALSE;
effect->effect_specific[1] = RANDOM_F(65535);
effect->effect_specific[2] = RANDOM_F(65535);
effect->effect_specific[3] = RANDOM_F(65535);
effect->effect_specific[4] = 0;
effect->velocity.x = sin_s(angle) * 0.77f;
effect->velocity.y = 5.5f;
effect->velocity.z = cos_s(angle) * 0.77f;
effect->acceleration.x = 0.0f;
effect->acceleration.y = -0.2f;
effect->acceleration.z = 0.0f;
effect->offset.x = 14.0f + eCoin_GetFountainHeight() - 3.0f;
effect->offset.y = effect->offset.x - 4.5f;
sAdo_OngenTrgStart(0x466, &effect->position);
effect->effect_specific[5] = RANDOM(100) & 1; // 0 = gold coin, 1 = silver coin
}
static void eCoin_mv(eEC_Effect_c* effect, GAME* game) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
if (effect->effect_specific[0] == FALSE) {
eEC_CLIP->set_continious_env_proc(effect, 100, 100);
effect->effect_specific[1] += DEG2SHORT_ANGLE(21.093750f);
effect->effect_specific[2] += DEG2SHORT_ANGLE(18.281250f);
effect->effect_specific[3] += DEG2SHORT_ANGLE(19.687500f);
if (effect->position.y <= effect->offset.x) {
xyz_t pos = effect->position;
pos.y = effect->offset.x;
effect->position.y = effect->offset.x;
sAdo_OngenTrgStart(0x467, &effect->position);
effect->effect_specific[0] = TRUE;
eEC_CLIP->effect_make_proc(eEC_EFFECT_TURI_MIZU, pos, effect->prio, 0, game, (u16)effect->item_name, 0, 0);
effect->effect_specific[1] = 0;
effect->effect_specific[2] = 0;
effect->effect_specific[3] = 0;
effect->acceleration.x = 0.0f;
effect->acceleration.y = 0.0f;
effect->acceleration.z = 0.0f;
effect->velocity.x = 0.0f;
effect->velocity.y = -0.14f;
effect->velocity.z = 0.0f;
effect->timer = 300;
}
} else if (effect->position.y <= effect->offset.y) {
effect->position.y = effect->offset.y;
effect->velocity.x = 0.0f;
effect->velocity.y = 0.0f;
effect->velocity.z = 0.0f;
effect->effect_specific[1] = 0;
effect->effect_specific[2] = 0;
effect->effect_specific[3] = 0;
} else {
effect->effect_specific[4] += DEG2SHORT_ANGLE(7.031250f);
effect->effect_specific[1] = sin_s(effect->effect_specific[4]) * 2048.0f;
effect->effect_specific[3] = cos_s(effect->effect_specific[4]) * 2048.0f;
effect->effect_specific[2] = 0;
}
}
static u16 ef_coin_gold_pal[16] ATTRIBUTE_ALIGN(32) = {
#include "assets/ef_coin_gold_pal.inc"
};
static u16 ef_coin_silver_pal[16] ATTRIBUTE_ALIGN(32) = {
#include "assets/ef_coin_silver_pal.inc"
};
static u16* eCoin_pal_table[2] = { ef_coin_gold_pal, ef_coin_silver_pal };
extern Gfx ef_coin_model[];
extern Gfx ef_coin_modelT[];
static void eCoin_dw(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
if (effect->effect_specific[0] == FALSE) {
_texture_z_light_fog_prim(game->graph);
Setpos_HiliteReflect_init(&effect->position, play);
OPEN_DISP(game->graph);
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, 0);
Matrix_RotateX(effect->effect_specific[1], 1);
Matrix_RotateY(effect->effect_specific[2], 1);
Matrix_RotateZ(effect->effect_specific[3], 1);
Matrix_scale(0.01f, 0.01f, 0.01f, 1);
gSPSegment(NEXT_POLY_OPA_DISP, G_MWO_SEGMENT_8, eCoin_pal_table[effect->effect_specific[5] & 1]);
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_OPA_DISP, ef_coin_model);
CLOSE_DISP(game->graph);
} else {
u8 alpha = (int)eEC_CLIP->calc_adjust_proc(300 - effect->timer, 0, 300, 180.0f, 0.0f);
_texture_z_light_fog_prim_xlu(game->graph);
Setpos_HiliteReflect_xlu_init(&effect->position, play);
OPEN_DISP(game->graph);
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, 0);
Matrix_RotateX(effect->effect_specific[1], 1);
Matrix_RotateY(effect->effect_specific[2], 1);
Matrix_RotateZ(effect->effect_specific[3], 1);
Matrix_scale(0.01f, 0.01f, 0.01f, 1);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 128, 255, 255, 255, alpha);
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_8, eCoin_pal_table[effect->effect_specific[5] & 1]);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_coin_modelT);
CLOSE_DISP(game->graph);
}
}
+194
View File
@@ -0,0 +1,194 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eDashAsimoto_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eDashAsimoto_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eDashAsimoto_mv(eEC_Effect_c* effect, GAME* game);
static void eDashAsimoto_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_dash_asimoto = {
// clang-format off
&eDashAsimoto_init,
&eDashAsimoto_ct,
&eDashAsimoto_mv,
&eDashAsimoto_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static xyz_t eDahsAsimoto_GetMakeOffset(xyz_t pos, s16 angle_y) {
xyz_t base_ofs = { 0.0f, 0.0f, 10.0f };
sMath_RotateY(&base_ofs, SHORTANGLE2RAD(angle_y));
xyz_t_add(&pos, &base_ofs, &pos);
return pos;
}
static void eDashAsimoto_Hanabira_Make(eEC_Effect_c* effect, GAME* game) {
mActor_name_t* item_p = mFI_GetUnitFG(effect->position);
if (item_p != NULL && *item_p >= FLOWER_PANSIES0 && *item_p <= FLOWER_TULIP2) {
int i;
for (i = 0; i < 2; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_HANABIRA, effect->position, effect->prio, 0, game, effect->item_name,
*item_p - FLOWER_PANSIES0, 0);
}
}
}
static void eDashAsimoto_RainDay(eEC_Effect_c* effect, GAME* game) {
xyz_t pos = effect->position;
xyz_t bush_pos;
xyz_t ofs;
int i;
ofs = eDahsAsimoto_GetMakeOffset(pos, effect->effect_specific[0]);
bush_pos = ofs;
switch (effect->arg0) {
case mCoBG_ATTRIBUTE_BUSH:
i = 2;
do {
eEC_CLIP->effect_make_proc(eEC_EFFECT_BUSH_HAPPA, bush_pos, effect->prio, effect->effect_specific[0],
game, effect->item_name, effect->arg0, 1);
} while (i-- != 0);
break;
case mCoBG_ATTRIBUTE_FLOOR:
break;
case mCoBG_ATTRIBUTE_WAVE:
eEC_CLIP->effect_make_proc(eEC_EFFECT_SIBUKI, effect->position, effect->prio, effect->effect_specific[0],
game, effect->item_name, effect->arg0, 1);
break;
default:
eEC_CLIP->effect_make_proc(eEC_EFFECT_SIBUKI, effect->position, effect->prio, effect->effect_specific[0],
game, effect->item_name, effect->arg0, 0);
break;
}
}
static void eDashAsimoto_FineDay(eEC_Effect_c* effect, GAME* game) {
xyz_t pos = effect->position;
xyz_t bush_pos;
xyz_t ofs;
int season;
int i;
ofs = eDahsAsimoto_GetMakeOffset(pos, effect->effect_specific[0]);
bush_pos = ofs;
season = Common_Get(time.season);
switch (season) {
case mTM_SEASON_WINTER: {
switch (effect->arg0) {
case mCoBG_ATTRIBUTE_GRASS0:
case mCoBG_ATTRIBUTE_GRASS1:
case mCoBG_ATTRIBUTE_GRASS2:
case mCoBG_ATTRIBUTE_GRASS3:
eEC_CLIP->effect_make_proc(eEC_EFFECT_YUKIHANE, effect->position, effect->prio,
effect->effect_specific[0], game, effect->item_name, effect->arg0,
effect->arg1);
break;
case mCoBG_ATTRIBUTE_BUSH:
i = 2;
do {
eEC_CLIP->effect_make_proc(eEC_EFFECT_BUSH_HAPPA, bush_pos, effect->prio,
effect->effect_specific[0], game, effect->item_name, effect->arg0,
1);
} while (i-- != 0);
i = 2;
do {
eEC_CLIP->effect_make_proc(eEC_EFFECT_BUSH_YUKI, bush_pos, effect->prio,
effect->effect_specific[0], game, effect->item_name, effect->arg0,
0);
} while (i-- != 0);
break;
case mCoBG_ATTRIBUTE_FLOOR:
break;
case mCoBG_ATTRIBUTE_SAND:
eEC_CLIP->effect_make_proc(eEC_EFFECT_SANDSPLASH, effect->position, effect->prio,
effect->effect_specific[0], game, effect->item_name, effect->arg0, 0);
break;
case mCoBG_ATTRIBUTE_WAVE:
eEC_CLIP->effect_make_proc(eEC_EFFECT_SIBUKI, effect->position, effect->prio,
effect->effect_specific[0], game, effect->item_name, effect->arg0, 1);
break;
default:
eEC_CLIP->effect_make_proc(eEC_EFFECT_DUST, effect->position, effect->prio,
effect->effect_specific[0], game, effect->item_name, effect->arg0, 8);
break;
}
break;
}
default: {
switch (effect->arg0) {
case mCoBG_ATTRIBUTE_BUSH:
i = 2;
do {
eEC_CLIP->effect_make_proc(eEC_EFFECT_BUSH_HAPPA, bush_pos, effect->prio,
effect->effect_specific[0], game, effect->item_name, effect->arg0,
1);
} while (i-- != 0);
break;
case mCoBG_ATTRIBUTE_FLOOR:
break;
case mCoBG_ATTRIBUTE_SAND:
eEC_CLIP->effect_make_proc(eEC_EFFECT_SANDSPLASH, effect->position, effect->prio,
effect->effect_specific[0], game, effect->item_name, effect->arg0, 0);
break;
case mCoBG_ATTRIBUTE_WAVE:
eEC_CLIP->effect_make_proc(eEC_EFFECT_SIBUKI, effect->position, effect->prio,
effect->effect_specific[0], game, effect->item_name, effect->arg0, 1);
break;
default:
eEC_CLIP->effect_make_proc(eEC_EFFECT_DUST, effect->position, effect->prio,
effect->effect_specific[0], game, effect->item_name, effect->arg0, 8);
break;
}
break;
}
}
}
static void eDashAsimoto_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_DASH_ASIMOTO, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
typedef void (*eDashAsimoto_PROC)(eEC_Effect_c*, GAME*);
static void eDashAsimoto_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// clang-format off
static eDashAsimoto_PROC asimoto_func_table[mEnv_WEATHER_NUM] = {
&eDashAsimoto_FineDay,
&eDashAsimoto_RainDay,
&eDashAsimoto_FineDay,
&eDashAsimoto_FineDay,
/* @BUG - the step effect process func for 'leaves' weather is left as NULL */
#ifdef BUGFIXES
&eDashAsimoto_FineDay,
#else
NULL,
#endif
};
// clang-format on
s16 weather = mEnv_NowWeather();
s16* angle_p = (s16*)ct_arg;
effect->timer = 0;
eDashAsimoto_Hanabira_Make(effect, game);
effect->effect_specific[0] = *angle_p;
(*asimoto_func_table[weather])(effect, game);
}
static void eDashAsimoto_mv(eEC_Effect_c* effect, GAME* game) {
// empty
}
static void eDashAsimoto_dw(eEC_Effect_c* effect, GAME* game) {
// empty
}
+197
View File
@@ -0,0 +1,197 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_player_lib.h"
#include "m_rcp.h"
#include "sys_matrix.h"
static void eDig_Hole_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eDig_Hole_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eDig_Hole_mv(eEC_Effect_c* effect, GAME* game);
static void eDig_Hole_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_dig_hole = {
// clang-format off
&eDig_Hole_init,
&eDig_Hole_ct,
&eDig_Hole_mv,
&eDig_Hole_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
typedef struct dig_hole_init_data_s {
s16 type;
s16 angle_y;
s16 goal_angle_x;
s16 timer;
} eDig_Hole_init_data_c;
static void eDig_Hole_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
GAME_PLAY* play = (GAME_PLAY*)game;
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
pos.x += player->actor_class.world.position.x + sin_s(angle) * 30.0f;
pos.z += player->actor_class.world.position.z + cos_s(angle) * 30.0f;
pos.x /= 2.0f;
pos.z /= 2.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_DIG_HOLE, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eDig_Hole_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
static xyz_t fill_hole_pos_tbl[] = {
{ 0.0f, 0.0f, -21.0f },
{ 11.0f, 0.0f, -14.0f },
{ -3.0f, 0.0f, -8.0f },
};
static eDig_Hole_init_data_c init_data[] = {
{ 0, DEG2SHORT_ANGLE2(180.0f), DEG2SHORT_ANGLE2(179.0f), 36 },
{ 0, DEG2SHORT_ANGLE2(60.0f), DEG2SHORT_ANGLE2(179.0f), 36 },
{ 0, DEG2SHORT_ANGLE2(300.0f) + 1, DEG2SHORT_ANGLE2(179.0f), 36 },
{ 1, DEG2SHORT_ANGLE2(270.0f), DEG2SHORT_ANGLE2(179.0f), 58 },
{ 1, DEG2SHORT_ANGLE2(270.0f), DEG2SHORT_ANGLE2(179.0f), 46 },
{ 1, DEG2SHORT_ANGLE2(270.0f), DEG2SHORT_ANGLE2(150.0f), 34 },
};
s16* angle_p = (s16*)ct_arg;
effect->effect_specific[0] = *angle_p;
effect->effect_specific[4] = init_data[effect->arg1].type;
effect->effect_specific[0] += init_data[effect->arg1].angle_y;
effect->effect_specific[3] = init_data[effect->arg1].goal_angle_x;
effect->effect_specific[2] = init_data[effect->arg1].timer;
effect->effect_specific[1] = 0;
effect->scale = ZeroVec;
if (effect->effect_specific[4] == 1) {
xyz_t pos = fill_hole_pos_tbl[effect->arg1 - 3];
eEC_CLIP->vector_rotate_y_proc(&pos, SHORTANGLE2RAD(effect->effect_specific[0]));
effect->position.x += pos.x;
effect->position.y += 10.0f;
effect->position.z += pos.z;
eEC_CLIP->effect_make_proc(eEC_EFFECT_DIG_MUD, effect->position, effect->prio, effect->effect_specific[0], game,
effect->item_name, effect->arg0, 6);
} else {
effect->position.x += 5.0f * sin_s(effect->effect_specific[0]);
effect->position.y += 10.0f;
effect->position.z += 5.0f * cos_s(effect->effect_specific[0]);
}
if (effect->arg0 == mCoBG_ATTRIBUTE_WAVE) {
int i;
s16 mizutama_arg1;
s16 mizutama_angle = *angle_p;
s16 angle;
xyz_t pos = effect->position;
pos.y = 21.0f;
if (effect->arg1 <= 2) {
mizutama_arg1 = 0x4000 | (effect->arg1 << 1);
} else {
mizutama_arg1 = 0x4000 | (5 << 1);
}
for (i = 0; i < 2; i++) {
pos.x = effect->position.x + RANDOM2_F(10.0f);
pos.z = effect->position.z + RANDOM2_F(10.0f);
if (effect->arg1 > 2) {
angle = mizutama_angle + (s16)(int)(RANDOM2_F(150.0f) * 182.04445f);
} else {
angle = mizutama_angle + (s16)(int)(RANDOM2_F(90.0f) * 182.04445f);
}
mizutama_angle = angle;
eEC_CLIP->effect_make_proc(eEC_EFFECT_MIZUTAMA, pos, effect->prio, mizutama_angle, game, effect->item_name,
effect->arg0, mizutama_arg1);
}
}
effect->timer = effect->effect_specific[2];
}
static void eDig_Hole_mv(eEC_Effect_c* effect, GAME* game) {
if (effect->timer > (effect->effect_specific[2] - 6)) {
effect->scale.x += 0.00108333334f;
effect->scale.y = effect->scale.z = effect->scale.x;
} else if (effect->timer < 6 && effect->effect_specific[4] == 1) {
effect->scale.x -= 0.00108333334f;
effect->scale.y = effect->scale.z = effect->scale.x;
} else if (effect->effect_specific[4] == 1 || effect->timer <= (effect->effect_specific[2] - 8)) {
add_calc_short_angle2(&effect->effect_specific[1], effect->effect_specific[3], 1.0f - sqrtf(0.8f), 1820, 91);
}
if (effect->timer == (effect->effect_specific[2] - 8)) {
f32 speed;
if (effect->arg1 == 0 || effect->arg1 == 1 || effect->arg1 == 2) {
speed = 0.15f;
} else {
speed = 0.75f;
}
effect->velocity.y = 1.0f;
effect->velocity.x = speed * sin_s(effect->effect_specific[0]);
effect->velocity.z = speed * cos_s(effect->effect_specific[0]);
effect->acceleration.y = -0.1f;
}
if (effect->effect_specific[4] == 0 || effect->timer > (effect->effect_specific[2] - 30)) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
}
}
extern Gfx ef_anahori01_00_model[];
extern Gfx ef_anahori01_01_model[];
extern Gfx ef_anahori01_02_model[];
static void eDig_Hole_dw(eEC_Effect_c* effect, GAME* game) {
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->effect_specific[0], 1);
Matrix_RotateX(effect->effect_specific[1], 1);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, 1);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (effect->effect_specific[4] == 0) {
u8 a = (int)eEC_CLIP->calc_adjust_proc(effect->timer, 0, 10, 0.0f, 255.0f);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 255, 255, a);
} else {
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 255, 255, 255);
}
switch (effect->arg0) {
case mCoBG_ATTRIBUTE_GRASS0:
case mCoBG_ATTRIBUTE_GRASS1:
case mCoBG_ATTRIBUTE_GRASS2:
if (effect->effect_specific[4] == 0) {
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_anahori01_00_model);
} else {
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_anahori01_01_model);
}
break;
case mCoBG_ATTRIBUTE_WAVE:
case mCoBG_ATTRIBUTE_SAND:
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_anahori01_02_model);
break;
default:
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_anahori01_01_model);
break;
}
CLOSE_DISP(game->graph);
}
+168
View File
@@ -0,0 +1,168 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
#include "m_debug.h"
extern u8 ef_mogura01_01_tex[];
extern u8 ef_mogura01_02_tex[];
extern u8 ef_mogura01_03_tex[];
extern u8 ef_mogura01_04_tex[];
extern u8 ef_anahori02_01_tex[];
extern u8 ef_anahori02_02_tex[];
extern u8 ef_anahori02_03_tex[];
extern u8 ef_anahori02_04_tex[];
extern u8 ef_anahori03_01_tex[];
extern u8 ef_anahori03_02_tex[];
extern u8 ef_anahori03_03_tex[];
extern u8 ef_anahori03_04_tex[];
static u8* eDig_Mud_tex_tbl[] = {
ef_anahori02_01_tex,
ef_anahori02_02_tex,
ef_anahori02_03_tex,
ef_anahori02_04_tex,
};
static u8* eDig_Mud_Sand_tex_tbl[] = {
ef_anahori03_01_tex,
ef_anahori03_02_tex,
ef_anahori03_03_tex,
ef_anahori03_04_tex,
};
static u8* eDig_Mud_Mogura_tex_tbl[] = {
ef_mogura01_02_tex,
ef_mogura01_03_tex,
ef_mogura01_01_tex,
ef_mogura01_04_tex,
};
static void eDig_Mud_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eDig_Mud_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eDig_Mud_mv(eEC_Effect_c* effect, GAME* game);
static void eDig_Mud_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_dig_mud = {
// clang-format off
&eDig_Mud_init,
&eDig_Mud_ct,
&eDig_Mud_mv,
&eDig_Mud_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eDig_Mud_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_DIG_MUD, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eDig_Mud_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
s16* angle_p = (s16*)ct_arg;
s16 angle_y = *angle_p;
s16 angle_x = (s16)(int)((-60.0f + RANDOM2_F(20.0f)) * 182.04445f);
f32 cos_x = cos_s(angle_x);
f32 speed = -3.5f + RANDOM2_F(4.5f) * 0.5f;
if ((effect->arg1 & 0x8000)) {
effect->effect_specific[1] = 1;
effect->arg1 &= ~0x8000;
} else {
effect->effect_specific[1] = 0;
}
if ((effect->arg1 & 0x4000)) {
effect->scale.x = effect->scale.y = effect->scale.z = (0.5f + GETREG(TAKREG, 15) * 0.01f) * 0.01f;
effect->effect_specific[2] = 1;
effect->arg1 &= ~0x4000;
} else {
effect->scale.x = effect->scale.y = effect->scale.z = 0.01f;
effect->effect_specific[2] = 0;
}
if (effect->arg1 == 0 || effect->arg1 == 3) {
effect->effect_specific[0] = 32;
} else if (effect->arg1 == 1 || effect->arg1 == 4) {
effect->effect_specific[0] = 30;
} else {
effect->effect_specific[0] = 28;
}
if (effect->arg1 < 3) {
angle_y += (int)((30.0f + RANDOM2_F(20.0f)) * 182.04445f);
effect->velocity.x = (speed * cos_x) * sin_s(angle_y);
effect->velocity.y = speed * sin_s(angle_x);
effect->velocity.z = (speed * cos_x) * cos_s(angle_y);
} else if (effect->arg1 < 6) {
angle_y += (s16)(int)((120.0f * effect->arg1) * 182.04445f);
effect->velocity.x = 0.4f * sin_s(angle_y);
effect->velocity.y = 1.75f + fqrand();
effect->velocity.z = 0.4f * cos_s(angle_y);
} else if (effect->arg1 != 8) {
effect->velocity.x = sin_s(angle_y);
effect->velocity.y = 2.0f + fqrand();
effect->velocity.z = cos_s(angle_y);
} else {
effect->velocity.x = 0.0f;
effect->velocity.y = 2.0f + fqrand();
effect->velocity.z = 0.0f;
}
effect->acceleration.y = -0.175f;
effect->timer = effect->effect_specific[0];
}
static void eDig_Mud_mv(eEC_Effect_c* effect, GAME* game) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
if (effect->timer < 18) {
if (effect->effect_specific[2] != 1) {
eEC_CLIP->calc_adjust_proc(effect->timer, 0, 18, 0.012f, 0.010f);
} else {
eEC_CLIP->calc_adjust_proc(effect->timer, 0, 18, 0.006f, 0.005f);
}
}
}
extern Gfx ef_anahori02_00_modelT[];
extern Gfx ef_anahori03_00_modelT[];
extern Gfx ef_mogura01_00_modelT[];
static void eDig_Mud_dw(eEC_Effect_c* effect, GAME* game) {
int tex_idx;
if (effect->timer > 18) {
tex_idx = 0;
} else if (effect->timer > 14) {
tex_idx = 1;
} else if (effect->timer > 10) {
tex_idx = 2;
} else {
tex_idx = 3;
}
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_proc(game, &effect->position, &effect->scale);
if (effect->effect_specific[1] == 1) {
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_1_TXT_SEG, eDig_Mud_Mogura_tex_tbl[tex_idx]);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_mogura01_00_modelT);
} else if (effect->arg0 == mCoBG_ATTRIBUTE_SAND || effect->arg0 == mCoBG_ATTRIBUTE_WAVE) {
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_1_TXT_SEG, eDig_Mud_Sand_tex_tbl[tex_idx]);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_anahori03_00_modelT);
} else {
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_1_TXT_SEG, eDig_Mud_tex_tbl[tex_idx]);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_anahori02_00_modelT);
}
CLOSE_DISP(game->graph);
}
+181
View File
@@ -0,0 +1,181 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_player_lib.h"
static void eDig_Scoop_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eDig_Scoop_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eDig_Scoop_mv(eEC_Effect_c* effect, GAME* game);
static void eDig_Scoop_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_dig_scoop = {
// clang-format off
&eDig_Scoop_init,
&eDig_Scoop_ct,
&eDig_Scoop_mv,
&eDig_Scoop_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eDig_Scoop_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
ACTOR* player_actorx = (ACTOR*)GET_PLAYER_ACTOR_GAME(game);
PLAYER_ACTOR* player;
int i;
s16 star_ef_angle;
s16 sand_angle;
xyz_t sand_pos;
s16 dust_angle;
pos.x += player_actorx->world.position.x + 30.0f * sin_s(angle);
pos.z += player_actorx->world.position.z + 30.0f * cos_s(angle);
pos.x /= 2.0f;
pos.z /= 2.0f;
if (eEC_CLIP != NULL) {
if (arg1 == 1) {
player = GET_PLAYER_ACTOR_GAME(game);
star_ef_angle = angle + DEG2SHORT_ANGLE2(22.5f);
switch (arg0) {
case mCoBG_ATTRIBUTE_BUSH: {
int i = 4;
do {
eEC_CLIP->effect_make_proc(eEC_EFFECT_BUSH_HAPPA, player->actor_class.world.position, prio,
angle, game, item_name, arg0, 1);
} while (i--);
if (Common_Get(time).season == mTM_SEASON_WINTER) {
int j = 4;
do {
eEC_CLIP->effect_make_proc(eEC_EFFECT_BUSH_YUKI, player->actor_class.world.position, prio,
angle, game, item_name, arg0, 0);
} while (j--);
}
break;
}
case mCoBG_ATTRIBUTE_GRASS0:
case mCoBG_ATTRIBUTE_GRASS1:
case mCoBG_ATTRIBUTE_GRASS2:
case mCoBG_ATTRIBUTE_SOIL0:
case mCoBG_ATTRIBUTE_SOIL1:
case mCoBG_ATTRIBUTE_SOIL2: {
f32 ground_dist = mCoBG_GetBgY_AngleS_FromWpos(NULL, pos, 0.0f);
if (ground_dist < (pos.y + 10.0f)) {
break;
}
}
/* Fallthrough */
default: {
s16 i;
pos.y += 11.0f;
for (i = 0; i < 2; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_IMPACT_STAR, pos, prio, star_ef_angle, game, item_name,
arg0, (s16)i);
}
break;
}
}
} else if (arg1 == 0) {
pos.y += 10.0f;
for (i = 0; i < 6; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_DIG_MUD, pos, prio, angle, game, item_name, arg0, i);
}
} else if (arg1 == 3) {
pos.y += 10.0f;
for (i = 3; i < 6; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_DIG_MUD, pos, prio, angle, game, item_name, arg0, i);
}
} else {
pos.y += 5.0f;
if (Common_Get(time).season == mTM_SEASON_WINTER) {
if (arg0 == mCoBG_ATTRIBUTE_GRASS0 || arg0 == mCoBG_ATTRIBUTE_GRASS1 ||
arg0 == mCoBG_ATTRIBUTE_GRASS2) {
for (i = 2; i < 6; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_YUKIDAMA, pos, prio, angle, game, item_name, arg0,
(0x2000 | 0x1000) | i);
}
} else if (arg0 == mCoBG_ATTRIBUTE_SAND) {
sand_angle = angle - DEG2SHORT_ANGLE2(45.0f);
for (i = 0; i < 3; i++) {
xyz_t sand_pos = pos;
sand_pos.x += 15.0f * sin_s(sand_angle);
sand_pos.z += 15.0f * cos_s(sand_angle);
eEC_CLIP->effect_make_proc(eEC_EFFECT_SANDSPLASH, sand_pos, prio, sand_angle, game, item_name,
3, 0);
sand_angle += DEG2SHORT_ANGLE2(45.0f);
}
} else if (mEnv_NowWeather() != mEnv_WEATHER_RAIN && arg0 != mCoBG_ATTRIBUTE_WAVE) {
dust_angle = angle - DEG2SHORT_ANGLE2(45.0f);
for (i = 0; i < 3; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_TUMBLE_DUST, pos, prio, dust_angle, game, item_name, arg0,
i);
dust_angle += DEG2SHORT_ANGLE2(45.0f);
}
} else {
for (i = 2; i < 6; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_MIZUTAMA, pos, prio, angle, game, item_name, arg0,
(0x2000 | 0x1000) | i);
}
if (arg0 == mCoBG_ATTRIBUTE_WAVE) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_AMI_MIZU, pos, prio, angle, game, item_name, 1, 0);
}
}
} else {
if (arg0 == mCoBG_ATTRIBUTE_SAND) {
sand_angle = angle - DEG2SHORT_ANGLE2(45.0f);
for (i = 0; i < 3; i++) {
xyz_t sand_pos = pos;
sand_pos.x += 15.0f * sin_s(sand_angle);
sand_pos.z += 15.0f * cos_s(sand_angle);
eEC_CLIP->effect_make_proc(eEC_EFFECT_SANDSPLASH, sand_pos, prio, sand_angle, game, item_name,
3, 0);
sand_angle += DEG2SHORT_ANGLE2(45.0f);
}
} else if (mEnv_NowWeather() == mEnv_WEATHER_RAIN || arg0 == mCoBG_ATTRIBUTE_WAVE) {
for (i = 2; i < 6; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_MIZUTAMA, pos, prio, angle, game, item_name, arg0,
(0x2000 | 0x1000) | i);
}
if (arg0 == mCoBG_ATTRIBUTE_WAVE) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_AMI_MIZU, pos, prio, angle, game, item_name, 1, 0);
}
} else {
dust_angle = angle - DEG2SHORT_ANGLE2(45.0f);
for (i = 0; i < 3; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_TUMBLE_DUST, pos, prio, dust_angle, game, item_name, arg0,
i);
dust_angle += DEG2SHORT_ANGLE2(45.0f);
}
}
}
}
}
eEC_CLIP->make_effect_proc(eEC_EFFECT_DIG_SCOOP, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eDig_Scoop_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = 0;
}
static void eDig_Scoop_mv(eEC_Effect_c* effect, GAME* game) {
// empty
}
static void eDig_Scoop_dw(eEC_Effect_c* effect, GAME* game) {
// empty
}
+82
View File
@@ -0,0 +1,82 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
static void eDouzou_Light_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eDouzou_Light_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eDouzou_Light_mv(eEC_Effect_c* effect, GAME* game);
static void eDouzou_Light_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_douzou_light = {
// clang-format off
&eDouzou_Light_init,
&eDouzou_Light_ct,
&eDouzou_Light_mv,
&eDouzou_Light_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eDouzou_Light_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_DOUZOU_LIGHT, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eDouzou_Light_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
switch (effect->arg0) {
case 0:
effect->offset.x = 0.012f;
break;
case 1:
effect->offset.x = 0.011f;
break;
case 2:
effect->offset.x = 0.010f;
break;
default:
effect->offset.x = 0.009f;
break;
}
effect->timer = 24;
}
static void eDouzou_Light_mv(eEC_Effect_c* effect, GAME* game) {
if (effect->timer > 12) {
effect->scale.x = eEC_CLIP->calc_adjust_proc(effect->timer, 12, 24, effect->offset.x, 0.0f);
} else {
effect->scale.x = eEC_CLIP->calc_adjust_proc(effect->timer, 0, 12, 0.0f, effect->offset.x);
}
effect->scale.y = effect->scale.z = effect->scale.x;
}
extern Gfx ef_carhosi01_00_modelT[];
static void eDouzou_Light_dw(eEC_Effect_c* effect, GAME* game) {
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_proc(game, &effect->position, &effect->scale);
switch (effect->arg0) {
case 0:
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 255, 255, 0, 255);
break;
case 1:
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 200, 255, 255, 255);
break;
case 2:
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 255, 100, 100, 255);
break;
default:
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 100, 255, 100, 255);
break;
}
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_carhosi01_00_modelT);
CLOSE_DISP(game->graph);
}
+86
View File
@@ -0,0 +1,86 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
static void eDoyon_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eDoyon_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eDoyon_mv(eEC_Effect_c* effect, GAME* game);
static void eDoyon_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_doyon = {
// clang-format off
&eDoyon_init,
&eDoyon_ct,
&eDoyon_mv,
&eDoyon_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eDoyon_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_DOYON, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eDoyon_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
s16 rng = qrand();
s16 rng_angle = (s16)((f32)rng * 0.75f);
effect->position.x += 10.0f * sin_s(rng_angle);
effect->position.y += 10.0f * cos_s(rng_angle);
effect->velocity.x += sin_s(rng_angle) * 0.5f;
effect->velocity.y += cos_s(rng_angle) * 0.5f;
effect->offset.z = 20.0f;
effect->scale = ZeroVec;
effect->scale.z = 0.1f;
effect->timer = 60;
sAdo_OngenTrgStart(NA_SE_DOYON, &effect->position);
}
static void eDoyon_mv(eEC_Effect_c* effect, GAME* game) {
f32 progress = eEC_CLIP->calc_adjust_proc(effect->timer, 0, 60, 0.0f, 5.0f);
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
effect->effect_specific[0] += DEG2SHORT_ANGLE2(5.625f);
effect->effect_specific[1] += DEG2SHORT_ANGLE2(5.625f);
effect->velocity.x *= sqrtf(0.95f);
effect->velocity.y *= sqrtf(0.95f);
if (effect->timer > 50) {
f32 scale = (60 - effect->timer) * 0.00065f;
effect->scale.x = scale * (1.0f + 0.2f * cos_s(effect->effect_specific[0]));
effect->scale.y = scale * (1.0f + 0.2f * sin_s(effect->effect_specific[0]));
} else {
effect->scale.x = (1.0f + 0.2f * cos_s(effect->effect_specific[0])) * 0.0065f;
effect->scale.y = (1.0f + 0.2f * sin_s(effect->effect_specific[0])) * 0.0065f;
}
effect->offset.x = progress * cos_s(effect->effect_specific[1]);
effect->offset.y = progress * sin_s(effect->effect_specific[1]);
}
extern Gfx ef_doyon01_00_modelT[];
static void eDoyon_dw(eEC_Effect_c* effect, GAME* game) {
u8 a = (int)eEC_CLIP->calc_adjust_proc(effect->timer, 0, 8, 0.0f, 220.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, 40, 30, 40, a);
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 100, 100, 255, 255);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_doyon01_00_modelT);
CLOSE_DISP(game->graph);
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eDT_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eDT_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eDT_mv(eEC_Effect_c* effect, GAME* game);
static void eDT_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_dust = {
// clang-format off
&eDT_init,
&eDT_ct,
&eDT_mv,
&eDT_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eDT_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eDT_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eDT_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eDT_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+444
View File
@@ -0,0 +1,444 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "sys_matrix.h"
#include "m_rcp.h"
#include "m_player_lib.h"
#include "m_debug.h"
static eEC_PROFILE_c* profile_tbl[] = {
&iam_ef_shock,
&iam_ef_dust,
&iam_ef_muka,
&iam_ef_warau,
&iam_ef_ha,
&iam_ef_sibuki,
&iam_ef_gimonhu,
&iam_ef_kantanhu,
&iam_ef_ase,
&iam_ef_ase_ch,
&iam_ef_kangaeru,
&iam_ef_otikomi,
&iam_ef_buruburu,
&iam_ef_siawase_hikari,
&iam_ef_siawase_hana,
&iam_ef_siawase_hana_ch,
&iam_ef_takurami,
&iam_ef_takurami_kira,
&iam_ef_kaze,
&iam_ef_kaze_happa,
&iam_ef_lovelove,
&iam_ef_lovelove_heart,
&iam_ef_pun,
&iam_ef_pun_yuge,
&iam_ef_pun_sekimen,
&iam_ef_naku,
&iam_ef_namida,
&iam_ef_hirameki_den,
&iam_ef_hirameki_hikari,
&iam_ef_situren,
&iam_ef_ase2,
&iam_ef_dash_asimoto,
&iam_ef_konpu,
&iam_ef_lovelove2,
&iam_ef_kpun,
&iam_ef_kisha_kemuri,
&iam_ef_neboke,
&iam_ef_neboke_awa,
&iam_ef_hanabi_yanagi,
&iam_ef_hanabi_botan1,
&iam_ef_hanabi_botan2,
&iam_ef_hanabi_hoshi,
&iam_ef_hanabi_set,
&iam_ef_hanabi_switch,
&iam_ef_footprint,
&iam_ef_turn_footprint,
&iam_ef_bubu,
&iam_ef_turn_asimoto,
&iam_ef_string,
&iam_ef_yukihane,
&iam_ef_anahikari,
&iam_ef_bush_happa,
&iam_ef_bush_yuki,
&iam_ef_tumble,
&iam_ef_tumble_bodyprint,
&iam_ef_slip,
&iam_ef_tumble_dust,
&iam_ef_swing_net,
&iam_ef_ami_mizu,
&iam_ef_mizutama,
&iam_ef_yukidama,
&iam_ef_kikuzu,
&iam_ef_swing_axe,
&iam_ef_steam,
&iam_ef_night15_moon,
&iam_ef_night13_moon,
&iam_ef_neboke_akubi,
&iam_ef_slip_footprint,
&iam_ef_walk_asimoto,
&iam_ef_turi_hamon,
&iam_ef_turi_mizu,
&iam_ef_turi_hane0,
&iam_ef_turi_hane1,
&iam_ef_turi_suiteki,
&iam_ef_ongen,
&iam_ef_impact_star,
&iam_ef_sandsplash,
&iam_ef_young_tree,
&iam_ef_swing_rod,
&iam_ef_doyon,
&iam_ef_kagu_happa,
&iam_ef_hanabi_dummy,
&iam_ef_dig_hole,
&iam_ef_dig_scoop,
&iam_ef_dig_mud,
&iam_ef_kigae,
&iam_ef_kigae_light,
&iam_ef_tape,
&iam_ef_clacker,
&iam_ef_kamifubuki,
&iam_ef_car_blight,
&iam_ef_tamaire,
&iam_ef_car_light,
&iam_ef_reset_hole,
&iam_ef_goki,
&iam_ef_hanabira,
&iam_ef_wait_asimoto,
&iam_ef_otosiana,
&iam_ef_ikigire,
&iam_ef_yukidaruma,
&iam_ef_kyousou_onpu,
&iam_ef_douzou_light,
&iam_ef_halloween_smoke,
&iam_ef_halloween,
&iam_ef_motiyuge,
&iam_ef_taberu,
&iam_ef_kasamizu,
&iam_ef_kasamizutama,
&iam_ef_hanatiri,
&iam_ef_uranai,
&iam_ef_suisou_awa,
&iam_ef_break_axe,
&iam_ef_yajirushi,
&iam_ef_soba_yuge,
&iam_ef_furo_yuge,
&iam_ef_shooting,
&iam_ef_shooting_set,
&iam_ef_shooting_kira,
&iam_ef_coin,
&iam_ef_tent_lamp,
&iam_ef_flash,
&iam_ef_flashC,
&iam_ef_killer,
&iam_ef_make_hem,
&iam_ef_make_hem_kira,
&iam_ef_make_hem_light,
};
static u8 eEC_effect_feature[] = {
FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE,
TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE,
FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE,
};
static void eEC_actor_ct(ACTOR* actorx, GAME* game);
static void eEC_actor_dt(ACTOR* actorx, GAME* game);
static void eEC_actor_move(ACTOR* actorx, GAME* game);
static void eEC_actor_draw(ACTOR* actorx, GAME* game);
ACTOR_PROFILE Effect_Control_Profile = {
mAc_PROFILE_EFFECT_CONTROL,
ACTOR_PART_CONTROL,
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(EFFECT_CONTROL_ACTOR),
&eEC_actor_ct,
&eEC_actor_dt,
&eEC_actor_move,
&eEC_actor_draw,
NULL,
};
static eEC_work_c eEC_ctrl_work;
#include "../src/effect/ef_effect_lib.c"
static void eEC_Name2EffectMake(int effect_id, xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0,
s16 arg1) {
if (effect_id >= 0 && effect_id < eEC_EFFECT_NUM) {
if (eEC_effect_feature[effect_id] == FALSE) {
profile_tbl[effect_id]->init_proc(pos, prio, angle, game, item_name, arg0, arg1);
} else if (eEC_effect_feature[effect_id] == TRUE) {
int i;
u8* active_flags = eEC_ctrl_work.effect_active_flags;
eEC_Effect_c* effect = eEC_ctrl_work.effects;
/* Check if any of the spawned effects are an exact match to this one */
for (i = 0; i < eEC_EFFECT_ACTIVE_MAX; i++, active_flags++, effect++) {
if (*active_flags && effect->name == effect_id && effect->item_name == item_name) {
return;
}
}
/* No exact matches, so create effect */
profile_tbl[effect_id]->init_proc(pos, prio, angle, game, item_name, arg0, arg1);
}
}
}
static void eEC_Name2EffectKill(int effect_id, u16 item_name) {
int i;
u8* active_flags = eEC_ctrl_work.effect_active_flags;
eEC_Effect_c* effect = eEC_ctrl_work.effects;
for (i = 0; i < eEC_EFFECT_ACTIVE_MAX; i++, active_flags++, effect++) {
if (*active_flags && effect->name == effect_id && effect->item_name == item_name && effect->prog_idx != -1) {
if (profile_tbl[effect_id]->n_frames == eEC_IMMEDIATE_DEATH) {
*active_flags = 0;
if (profile_tbl[effect_id]->child_effect_id != eEC_NO_CHILD_ID) {
eEC_Name2EffectKill(profile_tbl[effect_id]->child_effect_id, item_name);
}
} else if (profile_tbl[effect_id]->n_frames != eEC_IGNORE_DEATH) {
effect->timer = profile_tbl[effect_id]->n_frames;
effect->state = eEC_STATE_FINISHED;
if (profile_tbl[effect_id]->child_effect_id != eEC_NO_CHILD_ID) {
eEC_Name2EffectKill(profile_tbl[effect_id]->child_effect_id, item_name);
}
}
}
}
}
static void eEC_Name2EffectKillAll(u16 item_name) {
int i;
u8* active_flags = eEC_ctrl_work.effect_active_flags;
eEC_Effect_c* effect = eEC_ctrl_work.effects;
for (i = 0; i < eEC_EFFECT_ACTIVE_MAX; i++, active_flags++, effect++) {
if (*active_flags && effect->item_name == item_name && effect->prog_idx != -1) {
if (profile_tbl[effect->name]->n_frames == eEC_IMMEDIATE_DEATH) {
*active_flags = FALSE;
} else if (eEC_ctrl_work.program_info[effect->prog_idx].end_frame != eEC_IGNORE_DEATH) {
effect->timer = eEC_ctrl_work.program_info[effect->prog_idx].end_frame;
effect->state = eEC_STATE_FINISHED;
}
}
}
}
static void eEC_InitEffectControlWork(void) {
eEL_InitUnchar(eEC_ctrl_work.effect_active_flags, eEC_EFFECT_ACTIVE_MAX, 0);
eEC_ctrl_work.active_effect_num = 0;
}
static eEC_Effect_c* eEC_MakeEffect(s16 effect_id, xyz_t pos, xyz_t* ofs, GAME* game, void* ct_arg, u16 item_name,
int prio, s16 arg0, s16 arg1);
static void eEC_EffectLib2Clip(ACTOR* actorx) {
EFFECT_CONTROL_ACTOR* effect_ctrl = (EFFECT_CONTROL_ACTOR*)actorx;
effect_ctrl->clip.effect_make_proc = &eEC_Name2EffectMake;
effect_ctrl->clip.effect_kill_proc = &eEC_Name2EffectKill;
effect_ctrl->clip.effect_kill_all_proc = &eEC_Name2EffectKillAll;
effect_ctrl->clip.vector_rotate_y_proc = &eEL_VectorRoteteY;
effect_ctrl->clip.random_first_speed_proc = &eEL_RandomFirstSpeed;
effect_ctrl->clip.set_continious_env_proc = &eEL_SetContiniousEnv;
effect_ctrl->clip.calc_adjust_proc = &eEL_CalcAdjust;
effect_ctrl->clip.auto_matrix_xlu_proc = &eEL_AutoMatrixXlu;
effect_ctrl->clip.auto_matrix_xlu_offset_proc = &eEL_AutoMatrixXlu_Offset;
effect_ctrl->clip._20 = NULL;
effect_ctrl->clip._24 = NULL;
effect_ctrl->clip.make_effect_proc = &eEC_MakeEffect;
effect_ctrl->clip.morph_combine_proc = &eEC_MorphCombine;
effect_ctrl->clip.regist_effect_light = &eEL_RegistEffectLight;
effect_ctrl->clip.decide_light_power_proc = &eEL_DecideLightPower;
effect_ctrl->clip.check_lookat_block_proc = &mEL_CheckLookAtBlock;
effect_ctrl->clip.effect_light_status = &eEL_EffectLightStatus;
effect_ctrl->clip.special_block_center_pos_proc = &eEL_SpecialBlockCenterPos;
eEC_CLIP = &effect_ctrl->clip;
}
static void eEC_MakeEffectLight(GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
Light_diffuse_ct(&eEC_ctrl_work.light_info, 0, 127, 0, 0, 0, 0);
eEC_ctrl_work.light_list = Global_light_list_new(game, &play->global_light, &eEC_ctrl_work.light_info);
}
static void eEC_DeleteEffectLight(GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
Global_light_list_delete(&play->global_light, eEC_ctrl_work.light_list);
}
int eMH_special_point_light_num = 0;
static void eEC_actor_ct(ACTOR* actorx, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
eEC_EffectLib2Clip(actorx);
eEC_InitEffectControlWork();
eEC_MakeEffectLight(game);
eEL_InitEffectLight();
if (Save_Get(scene_no) == SCENE_TENT) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_TENT_LAMP, actorx->world.position, 3, 0, game, RSV_NO, 0, 0);
}
eMH_special_point_light_num = -1;
}
static void eEC_actor_dt(ACTOR* actorx, GAME* game) {
eEC_CLIP = NULL;
eEC_DeleteEffectLight(game);
}
static void eEC_actor_draw(ACTOR* actorx, GAME* game) {
int i;
u8* active_flags = eEC_ctrl_work.effect_active_flags;
eEC_Effect_c* effect = eEC_ctrl_work.effects;
_texture_z_light_fog_prim(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
for (i = 0; i < eEC_EFFECT_ACTIVE_MAX; i++, active_flags++, effect++) {
if (*active_flags) {
profile_tbl[effect->name]->draw_proc(effect, game);
}
}
}
static int eEC_DistDeath(eEC_Effect_c* effect, GAME* game, s16 prog_idx) {
GAME_PLAY* play = (GAME_PLAY*)game;
int res = FALSE; // in range
if (prog_idx != -1) {
f32 max_dist = profile_tbl[effect->name]->max_dist;
if (max_dist != eEC_IGNORE_DEATH_DIST) {
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
if (ABS(player->actor_class.world.position.x - effect->position.x) > max_dist ||
ABS(player->actor_class.world.position.z - effect->position.z) > max_dist ||
ABS(player->actor_class.world.position.y - effect->position.y) > max_dist) {
res = TRUE; // out of range
}
}
}
return res;
}
static void eEC_AllEffectMove(GAME* game) {
int i;
u8* active_flags = eEC_ctrl_work.effect_active_flags;
eEC_Effect_c* effect = eEC_ctrl_work.effects;
for (i = 0; i < eEC_EFFECT_ACTIVE_MAX; i++, active_flags++, effect++) {
if (*active_flags) {
s16 prog_idx = effect->prog_idx;
profile_tbl[effect->name]->move_proc(effect, game);
effect->timer--;
if (effect->timer <= 0 || eEC_DistDeath(effect, game, prog_idx) == TRUE) {
*active_flags = 0;
effect->timer = 0;
effect->_0A = 0;
}
}
}
}
static void eEC_actor_move(ACTOR* actorx, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
eEL_CalcEffectLight_Set(game);
eEC_AllEffectMove(game);
actorx->world.position = player->actor_class.world.position;
}
static int eEC_GetEffectBuff(int prio) {
int now_idx = eEC_ctrl_work.active_effect_num;
u8* active_flags = eEC_ctrl_work.effect_active_flags;
int i;
for (i = now_idx; i < eEC_EFFECT_ACTIVE_MAX; i++) {
if (active_flags[i] == 0) {
return i;
}
}
for (i = 0; i < now_idx - 1; i++) {
if (active_flags[i] == 0) {
return i;
}
}
for (i = now_idx; i < eEC_EFFECT_ACTIVE_MAX; i++) {
if (active_flags[i] < prio) {
return i;
}
}
for (i = 0; i < now_idx - 1; i++) {
if (active_flags[i] != 2) {
return i;
}
}
return -1;
}
static void eEC_SetFirstOffset(eEC_Effect_c* effect, xyz_t* ofs) {
static xyz_t default_offset = { 0.0f, 0.0f, 0.0f };
effect->offset = default_offset;
if (ofs != NULL) {
effect->offset = *ofs;
}
}
static eEC_Effect_c* eEC_MakeEffect(s16 effect_id, xyz_t pos, xyz_t* ofs, GAME* game, void* ct_arg, u16 item_name,
int prio, s16 arg0, s16 arg1) {
static xyz_t defaultX = { 0.0f, 0.0f, 0.0f };
static xyz_t scale_default = { 0.01f, 0.01f, 0.01f };
int* active_effect_num = &eEC_ctrl_work.active_effect_num;
eEC_Effect_c* effect = NULL;
eEC_Effect_c* effects = eEC_ctrl_work.effects;
u8* active_flags = eEC_ctrl_work.effect_active_flags;
int use_idx;
use_idx = eEC_GetEffectBuff(prio);
if (use_idx != -1) {
active_flags[use_idx] = prio;
effects[use_idx].name = effect_id;
effects[use_idx].position = pos;
effects[use_idx].item_name = item_name;
effects[use_idx].prio = prio;
effects[use_idx].state = eEC_STATE_NORMAL;
eEC_SetFirstOffset(&effects[use_idx], ofs);
effects[use_idx].timer = 10;
effects[use_idx].velocity = defaultX;
effects[use_idx].acceleration = defaultX;
effects[use_idx].scale = scale_default;
effects[use_idx].arg0 = arg0;
effects[use_idx].arg1 = arg1;
profile_tbl[effect_id]->ct_proc(&effects[use_idx], game, ct_arg);
*active_effect_num = use_idx + 1;
effect = &effects[use_idx];
}
return effect;
}
+251
View File
@@ -0,0 +1,251 @@
static void eEL_InitUnchar(u8* unchar_p, int count, u8 val) {
int i;
for (i = 0; i < count; i++) {
*unchar_p++ = val;
}
}
static void eEL_VectorRoteteY(xyz_t* vec, f32 angle) {
xyz_t src = *vec;
f32 cos = cosf_table(angle);
f32 sin = sinf_table(angle);
vec->x = src.x * cos + src.z * sin;
vec->z = -src.x * sin + src.z * cos;
}
static s16 eEL_RandomFirstSpeed(xyz_t* speed, f32 y, f32 max_z, f32 max_x) {
xyz_t vec = { 0.0f, 1.0f, 0.0f };
f32 angle = 0.0f;
vec.y = y;
if (max_z != 0.0f) {
f32 rnd_z = RANDOM_F(max_z) - max_z * 0.5f;
angle = rnd_z;
sMath_RotateZ(&vec, DEG2RAD(rnd_z));
}
if (max_x != 0.0f) {
f32 rnd_x = RANDOM_F(max_x) - max_x * 0.5f;
sMath_RotateX(&vec, DEG2RAD(rnd_x));
}
if (speed != NULL) {
*speed = vec;
}
return RAD2SHORT_ANGLE2(DEG2RAD(angle));
}
static void eEL_SetContiniousEnv(eEC_Effect_c* effect, s16 unused, s16 timer) {
if (effect->state == eEC_STATE_NORMAL) {
if (effect->timer <= 1) {
effect->state = eEC_STATE_CONTINUOUS;
effect->timer = timer;
}
} else if (effect->state == eEC_STATE_CONTINUOUS) {
if (effect->timer <= 1) {
effect->state = eEC_STATE_CONTINUOUS;
effect->timer = timer;
}
}
}
static f32 eEL_CalcAdjust(s16 now, s16 start, s16 end, f32 start_val, f32 end_val) {
if (start == end) {
return start_val;
}
if (now <= start) {
return start_val;
}
if (now >= end) {
return end_val;
}
return start_val + (f32)(now - start) * ((end_val - start_val) / (f32)(end - start));
}
static void eEL_AutoMatrixXlu(GAME* game, xyz_t* pos, xyz_t* scale) {
GAME_PLAY* play = (GAME_PLAY*)game;
Mtx* mtx = (Mtx*)GRAPH_ALLOC_TYPE(game->graph, Mtx, 1);
f32 adj_scale;
OPEN_DISP(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
adj_scale = 1.0f + ((f32)(int)GETREG(MYKREG, 27)) * 0.01f;
suMtxMakeTS(mtx, scale->x * adj_scale, scale->y * adj_scale, scale->z * adj_scale, pos->x, pos->y, pos->z);
gSPMatrix(NEXT_POLY_XLU_DISP, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(NEXT_POLY_XLU_DISP, play->billboard_mtx_p, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
CLOSE_DISP(game->graph);
}
static void eEL_AutoMatrixXlu_Offset(GAME* game, xyz_t* pos, xyz_t* scale, xyz_t* offset) {
GAME_PLAY* play = (GAME_PLAY*)game;
f32 adj_scale;
OPEN_DISP(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
Matrix_translate(pos->x, pos->y, pos->z, 0);
Matrix_mult(&play->billboard_matrix, 1);
Matrix_translate(offset->x + (f32)(int)GETREG(MYKREG, 24), offset->y + (f32)(int)GETREG(MYKREG, 25),
offset->z + (f32)(int)GETREG(MYKREG, 26), 1);
adj_scale = 1.0f + ((f32)(int)GETREG(MYKREG, 27)) * 0.01f;
Matrix_scale(scale->x * adj_scale, scale->y * adj_scale, scale->z * adj_scale, 1);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
CLOSE_DISP(game->graph);
}
static void eEC_MorphCombine(u8* const result, eEC_morph_data_c* const morph_data, s16 now_timer) {
int i;
for (i = 0; i < 9; i++) {
if (morph_data[i].morph_flag) {
result[i] = eEL_CalcAdjust(now_timer, morph_data[i].start_frame << 1, morph_data[i].end_frame << 1,
morph_data[i].start_val, morph_data[i].end_val);
} else {
result[i] = morph_data[i].start_val;
}
}
}
static int eEL_SpecialBlockCenterPos(xyz_t* pos, u32 block_kind) {
int bx;
int bz;
*pos = ZeroVec;
if (mFI_BlockKind2BkNum(&bx, &bz, block_kind) && mFI_BkNum2WposXZ(&pos->x, &pos->z, bx, bz)) {
pos->x += mFI_BK_WORLDSIZE_X_F / 2;
pos->z += mFI_BK_WORLDSIZE_Z_F / 2;
return TRUE;
} else {
return FALSE;
}
}
static eEC_light_data_c eEL_light_data;
static const eEC_light_data_c eEC_light_default = { 0, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 0, 0, 0, 0 };
static int eEL_EffectLightStatus(rgba_t* color, int* shadow_flag) {
color->r = eEC_ctrl_work.light_info.lights.diffuse.color[0];
color->g = eEC_ctrl_work.light_info.lights.diffuse.color[1];
color->b = eEC_ctrl_work.light_info.lights.diffuse.color[2];
color->a = 0;
*shadow_flag = eEL_light_data.shadow_flag;
return eEL_light_data.light_state;
}
static void eEL_InitEffectLight(void) {
eEL_light_data = eEC_light_default;
eEL_light_data.n_frames = 10;
}
static void eEL_CalcEffectLight_Set(GAME* game) {
int r;
int g;
int b;
if (eEL_light_data.ctr > eEL_light_data.n_frames) {
eEL_InitEffectLight();
eEC_ctrl_work.light_info.lights.diffuse.color[0] = 0;
eEC_ctrl_work.light_info.lights.diffuse.color[1] = 0;
eEC_ctrl_work.light_info.lights.diffuse.color[2] = 0;
eEL_light_data.light_state = eEC_LIGHT_COLOR_DISABLED;
} else {
if (eEL_light_data.ctr < eEL_light_data.max_frame) {
r = (int)eEC_CLIP->calc_adjust_proc(eEL_light_data.ctr, 0, eEL_light_data.max_frame,
eEL_light_data.start_color.r, eEL_light_data.target_color.r);
g = (int)eEC_CLIP->calc_adjust_proc(eEL_light_data.ctr, 0, eEL_light_data.max_frame,
eEL_light_data.start_color.g, eEL_light_data.target_color.g);
b = (int)eEC_CLIP->calc_adjust_proc(eEL_light_data.ctr, 0, eEL_light_data.max_frame,
eEL_light_data.start_color.b, eEL_light_data.target_color.b);
eEL_light_data.light_state = eEC_LIGHT_COLOR_INCREASING;
} else {
r = (int)eEC_CLIP->calc_adjust_proc(eEL_light_data.ctr, eEL_light_data.max_frame, eEL_light_data.n_frames,
eEL_light_data.target_color.r, 0.0f);
g = (int)eEC_CLIP->calc_adjust_proc(eEL_light_data.ctr, eEL_light_data.max_frame, eEL_light_data.n_frames,
eEL_light_data.target_color.g, 0.0f);
b = (int)eEC_CLIP->calc_adjust_proc(eEL_light_data.ctr, eEL_light_data.max_frame, eEL_light_data.n_frames,
eEL_light_data.target_color.b, 0.0f);
if (eEL_light_data.ctr == eEL_light_data.max_frame) {
eEL_light_data.light_state = eEC_LIGHT_COLOR_MAXIMUM;
} else {
eEL_light_data.light_state = eEC_LIGHT_COLOR_DECREASING;
}
}
eEC_ctrl_work.light_info.lights.diffuse.color[0] = r;
eEC_ctrl_work.light_info.lights.diffuse.color[1] = g;
eEC_ctrl_work.light_info.lights.diffuse.color[2] = b;
eEL_light_data.ctr++;
}
}
static void eEL_RegistEffectLight(rgba_t color, s16 max_frames, s16 n_frames, int shadow_flag) {
eEL_light_data.start_color.r = eEC_ctrl_work.light_info.lights.diffuse.color[0];
eEL_light_data.start_color.g = eEC_ctrl_work.light_info.lights.diffuse.color[1];
eEL_light_data.start_color.b = eEC_ctrl_work.light_info.lights.diffuse.color[2];
eEL_light_data.ctr = 0;
eEL_light_data.target_color = color;
eEL_light_data.max_frame = max_frames;
eEL_light_data.n_frames = n_frames;
eEL_light_data.shadow_flag = shadow_flag;
}
static void eEL_DecideLightPower(rgba_t* result_color, rgba_t base_color, xyz_t pos, GAME* game, f32 max_power,
f32 min_power, f32 max_dist) {
GAME_PLAY* play = (GAME_PLAY*)game;
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
if (player != NULL) {
xyz_t player_pos = player->actor_class.world.position;
f32 dist = search_position_distance(&pos, &player_pos);
f32 power;
if (dist > max_dist) {
power = min_power;
} else {
power = (max_power - min_power) * (1.0f - dist / max_dist);
power += min_power;
}
result_color->r = (int)(base_color.r * power);
result_color->g = (int)(base_color.g * power);
result_color->b = (int)(base_color.b * power);
result_color->a = 255;
} else {
*result_color = base_color;
}
}
static int mEL_CheckLookAtBlock(xyz_t pos) {
xyz_t* lookat = Camera2_getCenterPos_p();
int effect_bx;
int effect_bz;
int lookat_bx;
int lookat_bz;
if (mFI_Wpos2BlockNum(&effect_bx, &effect_bz, pos) && mFI_Wpos2BlockNum(&lookat_bx, &lookat_bz, *lookat)) {
if (effect_bx == lookat_bx && effect_bz == lookat_bz) {
return TRUE;
}
}
return FALSE;
}
+148
View File
@@ -0,0 +1,148 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
static void eFlash_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eFlash_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eFlash_mv(eEC_Effect_c* effect, GAME* game);
static void eFlash_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_flash = {
// clang-format off
&eFlash_init,
&eFlash_ct,
&eFlash_mv,
&eFlash_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eFlash_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_FLASH, pos, NULL, game, NULL, item_name, prio, arg0, angle);
}
static void eFlash_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
s16 flash_length = 3.0f + RANDOM_F(7.0f);
s16 end_frame = flash_length >> 1;
if (effect->arg0 == 1) {
static rgba_t light_color = { 27, 27, 27, 255 };
(*eEC_CLIP->regist_effect_light)(light_color, flash_length, end_frame, TRUE);
}
effect->timer = 5;
effect->acceleration.x = 0.3f + RANDOM_F(0.7f);
}
static void eFlash_mv(eEC_Effect_c* effect, GAME* game) {
s16 elapsed_time = 5 - effect->timer;
f32 scale;
if (elapsed_time <= 4) {
scale = (*eEC_CLIP->calc_adjust_proc)(elapsed_time, 0, 2, effect->acceleration.x * 0.005f, 0.01f);
} else {
scale = (*eEC_CLIP->calc_adjust_proc)(elapsed_time, 3, 4, effect->acceleration.x * 0.01f, 0.0f);
}
effect->scale.x = scale;
effect->scale.y = scale;
effect->scale.z = scale;
}
extern Gfx ef_takurami01_normal_render_mode[];
extern Gfx ef_takurami01_kira_modelT[];
static void eFlash_dw(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, 0);
Matrix_mult(&play->billboard_matrix, 1);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, 1);
_texture_z_light_fog_prim_xlu(game->graph);
OPEN_DISP(game->graph);
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, 200);
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);
}
static void eFlashC_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eFlashC_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eFlashC_mv(eEC_Effect_c* effect, GAME* game);
static void eFlashC_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_flashC = {
// clang-format off
&eFlashC_init,
&eFlashC_ct,
&eFlashC_mv,
&eFlashC_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eFlashC_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_FLASHC, pos, NULL, game, NULL, item_name, prio, arg0, angle);
}
static void eFlashC_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = 240;
effect->effect_specific[0] = 0;
}
static void eFlashC_mv(eEC_Effect_c* effect, GAME* game) {
if ((effect->timer & 7) == 0) {
int size;
switch (Save_Get(scene_no)) {
case SCENE_MY_ROOM_S:
size = 4;
break;
case SCENE_NPC_HOUSE:
case SCENE_MY_ROOM_M:
case SCENE_MY_ROOM_LL2:
case SCENE_COTTAGE_NPC:
size = 6;
break;
case SCENE_MY_ROOM_L:
case SCENE_MY_ROOM_LL1:
case SCENE_MY_ROOM_BASEMENT_S:
case SCENE_MY_ROOM_BASEMENT_M:
case SCENE_MY_ROOM_BASEMENT_L:
case SCENE_MY_ROOM_BASEMENT_LL1:
case SCENE_COTTAGE_MY:
size = 8;
break;
default:
size = -1;
break;
}
if (size != -1) {
xyz_t pos;
pos.z = 43.0f;
pos.x = 40.0f + RANDOM_F(size) * 40.0f;
pos.y = -10.0f + RANDOM_F(20.0f) + 75.0f;
(*eEC_CLIP->effect_make_proc)(eEC_EFFECT_FLASH, pos, effect->prio, 0, game, (u16)effect->item_name,
effect->effect_specific[0] & 1, 0);
effect->effect_specific[0]++;
}
}
}
static void eFlashC_dw(eEC_Effect_c* effect, GAME* game) {
// nothing
}
+127
View File
@@ -0,0 +1,127 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
#include "m_debug.h"
static void eFootPrint_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eFootPrint_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eFootPrint_mv(eEC_Effect_c* effect, GAME* game);
static void eFootPrint_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_footprint = {
// clang-format off
&eFootPrint_init,
&eFootPrint_ct,
&eFootPrint_mv,
&eFootPrint_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
typedef struct footprint_data_s {
s16 attr;
s16 angle;
} eFootPrint_data_c;
static void eFootPrint_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eFootPrint_data_c data;
data.attr = arg0;
data.angle = angle;
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_FOOTPRINT, pos, NULL, game, &data, item_name, prio, arg0, arg1);
}
static xyz_t eFootPrint_area_offset_data[] = { { 2.0f, 0.0f, -2.0f }, { -2.0f, 0.0f, -2.0f }, { 0.0f, 0.0f, 2.0f } };
static void eFootPrint_GetAreaPos(xyz_t* pos, xyz_t effect_pos, int area) {
pos->x = effect_pos.x + eFootPrint_area_offset_data[area].x;
pos->y = effect_pos.y + eFootPrint_area_offset_data[area].y;
pos->z = effect_pos.z + eFootPrint_area_offset_data[area].z;
}
static void eFootPrint_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
eFootPrint_data_c* data = (eFootPrint_data_c*)ct_arg;
if (Common_Get(time.season) == mTM_SEASON_WINTER || data->attr == mCoBG_ATTRIBUTE_SAND ||
data->attr == mCoBG_ATTRIBUTE_WAVE) {
if (data->attr == mCoBG_ATTRIBUTE_GRASS0 || data->attr == mCoBG_ATTRIBUTE_GRASS1 ||
data->attr == mCoBG_ATTRIBUTE_GRASS2 || data->attr == mCoBG_ATTRIBUTE_GRASS3 ||
data->attr == mCoBG_ATTRIBUTE_SAND || data->attr == mCoBG_ATTRIBUTE_WAVE) {
int i;
int sum_angle_x = 0;
int sum_angle_z = 0;
effect->position.y = 2.0f + mCoBG_GetShadowBgY_AngleS_FromWpos(0.0f, NULL, effect->position);
effect->effect_specific[2] = data->angle;
/* Get the total ground angle (x & z) in a triangle around the effect position */
for (i = 0; i < ARRAY_COUNT(eFootPrint_area_offset_data); i++) {
xyz_t pos;
s_xyz ground_angle = { 0, 0, 0 };
eFootPrint_GetAreaPos(&pos, effect->position, i);
mCoBG_GetBgY_AngleS_FromWpos(&ground_angle, pos, 0.0f);
sum_angle_x += ground_angle.x;
sum_angle_z += ground_angle.z;
}
/* Average x & z rotation over the sum of all ground angles */
effect->effect_specific[0] = sum_angle_x / ARRAY_COUNT(eFootPrint_area_offset_data);
effect->effect_specific[1] = sum_angle_z / ARRAY_COUNT(eFootPrint_area_offset_data);
if (data->attr == mCoBG_ATTRIBUTE_SAND || data->attr == mCoBG_ATTRIBUTE_WAVE) {
effect->effect_specific[3] = TRUE;
if (data->attr == mCoBG_ATTRIBUTE_WAVE) {
(*eEC_CLIP->effect_make_proc)(eEC_EFFECT_TURI_HAMON, effect->position, effect->prio, 0, game,
effect->item_name, 2, 0);
}
} else {
effect->effect_specific[3] = FALSE;
}
effect->timer = 160;
return;
}
}
effect->timer = 0;
}
static void eFootPrint_mv(eEC_Effect_c* effect, GAME* game) {
if (effect->arg0 == mCoBG_ATTRIBUTE_WAVE && effect->timer == 150) {
(*eEC_CLIP->effect_make_proc)(eEC_EFFECT_TURI_HAMON, effect->position, effect->prio, 0, game, effect->item_name,
2, 0);
}
}
extern Gfx ef_footprint01_00_modelT[];
static void eFootPrint_dw(eEC_Effect_c* effect, GAME* game) {
u8 alpha = (int)(*eEC_CLIP->calc_adjust_proc)(160 - effect->timer, 118, 159, 150.0f, 0.0f);
f32 scale;
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_RotateX(effect->effect_specific[0], 1);
Matrix_RotateY(effect->effect_specific[2], 1);
Matrix_RotateZ(effect->effect_specific[1], 1);
scale = (1.0f + ((f32)(int)GETREG(MYKREG, 27)) * 0.01f) * 0.005f;
Matrix_scale(scale, scale, 0.0075f, 1);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (effect->effect_specific[3]) {
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 70, 50, 50, alpha);
} else {
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 0, 50, 100, alpha);
}
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 255, 255, 255, 255);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_footprint01_00_modelT);
CLOSE_DISP(game->graph);
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eFuro_Yuge_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eFuro_Yuge_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eFuro_Yuge_mv(eEC_Effect_c* effect, GAME* game);
static void eFuro_Yuge_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_furo_yuge = {
// clang-format off
&eFuro_Yuge_init,
&eFuro_Yuge_ct,
&eFuro_Yuge_mv,
&eFuro_Yuge_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eFuro_Yuge_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eFuro_Yuge_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eFuro_Yuge_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eFuro_Yuge_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eGM_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eGM_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eGM_mv(eEC_Effect_c* effect, GAME* game);
static void eGM_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_gimonhu = {
// clang-format off
&eGM_init,
&eGM_ct,
&eGM_mv,
&eGM_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eGM_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eGM_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eGM_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eGM_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eGoki_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eGoki_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eGoki_mv(eEC_Effect_c* effect, GAME* game);
static void eGoki_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_goki = {
// clang-format off
&eGoki_init,
&eGoki_ct,
&eGoki_mv,
&eGoki_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eGoki_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eGoki_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eGoki_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eGoki_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eHA_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHA_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHA_mv(eEC_Effect_c* effect, GAME* game);
static void eHA_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_ha = {
// clang-format off
&eHA_init,
&eHA_ct,
&eHA_mv,
&eHA_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eHA_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eHA_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eHA_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eHA_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+49
View File
@@ -0,0 +1,49 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eHalloween_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHalloween_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHalloween_mv(eEC_Effect_c* effect, GAME* game);
static void eHalloween_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_halloween = {
// clang-format off
&eHalloween_init,
&eHalloween_ct,
&eHalloween_mv,
&eHalloween_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eHalloween_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_HALLOWEEN, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eHalloween_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = 0x28;
effect->effect_specific[0] = 0;
sAdo_OngenTrgStart(0x107, &effect->position);
}
static void eHalloween_mv(eEC_Effect_c* effect, GAME* game) {
if (effect->effect_specific[0] == 4) {
s16 rnd_angle = qrand();
xyz_t pos = effect->position;
pos.x += 18.0f * sin_s(rnd_angle);
pos.y += -25.0f + RANDOM_F(30.0f);
pos.z += 5.0f + (18.0f * cos_s(rnd_angle));
effect->effect_specific[0] = 0;
eEC_CLIP->effect_make_proc(eEC_EFFECT_HALLOWEEN_SMOKE, pos, effect->prio, rnd_angle, game, effect->item_name, 0, 0);
}
effect->effect_specific[0]++;
}
static void eHalloween_dw(eEC_Effect_c* effect, GAME* game) {
// empty
}
+103
View File
@@ -0,0 +1,103 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
extern Gfx ef_haro01_00_modelT[];
extern u8 ef_dust01_0[];
extern u8 ef_dust01_1[];
extern u8 ef_dust01_2[];
extern u8 ef_dust01_3[];
static u8* eHalloween_texture_table[] = {
ef_dust01_0,
ef_dust01_1,
ef_dust01_2,
ef_dust01_3,
};
// clang-format off
static u8 eHalloween_2tile_texture_idx[][2] = {
{0, 0},
{0, 1},
{1, 1},
{1, 2},
{2, 2},
{2, 3},
{3, 3},
{3, 3},
{3, 3},
};
// clang-format on
// clang-format off
static u8 eHalloween_prim_f[] = {
0,
128,
255,
128,
0,
128,
255,
128,
0,
};
// clang-format on
static void eHalloween_Smoke_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHalloween_Smoke_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHalloween_Smoke_mv(eEC_Effect_c* effect, GAME* game);
static void eHalloween_Smoke_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_halloween_smoke = {
// clang-format off
&eHalloween_Smoke_init,
&eHalloween_Smoke_ct,
&eHalloween_Smoke_mv,
&eHalloween_Smoke_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eHalloween_Smoke_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_HALLOWEEN_SMOKE, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eHalloween_Smoke_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
s16 angle = *(s16*)ct_arg;
effect->timer = 18;
(effect->scale).x = (effect->scale).y = (effect->scale).z = 0.01f;
(effect->velocity).y = 0.25f;
(effect->velocity).x = 0.0f * sin_s(angle);
(effect->velocity).z = 0.0f * cos_s(angle);
(effect->acceleration).y = 0.075f;
(effect->acceleration).x = (effect->acceleration).z = 0.0f;
}
static void eHalloween_Smoke_mv(eEC_Effect_c* effect, GAME* game) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
}
static void eHalloween_Smoke_dw(eEC_Effect_c* effect, GAME* game) {
s16 frame = 18 - effect->timer;
int tex_idx = frame >> 1;
int tile_idx0 = eHalloween_2tile_texture_idx[tex_idx][0];
int tile_idx1 = eHalloween_2tile_texture_idx[tex_idx][1];
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_proc(game, &effect->position, &effect->scale);
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_1_TXT_SEG, eHalloween_texture_table[tile_idx0]);
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_2_TXT_SEG, eHalloween_texture_table[tile_idx1]);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, eHalloween_prim_f[tex_idx], 200, 0, 255, 120);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_haro01_00_modelT);
CLOSE_DISP(game->graph);
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eHanabiBotan1_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHanabiBotan1_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHanabiBotan1_mv(eEC_Effect_c* effect, GAME* game);
static void eHanabiBotan1_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hanabi_botan1 = {
// clang-format off
&eHanabiBotan1_init,
&eHanabiBotan1_ct,
&eHanabiBotan1_mv,
&eHanabiBotan1_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eHanabiBotan1_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eHanabiBotan1_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eHanabiBotan1_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eHanabiBotan1_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eHanabiBotan2_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHanabiBotan2_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHanabiBotan2_mv(eEC_Effect_c* effect, GAME* game);
static void eHanabiBotan2_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hanabi_botan2 = {
// clang-format off
&eHanabiBotan2_init,
&eHanabiBotan2_ct,
&eHanabiBotan2_mv,
&eHanabiBotan2_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eHanabiBotan2_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eHanabiBotan2_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eHanabiBotan2_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eHanabiBotan2_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+102
View File
@@ -0,0 +1,102 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#define eHanabiDummy_TIMER 80
#define eHanabiDummy_MIN_POWER 0.0f
#define eHanabiDummy_MAX_POWER 2.0f
#define eHanabiDummy_MAX_DIST (mFI_UNIT_BASE_SIZE_F * 12)
enum {
eHanabiDummy_TYPE0,
eHanabiDummy_TYPE1,
eHanabiDummy_TYPE2,
eHanabiDummy_TYPE3,
eHanabiDummy_TYPE4,
eHanabiDummy_TYPE5,
eHanabiDummy_TYPE_NUM
};
#define eHanabiDummy_TYPE_ARG (effect->effect_specific[0])
static void eHanabiDummy_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHanabiDummy_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHanabiDummy_mv(eEC_Effect_c* effect, GAME* game);
static void eHanabiDummy_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hanabi_dummy = {
// clang-format off
&eHanabiDummy_init,
&eHanabiDummy_ct,
&eHanabiDummy_mv,
&eHanabiDummy_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eHanabiDummy_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_HANABI_DUMMY, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eHanabiDummy_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = eHanabiDummy_TIMER;
eHanabiDummy_TYPE_ARG = RANDOM(eHanabiDummy_TYPE_NUM);
}
static void eHanabiDummy_mv(eEC_Effect_c* effect, GAME* game) {
rgba_t light_color;
s16 frames_passed = eHanabiDummy_TIMER - effect->timer;
if (frames_passed == 10) {
static rgba_t dummy_light[eHanabiDummy_TYPE_NUM] = {
{ 50, 30, 20, 255 }, { 20, 60, 20, 255 }, { 40, 10, 60, 255 },
{ 40, 20, 20, 255 }, { 20, 40, 20, 255 }, { 60, 60, 30, 255 },
};
eEC_CLIP->decide_light_power_proc(&light_color, dummy_light[eHanabiDummy_TYPE_ARG], effect->position, game,
eHanabiDummy_MAX_POWER, eHanabiDummy_MIN_POWER, eHanabiDummy_MAX_DIST);
if (effect->arg0 != 0) {
light_color.r = light_color.r * eHanabiDummy_MAX_POWER;
light_color.g = light_color.g * eHanabiDummy_MAX_POWER;
light_color.b = light_color.b * eHanabiDummy_MAX_POWER;
}
eEC_CLIP->regist_effect_light(light_color, 20, 50, TRUE);
}
if (frames_passed == 72) {
xyz_t pos = effect->position;
u16 sfx_no;
pos.y += 200.0f;
switch (eHanabiDummy_TYPE_ARG) {
case eHanabiDummy_TYPE0:
case eHanabiDummy_TYPE1:
sfx_no = NA_SE_HANABI0;
break;
case eHanabiDummy_TYPE2:
sfx_no = NA_SE_HANABI1;
break;
case eHanabiDummy_TYPE3:
case eHanabiDummy_TYPE4:
sfx_no = NA_SE_HANABI2;
break;
case eHanabiDummy_TYPE5:
sfx_no = NA_SE_HANABI3;
break;
default:
sfx_no = NA_SE_HANABI0;
break;
}
sAdo_OngenTrgStart(sfx_no, &pos);
}
}
static void eHanabiDummy_dw(eEC_Effect_c* effect, GAME* game) {
// empty
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eHanabiHoshi_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHanabiHoshi_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHanabiHoshi_mv(eEC_Effect_c* effect, GAME* game);
static void eHanabiHoshi_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hanabi_hoshi = {
// clang-format off
&eHanabiHoshi_init,
&eHanabiHoshi_ct,
&eHanabiHoshi_mv,
&eHanabiHoshi_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eHanabiHoshi_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eHanabiHoshi_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eHanabiHoshi_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eHanabiHoshi_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eHanabiSet_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHanabiSet_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHanabiSet_mv(eEC_Effect_c* effect, GAME* game);
static void eHanabiSet_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hanabi_set = {
// clang-format off
&eHanabiSet_init,
&eHanabiSet_ct,
&eHanabiSet_mv,
&eHanabiSet_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eHanabiSet_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eHanabiSet_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eHanabiSet_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eHanabiSet_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eHanabiSwitch_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHanabiSwitch_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHanabiSwitch_mv(eEC_Effect_c* effect, GAME* game);
static void eHanabiSwitch_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hanabi_switch = {
// clang-format off
&eHanabiSwitch_init,
&eHanabiSwitch_ct,
&eHanabiSwitch_mv,
&eHanabiSwitch_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eHanabiSwitch_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eHanabiSwitch_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eHanabiSwitch_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eHanabiSwitch_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eHanabiYanagi_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHanabiYanagi_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHanabiYanagi_mv(eEC_Effect_c* effect, GAME* game);
static void eHanabiYanagi_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hanabi_yanagi = {
// clang-format off
&eHanabiYanagi_init,
&eHanabiYanagi_ct,
&eHanabiYanagi_mv,
&eHanabiYanagi_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eHanabiYanagi_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eHanabiYanagi_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eHanabiYanagi_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eHanabiYanagi_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eHanabira_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHanabira_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHanabira_mv(eEC_Effect_c* effect, GAME* game);
static void eHanabira_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hanabira = {
// clang-format off
&eHanabira_init,
&eHanabira_ct,
&eHanabira_mv,
&eHanabira_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eHanabira_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eHanabira_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eHanabira_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eHanabira_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+51
View File
@@ -0,0 +1,51 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eHanatiri_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHanatiri_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHanatiri_mv(eEC_Effect_c* effect, GAME* game);
static void eHanatiri_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hanatiri = {
// clang-format off
&eHanatiri_init,
&eHanatiri_ct,
&eHanatiri_mv,
&eHanatiri_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eHanatiri_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_HANATIRI, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eHanatiri_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
int i;
if (effect->arg0 >= FLOWER_PANSIES0 && effect->arg0 <= FLOWER_TULIP2) {
s16 flower_idx = effect->arg0 - FLOWER_PANSIES0;
for (i = 0; i < 5; i++) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_HANABIRA, effect->position, effect->prio, 0, game, effect->item_name, flower_idx, 5);
}
}
for (i = 0; i < 4; i++){
eEC_CLIP->effect_make_proc(eEC_EFFECT_HANABIRA, effect->position, effect->prio, 0, game, effect->item_name, 9, 5);
}
effect->timer = 0;
}
static void eHanatiri_mv(eEC_Effect_c* effect, GAME* game) {
// empty
}
static void eHanatiri_dw(eEC_Effect_c* effect, GAME* game) {
// empty
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eHiramekiD_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHiramekiD_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHiramekiD_mv(eEC_Effect_c* effect, GAME* game);
static void eHiramekiD_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hirameki_den = {
// clang-format off
&eHiramekiD_init,
&eHiramekiD_ct,
&eHiramekiD_mv,
&eHiramekiD_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eHiramekiD_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eHiramekiD_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eHiramekiD_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eHiramekiD_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eHiramekiH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHiramekiH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHiramekiH_mv(eEC_Effect_c* effect, GAME* game);
static void eHiramekiH_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_hirameki_hikari = {
// clang-format off
&eHiramekiH_init,
&eHiramekiH_ct,
&eHiramekiH_mv,
&eHiramekiH_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eHiramekiH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eHiramekiH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eHiramekiH_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eHiramekiH_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eIkigire_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eIkigire_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eIkigire_mv(eEC_Effect_c* effect, GAME* game);
static void eIkigire_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_ikigire = {
// clang-format off
&eIkigire_init,
&eIkigire_ct,
&eIkigire_mv,
&eIkigire_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eIkigire_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eIkigire_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eIkigire_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eIkigire_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+97
View File
@@ -0,0 +1,97 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
extern Gfx ef_star01_00_modelT[];
static void eImpact_Star_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eImpact_Star_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eImpact_Star_mv(eEC_Effect_c* effect, GAME* game);
static void eImpact_Star_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_impact_star = {
// clang-format off
&eImpact_Star_init,
&eImpact_Star_ct,
&eImpact_Star_mv,
&eImpact_Star_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eImpact_Star_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_IMPACT_STAR, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eImpact_Star_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
f32 mul;
s16* angle_y_p = (s16*)ct_arg;
if (effect->arg1 == 0) {
s16 angle_y = *angle_y_p;
s16 angle_x = DEG2SHORT_ANGLE2(-70.0f);
mul = 6.0f + (f32)RANDOM_F(0.0f);
angle_y += DEG2SHORT_ANGLE2(RANDOM_F(20.0f));
angle_x += DEG2SHORT_ANGLE2(RANDOM_F(20.0f));
effect->scale.x = 0.01f;
effect->offset.x = 0.01f;
effect->offset.y = 0.004f;
effect->velocity.y = mul * cos_s(angle_x);
effect->velocity.x = mul * sin_s(angle_x) * sin_s(angle_y);
effect->velocity.z = mul * sin_s(angle_x) * cos_s(angle_y);
} else {
s16 angle_y = *angle_y_p + DEG2SHORT_ANGLE2(10.0f);
s16 angle_x = DEG2SHORT_ANGLE2(-60.0f);
mul = 6.0f + (f32)RANDOM_F(0.0f);
angle_y += -DEG2SHORT_ANGLE2(RANDOM_F(20.0f));
angle_x += -DEG2SHORT_ANGLE2(RANDOM_F(20.0f));
effect->scale.x = 0.012f;
effect->offset.x = 0.012f;
effect->offset.y = 0.006f;
effect->velocity.y = mul * cos_s(angle_x);
effect->velocity.x = mul * sin_s(angle_x) * sin_s(angle_y);
effect->velocity.z = mul * sin_s(angle_x) * cos_s(angle_y);
}
effect->effect_specific[0] = qrand();
effect->timer = 40;
}
static void eImpact_Star_mv(eEC_Effect_c* effect, GAME* game) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
effect->velocity.x *= sqrtf(0.85f);
effect->velocity.y *= sqrtf(0.85f);
effect->velocity.z *= sqrtf(0.85f);
}
static void eImpact_Star_dw(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
u8 alpha = (int)eEC_CLIP->calc_adjust_proc(effect->timer,0,10, 0.0f, 255.0f);
effect->scale.x = eEC_CLIP->calc_adjust_proc(effect->timer, 26, 40, effect->offset.y, effect->offset.x);
effect->scale.y= effect->scale.z= effect->scale.x;
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_mult(&play->billboard_matrix, 1);
Matrix_RotateZ(effect->effect_specific[0], 1);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, 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, 255, 255, 100, alpha);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_star01_00_modelT);
CLOSE_DISP(game->graph);
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKagu_Happa_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKagu_Happa_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKagu_Happa_mv(eEC_Effect_c* effect, GAME* game);
static void eKagu_Happa_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kagu_happa = {
// clang-format off
&eKagu_Happa_init,
&eKagu_Happa_ct,
&eKagu_Happa_mv,
&eKagu_Happa_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKagu_Happa_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKagu_Happa_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKagu_Happa_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKagu_Happa_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKamifubuki_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKamifubuki_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKamifubuki_mv(eEC_Effect_c* effect, GAME* game);
static void eKamifubuki_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kamifubuki = {
// clang-format off
&eKamifubuki_init,
&eKamifubuki_ct,
&eKamifubuki_mv,
&eKamifubuki_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKamifubuki_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKamifubuki_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKamifubuki_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKamifubuki_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKG_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKG_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKG_mv(eEC_Effect_c* effect, GAME* game);
static void eKG_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kangaeru = {
// clang-format off
&eKG_init,
&eKG_ct,
&eKG_mv,
&eKG_dw,
7,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKG_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKG_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKG_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKG_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.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);
eEC_PROFILE_c iam_ef_kantanhu = {
// clang-format off
&eKT_init,
&eKT_ct,
&eKT_mv,
&eKT_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKT_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKT_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKT_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKT_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+52
View File
@@ -0,0 +1,52 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "sys_matrix.h"
static void eKasamizu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKasamizu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKasamizu_mv(eEC_Effect_c* effect, GAME* game);
static void eKasamizu_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kasamizu = {
// clang-format off
&eKasamizu_init,
&eKasamizu_ct,
&eKasamizu_mv,
&eKasamizu_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKasamizu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_KASAMIZU, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eKasamizu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
static xyz_t base_offset = {0, 45.0f, -20.0f};
xyz_t pos;
s16 angle = *(s16*)ct_arg;
Matrix_RotateY(angle, 0);
Matrix_Position(&base_offset, &pos);
xyz_t_add(&effect->position, &pos, &effect->position);
effect->effect_specific[0] = angle;
effect->timer = 24;
}
static void eKasamizu_mv(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
if (eEC_CLIP != (eEC_EffectControl_Clip_c*)0) {
int mEnv_NowWeather();
if (mEnv_NowWeather() == mEnv_WEATHER_RAIN && play->game_frame & 1) {
xyz_t pos = effect->position;
eEC_CLIP->effect_make_proc(eEC_EFFECT_KASAMIZUTAMA, pos, effect->prio, effect->effect_specific[0], game,
effect->item_name, 0, 0);
}
}
}
static void eKasamizu_dw(eEC_Effect_c* effect, GAME* game) {
// Nothing
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
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);
static void eKasamizutama_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kasamizutama = {
// clang-format off
&eKasamizutama_init,
&eKasamizutama_ct,
&eKasamizutama_mv,
&eKasamizutama_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKasamizutama_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKasamizutama_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKasamizutama_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKasamizutama_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKZ_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKZ_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKZ_mv(eEC_Effect_c* effect, GAME* game);
static void eKZ_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kaze = {
// clang-format off
&eKZ_init,
&eKZ_ct,
&eKZ_mv,
&eKZ_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKZ_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKZ_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKZ_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKZ_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKZH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKZH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKZH_mv(eEC_Effect_c* effect, GAME* game);
static void eKZH_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kaze_happa = {
// clang-format off
&eKZH_init,
&eKZH_ct,
&eKZH_mv,
&eKZH_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKZH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKZH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKZH_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKZH_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKigae_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKigae_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKigae_mv(eEC_Effect_c* effect, GAME* game);
static void eKigae_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kigae = {
// clang-format off
&eKigae_init,
&eKigae_ct,
&eKigae_mv,
&eKigae_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKigae_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKigae_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKigae_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKigae_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKigae_Light_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKigae_Light_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKigae_Light_mv(eEC_Effect_c* effect, GAME* game);
static void eKigae_Light_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kigae_light = {
// clang-format off
&eKigae_Light_init,
&eKigae_Light_ct,
&eKigae_Light_mv,
&eKigae_Light_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKigae_Light_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKigae_Light_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKigae_Light_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKigae_Light_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKikuzu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKikuzu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKikuzu_mv(eEC_Effect_c* effect, GAME* game);
static void eKikuzu_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kikuzu = {
// clang-format off
&eKikuzu_init,
&eKikuzu_ct,
&eKikuzu_mv,
&eKikuzu_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKikuzu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKikuzu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKikuzu_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKikuzu_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+154
View File
@@ -0,0 +1,154 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "sys_matrix.h"
#include "m_rcp.h"
static void eKL_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKL_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKL_mv(eEC_Effect_c* effect, GAME* game);
static void eKL_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_killer = {
// clang-format off
&eKL_init,
&eKL_ct,
&eKL_mv,
&eKL_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eKL_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_KILLER, pos, NULL, game, NULL, item_name, prio, angle, arg1);
}
static void eKL_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
static xyz_t xyz0 = { 0.0f, 0.0f, 0.0f };
effect->acceleration = xyz0;
effect->velocity = xyz0;
effect->velocity.x = sin_s(effect->arg0) * 2.0f;
effect->velocity.z = cos_s(effect->arg0) * 2.0f;
effect->timer = 360;
switch (Save_Get(scene_no)) {
case SCENE_MY_ROOM_S:
effect->offset.x = 40.0f;
effect->offset.z = 40.0f;
effect->offset.y = 200.0f;
effect->scale.x = 360.0f;
break;
case SCENE_NPC_HOUSE:
case SCENE_MY_ROOM_M:
case SCENE_MY_ROOM_LL2:
case SCENE_COTTAGE_NPC:
effect->offset.x = 40.0f;
effect->offset.z = 40.0f;
effect->offset.y = 280.0f;
effect->scale.x = 440.0f;
break;
case SCENE_MY_ROOM_L:
case SCENE_MY_ROOM_LL1:
case SCENE_MY_ROOM_BASEMENT_S:
case SCENE_MY_ROOM_BASEMENT_M:
case SCENE_MY_ROOM_BASEMENT_L:
case SCENE_MY_ROOM_BASEMENT_LL1:
case SCENE_COTTAGE_MY:
effect->offset.x = 40.0f;
effect->offset.z = 40.0f;
effect->offset.y = 360.0f;
effect->scale.x = 520.0f;
break;
default:
effect->offset.x = 0.0f;
effect->offset.y = 0.0f;
effect->offset.z = 0.0f;
effect->scale.x = 0.0f;
break;
}
{
if (ABS(effect->arg0 & 0xFFFF) <= 15) {
if (ABS(effect->position.z - effect->scale.x) <= 21.0f) {
effect->timer = 0;
return;
}
} else if (ABS((effect->arg0 & 0xFFFF) - (u16)DEG2SHORT_ANGLE(90.0f)) <= 15) {
if (ABS(effect->position.x - effect->offset.y) <= 21.0f) {
effect->timer = 0;
return;
}
} else if (ABS((effect->arg0 & 0xFFFF) - (u16)DEG2SHORT_ANGLE(180.0f)) <= 15) {
if (ABS(effect->position.z - effect->offset.z) <= 21.0f) {
effect->timer = 0;
return;
}
} else if (ABS((effect->arg0 & 0xFFFF) - (u16)DEG2SHORT_ANGLE(270.0f)) <= 15) {
if (ABS(effect->position.x - effect->offset.x) <= 21.0f) {
effect->timer = 0;
return;
}
} else {
return;
}
sAdo_OngenTrgStart(0x44F, &effect->position);
effect->effect_specific[0] = 0;
}
}
static void eKL_mv(eEC_Effect_c* effect, GAME* game) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
if (effect->position.x < effect->offset.x || effect->position.z < effect->offset.z ||
effect->position.x > effect->offset.y || effect->position.z > effect->scale.x) {
effect->timer = 0;
effect->scale.z = 0.0f;
} else {
f32 dist = 1000.0f;
if (ABS(effect->position.x - effect->offset.x) < 16.0f) {
dist = ABS(effect->position.x - effect->offset.x);
} else if (ABS(effect->position.z - effect->offset.z) < 16.0f) {
dist = ABS(effect->position.z - effect->offset.z);
} else if (ABS(effect->position.x - effect->offset.y) < 16.0f) {
dist = ABS(effect->position.x - effect->offset.y);
} else if (ABS(effect->position.z - effect->scale.x) < 16.0f) {
dist = ABS(effect->position.z - effect->scale.x);
}
if (dist < 20.0f) {
effect->scale.z = dist / 16.0f;
if (effect->effect_specific[0] == 0) {
effect->velocity.x *= 0.5f;
effect->velocity.z *= 0.5f;
effect->effect_specific[0] = 1;
}
} else {
effect->scale.z = 1.0f;
}
}
}
extern Gfx act_killer_model[];
static void eKL_dw(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, 0);
Matrix_RotateY(effect->arg0, 1);
Matrix_scale(0.01f, 0.01f, effect->scale.z * 0.01f, 1);
_texture_z_light_fog_prim(game->graph);
OPEN_DISP(game->graph);
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_OPA_DISP, act_killer_model);
CLOSE_DISP(game->graph);
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKishaK_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKishaK_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKishaK_mv(eEC_Effect_c* effect, GAME* game);
static void eKishaK_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kisha_kemuri = {
// clang-format off
&eKishaK_init,
&eKishaK_ct,
&eKishaK_mv,
&eKishaK_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKishaK_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKishaK_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKishaK_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKishaK_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKONP_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKONP_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKONP_mv(eEC_Effect_c* effect, GAME* game);
static void eKONP_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_konpu = {
// clang-format off
&eKONP_init,
&eKONP_ct,
&eKONP_mv,
&eKONP_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKONP_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKONP_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKONP_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKONP_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKPun_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKPun_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKPun_mv(eEC_Effect_c* effect, GAME* game);
static void eKPun_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kpun = {
// clang-format off
&eKPun_init,
&eKPun_ct,
&eKPun_mv,
&eKPun_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKPun_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKPun_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKPun_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKPun_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eKyousou_Onpu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eKyousou_Onpu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eKyousou_Onpu_mv(eEC_Effect_c* effect, GAME* game);
static void eKyousou_Onpu_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_kyousou_onpu = {
// clang-format off
&eKyousou_Onpu_init,
&eKyousou_Onpu_ct,
&eKyousou_Onpu_mv,
&eKyousou_Onpu_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eKyousou_Onpu_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eKyousou_Onpu_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eKyousou_Onpu_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eKyousou_Onpu_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+132
View File
@@ -0,0 +1,132 @@
#include "ef_lamp_light.h"
#include "m_field_info.h"
#include "m_lights.h"
#include "m_common_data.h"
#include "m_name_table.h"
static void Ef_Lamp_Light_actor_ct(ACTOR* actor, GAME* game);
static void Ef_Lamp_Light_actor_dt(ACTOR* actor, GAME* game);
static void Ef_Lamp_Light_actor_move(ACTOR* actor, GAME* game);
ACTOR_PROFILE Lamp_Light_Profile = {
mAc_PROFILE_LAMP_LIGHT,
ACTOR_PART_EFFECT,
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(LAMPLIGHT_ACTOR),
Ef_Lamp_Light_actor_ct,
Ef_Lamp_Light_actor_dt,
(mActor_proc)Ef_Lamp_Light_actor_move,
NONE_ACTOR_PROC,
NULL,
};
static void Ef_Lamp_Light_actor_ct(ACTOR* actor, GAME* game) {
LAMPLIGHT_ACTOR* lamp = (LAMPLIGHT_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
play->kankyo.lamp_light = &lamp->lights;
Light_diffuse_ct(&lamp->lights, 0, 0x50, 0, 0, 0, 0);
lamp->node_p = Global_light_list_new(game, &play->global_light, &lamp->lights);
}
static void Ef_Lamp_Light_actor_dt(ACTOR* actor, GAME* game) {
LAMPLIGHT_ACTOR* lamp = (LAMPLIGHT_ACTOR*)actor;
GAME_PLAY* play = (GAME_PLAY*)game;
play->kankyo.lamp_light = NULL;
Global_light_list_delete(&play->global_light, lamp->node_p);
}
static int eLL_get_light_sw_other_room() {
int ret = 0;
// Not before 6 p.m or past 6 a.m
if ((Common_Get(time.now_sec) < 21600) || (Common_Get(time.now_sec) >= 64800)) {
ret = 1;
}
return ret;
}
static int eLL_get_light_sw_player_room() {
// 6 p.m to 11 p.m
if ((Common_Get(time.now_sec) >= 64800) && (Common_Get(time.now_sec) < 82800)) {
return 1;
}
return 0;
}
static int eLL_get_light_sw_start_demo() {
int ret = 1;
if (Common_Get(sunlight_flag) == 1) {
ret = 0;
}
return ret;
}
static void eLL_ctrl_light_sw(LAMPLIGHT_ACTOR* lamp) {
int ret = 0;
switch (Common_Get(field_type)) {
case 2:
case 3:
switch (mFI_GetFieldId()) {
case mFI_FIELD_PLAYER0_ROOM:
case mFI_FIELD_PLAYER1_ROOM:
case mFI_FIELD_PLAYER2_ROOM:
case mFI_FIELD_PLAYER3_ROOM:
ret = eLL_get_light_sw_player_room(lamp);
break;
case mFI_FIELD_DEMO_STARTDEMO:
case mFI_FIELD_DEMO_STARTDEMO2:
ret = eLL_get_light_sw_start_demo();
break;
default:
ret = eLL_get_light_sw_other_room();
break;
}
break;
case 1:
ret = eLL_get_light_sw_player_room(lamp);
break;
}
lamp->switch_type = ret;
}
static void Ef_Lamp_Light_actor_move(ACTOR* actor, GAME* game) {
static s16 add_data_off[] = { 2, 2, 1, 0 };
static s16 add_data_on[] = { 16, 16, 8, 0 };
static s16* add_data[] = { add_data_off, add_data_on };
static s16 cmp_data_off[] = { 0, 0, 0, 0 };
static s16 cmp_data_on[] = { 0xC8, 0xC8, 0x96, 0 };
static s16* cmp_data[] = { cmp_data_off, cmp_data_on };
LAMPLIGHT_ACTOR* lamp = (LAMPLIGHT_ACTOR*)actor;
s16 val;
u8* color;
s16* add;
int type;
s16* cmp;
int i;
eLL_ctrl_light_sw(lamp);
color = lamp->lights.lights.diffuse.color;
type = lamp->switch_type;
add = add_data[type];
cmp = cmp_data[type];
for (i = 0; i < 3; i++, add++, cmp++, color++) {
val = *color;
chase_s(&val, *cmp, (0.5f * *add));
*color = val;
}
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eLove_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eLove_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eLove_mv(eEC_Effect_c* effect, GAME* game);
static void eLove_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_lovelove = {
// clang-format off
&eLove_init,
&eLove_ct,
&eLove_mv,
&eLove_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eLove_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eLove_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eLove_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eLove_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eLL2_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eLL2_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eLL2_mv(eEC_Effect_c* effect, GAME* game);
static void eLL2_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_lovelove2 = {
// clang-format off
&eLL2_init,
&eLL2_ct,
&eLL2_mv,
&eLL2_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eLL2_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eLL2_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eLL2_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eLL2_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eLoveH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eLoveH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eLoveH_mv(eEC_Effect_c* effect, GAME* game);
static void eLoveH_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_lovelove_heart = {
// clang-format off
&eLoveH_init,
&eLoveH_ct,
&eLoveH_mv,
&eLoveH_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eLoveH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eLoveH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eLoveH_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eLoveH_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+302
View File
@@ -0,0 +1,302 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_debug.h"
#include "sys_matrix.h"
#include "m_rcp.h"
#define eHM_TIMER 2000
static void eMH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_MAKE_HEM, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eMH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = eHM_TIMER;
effect->scale.x = 0.0f;
effect->scale.y = 0.0f;
effect->scale.z = 0.0f;
if (effect->arg0 == 1) {
effect->position.y += 30.0f;
} else {
effect->position.y += 20.0f;
}
if (effect->arg0 == 1) {
int* const point_light_num = &eMH_special_point_light_num;
if (*point_light_num == -1) {
xyz_t pos = effect->position;
pos.z += 20.0f;
*point_light_num = mEnv_ReservePointLight((GAME_PLAY*)game, &pos, 0, 0, 0, GETREG(MYKREG, 0) + 100);
}
(*eEC_CLIP->effect_make_proc)(eEC_EFFECT_MAKE_HEM_LIGHT, effect->position, 2, 0, game, RSV_NO, 0, 0);
sAdo_OngenTrgStart(0x468, &effect->position);
} else {
(*eEC_CLIP->effect_kill_proc)(eEC_EFFECT_MAKE_HEM_LIGHT, RSV_NO);
sAdo_OngenTrgStart(0x469, &effect->position);
}
}
static void eMH_mv(eEC_Effect_c* effect, GAME* game) {
f32 default_col = 255.0f;
s16 elapsed_time = eHM_TIMER - effect->timer;
f32 light_intensity;
u8 col;
int i;
if (elapsed_time <= 120) {
if (effect->arg0 == 1) {
light_intensity = (*eEC_CLIP->calc_adjust_proc)(elapsed_time, 0, 120, 0.0f, 1.0f);
} else {
light_intensity = 1.0f;
}
effect->effect_specific[0] = (int)(255.0f * (*eEC_CLIP->calc_adjust_proc)(elapsed_time, 0, 120, 0.0f, 1.0f));
} else if (elapsed_time <= 150) {
light_intensity = 1.0f;
effect->effect_specific[0] = (int)default_col;
if (elapsed_time == 150) {
if (Common_Get(hem_visible) == FALSE) {
Common_Set(hem_visible, TRUE);
} else {
Common_Set(hem_visible, FALSE);
}
/* Spawn 16 twinkle effects at random points around the central effect */
for (i = 0; i < 16; i++) {
xyz_t pos = effect->position;
s16 rnd_angle = RANDOM_F(66536.0f); // lol nice typo here.. should be 65536.0f
f32 z = 20.0f * cos_s(rnd_angle);
f32 x = 20.0f * sin_s(rnd_angle);
f32 y = -10.0f + RANDOM_F(25.0f);
pos.x += x;
pos.y += y;
pos.z += z;
(*eEC_CLIP->effect_make_proc)(eEC_EFFECT_MAKE_HEM_KIRA, pos, 2, 0, game, RSV_NO, 0, 0);
}
}
} else {
if (effect->arg0 == 1) {
light_intensity = 1.0f;
} else {
light_intensity = (*eEC_CLIP->calc_adjust_proc)(elapsed_time, 151, 195, 1.0f, 0.0f);
}
effect->effect_specific[0] = (int)(255.0f * (*eEC_CLIP->calc_adjust_proc)(elapsed_time, 151, 195, 1.0f, 0.0f));
if (elapsed_time == 196) {
effect->timer = 0;
if (effect->arg0 == 0) {
int* const point_light_num = &eMH_special_point_light_num;
if (*point_light_num != -1) {
*point_light_num = mEnv_CancelReservedPointLight(*point_light_num, (GAME_PLAY*)game);
}
}
}
}
add_calc(&effect->scale.x, 0.575f, 0.05f, 0.1f, 0.001f);
col = (int)(255.0f * light_intensity);
mEnv_OperateReservedPointLight_Color(eMH_special_point_light_num, col, col, col);
}
extern Gfx ef_sphere_light_model[];
static void eMH_dw(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
xyz_t* pos = &effect->position;
u8 alpha = effect->effect_specific[0];
f32 scale = effect->scale.x * 0.01f;
Setpos_HiliteReflect_xlu_init(pos, play);
Matrix_translate(pos->x, pos->y, pos->z, 0);
Matrix_scale(scale, scale, scale, 1);
_texture_z_light_fog_prim(game->graph);
OPEN_DISP(game->graph);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 255, 255, alpha);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_sphere_light_model);
CLOSE_DISP(game->graph);
}
eEC_PROFILE_c iam_ef_make_hem = {
// clang-format off
&eMH_init,
&eMH_ct,
&eMH_mv,
&eMH_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eMHK_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eMHK_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eMHK_mv(eEC_Effect_c* effect, GAME* game);
static void eMHK_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_make_hem_kira = {
// clang-format off
&eMHK_init,
&eMHK_ct,
&eMHK_mv,
&eMHK_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eMHK_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_MAKE_HEM_KIRA, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eMHK_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
static xyz_t xyz0 = { 0.0f, 0.0f, 0.0f };
effect->timer = 500.0f;
effect->acceleration = xyz0;
effect->velocity = xyz0;
effect->scale = xyz0;
effect->velocity.y = -(RANDOM_F(0.1f) + 0.2f);
effect->effect_specific[0] = RANDOM(32);
}
static void eMHK_mv(eEC_Effect_c* effect, GAME* game) {
s16 elapsed_time = (effect->timer + effect->effect_specific[0]) & 15;
f32 scale;
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
/* Shrink then scale */
if (elapsed_time <= 7) {
scale = (*eEC_CLIP->calc_adjust_proc)(elapsed_time, 0, 7, 0.0f, 0.0064999999f);
} else {
scale = (*eEC_CLIP->calc_adjust_proc)(elapsed_time, 8, 15, 0.0064999999f, 0.0f);
}
effect->scale.x = scale;
effect->scale.y = scale;
effect->scale.z = scale;
if (elapsed_time == 0) {
f32 bg_y = mCoBG_GetBgY_OnlyCenter_FromWpos2(effect->position, 0.0f);
if (effect->position.y < bg_y) {
effect->timer = 0;
}
}
}
extern Gfx ef_takurami01_normal_render_mode[];
extern Gfx ef_takurami01_kira_modelT[];
static void eMHK_dw(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, 0);
Matrix_mult(&play->billboard_matrix, 1);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, 1);
_texture_z_light_fog_prim_xlu(game->graph);
OPEN_DISP(game->graph);
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, 200);
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);
}
static void eMHL_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_MAKE_HEM_LIGHT, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eMHL_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = 195;
effect->effect_specific[0] = 0;
effect->position.y = mCoBG_GetBgY_OnlyCenter_FromWpos2(effect->position, 0.0f);
}
static void eMHL_mv(eEC_Effect_c* effect, GAME* game) {
(*eEC_CLIP->set_continious_env_proc)(effect, 195, 195);
switch (effect->state) {
case eEC_STATE_NORMAL: {
s16 elapsed_time = 195 - effect->timer;
if (elapsed_time < 120) {
effect->effect_specific[0] = (int)(*eEC_CLIP->calc_adjust_proc)(elapsed_time, 0, 119, 170.0f, 0.0f);
} else if (elapsed_time < 150) {
effect->effect_specific[0] = 0;
} else {
effect->effect_specific[0] = (int)(*eEC_CLIP->calc_adjust_proc)(elapsed_time, 151, 175, 0.0f, 50.0f);
}
break;
}
case eEC_STATE_FINISHED: {
s16 elapsed_time = 195 - effect->timer;
if (elapsed_time < 120) {
effect->effect_specific[0] = (int)(*eEC_CLIP->calc_adjust_proc)(elapsed_time, 0, 119, 50.0f, 0.0f);
} else if (elapsed_time < 150) {
effect->effect_specific[0] = 0;
} else {
effect->effect_specific[0] = (int)(*eEC_CLIP->calc_adjust_proc)(elapsed_time, 151, 195, 0.0f, 170.0f);
}
break;
}
default:
effect->effect_specific[0] = 50;
}
}
extern Gfx ef_circle_light_model[];
static void eMHL_dw(eEC_Effect_c* effect, GAME* game) {
u8 alpha = effect->effect_specific[0];
Matrix_translate(effect->position.x, effect->position.y + 0.1f, effect->position.z, 0);
Matrix_scale(0.01f, 0.01f, 0.01f, 1);
_texture_z_light_fog_prim_shadow(game->graph);
OPEN_DISP(game->graph);
gSPMatrix(NEXT_SHADOW_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(NEXT_SHADOW_DISP, 0, 0, 255, 255, 220, alpha);
gDPSetEnvColor(NEXT_SHADOW_DISP, 255, 255, 255, 100);
gSPDisplayList(NEXT_SHADOW_DISP, ef_circle_light_model);
CLOSE_DISP(game->graph);
}
eEC_PROFILE_c iam_ef_make_hem_light = {
// clang-format off
&eMHL_init,
&eMHL_ct,
&eMHL_mv,
&eMHL_dw,
195,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eMizutama_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eMizutama_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eMizutama_mv(eEC_Effect_c* effect, GAME* game);
static void eMizutama_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_mizutama = {
// clang-format off
&eMizutama_init,
&eMizutama_ct,
&eMizutama_mv,
&eMizutama_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eMizutama_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eMizutama_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eMizutama_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eMizutama_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eMotiyuge_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eMotiyuge_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eMotiyuge_mv(eEC_Effect_c* effect, GAME* game);
static void eMotiyuge_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_motiyuge = {
// clang-format off
&eMotiyuge_init,
&eMotiyuge_ct,
&eMotiyuge_mv,
&eMotiyuge_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eMotiyuge_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eMotiyuge_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eMotiyuge_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eMotiyuge_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eMK_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eMK_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eMK_mv(eEC_Effect_c* effect, GAME* game);
static void eMK_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_muka = {
// clang-format off
&eMK_init,
&eMK_ct,
&eMK_mv,
&eMK_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eMK_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eMK_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eMK_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eMK_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eNaku_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eNaku_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eNaku_mv(eEC_Effect_c* effect, GAME* game);
static void eNaku_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_naku = {
// clang-format off
&eNaku_init,
&eNaku_ct,
&eNaku_mv,
&eNaku_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eNaku_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eNaku_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eNaku_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eNaku_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eNamida_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eNamida_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eNamida_mv(eEC_Effect_c* effect, GAME* game);
static void eNamida_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_namida = {
// clang-format off
&eNamida_init,
&eNamida_ct,
&eNamida_mv,
&eNamida_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eNamida_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eNamida_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eNamida_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eNamida_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eNebo_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eNebo_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eNebo_mv(eEC_Effect_c* effect, GAME* game);
static void eNebo_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_neboke = {
// clang-format off
&eNebo_init,
&eNebo_ct,
&eNebo_mv,
&eNebo_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eNebo_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eNebo_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eNebo_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eNebo_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eNeboke_Akubi_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eNeboke_Akubi_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eNeboke_Akubi_mv(eEC_Effect_c* effect, GAME* game);
static void eNeboke_Akubi_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_neboke_akubi = {
// clang-format off
&eNeboke_Akubi_init,
&eNeboke_Akubi_ct,
&eNeboke_Akubi_mv,
&eNeboke_Akubi_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eNeboke_Akubi_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eNeboke_Akubi_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eNeboke_Akubi_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eNeboke_Akubi_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eSleep_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSleep_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSleep_mv(eEC_Effect_c* effect, GAME* game);
static void eSleep_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_neboke_awa = {
// clang-format off
&eSleep_init,
&eSleep_ct,
&eSleep_mv,
&eSleep_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eSleep_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSleep_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSleep_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSleep_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eNight13Moon_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eNight13Moon_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eNight13Moon_mv(eEC_Effect_c* effect, GAME* game);
static void eNight13Moon_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_night13_moon = {
// clang-format off
&eNight13Moon_init,
&eNight13Moon_ct,
&eNight13Moon_mv,
&eNight13Moon_dw,
80,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eNight13Moon_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eNight13Moon_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eNight13Moon_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eNight13Moon_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eNight15Moon_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eNight15Moon_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eNight15Moon_mv(eEC_Effect_c* effect, GAME* game);
static void eNight15Moon_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_night15_moon = {
// clang-format off
&eNight15Moon_init,
&eNight15Moon_ct,
&eNight15Moon_mv,
&eNight15Moon_dw,
60,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eNight15Moon_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eNight15Moon_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eNight15Moon_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eNight15Moon_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eOngen_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eOngen_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eOngen_mv(eEC_Effect_c* effect, GAME* game);
static void eOngen_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_ongen = {
// clang-format off
&eOngen_init,
&eOngen_ct,
&eOngen_mv,
&eOngen_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eOngen_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eOngen_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eOngen_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eOngen_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eOMN_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eOMN_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eOMN_mv(eEC_Effect_c* effect, GAME* game);
static void eOMN_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_otikomi = {
// clang-format off
&eOMN_init,
&eOMN_ct,
&eOMN_mv,
&eOMN_dw,
10,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eOMN_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eOMN_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eOMN_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eOMN_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+52
View File
@@ -0,0 +1,52 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void eOtosiana_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eOtosiana_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eOtosiana_mv(eEC_Effect_c* effect, GAME* game);
static void eOtosiana_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_otosiana = {
// clang-format off
&eOtosiana_init,
&eOtosiana_ct,
&eOtosiana_mv,
&eOtosiana_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eOtosiana_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
(*eEC_CLIP->make_effect_proc)(eEC_EFFECT_OTOSIANA, pos, NULL, game, NULL, item_name, prio, arg0, arg1);
}
static void eOtosiana_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->timer = 16;
}
static void eOtosiana_mv(eEC_Effect_c* effect, GAME* game) {
static s16 angle_tbl[] = { DEG2SHORT_ANGLE2(0.0f), DEG2SHORT_ANGLE2(135.0f), DEG2SHORT_ANGLE2(270.0f) };
if ((s16)(effect->timer & 7) == 0) {
int i;
for (i = 0; i < 3; i++) {
xyz_t pos = effect->position;
s16 angle = angle_tbl[i];
if ((effect->timer & 15) == 0) {
angle += DEG2SHORT_ANGLE2(180.0f);
}
eEC_CLIP->effect_make_proc(eEC_EFFECT_DIG_MUD, pos, effect->prio, angle, game, effect->item_name,
effect->arg0, 7);
}
}
}
static void eOtosiana_dw(eEC_Effect_c* effect, GAME* game) {
// Nothing
}
+54
View File
@@ -0,0 +1,54 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void ePun_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void ePun_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void ePun_mv(eEC_Effect_c* effect, GAME* game);
static void ePun_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_pun = {
// clang-format off
&ePun_init,
&ePun_ct,
&ePun_mv,
&ePun_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void ePun_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_PUN, pos, NULL, game, &angle, item_name, prio, 0, 0);
}
static void ePun_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
s16 var = *(s16*)ct_arg;
effect->effect_specific[0] = var;
effect->timer = 24;
}
static void ePun_mv(eEC_Effect_c* effect, GAME* game) {
eEC_CLIP->set_continious_env_proc(effect, 24, 44);
if (effect->state == eEC_STATE_CONTINUOUS) {
s16 timer_left = 44 - effect->timer;
if (timer_left == 0) {
effect->effect_specific[1] = RANDOM(100) & 1;
}
if (timer_left == 8) {
eEC_CLIP->effect_make_proc(eEC_EFFECT_PUN_YUGE, effect->position, effect->prio, effect->effect_specific[0], game, (u16)effect->item_name, effect->effect_specific[1], 0);
effect->effect_specific[1] = ++effect->effect_specific[1] & 1;
eEC_CLIP->effect_make_proc(eEC_EFFECT_PUN_SEKIMEN, effect->position, effect->prio, effect->effect_specific[0], game, (u16)effect->item_name, 0, 0);
}
}
}
static void ePun_dw(eEC_Effect_c* effect, GAME* game) {
}
+62
View File
@@ -0,0 +1,62 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void ePunRed_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void ePunRed_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void ePunRed_mv(eEC_Effect_c* effect, GAME* game);
static void ePunRed_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_pun_sekimen = {
// clang-format off
&ePunRed_init,
&ePunRed_ct,
&ePunRed_mv,
&ePunRed_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void ePunRed_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
xyz_t ofs;
ofs.x = 0.0f;
ofs.y = -2.0f;
ofs.z = 25.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_PUN_SEKIMEN, pos, &ofs, game, NULL, item_name, prio, 0, 0);
}
static void ePunRed_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->scale.x = 0.0105f;
effect->scale.y = 0.0105f;
effect->scale.z = 0.0105f;
effect->timer = 16;
}
static void ePunRed_mv(eEC_Effect_c* effect, GAME* game) {
// nothing
}
extern Gfx ef_pun01_01_modelT[];
static void ePunRed_dw(eEC_Effect_c* effect, GAME* game) {
int a;
xyz_t* scale;
s16 now_timer;
scale = &effect->scale;
now_timer = 16 - effect->timer;
a = (u8)eEC_CLIP->calc_adjust_proc(now_timer, 8, 16, 150.0f, 0.0f);
scale->z = scale->y = scale->x = eEC_CLIP->calc_adjust_proc(now_timer, 0, 16, 0.0105f, 0.0189f);
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, scale, &effect->offset);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 0, 0, a);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_pun01_01_modelT);
CLOSE_DISP(game->graph);
}
+124
View File
@@ -0,0 +1,124 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_rcp.h"
#include "sys_matrix.h"
extern u8 ef_pun01_0_int_i4[];
extern u8 ef_pun01_1_int_i4[];
extern u8 ef_pun01_2_int_i4[];
extern u8 ef_pun01_3_int_i4[];
extern u8 ef_pun01_4_int_i4[];
extern Gfx ef_pun01_00_modelT[];
static u8* ePunYuge_yuge_texture_table[] = {
ef_pun01_0_int_i4, ef_pun01_1_int_i4, ef_pun01_2_int_i4, ef_pun01_3_int_i4, ef_pun01_4_int_i4,
};
static void ePunYuge_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void ePunYuge_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void ePunYuge_mv(eEC_Effect_c* effect, GAME* game);
static void ePunYuge_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_pun_yuge = {
// clang-format off
&ePunYuge_init,
&ePunYuge_ct,
&ePunYuge_mv,
&ePunYuge_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void ePunYuge_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
pos.y += 23.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_PUN_YUGE, pos, NULL, game, &arg0, item_name, prio, 0, 0);
}
static void ePunYuge_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
effect->effect_specific[1] = *(s16*)ct_arg;
effect->effect_specific[0] = eEC_CLIP->random_first_speed_proc(NULL, 1.5f, 16.0f, 0.0f);
effect->offset.z = 10.0f;
effect->timer = 26.0f;
sAdo_OngenTrgStart(NA_SE_PUN_YUGE, &effect->position);
}
static void ePunYuge_mv(eEC_Effect_c* effect, GAME* game) {
s16 elapsed_time = 26 - effect->timer;
if (elapsed_time < 4) {
effect->offset.y += 1.5f;
}
}
typedef struct pun_yuge_tex_anim_s {
u8 tex0;
u8 tex1;
u8 prim_f;
u8 unused;
} ePunYuge_tex_anim_c;
static ePunYuge_tex_anim_c ePunYuge_texture_anime_idx[] = {
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 1, 127, 0 }, { 1, 1, 255, 0 },
{ 1, 2, 127, 0 }, { 2, 2, 0, 0 }, { 2, 3, 127, 0 }, { 3, 3, 255, 0 }, { 3, 4, 127, 0 },
{ 4, 4, 0, 0 }, { 4, 4, 0, 0 }, { 4, 4, 0, 0 },
};
static u8 ePunYuge_prim_f_table[] = {
0, 0, 0, 127, 255, 127, 0, 127, 255, 127, 0, 0, 0,
};
static void ePunYuge_dw(eEC_Effect_c* effect, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
int frame;
s16 time_elapsed = 26 - effect->timer;
int anime_idx0;
int anime_idx1;
int prim_f;
int prim_gb;
int prim_a;
int env_gb;
frame = (s16)CLAMP(time_elapsed >> 1, 0, 12);
anime_idx0 = ePunYuge_texture_anime_idx[frame].tex0;
anime_idx1 = ePunYuge_texture_anime_idx[frame].tex1;
prim_f = ePunYuge_prim_f_table[frame];
prim_gb = (u8)eEC_CLIP->calc_adjust_proc(time_elapsed, 0, 8, 200.0f, 255.0f);
prim_a = (u8)eEC_CLIP->calc_adjust_proc(time_elapsed, 12, 26, 255.0f, 0.0f);
env_gb = (u8)eEC_CLIP->calc_adjust_proc(time_elapsed, 0, 8, 0.0f, 255.0f);
if (frame <= 4) {
f32 scale_y[5];
scale_y[0] = 0.00595f;
scale_y[1] = 0.00833f;
scale_y[2] = 0.014161f;
scale_y[3] = 0.00833f;
scale_y[4] = 0.00595f;
effect->scale.y = scale_y[frame];
effect->scale.x = 0.00595f;
} else {
effect->scale.x = eEC_CLIP->calc_adjust_proc(time_elapsed, 10, 26, 0.00595f, 0.0119f);
effect->scale.y = effect->scale.x;
}
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_mult(&play->billboard_matrix, 1);
Matrix_RotateZ(effect->effect_specific[0], 1);
Matrix_translate(effect->offset.x, effect->offset.y, effect->offset.z, 1);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, 1);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_8, ePunYuge_yuge_texture_table[anime_idx0]);
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_9, ePunYuge_yuge_texture_table[anime_idx1]);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, (u8)prim_f, 255, (u8)prim_gb, (u8)prim_gb, (u8)prim_a);
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 255, (u8)env_gb, (u8)env_gb, 255);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_pun01_00_modelT);
CLOSE_DISP(game->graph);
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eReset_Hole_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eReset_Hole_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eReset_Hole_mv(eEC_Effect_c* effect, GAME* game);
static void eReset_Hole_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_reset_hole = {
// clang-format off
&eReset_Hole_init,
&eReset_Hole_ct,
&eReset_Hole_mv,
&eReset_Hole_dw,
24,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eReset_Hole_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eReset_Hole_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eReset_Hole_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eReset_Hole_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+203
View File
@@ -0,0 +1,203 @@
#include "ef_room_sunshine.h"
#include "m_common_data.h"
#include "m_name_table.h"
#include "m_debug.h"
#include "m_collision_bg.h"
#include "sys_matrix.h"
void Ef_Room_Sunshine_actor_ct(ACTOR* actor, GAME* play);
void Ef_Room_SunshineL_actor_move(ACTOR* actor, GAME* play);
void Ef_Room_SunshineL_actor_draw(ACTOR* actor, GAME* play);
void Ef_Room_SunshineR_actor_move(ACTOR* actor, GAME* play);
void Ef_Room_SunshineR_actor_draw(ACTOR* actor, GAME* play);
extern Gfx light_floor01_mode[];
extern Vtx light_floorL01_vtx[];
extern Vtx light_floorR01_vtx[];
extern Gfx light_shine01_mode[];
extern Vtx light_shineL01_vtx[];
extern Vtx light_shineR01_vtx[];
ACTOR_PROFILE Room_Sunshine_Profile = {
mAc_PROFILE_ROOM_SUNSHINE,
ACTOR_PART_EFFECT,
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_ROOM_SUNSHINE,
sizeof(ROOMSUNSHINE_ACTOR),
Ef_Room_Sunshine_actor_ct,
NONE_ACTOR_PROC,
Ef_Room_SunshineR_actor_move,
Ef_Room_SunshineR_actor_draw,
NULL,
};
static void Ef_Room_Sunshine_actor_ct(ACTOR* actor, GAME* game) {
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
xyz_t pos;
xyz_t pos2;
xyz_t pos3;
sunshine->unk_174 = 0;
if (sunshine->actor_class.actor_specific == 0) {
sunshine->actor_class.mv_proc = Ef_Room_SunshineL_actor_move;
sunshine->actor_class.dw_proc = Ef_Room_SunshineL_actor_draw;
} else {
sunshine->actor_class.world.position.x -= 1.0f;
}
sunshine->actor_class.world.position.y =
mCoBG_GetBgY_OnlyCenter_FromWpos(sunshine->actor_class.world.position, 0.0f);
sunshine->actor_class.scale.x = 1.0f;
sunshine->actor_class.scale.y = 1.0f;
sunshine->actor_class.scale.z = 1.0f;
switch (sunshine->actor_class.actor_specific) {
case 2:
sunshine->actor_class.mv_proc = Ef_Room_SunshineL_actor_move;
sunshine->actor_class.dw_proc = Ef_Room_SunshineL_actor_draw;
sunshine->actor_class.world.position.x += 5.0f;
sunshine->actor_class.world.position.y =
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(sunshine->actor_class.world.position, 0.0f);
sunshine->actor_class.world.position.x -= 6.0f;
break;
case 3:
sunshine->actor_class.world.position.x -= 5.0f;
sunshine->actor_class.world.position.y =
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(sunshine->actor_class.world.position, 0.0f);
sunshine->actor_class.world.position.x += 6.0f;
break;
}
}
static f32 calc_scale_Ef_Room_Sunshine(int flag, int sec) {
if (flag == 0) {
return 1.5f * sin_s((sec << 14) / 28800.0f);
} else {
return 1.5f * sin_s((sec << 14) / 14400.0f);
}
}
static int calc_alpha_Ef_Room_Sunshine() {
f32 ret;
int sec;
if (Common_Get(time.now_sec) < 14400) {
ret = (120.0f + GETREG(TAKREG, 30)) * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
} else if (Common_Get(time.now_sec) < 72000) {
sec = (Common_Get(time.now_sec) - 43200) >= 0 ? (Common_Get(time.now_sec) - 43200U)
: -(Common_Get(time.now_sec) - 43200U);
ret = 255.0f * ((28800 - sec) / 28800.0f);
} else {
ret = (120.0f + GETREG(TAKREG, 30)) * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
}
if ((Common_Get(weather) == 1) || (Common_Get(weather) == 2)) {
ret *= 0.6f;
}
return (u8)ret;
}
static void Ef_Room_SunshineL_actor_move(ACTOR* actor, GAME* game) {
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
if (Common_Get(time.now_sec) < 14400) {
sunshine->actor_class.scale.x = calc_scale_Ef_Room_Sunshine(1, Common_Get(time.now_sec));
} else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)) {
sunshine->actor_class.scale.x = calc_scale_Ef_Room_Sunshine(0, Common_Get(time.now_sec) - 43200);
} else {
sunshine->actor_class.scale.x = 0.0f;
}
}
static void Ef_Room_SunshineR_actor_move(ACTOR* actor, GAME* game) {
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)) {
sunshine->actor_class.scale.x = calc_scale_Ef_Room_Sunshine(0, 43200 - Common_Get(time.now_sec));
} else if (Common_Get(time.now_sec) >= 72000) {
sunshine->actor_class.scale.x = calc_scale_Ef_Room_Sunshine(1, 86400 - Common_Get(time.now_sec));
} else {
sunshine->actor_class.scale.x = 0.0f;
}
}
static void setup_mode_Ef_Room_Sunshine(ACTOR* actor, GAME_PLAY* play) {
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
u8* color;
f32 alpha;
GRAPH* graph = play->game.graph;
OPEN_DISP(graph);
Matrix_translate(sunshine->actor_class.world.position.x, 0.1f + sunshine->actor_class.world.position.y,
sunshine->actor_class.world.position.z, 0);
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z, 1);
gDPPipeSync(NEXT_POLY_XLU_DISP);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
color = play->kankyo.base_light.sun_color_window;
} else {
color = play->kankyo.base_light.moon_color_window;
}
alpha = (u8)calc_alpha_Ef_Room_Sunshine() * mKK_windowlight_alpha_get();
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 0, color[0], color[1], color[2], (int)(alpha));
CLOSE_DISP(graph);
}
static void Ef_Room_SunshineL_actor_draw(ACTOR* actor, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
GRAPH* graph;
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
return;
}
graph = play->game.graph;
setup_mode_Ef_Room_Sunshine(actor, play);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, light_floor01_mode);
gSPDisplayList(NEXT_POLY_XLU_DISP, light_floorL01_vtx);
gSPDisplayList(NEXT_POLY_XLU_DISP, light_shine01_mode);
gSPDisplayList(NEXT_POLY_XLU_DISP, light_shineL01_vtx);
CLOSE_DISP(graph);
}
static void Ef_Room_SunshineR_actor_draw(ACTOR* actor, GAME* game) {
GAME_PLAY* play = (GAME_PLAY*)game;
GRAPH* graph;
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
return;
}
graph = play->game.graph;
setup_mode_Ef_Room_Sunshine(actor, play);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, light_floor01_mode);
gSPDisplayList(NEXT_POLY_XLU_DISP, light_floorR01_vtx);
gSPDisplayList(NEXT_POLY_XLU_DISP, light_shine01_mode);
gSPDisplayList(NEXT_POLY_XLU_DISP, light_shineR01_vtx);
CLOSE_DISP(graph);
}
+308
View File
@@ -0,0 +1,308 @@
#include "ef_room_sunshine_minsect.h"
#include "m_common_data.h"
#include "m_name_table.h"
#include "m_debug.h"
#include "m_collision_bg.h"
#include "sys_matrix.h"
#include "m_rcp.h"
void Ef_Room_Sunshine_Minsect_actor_ct(ACTOR* actor, GAME* play);
void Ef_Room_Sunshine_Minsect_actor_dt(ACTOR* actor, GAME* play);
void Ef_Room_Sunshine_MinsectL_actor_draw(ACTOR* actor, GAME* play);
void Ef_Room_Sunshine_MinsectL_actor_move(ACTOR* actor, GAME* play);
void Ef_Room_Sunshine_MinsectR_actor_draw(ACTOR* actor, GAME* play);
void Ef_Room_Sunshine_MinsectR_actor_move(ACTOR* actor, GAME* play);
extern Gfx rom_museum4_ue_model[];
extern Gfx rom_museum4_model[];
extern Gfx obj_museum4_shine_1T_model[];
extern Gfx obj_museum4_shine_2T_model[];
u8 draw_status;
ACTOR_PROFILE Room_Sunshine_Minsect_Profile = {
mAc_PROFILE_ROOM_SUNSHINE_MINSECT,
ACTOR_PART_ITEM,
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_EF_MINSECT,
sizeof(ROOMSUNSHINEMINSECT_ACTOR),
Ef_Room_Sunshine_Minsect_actor_ct,
NONE_ACTOR_PROC,
Ef_Room_Sunshine_MinsectR_actor_move,
Ef_Room_Sunshine_MinsectR_actor_draw,
NULL,
};
static void Ef_Room_Sunshine_Minsect_actor_ct(ACTOR* actor, GAME* game) {
ROOMSUNSHINEMINSECT_ACTOR* minsect = (ROOMSUNSHINEMINSECT_ACTOR*)actor;
xyz_t pos;
minsect->ef_sunshine_class.unk_174 = 0;
draw_status = 0;
if (minsect->ef_sunshine_class.actor_class.actor_specific == 0) {
minsect->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_MinsectL_actor_move;
minsect->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_MinsectL_actor_draw;
} else {
minsect->ef_sunshine_class.actor_class.world.position.x -= 1.0f;
}
minsect->ef_sunshine_class.actor_class.world.position.y =
mCoBG_GetBgY_OnlyCenter_FromWpos(minsect->ef_sunshine_class.actor_class.world.position, 0.0f);
minsect->ef_sunshine_class.actor_class.scale.x = 0.01f;
minsect->ef_sunshine_class.actor_class.scale.y = 0.01f;
minsect->ef_sunshine_class.actor_class.scale.z = 0.01f;
minsect->ef_sunshine_class.actor_class.cull_radius = 10000.0f;
switch (minsect->ef_sunshine_class.actor_class.actor_specific) {
case 2:
minsect->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_MinsectL_actor_move;
minsect->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_MinsectL_actor_draw;
minsect->ef_sunshine_class.actor_class.world.position.x += 5.0f;
minsect->ef_sunshine_class.actor_class.world.position.x -= 6.0f;
break;
case 3:
minsect->ef_sunshine_class.actor_class.world.position.x -= 5.0f;
minsect->ef_sunshine_class.actor_class.world.position.x += 6.0f;
break;
}
}
static f32 calc_scale_Ef_Room_Sunshine_Minsect(int flag, int sec) {
if (flag == 0) {
return 0.01f * (1.5f * sin_s((sec << 14) / 28800.0f));
} else {
return 0.01f * (1.5f * sin_s((sec << 14) / 14400.0f));
}
}
static int calc_alpha_Ef_Room_SunshineMinsect() {
f32 ret;
int sec;
if (Common_Get(time.now_sec) < 14400) {
ret = 120.0f * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
} else if (Common_Get(time.now_sec) < 72000) {
// any other number matches codegen, but 43200 breaks
sec = (Common_Get(time.now_sec) - 43200) >= 0 ? (Common_Get(time.now_sec) - 43200U)
: -(Common_Get(time.now_sec) - 43200U);
ret = 255.0f * ((28800 - sec) / 28800.0f);
} else {
ret = 120.0f * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
}
if ((Common_Get(weather) == 1) || (Common_Get(weather) == 2)) {
ret *= 0.6f;
}
return (u8)ret;
}
static void Ef_Room_Sunshine_MinsectL_actor_move(ACTOR* actor, GAME* game) {
ROOMSUNSHINEMINSECT_ACTOR* minsect = (ROOMSUNSHINEMINSECT_ACTOR*)actor;
if (Common_Get(time.now_sec) < 14400) {
minsect->ef_sunshine_class.actor_class.scale.x =
calc_scale_Ef_Room_Sunshine_Minsect(1, Common_Get(time.now_sec));
} else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)) {
minsect->ef_sunshine_class.actor_class.scale.x =
calc_scale_Ef_Room_Sunshine_Minsect(0, Common_Get(time.now_sec) - 43200);
} else {
minsect->ef_sunshine_class.actor_class.scale.x = 0.0f;
}
minsect->ef_sunshine_class.actor_class.world.position.y = minsect->ef_sunshine_class.actor_class.home.position.y;
minsect->ef_sunshine_class.actor_class.world.position.y += 0.01f * GETREG(TAKREG, 64);
}
static void Ef_Room_Sunshine_MinsectR_actor_move(ACTOR* actor, GAME* game) {
ROOMSUNSHINEMINSECT_ACTOR* minsect = (ROOMSUNSHINEMINSECT_ACTOR*)actor;
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)) {
minsect->ef_sunshine_class.actor_class.scale.x =
-calc_scale_Ef_Room_Sunshine_Minsect(0, 43200 - Common_Get(time.now_sec));
} else if (Common_Get(time.now_sec) >= 72000) {
minsect->ef_sunshine_class.actor_class.scale.x =
-calc_scale_Ef_Room_Sunshine_Minsect(1, 86400 - Common_Get(time.now_sec));
} else {
minsect->ef_sunshine_class.actor_class.scale.x = 0.0f;
}
minsect->ef_sunshine_class.actor_class.world.position.y = minsect->ef_sunshine_class.actor_class.home.position.y;
minsect->ef_sunshine_class.actor_class.world.position.y += 0.01f * GETREG(TAKREG, 64);
}
static void setup_mode_Ef_Room_Sunshine_Minsect(ACTOR* actor, GAME_PLAY* play) {
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
u8* color;
int calc;
GRAPH* graph = play->game.graph;
OPEN_DISP(graph);
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
sunshine->actor_class.world.position.z, 0);
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z, 1);
gDPPipeSync(NEXT_POLY_XLU_DISP);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
color = play->kankyo.base_light.sun_color_window;
} else {
color = play->kankyo.base_light.moon_color_window;
}
calc = ((u8)calc_alpha_Ef_Room_SunshineMinsect() * mKK_windowlight_alpha_get());
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, calc, color[0], color[1], color[2], 75);
CLOSE_DISP(graph);
}
static void setup_mode_Ef_Room_Sunshine_Minsect_decal(ACTOR* actor, GAME_PLAY* play) {
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
u8* color;
int calc;
GRAPH* graph = play->game.graph;
OPEN_DISP(graph);
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
sunshine->actor_class.world.position.z, 0);
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z, 1);
gDPPipeSync(NEXT_POLY_OPA_DISP);
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
color = play->kankyo.base_light.sun_color_window;
} else {
color = play->kankyo.base_light.moon_color_window;
}
calc = ((u8)calc_alpha_Ef_Room_SunshineMinsect() * mKK_windowlight_alpha_get());
gDPSetPrimColor(NEXT_POLY_OPA_DISP, 0, calc, color[0], color[1], color[2], 75);
CLOSE_DISP(graph);
}
static void BG_draw_Minsect(ACTOR* actor, GAME_PLAY* play) {
GRAPH* graph;
if (!(draw_status & 4)) {
draw_status |= 4;
}
if ((draw_status & 1) && (draw_status & 2)) {
draw_status = 0;
}
graph = play->game.graph;
Matrix_scale(0.0625f, 0.0625f, 0.0625f, 0);
Global_kankyo_set_room_prim(play);
OPEN_DISP(graph);
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_OPA_DISP, rom_museum4_ue_model);
CLOSE_DISP(graph);
}
static void BG_draw_Minsect_niwa(ACTOR* actor, GAME_PLAY* play) {
GRAPH* graph;
graph = play->game.graph;
Matrix_scale(0.0625f, 0.0625f, 0.0625f, 0);
Global_kankyo_set_room_prim(play);
OPEN_DISP(graph);
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_OPA_DISP, rom_museum4_model);
CLOSE_DISP(graph);
}
static void Ef_Room_Sunshine_MinsectL_actor_draw(ACTOR* actor, GAME* game) {
GRAPH* graph;
_texture_z_light_fog_prim(game->graph);
_texture_z_light_fog_prim_shadow(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
draw_status |= 1;
if (mKK_windowlight_alpha_get() < 9.99999974738e-05f) {
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)) {
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
BG_draw_Minsect(actor, (GAME_PLAY*)game);
}
} else if (0.0f == actor->scale.x) {
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)) {
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
BG_draw_Minsect(actor, (GAME_PLAY*)game);
}
} else {
s16 reg;
graph = game->graph;
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
setup_mode_Ef_Room_Sunshine_Minsect(actor, (GAME_PLAY*)game);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_museum4_shine_1T_model);
setup_mode_Ef_Room_Sunshine_Minsect_decal(actor, (GAME_PLAY*)game);
if (REGADDR(TAKREG, 0) == 0) {
gSPDisplayList(NEXT_POLY_OPA_DISP, obj_museum4_shine_2T_model);
}
BG_draw_Minsect(actor, (GAME_PLAY*)game);
CLOSE_DISP(graph);
}
}
static void Ef_Room_Sunshine_MinsectR_actor_draw(ACTOR* actor, GAME* game) {
GRAPH* graph;
_texture_z_light_fog_prim(game->graph);
_texture_z_light_fog_prim_shadow(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
draw_status |= 2;
if (mKK_windowlight_alpha_get() < 9.99999974738e-05f) {
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)) {
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
BG_draw_Minsect(actor, (GAME_PLAY*)game);
}
} else if (0.0f == actor->scale.x) {
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)) {
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
BG_draw_Minsect(actor, (GAME_PLAY*)game);
}
} else {
graph = game->graph;
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
setup_mode_Ef_Room_Sunshine_Minsect(actor, (GAME_PLAY*)game);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_museum4_shine_1T_model);
setup_mode_Ef_Room_Sunshine_Minsect_decal(actor, (GAME_PLAY*)game);
if (REGADDR(TAKREG, 0) == 0) {
gSPDisplayList(NEXT_POLY_OPA_DISP, obj_museum4_shine_2T_model);
}
BG_draw_Minsect(actor, (GAME_PLAY*)game);
CLOSE_DISP(graph);
}
}
+205
View File
@@ -0,0 +1,205 @@
#include "ef_room_sunshine_museum.h"
#include "m_common_data.h"
#include "m_name_table.h"
#include "m_debug.h"
#include "m_collision_bg.h"
#include "sys_matrix.h"
void Ef_Room_Sunshine_Museum_actor_ct(ACTOR* actor, GAME* play);
void Ef_Room_Sunshine_Museum_actor_dt(ACTOR* actor, GAME* play);
void Ef_Room_Sunshine_MuseumL_actor_draw(ACTOR* actor, GAME* play);
void Ef_Room_Sunshine_MuseumL_actor_move(ACTOR* actor, GAME* play);
void Ef_Room_Sunshine_MuseumR_actor_draw(ACTOR* actor, GAME* play);
void Ef_Room_Sunshine_MuseumR_actor_move(ACTOR* actor, GAME* play);
extern Gfx obj_museum1_shine_model[];
extern Gfx obj_museum1_shine_modelT[];
ACTOR_PROFILE Room_Sunshine_Museum_Profile = {
mAc_PROFILE_ROOM_SUNSHINE_MUSEUM,
ACTOR_PART_EFFECT,
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_EF_MUSEUM,
sizeof(ROOMSUNSHINEMUSEUM_ACTOR),
Ef_Room_Sunshine_Museum_actor_ct,
NONE_ACTOR_PROC,
Ef_Room_Sunshine_MuseumR_actor_move,
Ef_Room_Sunshine_MuseumR_actor_draw,
NULL,
};
void Ef_Room_Sunshine_Museum_actor_ct(ACTOR* actor, GAME* game){
ROOMSUNSHINEMUSEUM_ACTOR* museum = (ROOMSUNSHINEMUSEUM_ACTOR*)actor;
xyz_t pos;
xyz_t pos2;
xyz_t pos3;
museum->ef_sunshine_class.unk_174 = 0;
if(museum->ef_sunshine_class.actor_class.actor_specific == 0){
museum->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_MuseumL_actor_move;
museum->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_MuseumL_actor_draw;
}
else{
museum->ef_sunshine_class.actor_class.world.position.x -= 1.0f;
}
museum->ef_sunshine_class.actor_class.world.position.y = mCoBG_GetBgY_OnlyCenter_FromWpos(museum->ef_sunshine_class.actor_class.world.position, 0.0f);
museum->ef_sunshine_class.actor_class.scale.x = 0.01f;
museum->ef_sunshine_class.actor_class.scale.y = 0.01f;
museum->ef_sunshine_class.actor_class.scale.z = 0.01f;
switch(museum->ef_sunshine_class.actor_class.actor_specific){
case 2:
museum->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_MuseumL_actor_move;
museum->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_MuseumL_actor_draw;
museum->ef_sunshine_class.actor_class.world.position.x += 5.0f;
museum->ef_sunshine_class.actor_class.world.position.y = 1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(museum->ef_sunshine_class.actor_class.world.position, 0.0f) - 40.0f;
museum->ef_sunshine_class.actor_class.world.position.x -= 6.0f;
break;
case 3:
museum->ef_sunshine_class.actor_class.world.position.x -= 5.0f;
museum->ef_sunshine_class.actor_class.world.position.y = 1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(pos3 = museum->ef_sunshine_class.actor_class.world.position, 0.0f) - 40.0f;
museum->ef_sunshine_class.actor_class.world.position.x += 6.0f;
break;
}
}
f32 calc_scale_Ef_Room_Sunshine_Museum(int flag, int sec){
if(flag == 0){
return 0.01f * (1.5f * sin_s((sec << 14) / 28800.0f));
}
else{
return 0.01f * (1.5f * sin_s((sec << 14) / 14400.0f));
}
}
int calc_alpha_Ef_Room_SunshineMuseum(){
f32 ret;
int sec;
if(Common_Get(time.now_sec) < 14400){
ret = 120.0f * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
}
else if(Common_Get(time.now_sec) < 72000){
//any other number matches codegen, but 43200 breaks
sec = (Common_Get(time.now_sec) - 43200) >= 0 ?
(Common_Get(time.now_sec) - 43200U) : -(Common_Get(time.now_sec) - 43200U);
ret = 255.0f * ((28800 - sec) / 28800.0f);
}
else{
ret = 120.0f * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
}
if((Common_Get(weather) == 1) || (Common_Get(weather) == 2)){
ret *= 0.6f;
}
return (u8)ret;
}
void Ef_Room_Sunshine_MuseumL_actor_move(ACTOR* actor, GAME* game){
ROOMSUNSHINEMUSEUM_ACTOR* museum = (ROOMSUNSHINEMUSEUM_ACTOR*)actor;
if(Common_Get(time.now_sec) < 14400){
museum->ef_sunshine_class.actor_class.scale.x = calc_scale_Ef_Room_Sunshine_Museum(1, Common_Get(time.now_sec));
}
else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)){
museum->ef_sunshine_class.actor_class.scale.x = calc_scale_Ef_Room_Sunshine_Museum(0, Common_Get(time.now_sec) - 43200);
}
else{
museum->ef_sunshine_class.actor_class.scale.x = 0.0f;
}
}
void Ef_Room_Sunshine_MuseumR_actor_move(ACTOR* actor, GAME* game){
ROOMSUNSHINEMUSEUM_ACTOR* museum = (ROOMSUNSHINEMUSEUM_ACTOR*)actor;
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)){
museum->ef_sunshine_class.actor_class.scale.x = -calc_scale_Ef_Room_Sunshine_Museum(0, 43200 - Common_Get(time.now_sec));
}
else if (Common_Get(time.now_sec) >= 72000){
museum->ef_sunshine_class.actor_class.scale.x = -calc_scale_Ef_Room_Sunshine_Museum(1, 86400 -Common_Get(time.now_sec));
}
else{
museum->ef_sunshine_class.actor_class.scale.x = 0.0f;
}
}
void setup_mode_Ef_Room_Sunshine_Museum(ACTOR* actor, GAME_PLAY* play){
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
u8* color;
int calc;
GRAPH* graph = play->game.graph;
OPEN_DISP(graph);
Matrix_translate(sunshine->actor_class.world.position.x + GETREG(TAKREG,20), sunshine->actor_class.world.position.y + GETREG(TAKREG,21),
sunshine->actor_class.world.position.z + GETREG(TAKREG,22), 0);
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z,1);
gDPPipeSync(NEXT_POLY_XLU_DISP);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)){
color =play->kankyo.base_light.sun_color_window;
}
else{
color =play->kankyo.base_light.moon_color_window;
}
calc = ((u8)calc_alpha_Ef_Room_SunshineMuseum() * mKK_windowlight_alpha_get());
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, calc, color[0], color[1], color[2], 75);
CLOSE_DISP(graph);
}
void Ef_Room_Sunshine_MuseumL_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
GAME_PLAY* play = (GAME_PLAY*)game;
if(!(mKK_windowlight_alpha_get() < 9.99999974738e-05f) && (actor->scale.x != 0.0f)){
graph = play->game.graph;
setup_mode_Ef_Room_Sunshine_Museum(actor, play);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_museum1_shine_model);
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_museum1_shine_modelT);
CLOSE_DISP(graph);
}
}
void Ef_Room_Sunshine_MuseumR_actor_draw(ACTOR* actor, GAME* game){
GRAPH* graph;
GAME_PLAY* play = (GAME_PLAY*)game;
if(!(mKK_windowlight_alpha_get() < 9.99999974738e-05f) && (actor->scale.x != 0.0f)){
graph = play->game.graph;
setup_mode_Ef_Room_Sunshine_Museum(actor, play);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_museum1_shine_model);
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_museum1_shine_modelT);
CLOSE_DISP(graph);
}
}
+211
View File
@@ -0,0 +1,211 @@
#include "ef_room_sunshine_police.h"
#include "m_common_data.h"
#include "m_name_table.h"
#include "m_debug.h"
#include "m_collision_bg.h"
#include "sys_matrix.h"
static void Ef_Room_Sunshine_Police_actor_ct(ACTOR* actor, GAME* play);
static void Ef_Room_Sunshine_Police_actor_dt(ACTOR* actor, GAME* play);
static void Ef_Room_Sunshine_PoliceL_actor_draw(ACTOR* actor, GAME* play);
static void Ef_Room_Sunshine_PoliceL_actor_move(ACTOR* actor, GAME* play);
static void Ef_Room_Sunshine_PoliceR_actor_draw(ACTOR* actor, GAME* play);
static void Ef_Room_Sunshine_PoliceR_actor_move(ACTOR* actor, GAME* play);
extern Gfx obj_koban_shine_modelT[];
ACTOR_PROFILE Room_Sunshine_Police_Profile = {
mAc_PROFILE_ROOM_SUNSHINE_POLICE,
ACTOR_PART_EFFECT,
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_EF_POLICE,
sizeof(ROOMSUNSHINEPOLICE_ACTOR),
Ef_Room_Sunshine_Police_actor_ct,
NONE_ACTOR_PROC,
Ef_Room_Sunshine_PoliceR_actor_move,
Ef_Room_Sunshine_PoliceR_actor_draw,
NULL,
};
static void Ef_Room_Sunshine_Police_actor_ct(ACTOR* actor, GAME* game) {
ROOMSUNSHINEPOLICE_ACTOR* police = (ROOMSUNSHINEPOLICE_ACTOR*)actor;
xyz_t pos;
xyz_t pos2;
xyz_t pos3;
police->ef_sunshine_class.unk_174 = 0;
if (police->ef_sunshine_class.actor_class.actor_specific == 0) {
police->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_PoliceL_actor_move;
police->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_PoliceL_actor_draw;
} else {
police->ef_sunshine_class.actor_class.world.position.x -= 1.0f;
}
police->ef_sunshine_class.actor_class.world.position.y =
mCoBG_GetBgY_OnlyCenter_FromWpos(police->ef_sunshine_class.actor_class.world.position, 0.0f);
police->ef_sunshine_class.actor_class.scale.x = 0.01f;
police->ef_sunshine_class.actor_class.scale.y = 0.01f;
police->ef_sunshine_class.actor_class.scale.z = 0.01f;
switch (police->ef_sunshine_class.actor_class.actor_specific) {
case 2:
police->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_PoliceL_actor_move;
police->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_PoliceL_actor_draw;
police->ef_sunshine_class.actor_class.world.position.x += 5.0f;
police->ef_sunshine_class.actor_class.world.position.y =
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(police->ef_sunshine_class.actor_class.world.position, 0.0f) -
40.0f;
police->ef_sunshine_class.actor_class.world.position.x -= 6.0f;
break;
case 3:
police->ef_sunshine_class.actor_class.world.position.x -= 5.0f;
police->ef_sunshine_class.actor_class.world.position.y =
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(police->ef_sunshine_class.actor_class.world.position, 0.0f) -
40.0f;
police->ef_sunshine_class.actor_class.world.position.x += 6.0f;
break;
}
}
static f32 calc_scale_Ef_Room_Sunshine_Police(int flag, int sec) {
if (flag == 0) {
return 0.01f * (1.5f * sin_s((sec << 14) / 28800.0f));
} else {
return 0.01f * (1.5f * sin_s((sec << 14) / 14400.0f));
}
}
static int calc_alpha_Ef_Room_SunshinePolice() {
f32 ret;
int sec;
if (Common_Get(time.now_sec) < 14400) {
ret = 120.0f * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
} else if (Common_Get(time.now_sec) < 72000) {
sec = (Common_Get(time.now_sec) - 43200) >= 0 ? (Common_Get(time.now_sec) - 43200U)
: -(Common_Get(time.now_sec) - 43200U);
ret = 255.0f * ((28800 - sec) / 28800.0f);
} else {
ret = 120.0f * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
}
if ((Common_Get(weather) == 1) || (Common_Get(weather) == 2)) {
ret *= 0.6f;
}
return (u8)ret;
}
static void Ef_Room_Sunshine_PoliceL_actor_move(ACTOR* actor, GAME* game) {
ROOMSUNSHINEPOLICE_ACTOR* police = (ROOMSUNSHINEPOLICE_ACTOR*)actor;
if (Common_Get(time.now_sec) < 14400) {
police->ef_sunshine_class.actor_class.scale.x = calc_scale_Ef_Room_Sunshine_Police(1, Common_Get(time.now_sec));
} else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)) {
police->ef_sunshine_class.actor_class.scale.x =
calc_scale_Ef_Room_Sunshine_Police(0, Common_Get(time.now_sec) - 43200);
} else {
police->ef_sunshine_class.actor_class.scale.x = 0.0f;
}
}
static void Ef_Room_Sunshine_PoliceR_actor_move(ACTOR* actor, GAME* game) {
ROOMSUNSHINEPOLICE_ACTOR* police = (ROOMSUNSHINEPOLICE_ACTOR*)actor;
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)) {
police->ef_sunshine_class.actor_class.scale.x =
-calc_scale_Ef_Room_Sunshine_Police(0, 43200 - Common_Get(time.now_sec));
} else if (Common_Get(time.now_sec) >= 72000) {
police->ef_sunshine_class.actor_class.scale.x =
-calc_scale_Ef_Room_Sunshine_Police(1, 86400 - Common_Get(time.now_sec));
} else {
police->ef_sunshine_class.actor_class.scale.x = 0.0f;
}
}
static int cull_check_from_camera(ACTOR* actor, GAME_PLAY* play, int flag) {
if (((play->camera.lookat.eye.x >= actor->world.position.x) && (flag == 1)) ||
(play->camera.lookat.eye.x <= actor->world.position.x) && (flag == 0)) {
return 1;
}
return 0;
}
static void setup_mode_Ef_Room_Sunshine_Police(ACTOR* actor, GAME_PLAY* play) {
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
u8* color;
int calc;
GRAPH* graph = play->game.graph;
OPEN_DISP(graph);
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
sunshine->actor_class.world.position.z, 0);
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z, 1);
gDPPipeSync(NEXT_POLY_XLU_DISP);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
color = play->kankyo.base_light.sun_color_window;
} else {
color = play->kankyo.base_light.moon_color_window;
}
calc = ((u8)calc_alpha_Ef_Room_SunshinePolice() * mKK_windowlight_alpha_get());
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, calc, color[0], color[1], color[2], 255);
CLOSE_DISP(graph);
}
static void Ef_Room_Sunshine_PoliceL_actor_draw(ACTOR* actor, GAME* game) {
GRAPH* graph;
GAME_PLAY* play = (GAME_PLAY*)game;
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
return;
}
if (cull_check_from_camera(actor, play, 0) == 0) {
graph = play->game.graph;
setup_mode_Ef_Room_Sunshine_Police(actor, play);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_koban_shine_modelT);
CLOSE_DISP(graph);
}
}
static void Ef_Room_Sunshine_PoliceR_actor_draw(ACTOR* actor, GAME* game) {
GRAPH* graph;
GAME_PLAY* play = (GAME_PLAY*)game;
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
return;
}
if (cull_check_from_camera(actor, play, 1) == 0) {
graph = play->game.graph;
setup_mode_Ef_Room_Sunshine_Police(actor, play);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_koban_shine_modelT);
CLOSE_DISP(graph);
}
}
+198
View File
@@ -0,0 +1,198 @@
#include "ef_room_sunshine_posthouse.h"
#include "m_common_data.h"
#include "m_name_table.h"
#include "m_debug.h"
#include "m_collision_bg.h"
#include "sys_matrix.h"
#include "libultra/libultra.h"
static void Ef_Room_Sunshine_Posthouse_actor_ct(ACTOR* actor, GAME* play);
static void Ef_Room_Sunshine_Posthouse_actor_dt(ACTOR* actor, GAME* play);
static void Ef_Room_Sunshine_PosthouseL_actor_draw(ACTOR* actor, GAME* play);
static void Ef_Room_Sunshine_PosthouseL_actor_move(ACTOR* actor, GAME* play);
static void Ef_Room_Sunshine_PosthouseR_actor_draw(ACTOR* actor, GAME* play);
static void Ef_Room_Sunshine_PosthouseR_actor_move(ACTOR* actor, GAME* play);
extern Gfx obj_yubinkyoku_shine_modelT[];
ACTOR_PROFILE Room_Sunshine_Posthouse_Profile = {
mAc_PROFILE_ROOM_SUNSHINE_POSTHOUSE,
ACTOR_PART_EFFECT,
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_POSTHOUSE,
sizeof(ROOMSUNSHINEPOSTHOUSE_ACTOR),
Ef_Room_Sunshine_Posthouse_actor_ct,
NONE_ACTOR_PROC,
Ef_Room_Sunshine_PosthouseR_actor_move,
Ef_Room_Sunshine_PosthouseR_actor_draw,
NULL,
};
static void Ef_Room_Sunshine_Posthouse_actor_ct(ACTOR* actor, GAME* game) {
ROOMSUNSHINEPOSTHOUSE_ACTOR* posthouse = (ROOMSUNSHINEPOSTHOUSE_ACTOR*)actor;
xyz_t pos;
xyz_t pos2;
xyz_t pos3;
posthouse->ef_sunshine_class.unk_174 = 0;
if (posthouse->ef_sunshine_class.actor_class.actor_specific == 0) {
posthouse->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_PosthouseL_actor_move;
posthouse->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_PosthouseL_actor_draw;
} else {
posthouse->ef_sunshine_class.actor_class.world.position.x -= 1.0f;
}
posthouse->ef_sunshine_class.actor_class.world.position.y =
mCoBG_GetBgY_OnlyCenter_FromWpos(posthouse->ef_sunshine_class.actor_class.world.position, 0.0f);
posthouse->ef_sunshine_class.actor_class.scale.x = 0.05f;
posthouse->ef_sunshine_class.actor_class.scale.y = 0.05f;
posthouse->ef_sunshine_class.actor_class.scale.z = 0.05f;
switch (posthouse->ef_sunshine_class.actor_class.actor_specific) {
case 2:
posthouse->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_PosthouseL_actor_move;
posthouse->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_PosthouseL_actor_draw;
posthouse->ef_sunshine_class.actor_class.world.position.x += 5.0f;
posthouse->ef_sunshine_class.actor_class.world.position.y =
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(posthouse->ef_sunshine_class.actor_class.world.position, 0.0f);
posthouse->ef_sunshine_class.actor_class.world.position.x -= 6.0f;
break;
case 3:
posthouse->ef_sunshine_class.actor_class.world.position.x -= 5.0f;
posthouse->ef_sunshine_class.actor_class.world.position.y =
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(posthouse->ef_sunshine_class.actor_class.world.position, 0.0f);
posthouse->ef_sunshine_class.actor_class.world.position.x += 6.0f;
break;
}
}
static f32 calc_scale_Ef_Room_Sunshine_Posthouse(int flag, int sec) {
if (flag == 0) {
return 0.05f * (1.5f * sin_s((sec << 14) / 28800.0f));
} else {
return 0.05f * (1.5f * sin_s((sec << 14) / 14400.0f));
}
}
static int calc_alpha_Ef_Room_Sunshine_Posthouse() {
f32 ret;
int sec;
if (Common_Get(time.now_sec) < 14400) {
ret = 120.0f * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
} else if (Common_Get(time.now_sec) < 72000) {
// any other number matches codegen, but 43200 breaks
sec = (Common_Get(time.now_sec) - 43200) >= 0 ? (Common_Get(time.now_sec) - 43200U)
: -(Common_Get(time.now_sec) - 43200U);
ret = 255.0f * ((28800 - sec) / 28800.0f);
} else {
ret = 120.0f * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
}
if ((Common_Get(weather) == 1) || (Common_Get(weather) == 2)) {
ret *= 0.6f;
}
return (u8)ret;
}
static void Ef_Room_Sunshine_PosthouseL_actor_move(ACTOR* actor, GAME* game) {
ROOMSUNSHINEPOSTHOUSE_ACTOR* posthouse = (ROOMSUNSHINEPOSTHOUSE_ACTOR*)actor;
if (Common_Get(time.now_sec) < 14400) {
posthouse->ef_sunshine_class.actor_class.scale.x =
calc_scale_Ef_Room_Sunshine_Posthouse(1, Common_Get(time.now_sec));
} else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)) {
posthouse->ef_sunshine_class.actor_class.scale.x =
calc_scale_Ef_Room_Sunshine_Posthouse(0, Common_Get(time.now_sec) - 43200);
} else {
posthouse->ef_sunshine_class.actor_class.scale.x = 0.0f;
}
}
static void Ef_Room_Sunshine_PosthouseR_actor_move(ACTOR* actor, GAME* game) {
ROOMSUNSHINEPOSTHOUSE_ACTOR* posthouse = (ROOMSUNSHINEPOSTHOUSE_ACTOR*)actor;
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)) {
posthouse->ef_sunshine_class.actor_class.scale.x =
-calc_scale_Ef_Room_Sunshine_Posthouse(0, 43200 - Common_Get(time.now_sec));
} else if (Common_Get(time.now_sec) >= 72000) {
posthouse->ef_sunshine_class.actor_class.scale.x =
-calc_scale_Ef_Room_Sunshine_Posthouse(1, 86400 - Common_Get(time.now_sec));
} else {
posthouse->ef_sunshine_class.actor_class.scale.x = 0.0f;
}
}
static void setup_mode_Ef_Room_Sunshine_Posthouse(ACTOR* actor, GAME_PLAY* play) {
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
u8* color;
int calc;
GRAPH* graph = play->game.graph;
OPEN_DISP(graph);
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
sunshine->actor_class.world.position.z, 0);
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z, 1);
gDPPipeSync(NEXT_POLY_XLU_DISP);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
color = play->kankyo.base_light.sun_color_window;
} else {
color = play->kankyo.base_light.moon_color_window;
}
calc = ((u8)calc_alpha_Ef_Room_Sunshine_Posthouse() * mKK_windowlight_alpha_get());
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, calc, color[0], color[1], color[2], 255);
CLOSE_DISP(graph);
}
static void Ef_Room_Sunshine_PosthouseL_actor_draw(ACTOR* actor, GAME* game) {
GRAPH* graph;
GAME_PLAY* play = (GAME_PLAY*)game;
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
return;
}
graph = play->game.graph;
setup_mode_Ef_Room_Sunshine_Posthouse(actor, play);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_yubinkyoku_shine_modelT);
CLOSE_DISP(graph);
}
static void Ef_Room_Sunshine_PosthouseR_actor_draw(ACTOR* actor, GAME* game) {
GRAPH* graph;
GAME_PLAY* play = (GAME_PLAY*)game;
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
return;
}
graph = play->game.graph;
setup_mode_Ef_Room_Sunshine_Posthouse(actor, play);
OPEN_DISP(graph);
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_yubinkyoku_shine_modelT);
CLOSE_DISP(graph);
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eSandsplash_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSandsplash_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSandsplash_mv(eEC_Effect_c* effect, GAME* game);
static void eSandsplash_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_sandsplash = {
// clang-format off
&eSandsplash_init,
&eSandsplash_ct,
&eSandsplash_mv,
&eSandsplash_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eSandsplash_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSandsplash_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSandsplash_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSandsplash_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eSK_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSK_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSK_mv(eEC_Effect_c* effect, GAME* game);
static void eSK_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_shock = {
// clang-format off
&eSK_init,
&eSK_ct,
&eSK_mv,
&eSK_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eSK_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSK_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSK_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSK_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eShooting_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eShooting_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eShooting_mv(eEC_Effect_c* effect, GAME* game);
static void eShooting_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_shooting = {
// clang-format off
&eShooting_init,
&eShooting_ct,
&eShooting_mv,
&eShooting_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eShooting_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eShooting_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eShooting_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eShooting_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eShootingKira_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eShootingKira_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eShootingKira_mv(eEC_Effect_c* effect, GAME* game);
static void eShootingKira_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_shooting_kira = {
// clang-format off
&eShootingKira_init,
&eShootingKira_ct,
&eShootingKira_mv,
&eShootingKira_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eShootingKira_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eShootingKira_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eShootingKira_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eShootingKira_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eShootingSet_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eShootingSet_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eShootingSet_mv(eEC_Effect_c* effect, GAME* game);
static void eShootingSet_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_shooting_set = {
// clang-format off
&eShootingSet_init,
&eShootingSet_ct,
&eShootingSet_mv,
&eShootingSet_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eShootingSet_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eShootingSet_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eShootingSet_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eShootingSet_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.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);
static void eSSHN_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_siawase_hana = {
// clang-format off
&eSSHN_init,
&eSSHN_ct,
&eSSHN_mv,
&eSSHN_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eSSHN_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSSHN_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSSHN_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSSHN_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
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);
static void eSSHNC_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_siawase_hana_ch = {
// clang-format off
&eSSHNC_init,
&eSSHNC_ct,
&eSSHNC_mv,
&eSSHNC_dw,
eEC_IMMEDIATE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eSSHNC_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSSHNC_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSSHNC_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSSHNC_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
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);
static void eSSHKR_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_siawase_hikari = {
// clang-format off
&eSSHKR_init,
&eSSHKR_ct,
&eSSHKR_mv,
&eSSHKR_dw,
72,
eEC_EFFECT_SIAWASE_HANA,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eSSHKR_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSSHKR_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSSHKR_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSSHKR_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
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);
static void eSibuki_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_sibuki = {
// clang-format off
&eSibuki_init,
&eSibuki_ct,
&eSibuki_mv,
&eSibuki_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eSibuki_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSibuki_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSibuki_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSibuki_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eSN_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSN_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSN_mv(eEC_Effect_c* effect, GAME* game);
static void eSN_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_situren = {
// clang-format off
&eSN_init,
&eSN_ct,
&eSN_mv,
&eSN_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eSN_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSN_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSN_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSN_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eSlip_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSlip_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSlip_mv(eEC_Effect_c* effect, GAME* game);
static void eSlip_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_slip = {
// clang-format off
&eSlip_init,
&eSlip_ct,
&eSlip_mv,
&eSlip_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eSlip_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSlip_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSlip_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSlip_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eSlipFootPrint_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSlipFootPrint_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSlipFootPrint_mv(eEC_Effect_c* effect, GAME* game);
static void eSlipFootPrint_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_slip_footprint = {
// clang-format off
&eSlipFootPrint_init,
&eSlipFootPrint_ct,
&eSlipFootPrint_mv,
&eSlipFootPrint_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eSlipFootPrint_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSlipFootPrint_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSlipFootPrint_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSlipFootPrint_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}
+34
View File
@@ -0,0 +1,34 @@
#include "ef_effect_control.h"
static void eSoba_Yuge_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eSoba_Yuge_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eSoba_Yuge_mv(eEC_Effect_c* effect, GAME* game);
static void eSoba_Yuge_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_soba_yuge = {
// clang-format off
&eSoba_Yuge_init,
&eSoba_Yuge_ct,
&eSoba_Yuge_mv,
&eSoba_Yuge_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_IGNORE_DEATH_DIST,
// clang-format on
};
static void eSoba_Yuge_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
}
static void eSoba_Yuge_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
}
static void eSoba_Yuge_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
}
static void eSoba_Yuge_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
}

Some files were not shown because too many files have changed in this diff Show More