From be6c56384e383d6f81317c1f82b2f31a1bdd881e Mon Sep 17 00:00:00 2001 From: Weaky322 Date: Tue, 6 Aug 2024 23:54:27 -0600 Subject: [PATCH 1/2] Link ef_hanatiri.c --- config/rel_slices.yml | 3 +++ src/ef_hanatiri.c | 25 +++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/config/rel_slices.yml b/config/rel_slices.yml index 5e68c7bf..d9c6f9e2 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -1155,6 +1155,9 @@ ef_hanabi_dummy.c: .text: [0x8060E6D8, 0x8060E9B8] .rodata: [0x8064C2A0, 0x8064C2C0] .data: [0x806D2858, 0x806D2888] +ef_hanatiri.c: + .text: [0x80610478, 0x8061061C] + .data: [0x806D2C08, 0x806D2C20] ef_killer.c: .text: [0x80614178, 0x8061481C] .rodata: [0x8064C680, 0x8064C6C0] diff --git a/src/ef_hanatiri.c b/src/ef_hanatiri.c index 9102f464..8cfa3966 100644 --- a/src/ef_hanatiri.c +++ b/src/ef_hanatiri.c @@ -1,5 +1,7 @@ #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); @@ -18,17 +20,32 @@ eEC_PROFILE_c iam_ef_hanatiri = { }; static void eHanatiri_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_HANATIRI, pos, NULL, game, NULL, item_name, prio, arg0, arg1); } static void eHanatiri_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + 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) { - // TODO + // empty } static void eHanatiri_dw(eEC_Effect_c* effect, GAME* game) { - // TODO + // empty } + From dec0f895a82052402965929fbcc5147db121f25f Mon Sep 17 00:00:00 2001 From: Weaky322 Date: Wed, 7 Aug 2024 00:00:32 -0600 Subject: [PATCH 2/2] Link ef_hanatiri.c --- config/rel_slices.yml | 6 ++++-- src/ef_halloween.c | 23 +++++++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/config/rel_slices.yml b/config/rel_slices.yml index d9c6f9e2..fa30808d 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -1151,6 +1151,10 @@ ef_footprint.c: .text: [0x8060BCB0, 0x8060C21C] .rodata: [0x8064C0B0, 0x8064C0E0] .data: [0x806D2430, 0x806D2470] +ef_halloween.c: + .text: [0x8060D44C, 0x8060D654] + .rodata: [0x8064C1C0, 0x8064C1D0] + .data: [0x806D2600, 0x806D2618] ef_hanabi_dummy.c: .text: [0x8060E6D8, 0x8060E9B8] .rodata: [0x8064C2A0, 0x8064C2C0] @@ -1228,7 +1232,6 @@ f_furniture.c: .data: [0x806D4D40, 0x806E02A0] ac_weather_fine.c: .data: [0x806D1DA0, 0x806D1DB8] - # dataobject.obj NPC draw data TUs data/npc/model/mdl/bev_1.c: .data: [0x806E03A0, 0x806E27D0] @@ -1271,7 +1274,6 @@ data/npc/model/tex/bea_9.c: data/npc/model/tex/bea_10.c: .data: [0x806FA140, 0x806FB360] - # dataobject.obj files data/field/bg/flower/obj_flower.c: .data: [0x8074FE80, 0x807508C0] diff --git a/src/ef_halloween.c b/src/ef_halloween.c index 923de7e8..82ecbf35 100644 --- a/src/ef_halloween.c +++ b/src/ef_halloween.c @@ -1,5 +1,7 @@ #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); @@ -18,17 +20,30 @@ eEC_PROFILE_c iam_ef_halloween = { }; static void eHalloween_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_HALLOWEEN, pos, NULL, game, &angle, item_name, prio, arg0, arg1); } static void eHalloween_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + effect->timer = 0x28; + effect->effect_specific[0] = 0; + sAdo_OngenTrgStart(0x107, &effect->position); } static void eHalloween_mv(eEC_Effect_c* effect, GAME* game) { - // TODO + 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) { - // TODO + // empty }