mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-08 20:24:49 -04:00
link ef_ha
This commit is contained in:
+1
-1
@@ -1256,7 +1256,7 @@ config.libs = [
|
||||
Object(Matching, "effect/ef_furo_yuge.c"),
|
||||
Object(Matching, "effect/ef_gimonhu.c"),
|
||||
Object(Matching, "effect/ef_goki.c"),
|
||||
Object(NonMatching, "effect/ef_ha.c"),
|
||||
Object(Matching, "effect/ef_ha.c"),
|
||||
Object(Matching, "effect/ef_halloween.c"),
|
||||
Object(Matching, "effect/ef_halloween_smoke.c"),
|
||||
Object(NonMatching, "effect/ef_hanabi_botan1.c"),
|
||||
|
||||
@@ -60,6 +60,7 @@ typedef enum audio_sound_effects {
|
||||
NA_SE_27 = 0x27,
|
||||
|
||||
NA_SE_2A = 0x2A,
|
||||
NA_SE_2C = 0x2C,
|
||||
|
||||
NA_SE_2F = 0x2F,
|
||||
|
||||
@@ -327,7 +328,6 @@ typedef enum audio_sound_effects {
|
||||
NA_SE_FOOTSTEP_WAVE,
|
||||
NA_SE_FOOTSTEP_PLUSSBRIDGE,
|
||||
|
||||
|
||||
NA_SE_FLOOR_SE_START = SE_ECHO(0x2E6),
|
||||
} AudioSE;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ static void eGM_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
|
||||
static void eGM_mv(eEC_Effect_c* effect, GAME* game) {
|
||||
s16 currentFrame = EFFECT_LIFETIME - effect->timer;
|
||||
if (currentFrame == 0) {
|
||||
sAdo_OngenTrgStart(0X2F, &effect->position);
|
||||
sAdo_OngenTrgStart(NA_SE_2F, &effect->position);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+47
-5
@@ -1,10 +1,16 @@
|
||||
#include "ef_effect_control.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_rcp.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_debug.h"
|
||||
|
||||
#define EFFECT_LIFETIME 56
|
||||
|
||||
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);
|
||||
|
||||
extern Gfx ef_ha01_00_modelT[];
|
||||
eEC_PROFILE_c iam_ef_ha = {
|
||||
// clang-format off
|
||||
&eHA_init,
|
||||
@@ -17,18 +23,54 @@ eEC_PROFILE_c iam_ef_ha = {
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
s16 eHA_angle_z_data[] = { DEG2SHORT_ANGLE2(45.f), DEG2SHORT_ANGLE2(315.f) };
|
||||
|
||||
static void eHA_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_HA, pos, NULL, game, &angle, item_name, prio, 0, 0);
|
||||
}
|
||||
|
||||
static void eHA_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
|
||||
// TODO
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
s16* ang_p = (s16*)ct_arg;
|
||||
u16 angle = *ang_p - (s16)((s16)getCamera2AngleY(play) + DEG2SHORT_ANGLE2(180));
|
||||
|
||||
effect->scale.x = 0.0067f;
|
||||
effect->scale.y = 0.0067f;
|
||||
effect->scale.z = 0.0067f;
|
||||
effect->timer = EFFECT_LIFETIME;
|
||||
effect->offset.y += 12.f;
|
||||
if (angle >= (u16)DEG2SHORT_ANGLE2(180)) {
|
||||
effect->effect_specific[0] = 0;
|
||||
effect->offset.x += -16.f;
|
||||
} else {
|
||||
effect->effect_specific[0] = 1;
|
||||
effect->offset.x += 16.f;
|
||||
}
|
||||
}
|
||||
|
||||
static void eHA_mv(eEC_Effect_c* effect, GAME* game) {
|
||||
// TODO
|
||||
if (effect->timer == EFFECT_LIFETIME) {
|
||||
sAdo_OngenTrgStart(NA_SE_2C, &effect->position);
|
||||
}
|
||||
}
|
||||
|
||||
static void eHA_dw(eEC_Effect_c* effect, GAME* game) {
|
||||
// TODO
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
s16 v = effect->effect_specific[0];
|
||||
int opacity = (u8)eEC_CLIP->calc_adjust_proc(EFFECT_LIFETIME - effect->timer, 24, EFFECT_LIFETIME, 255.f, 0.f);
|
||||
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_mult(&play->billboard_matrix, TRUE);
|
||||
Matrix_translate(effect->offset.x + GETREG(MYKREG, 0x18), effect->offset.y + GETREG(MYKREG, 0x19),
|
||||
effect->offset.z + GETREG(MYKREG, 0x1a), TRUE);
|
||||
Matrix_RotateZ(eHA_angle_z_data[v], TRUE);
|
||||
Matrix_scale(effect->scale.x * (GETREG(MYKREG, 0x1b) * 0.01f + 1.f),
|
||||
effect->scale.y * (GETREG(MYKREG, 0x1b) * 0.01f + 1.f),
|
||||
effect->scale.z * (GETREG(MYKREG, 0x1b) * 0.01f + 1.f), TRUE);
|
||||
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 128, 255, 255, 255, opacity);
|
||||
gDPSetEnvColor(NEXT_POLY_XLU_DISP, 0, 0, 255, 255);
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_ha01_00_modelT);
|
||||
CLOSE_DISP(game->graph);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user