link ef_ase_ch

This commit is contained in:
Prakxo
2024-04-21 17:48:25 +02:00
parent d7e750a320
commit 8770de8f4f
2 changed files with 48 additions and 4 deletions
+4
View File
@@ -990,6 +990,10 @@ ef_ase2.c:
.text: [0x806050E4, 0x806052A8]
.rodata: [0x8064BC98, 0x8064BCA8]
.data: [0x806D1EA0, 0x806D1EC8]
ef_ase_ch.c:
.text: [0x806052A8, 0x806054F0]
.rodata: [0x8064BCA8, 0x8064BCC0]
.data: [0x806D1EC8, 0x806D1F08]
ef_coin.c:
.text: [0x80608060, 0x806087EC]
.rodata: [0x8064BE48, 0x8064BEA0]
+44 -4
View File
@@ -1,4 +1,5 @@
#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);
@@ -16,19 +17,58 @@ eEC_PROFILE_c iam_ef_ase_ch = {
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) {
// TODO
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) {
// TODO
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) {
// TODO
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) {
// TODO
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);
}