From 61351a9ddeb0a02aa0487c09f1400c2e88216634 Mon Sep 17 00:00:00 2001 From: Prakxo Date: Sun, 21 Apr 2024 18:32:23 +0200 Subject: [PATCH] link ef_bush_yuki --- config/rel_slices.yml | 4 ++++ src/ef_bush_yuki.c | 52 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/config/rel_slices.yml b/config/rel_slices.yml index b439478f..734b29f0 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -1006,6 +1006,10 @@ ef_bush_happa.c: .text: [0x80606A68, 0x806072DC] .rodata: [0x8064BD78, 0x8064BDD8] .data: [0x806D1F68, 0x806D1F80] +ef_bush_yuki.c: + .text: [0x806072DC, 0x806075BC] + .rodata: [0x8064BDD8, 0x8064BE00] + .data: [0x806D1F80, 0x806D1F98] ef_coin.c: .text: [0x80608060, 0x806087EC] .rodata: [0x8064BE48, 0x8064BEA0] diff --git a/src/ef_bush_yuki.c b/src/ef_bush_yuki.c index 68ae4d10..caf0e9cb 100644 --- a/src/ef_bush_yuki.c +++ b/src/ef_bush_yuki.c @@ -1,4 +1,8 @@ #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); @@ -18,17 +22,55 @@ eEC_PROFILE_c iam_ef_bush_yuki = { }; static void eBushYuki_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_BUSH_YUKI, pos, NULL, game, &angle, item_name, prio, arg0, arg1); } static void eBushYuki_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + + 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; } -static void eBushYuki_mv(eEC_Effect_c* effect, GAME* game) { - // TODO +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) { - // TODO + 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); + }