mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Implement & link ac_handOverItem
This commit is contained in:
@@ -387,6 +387,11 @@ ac_boxMove.c:
|
||||
ac_boxTrick01.c:
|
||||
.text: [0x80415BF8, 0x80415C04]
|
||||
.data: [0x806818F0, 0x80681918]
|
||||
ac_handOverItem.c:
|
||||
.text: [0x80426A50, 0x80427624]
|
||||
.rodata: [0x806440A0, 0x806440B8]
|
||||
.data: [0x806832C0, 0x80683D08]
|
||||
.bss: [0x812F9C28, 0x812F9C50]
|
||||
ac_haniwa.c:
|
||||
.text: [0x80427624, 0x80428F64]
|
||||
.rodata: [0x806440B8, 0x806440F8]
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_tools.h"
|
||||
#include "m_scene.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -26,9 +27,16 @@ enum {
|
||||
aHOI_REQUEST_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
aHOI_NOT_PRESENT,
|
||||
aHOI_PRESENT,
|
||||
|
||||
aHOI_PRESENT_TYPE_NUM
|
||||
};
|
||||
|
||||
typedef struct hand_over_item_actor_s HANDOVERITEM_ACTOR;
|
||||
|
||||
typedef ACTOR* (*aHOI_BIRTH_PROC)(mActor_name_t, int, int);
|
||||
typedef ACTOR* (*aHOI_BIRTH_PROC)(mActor_name_t, int, int, ACTOR*);
|
||||
typedef ACTOR* (*aHOI_CHG_MASTER_PROC)(ACTOR*);
|
||||
typedef int (*aHOI_CHG_REQUEST_MODE_PROC)(ACTOR*, int);
|
||||
typedef void (*aHOI_REBUILD_DMA_PROC)(Object_Exchange_c*, ACTOR*); /* yoinked from DnM, unused in AC */
|
||||
@@ -49,8 +57,18 @@ typedef struct hand_over_item_clip_s {
|
||||
} aHOI_Clip_c;
|
||||
|
||||
struct hand_over_item_actor_s {
|
||||
ACTOR actor_class;
|
||||
u8 _174[0x1F4 - 0x174]; /* TODO */
|
||||
TOOLS_ACTOR tools_class;
|
||||
int mode;
|
||||
f32 anm_cnt;
|
||||
xyz_t trans;
|
||||
f32 scale;
|
||||
u8 trans_flag;
|
||||
u8 item_type;
|
||||
u8 draw_type;
|
||||
u8 se_set_flag;
|
||||
int item;
|
||||
int gyo_type;
|
||||
int gyo_flag;
|
||||
};
|
||||
|
||||
extern ACTOR_PROFILE HandOverItem_Profile;
|
||||
|
||||
+10
-4
@@ -169,11 +169,17 @@ extern s16 actor_profile_table[];
|
||||
extern s16 props_profile_table[];
|
||||
extern u8 npc_looks_table[];
|
||||
|
||||
extern int mNT_check_unknown(mActor_name_t item_no);
|
||||
extern int FGTreeType_check(mActor_name_t tree);
|
||||
extern mActor_name_t bg_item_fg_sub_tree_grow(mActor_name_t tree, int past_days, int check_plant);
|
||||
extern mActor_name_t bg_item_fg_sub_dig2take_conv(mActor_name_t item);
|
||||
extern int mNT_get_itemTableNo(mActor_name_t item);
|
||||
extern mActor_name_t mNT_FishIdx2FishItemNo(int idx);
|
||||
extern mActor_name_t bg_item_fg_sub(mActor_name_t item, s16 flag);
|
||||
extern mActor_name_t bg_item_fg_sub_tree_grow(mActor_name_t item, int past_days, int check_plant);
|
||||
extern mActor_name_t bg_item_fg_sub_dig2take_conv(mActor_name_t item);
|
||||
extern mNT_offset_table_c* obj_hight_table_item0_nogrow(mActor_name_t item);
|
||||
extern int FGTreeType_check(mActor_name_t tree);
|
||||
extern int mNT_ItIsStump(mActor_name_t actor);
|
||||
extern int mNT_ItIsStoneCoin10(mActor_name_t actor);
|
||||
extern int mNT_ItIsReserveDummy(mActor_name_t actor);
|
||||
extern int mNT_check_unknown(mActor_name_t item_no);
|
||||
|
||||
/* Retrieve the item actor's category */
|
||||
#define ITEM_NAME_GET_TYPE(n) (((n) & 0xF000) >> 12)
|
||||
|
||||
@@ -48,6 +48,7 @@ extern void mPlib_Load_PlayerTexAndPallet(void* tex_p, void* pal_p, int idx);
|
||||
extern void mPlib_request_main_give_from_submenu(mActor_name_t disp_item, int submenu_ovl, int present_flag, int counter_flag);
|
||||
extern int mPlib_Check_tree_shaken_big(const xyz_t* pos);
|
||||
extern int mPlib_Check_tree_shaken_little(const xyz_t* pos);
|
||||
extern int mPlib_request_main_recieve_wait_type1(GAME* game, mActor_name_t item, int counter_flag);
|
||||
|
||||
extern mPlayer_change_data_from_submenu_c* mPlib_Get_change_data_from_submenu_p();
|
||||
|
||||
|
||||
@@ -0,0 +1,675 @@
|
||||
#include "ac_handOverItem.h"
|
||||
|
||||
#include "libultra/libultra.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_demo.h"
|
||||
#include "m_msg.h"
|
||||
#include "m_name_table.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_rcp.h"
|
||||
#include "sys_matrix.h"
|
||||
|
||||
enum {
|
||||
aHOI_ITEM_TYPE_ITEM,
|
||||
aHOI_ITEM_TYPE_FISH,
|
||||
aHOI_ITEM_TYPE_MAIL,
|
||||
|
||||
aHOI_ITEM_TYPE_NUM
|
||||
};
|
||||
|
||||
static void aHOI_actor_ct(ACTOR*, GAME*);
|
||||
static void aHOI_actor_dt(ACTOR*, GAME*);
|
||||
static void aHOI_actor_move(ACTOR*, GAME*);
|
||||
static void aHOI_actor_draw(ACTOR*, GAME*);
|
||||
|
||||
ACTOR_PROFILE HandOverItem_Profile = {
|
||||
mAc_PROFILE_HANDOVERITEM,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(HANDOVERITEM_ACTOR),
|
||||
&aHOI_actor_ct,
|
||||
&aHOI_actor_dt,
|
||||
&aHOI_actor_move,
|
||||
&aHOI_actor_draw,
|
||||
NULL
|
||||
};
|
||||
|
||||
static aHOI_Clip_c aHOI_clip;
|
||||
|
||||
typedef struct gyo_model_s {
|
||||
Gfx* dl_a;
|
||||
Gfx* dl_b;
|
||||
Gfx* dl_c;
|
||||
} aHOI_GYO_DL_c;
|
||||
|
||||
extern Gfx act_f01_funa_aT_model[];
|
||||
extern Gfx act_f01_funa_bT_model[];
|
||||
extern Gfx act_f01_funa_cT_model[];
|
||||
extern Gfx act_f02_hera_aT_model[];
|
||||
extern Gfx act_f02_hera_bT_model[];
|
||||
extern Gfx act_f02_hera_cT_model[];
|
||||
extern Gfx act_f03_koi_aT_model[];
|
||||
extern Gfx act_f03_koi_bT_model[];
|
||||
extern Gfx act_f03_koi_cT_model[];
|
||||
extern Gfx act_f04_nisiki_aT_model[];
|
||||
extern Gfx act_f04_nisiki_bT_model[];
|
||||
extern Gfx act_f04_nisiki_cT_model[];
|
||||
extern Gfx act_f05_namazu_aT_model[];
|
||||
extern Gfx act_f05_namazu_bT_model[];
|
||||
extern Gfx act_f05_namazu_cT_model[];
|
||||
extern Gfx act_f06_bass_aT_model[];
|
||||
extern Gfx act_f06_bass_bT_model[];
|
||||
extern Gfx act_f06_bass_cT_model[];
|
||||
extern Gfx act_f07_bassm_aT_model[];
|
||||
extern Gfx act_f07_bassm_bT_model[];
|
||||
extern Gfx act_f07_bassm_cT_model[];
|
||||
extern Gfx act_f08_bassl_aT_model[];
|
||||
extern Gfx act_f08_bassl_bT_model[];
|
||||
extern Gfx act_f08_bassl_cT_model[];
|
||||
extern Gfx act_f09_gill_aT_model[];
|
||||
extern Gfx act_f09_gill_bT_model[];
|
||||
extern Gfx act_f09_gill_cT_model[];
|
||||
extern Gfx act_f10_oonamazu_aT_model[];
|
||||
extern Gfx act_f10_oonamazu_bT_model[];
|
||||
extern Gfx act_f10_oonamazu_cT_model[];
|
||||
extern Gfx act_f11_raigyo_aT_model[];
|
||||
extern Gfx act_f11_raigyo_bT_model[];
|
||||
extern Gfx act_f11_raigyo_cT_model[];
|
||||
extern Gfx act_f12_nigoi_aT_model[];
|
||||
extern Gfx act_f12_nigoi_bT_model[];
|
||||
extern Gfx act_f12_nigoi_cT_model[];
|
||||
extern Gfx act_f13_ugui_aT_model[];
|
||||
extern Gfx act_f13_ugui_bT_model[];
|
||||
extern Gfx act_f13_ugui_cT_model[];
|
||||
extern Gfx act_f14_oikawa_aT_model[];
|
||||
extern Gfx act_f14_oikawa_bT_model[];
|
||||
extern Gfx act_f14_oikawa_cT_model[];
|
||||
extern Gfx act_f15_tanago_aT_model[];
|
||||
extern Gfx act_f15_tanago_bT_model[];
|
||||
extern Gfx act_f15_tanago_cT_model[];
|
||||
extern Gfx act_f16_dojyo_aT_model[];
|
||||
extern Gfx act_f16_dojyo_bT_model[];
|
||||
extern Gfx act_f16_dojyo_cT_model[];
|
||||
extern Gfx act_f17_wakasagi_aT_model[];
|
||||
extern Gfx act_f17_wakasagi_bT_model[];
|
||||
extern Gfx act_f17_wakasagi_cT_model[];
|
||||
extern Gfx act_f18_ayu_aT_model[];
|
||||
extern Gfx act_f18_ayu_bT_model[];
|
||||
extern Gfx act_f18_ayu_cT_model[];
|
||||
extern Gfx act_f19_yamame_aT_model[];
|
||||
extern Gfx act_f19_yamame_bT_model[];
|
||||
extern Gfx act_f19_yamame_cT_model[];
|
||||
extern Gfx act_f20_iwana_aT_model[];
|
||||
extern Gfx act_f20_iwana_bT_model[];
|
||||
extern Gfx act_f20_iwana_cT_model[];
|
||||
extern Gfx act_f21_niji_aT_model[];
|
||||
extern Gfx act_f21_niji_bT_model[];
|
||||
extern Gfx act_f21_niji_cT_model[];
|
||||
extern Gfx act_f22_ito_aT_model[];
|
||||
extern Gfx act_f22_ito_bT_model[];
|
||||
extern Gfx act_f22_ito_cT_model[];
|
||||
extern Gfx act_f23_sake_aT_model[];
|
||||
extern Gfx act_f23_sake_bT_model[];
|
||||
extern Gfx act_f23_sake_cT_model[];
|
||||
extern Gfx act_f24_kingyo_aT_model[];
|
||||
extern Gfx act_f24_kingyo_bT_model[];
|
||||
extern Gfx act_f24_kingyo_cT_model[];
|
||||
extern Gfx act_f25_pirania_aT_model[];
|
||||
extern Gfx act_f25_pirania_bT_model[];
|
||||
extern Gfx act_f25_pirania_cT_model[];
|
||||
extern Gfx act_f26_aroana_aT_model[];
|
||||
extern Gfx act_f26_aroana_bT_model[];
|
||||
extern Gfx act_f26_aroana_cT_model[];
|
||||
extern Gfx act_f27_unagi_aT_model[];
|
||||
extern Gfx act_f27_unagi_bT_model[];
|
||||
extern Gfx act_f27_unagi_cT_model[];
|
||||
extern Gfx act_f28_donko_aT_model[];
|
||||
extern Gfx act_f28_donko_bT_model[];
|
||||
extern Gfx act_f28_donko_cT_model[];
|
||||
extern Gfx act_f29_angel_aT_model[];
|
||||
extern Gfx act_f29_angel_bT_model[];
|
||||
extern Gfx act_f29_angel_cT_model[];
|
||||
extern Gfx act_f30_gupi_aT_model[];
|
||||
extern Gfx act_f30_gupi_bT_model[];
|
||||
extern Gfx act_f30_gupi_cT_model[];
|
||||
extern Gfx act_f31_demekin_aT_model[];
|
||||
extern Gfx act_f31_demekin_bT_model[];
|
||||
extern Gfx act_f31_demekin_cT_model[];
|
||||
extern Gfx act_f32_kaseki_aT_model[];
|
||||
extern Gfx act_f32_kasekiT_model[];
|
||||
extern Gfx act_f32_kaseki_cT_model[];
|
||||
extern Gfx act_f35_zarigani_aT_model[];
|
||||
extern Gfx act_f35_zarigani_bT_model[];
|
||||
extern Gfx act_f35_zarigani_cT_model[];
|
||||
extern Gfx act_f36_kaeru_aT_model[];
|
||||
extern Gfx act_f36_kaeru_bT_model[];
|
||||
extern Gfx act_f36_kaeru_cT_model[];
|
||||
extern Gfx act_f33_medaka_aT_model[];
|
||||
extern Gfx act_f33_medaka_bT_model[];
|
||||
extern Gfx act_f33_medaka_cT_model[];
|
||||
extern Gfx act_f37_kurage_aT_model[];
|
||||
extern Gfx act_f37_kurage_bT_model[];
|
||||
extern Gfx act_f37_kurage_cT_model[];
|
||||
extern Gfx act_f38_suzuki_aT_model[];
|
||||
extern Gfx act_f38_suzuki_bT_model[];
|
||||
extern Gfx act_f38_suzuki_cT_model[];
|
||||
extern Gfx act_f39_tai_aT_model[];
|
||||
extern Gfx act_f39_tai_bT_model[];
|
||||
extern Gfx act_f39_tai_cT_model[];
|
||||
extern Gfx act_f40_isidai_aT_model[];
|
||||
extern Gfx act_f40_isidai_bT_model[];
|
||||
extern Gfx act_f40_isidai_cT_model[];
|
||||
extern Gfx act_f34_piraluku_aT_model[];
|
||||
extern Gfx act_f34_piraluku_bT_model[];
|
||||
extern Gfx act_f34_piraluku_cT_model[];
|
||||
extern Gfx act_f28_akikanT_model[];
|
||||
extern Gfx act_f28_akikanT_model[];
|
||||
extern Gfx act_f28_akikanT_model[];
|
||||
extern Gfx act_f30_nagagutuT_model[];
|
||||
extern Gfx act_f30_nagagutuT_model[];
|
||||
extern Gfx act_f30_nagagutuT_model[];
|
||||
extern Gfx act_f29_petT_model[];
|
||||
extern Gfx act_f29_petT_model[];
|
||||
extern Gfx act_f29_petT_model[];
|
||||
|
||||
static aHOI_GYO_DL_c aGYO_funa_dl = {
|
||||
act_f01_funa_aT_model,
|
||||
act_f01_funa_bT_model,
|
||||
act_f01_funa_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_hera_dl = {
|
||||
act_f02_hera_aT_model,
|
||||
act_f02_hera_bT_model,
|
||||
act_f02_hera_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_koi_dl = {
|
||||
act_f03_koi_aT_model,
|
||||
act_f03_koi_bT_model,
|
||||
act_f03_koi_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_nisiki_dl = {
|
||||
act_f04_nisiki_aT_model,
|
||||
act_f04_nisiki_bT_model,
|
||||
act_f04_nisiki_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_namazu_dl = {
|
||||
act_f05_namazu_aT_model,
|
||||
act_f05_namazu_bT_model,
|
||||
act_f05_namazu_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_bass_s_dl = {
|
||||
act_f06_bass_aT_model,
|
||||
act_f06_bass_bT_model,
|
||||
act_f06_bass_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_bass_m_dl = {
|
||||
act_f07_bassm_aT_model,
|
||||
act_f07_bassm_bT_model,
|
||||
act_f07_bassm_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_bass_l_dl = {
|
||||
act_f08_bassl_aT_model,
|
||||
act_f08_bassl_bT_model,
|
||||
act_f08_bassl_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_blue_gill_dl = {
|
||||
act_f09_gill_aT_model,
|
||||
act_f09_gill_bT_model,
|
||||
act_f09_gill_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_oonamazu_dl = {
|
||||
act_f10_oonamazu_aT_model,
|
||||
act_f10_oonamazu_bT_model,
|
||||
act_f10_oonamazu_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_raigyo_dl = {
|
||||
act_f11_raigyo_aT_model,
|
||||
act_f11_raigyo_bT_model,
|
||||
act_f11_raigyo_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_nigoi_dl = {
|
||||
act_f12_nigoi_aT_model,
|
||||
act_f12_nigoi_bT_model,
|
||||
act_f12_nigoi_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_ugui_dl = {
|
||||
act_f13_ugui_aT_model,
|
||||
act_f13_ugui_bT_model,
|
||||
act_f13_ugui_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_oikawa_dl = {
|
||||
act_f14_oikawa_aT_model,
|
||||
act_f14_oikawa_bT_model,
|
||||
act_f14_oikawa_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_tanago_dl = {
|
||||
act_f15_tanago_aT_model,
|
||||
act_f15_tanago_bT_model,
|
||||
act_f15_tanago_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_dojyo_dl = {
|
||||
act_f16_dojyo_aT_model,
|
||||
act_f16_dojyo_bT_model,
|
||||
act_f16_dojyo_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_wakasagi_dl = {
|
||||
act_f17_wakasagi_aT_model,
|
||||
act_f17_wakasagi_bT_model,
|
||||
act_f17_wakasagi_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_ayu_dl = {
|
||||
act_f18_ayu_aT_model,
|
||||
act_f18_ayu_bT_model,
|
||||
act_f18_ayu_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_yamame_dl = {
|
||||
act_f19_yamame_aT_model,
|
||||
act_f19_yamame_bT_model,
|
||||
act_f19_yamame_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_iwana_dl = {
|
||||
act_f20_iwana_aT_model,
|
||||
act_f20_iwana_bT_model,
|
||||
act_f20_iwana_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_niji_dl = {
|
||||
act_f21_niji_aT_model,
|
||||
act_f21_niji_bT_model,
|
||||
act_f21_niji_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_ito_dl = {
|
||||
act_f22_ito_aT_model,
|
||||
act_f22_ito_bT_model,
|
||||
act_f22_ito_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_sake_dl = {
|
||||
act_f23_sake_aT_model,
|
||||
act_f23_sake_bT_model,
|
||||
act_f23_sake_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_kingyo_dl = {
|
||||
act_f24_kingyo_aT_model,
|
||||
act_f24_kingyo_bT_model,
|
||||
act_f24_kingyo_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_pirania_dl = {
|
||||
act_f25_pirania_aT_model,
|
||||
act_f25_pirania_bT_model,
|
||||
act_f25_pirania_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_aroana_dl = {
|
||||
act_f26_aroana_aT_model,
|
||||
act_f26_aroana_bT_model,
|
||||
act_f26_aroana_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_unagi_dl = {
|
||||
act_f27_unagi_aT_model,
|
||||
act_f27_unagi_bT_model,
|
||||
act_f27_unagi_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_donko_dl = {
|
||||
act_f28_donko_aT_model,
|
||||
act_f28_donko_bT_model,
|
||||
act_f28_donko_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_angel_dl = {
|
||||
act_f29_angel_aT_model,
|
||||
act_f29_angel_bT_model,
|
||||
act_f29_angel_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_gupi_dl = {
|
||||
act_f30_gupi_aT_model,
|
||||
act_f30_gupi_bT_model,
|
||||
act_f30_gupi_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_demekin_dl = {
|
||||
act_f31_demekin_aT_model,
|
||||
act_f31_demekin_bT_model,
|
||||
act_f31_demekin_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_kaseki_dl = {
|
||||
act_f32_kaseki_aT_model,
|
||||
act_f32_kasekiT_model,
|
||||
act_f32_kaseki_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_zarigani_dl = {
|
||||
act_f35_zarigani_aT_model,
|
||||
act_f35_zarigani_bT_model,
|
||||
act_f35_zarigani_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_kaeru_dl = {
|
||||
act_f36_kaeru_aT_model,
|
||||
act_f36_kaeru_bT_model,
|
||||
act_f36_kaeru_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_medaka_dl = {
|
||||
act_f33_medaka_aT_model,
|
||||
act_f33_medaka_bT_model,
|
||||
act_f33_medaka_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_kurage_dl = {
|
||||
act_f37_kurage_aT_model,
|
||||
act_f37_kurage_bT_model,
|
||||
act_f37_kurage_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_suzuki_dl = {
|
||||
act_f38_suzuki_aT_model,
|
||||
act_f38_suzuki_bT_model,
|
||||
act_f38_suzuki_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_tai_dl = {
|
||||
act_f39_tai_aT_model,
|
||||
act_f39_tai_bT_model,
|
||||
act_f39_tai_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_ishidai_dl = {
|
||||
act_f40_isidai_aT_model,
|
||||
act_f40_isidai_bT_model,
|
||||
act_f40_isidai_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_piraluku_dl = {
|
||||
act_f34_piraluku_aT_model,
|
||||
act_f34_piraluku_bT_model,
|
||||
act_f34_piraluku_cT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_akikan_dl = {
|
||||
act_f28_akikanT_model,
|
||||
act_f28_akikanT_model,
|
||||
act_f28_akikanT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_nagagutu_dl = {
|
||||
act_f30_nagagutuT_model,
|
||||
act_f30_nagagutuT_model,
|
||||
act_f30_nagagutuT_model,
|
||||
};
|
||||
static aHOI_GYO_DL_c aGYO_taiya_dl = {
|
||||
act_f29_petT_model,
|
||||
act_f29_petT_model,
|
||||
act_f29_petT_model,
|
||||
};
|
||||
|
||||
|
||||
static aHOI_GYO_DL_c* aGYO_displayList[45] = {
|
||||
&aGYO_funa_dl,
|
||||
&aGYO_hera_dl,
|
||||
&aGYO_koi_dl,
|
||||
&aGYO_nisiki_dl,
|
||||
&aGYO_namazu_dl,
|
||||
&aGYO_bass_s_dl,
|
||||
&aGYO_bass_m_dl,
|
||||
&aGYO_bass_l_dl,
|
||||
&aGYO_blue_gill_dl,
|
||||
&aGYO_oonamazu_dl,
|
||||
&aGYO_raigyo_dl,
|
||||
&aGYO_nigoi_dl,
|
||||
&aGYO_ugui_dl,
|
||||
&aGYO_oikawa_dl,
|
||||
&aGYO_tanago_dl,
|
||||
&aGYO_dojyo_dl,
|
||||
&aGYO_wakasagi_dl,
|
||||
&aGYO_ayu_dl,
|
||||
&aGYO_yamame_dl,
|
||||
&aGYO_iwana_dl,
|
||||
&aGYO_niji_dl,
|
||||
&aGYO_ito_dl,
|
||||
&aGYO_sake_dl,
|
||||
&aGYO_kingyo_dl,
|
||||
&aGYO_pirania_dl,
|
||||
&aGYO_aroana_dl,
|
||||
&aGYO_unagi_dl,
|
||||
&aGYO_donko_dl,
|
||||
&aGYO_angel_dl,
|
||||
&aGYO_gupi_dl,
|
||||
&aGYO_demekin_dl,
|
||||
&aGYO_kaseki_dl,
|
||||
&aGYO_zarigani_dl,
|
||||
&aGYO_kaeru_dl,
|
||||
&aGYO_medaka_dl,
|
||||
&aGYO_kurage_dl,
|
||||
&aGYO_suzuki_dl,
|
||||
&aGYO_tai_dl,
|
||||
&aGYO_ishidai_dl,
|
||||
&aGYO_piraluku_dl,
|
||||
&aGYO_piraluku_dl,
|
||||
&aGYO_akikan_dl,
|
||||
&aGYO_nagagutu_dl,
|
||||
&aGYO_taiya_dl,
|
||||
NULL
|
||||
};
|
||||
|
||||
extern Gfx apple_DL_mode[];
|
||||
extern Gfx orange_DL_mode[];
|
||||
extern Gfx peach_DL_mode[];
|
||||
extern Gfx pear_DL_mode[];
|
||||
extern Gfx nuts_DL_mode[];
|
||||
extern Gfx matutake_DL_mode[];
|
||||
extern Gfx kabu_DL_mode[];
|
||||
extern Gfx fish_DL_mode[];
|
||||
extern Gfx bag_DL_mode[];
|
||||
extern Gfx leaf_DL_mode[];
|
||||
extern Gfx obj_rollT_mat_model[];
|
||||
extern Gfx box_DL_mode[];
|
||||
extern Gfx pack_DL_mode[];
|
||||
extern Gfx present_DL_mode[];
|
||||
extern Gfx seed_DL_mode[];
|
||||
extern Gfx obj_haniwaT_mat_model[];
|
||||
extern Gfx obj_boxT_mat_model[];
|
||||
extern Gfx obj_cageT_mat_model[];
|
||||
extern Gfx obj_toolT_mat_model[];
|
||||
extern Gfx obj_fossilT_mat_model[];
|
||||
extern Gfx obj_trashT_mat_model[];
|
||||
extern Gfx obj_letterT_mat_model[];
|
||||
extern Gfx obj_otosiT_mat_model[];
|
||||
extern Gfx obj_item_shellAT_mat_model[];
|
||||
extern Gfx obj_item_shellBT_mat_model[];
|
||||
extern Gfx obj_item_shellCT_mat_model[];
|
||||
extern Gfx obj_shop_candy_mat_modelT[];
|
||||
extern Gfx obj_item_cocoT_mat_model[];
|
||||
extern Gfx obj_item_omikuji_mat_model[];
|
||||
extern Gfx obj_item_clothT_mat_model[];
|
||||
extern Gfx obj_item_carpetT_mat_model[];
|
||||
extern Gfx obj_item_wallT_mat_model[];
|
||||
extern Gfx obj_item_axeT_mat_model[];
|
||||
extern Gfx obj_item_netT_mat_model[];
|
||||
extern Gfx obj_item_rodT_mat_model[];
|
||||
extern Gfx obj_item_shovelT_mat_model[];
|
||||
extern Gfx obj_item_axe2T_mat_model[];
|
||||
extern Gfx obj_item_net2T_mat_model[];
|
||||
extern Gfx obj_item_rod2T_mat_model[];
|
||||
extern Gfx obj_item_shovel2T_mat_model[];
|
||||
extern Gfx obj_item_umbrellaT_mat_model[];
|
||||
extern Gfx obj_item_kazaT_mat_model[];
|
||||
extern Gfx obj_item_utiwaT_mat_model[];
|
||||
extern Gfx obj_item_paperT_mat_model[];
|
||||
extern Gfx obj_item_seedT_mat_model[];
|
||||
extern Gfx obj_item_fukuT_mat_model[];
|
||||
extern Gfx obj_item_taisouT_mat_model[];
|
||||
extern Gfx obj_mdT_mat_model[];
|
||||
extern Gfx obj_item_ticketT_mat_model[];
|
||||
extern Gfx obj_item_boneT_mat_model[];
|
||||
extern Gfx obj_item_diaryT_mat_model[];
|
||||
extern Gfx obj_item_fork_onT_mat_model[];
|
||||
|
||||
static Gfx* mode_DL_table[mNT_ITEM_TYPE_NUM] = {
|
||||
NULL,
|
||||
apple_DL_mode,
|
||||
orange_DL_mode,
|
||||
peach_DL_mode,
|
||||
pear_DL_mode,
|
||||
nuts_DL_mode,
|
||||
matutake_DL_mode,
|
||||
kabu_DL_mode,
|
||||
fish_DL_mode,
|
||||
bag_DL_mode,
|
||||
leaf_DL_mode,
|
||||
obj_rollT_mat_model,
|
||||
box_DL_mode,
|
||||
pack_DL_mode,
|
||||
present_DL_mode,
|
||||
seed_DL_mode,
|
||||
obj_haniwaT_mat_model,
|
||||
obj_boxT_mat_model,
|
||||
obj_cageT_mat_model,
|
||||
obj_toolT_mat_model,
|
||||
obj_fossilT_mat_model,
|
||||
obj_trashT_mat_model,
|
||||
obj_letterT_mat_model,
|
||||
obj_otosiT_mat_model,
|
||||
obj_item_shellAT_mat_model,
|
||||
obj_item_shellBT_mat_model,
|
||||
obj_item_shellCT_mat_model,
|
||||
obj_shop_candy_mat_modelT,
|
||||
obj_item_cocoT_mat_model,
|
||||
obj_item_omikuji_mat_model,
|
||||
obj_item_clothT_mat_model,
|
||||
obj_item_carpetT_mat_model,
|
||||
obj_item_wallT_mat_model,
|
||||
obj_item_axeT_mat_model,
|
||||
obj_item_netT_mat_model,
|
||||
obj_item_rodT_mat_model,
|
||||
obj_item_shovelT_mat_model,
|
||||
obj_item_axe2T_mat_model,
|
||||
obj_item_net2T_mat_model,
|
||||
obj_item_rod2T_mat_model,
|
||||
obj_item_shovel2T_mat_model,
|
||||
obj_item_umbrellaT_mat_model,
|
||||
obj_item_kazaT_mat_model,
|
||||
obj_item_utiwaT_mat_model,
|
||||
obj_item_paperT_mat_model,
|
||||
obj_item_seedT_mat_model,
|
||||
obj_item_fukuT_mat_model,
|
||||
obj_item_taisouT_mat_model,
|
||||
obj_mdT_mat_model,
|
||||
obj_item_ticketT_mat_model,
|
||||
obj_item_boneT_mat_model,
|
||||
obj_item_diaryT_mat_model,
|
||||
obj_item_fork_onT_mat_model
|
||||
};
|
||||
|
||||
extern Gfx apple_DL_vtx[];
|
||||
extern Gfx orange_DL_vtx[];
|
||||
extern Gfx peach_DL_vtx[];
|
||||
extern Gfx pear_DL_vtx[];
|
||||
extern Gfx nuts_DL_vtx[];
|
||||
extern Gfx matutake_DL_vtx[];
|
||||
extern Gfx kabu_DL_vtx[];
|
||||
extern Gfx fish_DL_vtx[];
|
||||
extern Gfx bag_DL_vtx[];
|
||||
extern Gfx leaf_DL_vtx[];
|
||||
extern Gfx obj_rollT_gfx_model[];
|
||||
extern Gfx box_DL_vtx[];
|
||||
extern Gfx pack_DL_vtx[];
|
||||
extern Gfx present_DL_vtx[];
|
||||
extern Gfx seed_DL_vtx[];
|
||||
extern Gfx obj_haniwaT_gfx_model[];
|
||||
extern Gfx obj_boxT_gfx_model[];
|
||||
extern Gfx obj_cageT_gfx_model[];
|
||||
extern Gfx obj_toolT_gfx_model[];
|
||||
extern Gfx obj_fossilT_gfx_model[];
|
||||
extern Gfx obj_trashT_gfx_model[];
|
||||
extern Gfx obj_letterT_gfx_model[];
|
||||
extern Gfx obj_otosiT_gfx_model[];
|
||||
extern Gfx obj_item_shellAT_gfx_model[];
|
||||
extern Gfx obj_item_shellBT_gfx_model[];
|
||||
extern Gfx obj_item_shellCT_gfx_model[];
|
||||
extern Gfx obj_shop_candy_gfx_modelT[];
|
||||
extern Gfx obj_item_cocoT_gfx_model[];
|
||||
extern Gfx obj_item_omikuji_gfx_model[];
|
||||
extern Gfx obj_item_clothT_gfx_model[];
|
||||
extern Gfx obj_item_carpetT_gfx_model[];
|
||||
extern Gfx obj_item_wallT_gfx_model[];
|
||||
extern Gfx obj_item_axeT_gfx_model[];
|
||||
extern Gfx obj_item_netT_gfx_model[];
|
||||
extern Gfx obj_item_rodT_gfx_model[];
|
||||
extern Gfx obj_item_shovelT_gfx_model[];
|
||||
extern Gfx obj_item_axe2T_gfx_model[];
|
||||
extern Gfx obj_item_net2T_gfx_model[];
|
||||
extern Gfx obj_item_rod2T_gfx_model[];
|
||||
extern Gfx obj_item_shovel2T_gfx_model[];
|
||||
extern Gfx obj_item_umbrellaT_gfx_model[];
|
||||
extern Gfx obj_item_kazaT_gfx_model[];
|
||||
extern Gfx obj_item_utiwaT_gfx_model[];
|
||||
extern Gfx obj_item_paperT_gfx_model[];
|
||||
extern Gfx obj_item_seedT_gfx_model[];
|
||||
extern Gfx obj_item_fukuT_gfx_model[];
|
||||
extern Gfx obj_item_taisouT_gfx_model[];
|
||||
extern Gfx obj_mdT_gfx_model[];
|
||||
extern Gfx obj_item_ticketT_gfx_model[];
|
||||
extern Gfx obj_item_boneT_gfx_model[];
|
||||
extern Gfx obj_item_diaryT_gfx_model[];
|
||||
extern Gfx obj_item_fork_onT_gfx_model[];
|
||||
|
||||
static Gfx* vtx_DL_table[mNT_ITEM_TYPE_NUM] = {
|
||||
NULL,
|
||||
apple_DL_vtx,
|
||||
orange_DL_vtx,
|
||||
peach_DL_vtx,
|
||||
pear_DL_vtx,
|
||||
nuts_DL_vtx,
|
||||
matutake_DL_vtx,
|
||||
kabu_DL_vtx,
|
||||
fish_DL_vtx,
|
||||
bag_DL_vtx,
|
||||
leaf_DL_vtx,
|
||||
obj_rollT_gfx_model,
|
||||
box_DL_vtx,
|
||||
pack_DL_vtx,
|
||||
present_DL_vtx,
|
||||
seed_DL_vtx,
|
||||
obj_haniwaT_gfx_model,
|
||||
obj_boxT_gfx_model,
|
||||
obj_cageT_gfx_model,
|
||||
obj_toolT_gfx_model,
|
||||
obj_fossilT_gfx_model,
|
||||
obj_trashT_gfx_model,
|
||||
obj_letterT_gfx_model,
|
||||
obj_otosiT_gfx_model,
|
||||
obj_item_shellAT_gfx_model,
|
||||
obj_item_shellBT_gfx_model,
|
||||
obj_item_shellCT_gfx_model,
|
||||
obj_shop_candy_gfx_modelT,
|
||||
obj_item_cocoT_gfx_model,
|
||||
obj_item_omikuji_gfx_model,
|
||||
obj_item_clothT_gfx_model,
|
||||
obj_item_carpetT_gfx_model,
|
||||
obj_item_wallT_gfx_model,
|
||||
obj_item_axeT_gfx_model,
|
||||
obj_item_netT_gfx_model,
|
||||
obj_item_rodT_gfx_model,
|
||||
obj_item_shovelT_gfx_model,
|
||||
obj_item_axe2T_gfx_model,
|
||||
obj_item_net2T_gfx_model,
|
||||
obj_item_rod2T_gfx_model,
|
||||
obj_item_shovel2T_gfx_model,
|
||||
obj_item_umbrellaT_gfx_model,
|
||||
obj_item_kazaT_gfx_model,
|
||||
obj_item_utiwaT_gfx_model,
|
||||
obj_item_paperT_gfx_model,
|
||||
obj_item_seedT_gfx_model,
|
||||
obj_item_fukuT_gfx_model,
|
||||
obj_item_taisouT_gfx_model,
|
||||
obj_mdT_gfx_model,
|
||||
obj_item_ticketT_gfx_model,
|
||||
obj_item_boneT_gfx_model,
|
||||
obj_item_diaryT_gfx_model,
|
||||
obj_item_fork_onT_gfx_model
|
||||
};
|
||||
|
||||
/* Clip */
|
||||
#include "../src/ac_handOverItem_clip.c_inc"
|
||||
|
||||
/* Move */
|
||||
#include "../src/ac_handOverItem_move.c_inc"
|
||||
|
||||
/* Draw */
|
||||
#include "../src/ac_handOverItem_draw.c_inc"
|
||||
|
||||
static void aHOI_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
aHOI_init_clip_area(actorx, game);
|
||||
}
|
||||
|
||||
static void aHOI_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
aHOI_free_clip_area();
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
static ACTOR* aHOI_birth_proc(mActor_name_t item, int after_mode, int present_flag, ACTOR* master) {
|
||||
ACTOR* speaker;
|
||||
ACTOR* listener;
|
||||
|
||||
if (Common_Get(clip).handOverItem_clip->master_actor != NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (mDemo_Get_Talk_Actors(&speaker, &listener) == FALSE) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Common_Get(clip).handOverItem_clip->master_actor = master;
|
||||
|
||||
if (speaker != master) {
|
||||
Common_Get(clip).handOverItem_clip->target_actor = speaker;
|
||||
}
|
||||
else {
|
||||
Common_Get(clip).handOverItem_clip->target_actor = listener;
|
||||
}
|
||||
|
||||
Common_Get(clip).handOverItem_clip->item = item;
|
||||
|
||||
if (after_mode != 5 && after_mode != 6 && after_mode != 7 && after_mode != 8) {
|
||||
after_mode = 7;
|
||||
}
|
||||
|
||||
Common_Get(clip).handOverItem_clip->player_after_mode = after_mode;
|
||||
Common_Get(clip).handOverItem_clip->present_flag = present_flag;
|
||||
Common_Get(clip).handOverItem_clip->master_changed_flag = FALSE;
|
||||
mMsg_Set_LockContinue(mMsg_Get_base_window_p());
|
||||
return (ACTOR*)Common_Get(clip).handOverItem_clip->handOverItem_p;
|
||||
}
|
||||
|
||||
static ACTOR* aHOI_chg_master_proc(ACTOR* master) {
|
||||
ACTOR* actor = NULL;
|
||||
|
||||
if (master == Common_Get(clip).handOverItem_clip->target_actor) {
|
||||
switch (Common_Get(clip).handOverItem_clip->request_mode) {
|
||||
case aHOI_REQUEST_TRANS_WAIT:
|
||||
case aHOI_REQUEST_RETURN_WAIT:
|
||||
{
|
||||
Common_Get(clip).handOverItem_clip->target_actor = Common_Get(clip).handOverItem_clip->master_actor;
|
||||
Common_Get(clip).handOverItem_clip->master_actor = master;
|
||||
Common_Get(clip).handOverItem_clip->request_mode = aHOI_REQUEST_GET;
|
||||
Common_Get(clip).handOverItem_clip->master_changed_flag = TRUE;
|
||||
actor = (ACTOR*)Common_Get(clip).handOverItem_clip->handOverItem_p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return actor;
|
||||
}
|
||||
|
||||
static int aHOI_chg_request_mode_proc(ACTOR* master, int request_mode) {
|
||||
int res = FALSE;
|
||||
|
||||
if (master == Common_Get(clip).handOverItem_clip->master_actor) {
|
||||
Common_Get(clip).handOverItem_clip->request_mode = request_mode;
|
||||
res = TRUE;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void aHOI_init_clip_area(ACTOR* actorx, GAME* game) {
|
||||
HANDOVERITEM_ACTOR* handOverItem = (HANDOVERITEM_ACTOR*)actorx;
|
||||
|
||||
if (Common_Get(clip).handOverItem_clip == NULL) {
|
||||
Common_Get(clip).handOverItem_clip = &aHOI_clip;
|
||||
bzero(&aHOI_clip, sizeof(aHOI_Clip_c));
|
||||
Common_Get(clip).handOverItem_clip->birth_proc = &aHOI_birth_proc;
|
||||
Common_Get(clip).handOverItem_clip->chg_master_proc = &aHOI_chg_master_proc;
|
||||
Common_Get(clip).handOverItem_clip->chg_request_mode_proc = &aHOI_chg_request_mode_proc;
|
||||
Common_Get(clip).handOverItem_clip->request_mode = aHOI_REQUEST_NO_REQUEST;
|
||||
Common_Get(clip).handOverItem_clip->item = EMPTY_NO;
|
||||
Common_Get(clip).handOverItem_clip->master_actor = NULL;
|
||||
Common_Get(clip).handOverItem_clip->handOverItem_p = handOverItem;
|
||||
}
|
||||
}
|
||||
|
||||
static void aHOI_free_clip_area() {
|
||||
if (Common_Get(clip).handOverItem_clip != NULL) {
|
||||
Common_Get(clip).handOverItem_clip = NULL;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
static int aHOI_chase_pos(ACTOR* actorx, xyz_t* chase_pos) {
|
||||
HANDOVERITEM_ACTOR* handOverItem = (HANDOVERITEM_ACTOR*)actorx;
|
||||
s16 angle_x;
|
||||
s16 angle_y;
|
||||
f32 dist_x;
|
||||
f32 dist_y;
|
||||
f32 dist_z;
|
||||
f32 sin_x;
|
||||
f32 cos_x;
|
||||
f32 sin_y;
|
||||
f32 cos_y;
|
||||
int res = TRUE;
|
||||
|
||||
dist_x = actorx->world.position.x - chase_pos->x;
|
||||
dist_y = actorx->world.position.y - chase_pos->y;
|
||||
dist_z = actorx->world.position.z - chase_pos->z;
|
||||
|
||||
angle_x = atans_table(dist_y, dist_z);
|
||||
angle_y = atans_table(dist_z, dist_x);
|
||||
|
||||
sin_x = sin_s(angle_x);
|
||||
cos_x = cos_s(angle_x);
|
||||
sin_y = sin_s(angle_y);
|
||||
cos_y = cos_s(angle_y);
|
||||
|
||||
sin_y = ABS(sin_y * 2.0f * sin_x);
|
||||
cos_x = ABS(cos_x * 2.0f);
|
||||
sin_x = ABS(cos_y * 2.0f * sin_x);
|
||||
|
||||
res &= chase_f(&actorx->world.position.x, chase_pos->x, sin_y * 0.5f);
|
||||
res &= chase_f(&actorx->world.position.y, chase_pos->y, cos_x * 0.5f);
|
||||
res &= chase_f(&actorx->world.position.z, chase_pos->z, sin_x * 0.5f);
|
||||
xyz_t_move(chase_pos, &actorx->world.position);
|
||||
|
||||
if (res == TRUE) {
|
||||
handOverItem->trans_flag = FALSE; /* finished translational movement */
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void aHOI_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
static xyz_t dummy = { 0.0f, 0.0f, 0.0f }; /* unused but left in data */
|
||||
HANDOVERITEM_ACTOR* handOverItem = (HANDOVERITEM_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
// Object_Exchange exchange; ?
|
||||
ACTOR* master = Common_Get(clip).handOverItem_clip->master_actor;
|
||||
GRAPH* graph = game->graph;
|
||||
f32 scale = handOverItem->scale * 0.01f;
|
||||
xyz_t why_is_this_here;
|
||||
xyz_t chase_pos;
|
||||
Gfx* mode_dl = mode_DL_table[handOverItem->draw_type];
|
||||
Gfx* vtx_dl = vtx_DL_table[handOverItem->draw_type];
|
||||
Gfx* gfx;
|
||||
|
||||
if (
|
||||
handOverItem->draw_type == mNT_ITEM_TYPE_NONE ||
|
||||
master == NULL ||
|
||||
handOverItem->tools_class.init_matrix == FALSE
|
||||
) {
|
||||
handOverItem->gyo_flag = FALSE;
|
||||
}
|
||||
else {
|
||||
Matrix_RotateY(master->shape_info.rotation.y + DEG2SHORT_ANGLE(-90.0f), 0);
|
||||
Matrix_translate(handOverItem->trans.x, handOverItem->trans.y, handOverItem->trans.z, 1);
|
||||
Matrix_Position_Zero(&why_is_this_here);
|
||||
Matrix_put(&handOverItem->tools_class.matrix_work);
|
||||
Matrix_Position_Zero(&chase_pos);
|
||||
|
||||
chase_pos.x += why_is_this_here.x;
|
||||
chase_pos.y += why_is_this_here.y;
|
||||
chase_pos.z += why_is_this_here.z;
|
||||
|
||||
if (handOverItem->trans_flag == FALSE) {
|
||||
xyz_t_move(&actorx->world.position, &chase_pos); /* no translation */
|
||||
}
|
||||
else {
|
||||
aHOI_chase_pos(actorx, &chase_pos);
|
||||
}
|
||||
|
||||
Matrix_translate(chase_pos.x, chase_pos.y, chase_pos.z, 0);
|
||||
_texture_z_light_fog_prim(graph);
|
||||
|
||||
if (handOverItem->item_type == aHOI_ITEM_TYPE_FISH) {
|
||||
if (handOverItem->gyo_flag == FALSE) {
|
||||
handOverItem->gyo_type = ITEM_NAME_GET_INDEX(handOverItem->item);
|
||||
handOverItem->gyo_flag = TRUE;
|
||||
}
|
||||
|
||||
Matrix_scale(scale, scale, scale, 1);
|
||||
OPEN_DISP(graph);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, aGYO_displayList[handOverItem->gyo_type]->dl_a);
|
||||
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
else {
|
||||
Matrix_scale(scale, scale, scale, 1);
|
||||
OPEN_DISP(graph);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
|
||||
gSPDisplayList(gfx++, mode_dl);
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, vtx_dl);
|
||||
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,447 @@
|
||||
static void aHOI_set_se(HANDOVERITEM_ACTOR* handOverItem) {
|
||||
if (handOverItem->mode == aHOI_REQUEST_TRANSFER && handOverItem->anm_cnt > 24.0f && handOverItem->se_set_flag) {
|
||||
xyz_t sound_pos;
|
||||
|
||||
xyz_t_move(&sound_pos, &Common_Get(clip).handOverItem_clip->master_actor->world.position);
|
||||
sAdo_OngenTrgStart(0x56, &sound_pos);
|
||||
handOverItem->se_set_flag = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct trans_data_s {
|
||||
f32 frame;
|
||||
xyz_t trans;
|
||||
} aHOI_trans_data_c;
|
||||
|
||||
typedef struct trans_table_s {
|
||||
int max_idx;
|
||||
aHOI_trans_data_c* data;
|
||||
} aHOI_trans_table_c;
|
||||
|
||||
static void aHOI_calc_trans(HANDOVERITEM_ACTOR* handOverItem) {
|
||||
static aHOI_trans_data_c no_request_data[2] = {
|
||||
{ 0.0f, { 0.0f, 0.0f, 0.0f } },
|
||||
{ 1.0f, { 0.0f, 0.0f, 0.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c transfer_data[4] = {
|
||||
{ 0.0f, { 9.0f, 0.0f, 0.0f } },
|
||||
{ 17.0f, { 9.0f, 0.0f, 0.0f } },
|
||||
{ 31.0f, { 14.0f, -9.5f, 6.0f } },
|
||||
{ 39.0f, { 14.0f, -9.5f, 6.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c transfer_f_data[4] = {
|
||||
{ 0.0f, { 9.0f, 0.0f, 0.0f } },
|
||||
{ 17.0f, { 9.0f, 0.0f, 0.0f } },
|
||||
{ 31.0f, { 14.0f, -3.0f, 1.0f } },
|
||||
{ 39.0f, { 14.0f, -3.0f, 1.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c trans_wait_data[2] = {
|
||||
{ 0.0f, { 14.0f, -9.5f, 6.0f } },
|
||||
{ 1.0f, { 14.0f, -9.5f, 6.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c trans_wait_f_data[2] = {
|
||||
{ 0.0f, { 14.0f, -3.0f, 1.0f } },
|
||||
{ 1.0f, { 14.0f, -3.0f, 1.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c eat_data[4] = {
|
||||
{ 0.0f, { 14.0f, -3.0f, 1.0f } },
|
||||
{ 10.0f, { 14.0f, -3.0f, 1.0f } },
|
||||
{ 28.0f, { 10.0f, -0.5f, 5.0f } },
|
||||
{ 59.0f, { 10.0f, -0.5f, 5.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c change_data[3] = {
|
||||
{ 0.0f, { 14.0f, -9.5f, 6.0f } },
|
||||
{ 8.0f, { 9.0f, 0.0f, 0.0f } },
|
||||
{ 57.0f, { 9.0f, 0.0f, 0.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c putaway_data[3] = {
|
||||
{ 0.0f, { 14.0f, -9.5f, 6.0f } },
|
||||
{ 13.0f, { 9.0f, 0.0f, 0.0f } },
|
||||
{ 31.0f, { 9.0f, 0.0f, 0.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c putaway_f_data[3] = {
|
||||
{ 0.0f, { 14.0f, -3.0f, 1.0f } },
|
||||
{ 13.0f, { 9.0f, 0.0f, 0.0f } },
|
||||
{ 31.0f, { 9.0f, 0.0f, 0.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c send_mail_data[3] = {
|
||||
{ 0.0f, { 9.0f, 0.0f, 0.0f } },
|
||||
{ 17.0f, { 9.0f, 0.0f, 0.0f } },
|
||||
{ 38.0f, { 24.0f, -3.0f, 2.5f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c send_mail_wait_data[2] = {
|
||||
{ 0.0f, { 24.0f, -3.0f, 2.5f } },
|
||||
{ 1.0f, { 24.0f, -3.0f, 2.5f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c contract1_data[2] = {
|
||||
{ 0.0f, { 31.5f, -4.0f, 2.0f } },
|
||||
{ 1.0f, { 31.5f, -4.0f, 2.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c contract2_data[2] = {
|
||||
{ 0.0f, { 31.5f, -4.0f, 2.0f } },
|
||||
{ 13.0f, { 17.5f, -1.5f, 0.75f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c contract3_data[3] = {
|
||||
{ 0.0f, { 17.5f, -1.5f, 0.75f } },
|
||||
{ 5.0f, { 17.5f, -1.5f, 0.75f } },
|
||||
{ 18.0f, { 31.5f, -4.0f, 2.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c not_contract_data[3] = {
|
||||
{ 0.0f, { 17.5f, -1.5f, 0.75f } },
|
||||
{ 5.0f, { 17.5f, -1.5f, 0.75f } },
|
||||
{ 18.0f, { 31.5f, -4.0f, 2.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_data_c not_contract_wait_data[2] = {
|
||||
{ 0.0f, { 31.5f, -4.0f, 2.0f } },
|
||||
{ 1.0f, { 31.5f, -4.0f, 2.0f } }
|
||||
};
|
||||
|
||||
static aHOI_trans_table_c trans_data_table[aHOI_REQUEST_NUM] = {
|
||||
{ 1, no_request_data },
|
||||
{ 3, transfer_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 3, eat_data },
|
||||
{ 2, change_data },
|
||||
{ 2, putaway_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_f_data }
|
||||
};
|
||||
|
||||
static aHOI_trans_table_c trans_data_table_f[aHOI_REQUEST_NUM] = {
|
||||
{ 1, no_request_data },
|
||||
{ 3, transfer_f_data },
|
||||
{ 1, trans_wait_f_data },
|
||||
{ 1, trans_wait_f_data },
|
||||
{ 1, trans_wait_f_data },
|
||||
{ 3, eat_data },
|
||||
{ 2, change_data },
|
||||
{ 2, putaway_f_data },
|
||||
{ 1, trans_wait_f_data },
|
||||
{ 1, trans_wait_f_data },
|
||||
{ 1, trans_wait_f_data },
|
||||
{ 1, trans_wait_f_data }
|
||||
};
|
||||
|
||||
static aHOI_trans_table_c trans_data_table_m[aHOI_REQUEST_NUM] = {
|
||||
{ 1, no_request_data },
|
||||
{ 2, send_mail_data },
|
||||
{ 1, send_mail_wait_data },
|
||||
{ 1, contract1_data },
|
||||
{ 1, contract2_data },
|
||||
{ 3, eat_data },
|
||||
{ 2, change_data },
|
||||
{ 2, contract3_data },
|
||||
{ 1, trans_wait_f_data },
|
||||
{ 2, not_contract_data },
|
||||
{ 1, not_contract_wait_data },
|
||||
{ 1, trans_wait_f_data }
|
||||
};
|
||||
|
||||
static aHOI_trans_table_c* table[aHOI_ITEM_TYPE_NUM] = {
|
||||
trans_data_table,
|
||||
trans_data_table_f,
|
||||
trans_data_table_m
|
||||
};
|
||||
|
||||
aHOI_trans_table_c* tbl = &table[handOverItem->item_type][handOverItem->mode];
|
||||
int max_idx = tbl->max_idx;
|
||||
aHOI_trans_data_c* data = tbl->data;
|
||||
int i;
|
||||
xyz_t trans0;
|
||||
xyz_t trans1;
|
||||
f32 f = handOverItem->anm_cnt;
|
||||
f32 step;
|
||||
|
||||
for (i = max_idx; i != 0; i--) {
|
||||
if (f > data[i].frame) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= max_idx) {
|
||||
i = max_idx - 1;
|
||||
f = data[max_idx].frame;
|
||||
}
|
||||
|
||||
xyz_t_move(&trans0, &data[i + 1].trans);
|
||||
xyz_t_move(&trans1, &data[i].trans);
|
||||
|
||||
/* Apply linear interpolation to translation */
|
||||
|
||||
/* step = (current_frame - start_frame) / (total_frames), total_frames = (end_frame - start_frame) */
|
||||
f -= data[i].frame;
|
||||
step = f / (data[i + 1].frame - data[i].frame);
|
||||
handOverItem->trans.x = trans1.x + step * (trans0.x - trans1.x);
|
||||
handOverItem->trans.y = trans1.y + step * (trans0.y - trans1.y);
|
||||
handOverItem->trans.z = trans1.z + step * (trans0.z - trans1.z);
|
||||
}
|
||||
|
||||
typedef struct scale_data_s {
|
||||
f32 frame;
|
||||
f32 scale;
|
||||
} aHOI_scale_data_c;
|
||||
|
||||
typedef struct scale_table_s {
|
||||
int max_idx;
|
||||
aHOI_scale_data_c* data;
|
||||
} aHOI_scale_table_c;
|
||||
|
||||
|
||||
static void aHOI_calc_scale(HANDOVERITEM_ACTOR* handOverItem) {
|
||||
static aHOI_scale_data_c no_request_data[2] = {
|
||||
{ 0.0f, 0.0f },
|
||||
{ 1.0f, 0.0f }
|
||||
};
|
||||
|
||||
static aHOI_scale_data_c transfer_data[3] = {
|
||||
{ 0.0f, 0.0f },
|
||||
{ 17.0f, 0.0f },
|
||||
{ 35.0f, 1.0f }
|
||||
};
|
||||
|
||||
static aHOI_scale_data_c trans_wait_data[2] = {
|
||||
{ 0.0f, 1.0f },
|
||||
{ 1.0f, 1.0f }
|
||||
};
|
||||
|
||||
static aHOI_scale_data_c eat_data[2] = {
|
||||
{ 0.0f, 1.0f },
|
||||
{ 28.0f, 0.0f }
|
||||
};
|
||||
|
||||
static aHOI_scale_data_c change_data[2] = {
|
||||
{ 0.0f, 1.0f },
|
||||
{ 28.0f, 0.0f }
|
||||
};
|
||||
|
||||
static aHOI_scale_data_c putaway_data[2] = {
|
||||
{ 0.0f, 1.0f },
|
||||
{ 13.0f, 0.0f }
|
||||
};
|
||||
|
||||
static aHOI_scale_data_c send_mail_data[2] = {
|
||||
{ 0.0f, 0.0f },
|
||||
{ 38.0f, 1.0f }
|
||||
};
|
||||
|
||||
static aHOI_scale_data_c contract3_data[3] = {
|
||||
{ 0.0f, 1.0f },
|
||||
{ 5.0f, 1.0f },
|
||||
{ 18.0f, 0.0f }
|
||||
};
|
||||
|
||||
static aHOI_scale_table_c scale_data_table[aHOI_REQUEST_NUM] = {
|
||||
{ 1, no_request_data },
|
||||
{ 2, transfer_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, eat_data },
|
||||
{ 1, change_data },
|
||||
{ 1, putaway_data},
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data }
|
||||
};
|
||||
|
||||
static aHOI_scale_table_c scale_data_table_m[aHOI_REQUEST_NUM] = {
|
||||
{ 1, no_request_data },
|
||||
{ 1, send_mail_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, eat_data },
|
||||
{ 1, change_data },
|
||||
{ 2, contract3_data},
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data },
|
||||
{ 1, trans_wait_data }
|
||||
};
|
||||
|
||||
static aHOI_scale_table_c* table[aHOI_ITEM_TYPE_NUM] = {
|
||||
scale_data_table,
|
||||
scale_data_table,
|
||||
scale_data_table_m
|
||||
};
|
||||
|
||||
aHOI_scale_table_c* tbl = &table[handOverItem->item_type][handOverItem->mode];
|
||||
int max_idx = tbl->max_idx;
|
||||
int i;
|
||||
aHOI_scale_data_c* data = tbl->data;
|
||||
f32 f = handOverItem->anm_cnt;
|
||||
f32 step;
|
||||
f32 scale;
|
||||
|
||||
for (i = max_idx; i != 0; i--) {
|
||||
if (f > data[i].frame) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= max_idx) {
|
||||
i = max_idx - 1;
|
||||
f = data[max_idx].frame;
|
||||
}
|
||||
|
||||
/* Apply linear interpolation to scale */
|
||||
scale = data[i].scale;
|
||||
f -= data[i].frame;
|
||||
step = (f * (data[i + 1].scale - scale));
|
||||
handOverItem->scale = scale + step / (data[i + 1].frame - data[i].frame);
|
||||
}
|
||||
|
||||
static void aHOI_anime_proc(HANDOVERITEM_ACTOR* handOverItem) {
|
||||
static f32 max_anm_cnt[aHOI_REQUEST_NUM] = {
|
||||
1.0f,
|
||||
39.0f,
|
||||
17.0f,
|
||||
11.0f,
|
||||
11.0f,
|
||||
59.0f,
|
||||
57.0f,
|
||||
31.0f,
|
||||
17.0f,
|
||||
11.0f,
|
||||
1.0f,
|
||||
81.0f
|
||||
};
|
||||
|
||||
static f32 max_anm_cnt_m[aHOI_REQUEST_NUM] = {
|
||||
1.0f,
|
||||
38.0f,
|
||||
1.0f,
|
||||
12.0f,
|
||||
18.0f,
|
||||
59.0f,
|
||||
57.0f,
|
||||
29.0f,
|
||||
17.0f,
|
||||
29.0f,
|
||||
1.0f,
|
||||
81.0f
|
||||
};
|
||||
|
||||
static f32* table[aHOI_ITEM_TYPE_NUM] = {
|
||||
max_anm_cnt,
|
||||
max_anm_cnt,
|
||||
max_anm_cnt_m
|
||||
};
|
||||
|
||||
f32 anm_cnt = handOverItem->anm_cnt;
|
||||
f32 anm_cnt_max = table[handOverItem->item_type][handOverItem->mode];
|
||||
|
||||
anm_cnt += 0.5f;
|
||||
if (anm_cnt > anm_cnt_max) {
|
||||
anm_cnt = anm_cnt_max;
|
||||
}
|
||||
|
||||
handOverItem->anm_cnt = anm_cnt;
|
||||
aHOI_calc_trans(handOverItem);
|
||||
aHOI_calc_scale(handOverItem);
|
||||
|
||||
if (F32_IS_ZERO(handOverItem->scale) && anm_cnt == anm_cnt_max && Common_Get(clip).handOverItem_clip->master_actor != NULL) {
|
||||
Common_Get(clip).handOverItem_clip->master_actor = NULL;
|
||||
Common_Get(clip).handOverItem_clip->request_mode = aHOI_REQUEST_NO_REQUEST;
|
||||
handOverItem->mode = aHOI_REQUEST_NO_REQUEST;
|
||||
handOverItem->draw_type = mNT_ITEM_TYPE_NONE;
|
||||
mMsg_Unset_LockContinue(mMsg_Get_base_window_p());
|
||||
}
|
||||
}
|
||||
|
||||
static int aHOI_get_item_type(HANDOVERITEM_ACTOR* handOverItem) {
|
||||
int type = aHOI_ITEM_TYPE_ITEM; /* Show as respective 2D sprite */
|
||||
|
||||
/* Force all icons to mail in the post office */
|
||||
if (handOverItem->item == ITM_FORTUNE_SLIP || Save_Get(scene_no) == SCENE_POST_OFFICE) {
|
||||
type = aHOI_ITEM_TYPE_MAIL; /* Show as mail */
|
||||
}
|
||||
else if (ITEM_NAME_GET_TYPE(handOverItem->item) == NAME_TYPE_ITEM1 && ITEM_NAME_GET_CAT(handOverItem->item) == ITEM1_CAT_FISH) {
|
||||
type = aHOI_ITEM_TYPE_FISH; /* Show as fish model */
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void aHOI_actor_move(ACTOR* actorx, GAME* game) {
|
||||
TOOLS_ACTOR* tools = (TOOLS_ACTOR*)actorx;
|
||||
HANDOVERITEM_ACTOR* handOverItem = (HANDOVERITEM_ACTOR*)actorx;
|
||||
mActor_name_t item;
|
||||
int counter_flag = FALSE;
|
||||
|
||||
if (handOverItem->mode != Common_Get(clip).handOverItem_clip->request_mode) {
|
||||
switch (Common_Get(clip).handOverItem_clip->request_mode) {
|
||||
case aHOI_REQUEST_TRANSFER:
|
||||
{
|
||||
handOverItem->item = Common_Get(clip).handOverItem_clip->item;
|
||||
switch (Common_Get(clip).handOverItem_clip->present_flag) {
|
||||
case aHOI_PRESENT:
|
||||
{
|
||||
handOverItem->draw_type = mNT_ITEM_TYPE_PRESENT;
|
||||
handOverItem->item_type = aHOI_ITEM_TYPE_ITEM;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
handOverItem->draw_type = mNT_get_itemTableNo(Common_Get(clip).handOverItem_clip->item);
|
||||
handOverItem->item_type = aHOI_get_item_type(handOverItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tools->init_matrix = FALSE;
|
||||
handOverItem->se_set_flag = TRUE;
|
||||
handOverItem->trans_flag = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
case aHOI_REQUEST_TRANS_WAIT:
|
||||
case aHOI_REQUEST_RETURN_WAIT:
|
||||
{
|
||||
if (Common_Get(clip).handOverItem_clip->target_actor->part == ACTOR_PART_PLAYER) {
|
||||
item = handOverItem->item;
|
||||
if (handOverItem->item_type == aHOI_ITEM_TYPE_MAIL) {
|
||||
counter_flag = TRUE; /* display over counter since it's mail at the post office */
|
||||
}
|
||||
|
||||
mPlib_request_main_recieve_wait_type1(game, item, counter_flag);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case aHOI_REQUEST_GET_PULL:
|
||||
{
|
||||
handOverItem->trans_flag = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
handOverItem->mode = Common_Get(clip).handOverItem_clip->request_mode;
|
||||
handOverItem->anm_cnt = 0.0f;
|
||||
}
|
||||
|
||||
aHOI_set_se(handOverItem);
|
||||
aHOI_anime_proc(handOverItem);
|
||||
}
|
||||
Reference in New Issue
Block a user