From 8222b5f062d0212b8b54581c11cd2bcaefbc5a2c Mon Sep 17 00:00:00 2001 From: koba Date: Tue, 3 Sep 2024 06:13:51 -0400 Subject: [PATCH] Implement & link ef_otosiana (#420) * Implement & link ef_otosiana * New line fix --------- Co-authored-by: kobacat --- config/rel_slices.yml | 3 +++ src/ef_otosiana.c | 26 ++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/config/rel_slices.yml b/config/rel_slices.yml index d6e9de75..635461a6 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -1204,6 +1204,9 @@ ef_make_hem.c: .text: [0x806162B0, 0x8061710C] .rodata: [0x8064C818, 0x8064C860] .data: [0x806D3160, 0x806D31B8] +ef_otosiana.c: + .text: [0x8061A4E0, 0x8061A650] + .data: [0x806D33B8, 0x806D33D8] ef_pun.c: .text: [0x8061A650, 0x8061A824] .rodata: [0x8064CAB8, 0x8064CAC0] diff --git a/src/ef_otosiana.c b/src/ef_otosiana.c index 59f60c98..e1d53c1d 100644 --- a/src/ef_otosiana.c +++ b/src/ef_otosiana.c @@ -1,5 +1,7 @@ #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); @@ -18,17 +20,33 @@ eEC_PROFILE_c iam_ef_otosiana = { }; static void eOtosiana_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_OTOSIANA, pos, NULL, game, NULL, item_name, prio, arg0, arg1); } static void eOtosiana_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + effect->timer = 16; } static void eOtosiana_mv(eEC_Effect_c* effect, GAME* game) { - // TODO + 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) { - // TODO + // Nothing }