mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-06-30 09:51:39 -04:00
Match ac_my_room_move.c_inc
This commit is contained in:
@@ -15,6 +15,8 @@ typedef struct furniture_actor_s FTR_ACTOR;
|
||||
#define aFTR_KEEP_ITEM_COUNT (mCoBG_LAYER_NUM - 1)
|
||||
#define aFTR_CHECK_INTERACTION(inter, type) (((inter) >> (type)) & 1)
|
||||
|
||||
#define aFTR_EDGE_COL_NUM 4
|
||||
|
||||
enum {
|
||||
aFTR_STATE_STOP,
|
||||
aFTR_STATE_WAIT_PUSH,
|
||||
@@ -110,6 +112,7 @@ enum {
|
||||
aFTR_CHECK_INTERACTION((profile)->interaction_type, aFTR_INTERACTION_TYPE_CLOSET) || \
|
||||
aFTR_CHECK_INTERACTION((profile)->interaction_type, aFTR_INTERACTION_TYPE_MUSIC_DISK))
|
||||
enum {
|
||||
aFTR_CONTACT_ACTION_NONE = 0,
|
||||
aFTR_CONTACT_ACTION_CHAIR_UNIDIRECTIONAL = 1, // only can sit from the front
|
||||
aFTR_CONTACT_ACTION_CHAIR_MULTIDIRECTIONAL = 2, // can sit from any direction
|
||||
aFTR_CONTACT_ACTION_CHAIR_SOFA = 4, // cam sit anywhere from the front
|
||||
@@ -195,7 +198,7 @@ struct furniture_actor_s {
|
||||
u8 shape_type; /* current size & shape (rotation) */
|
||||
u8 original_shape_type; /* original size & shape (rotation) */
|
||||
xyz_t base_position;
|
||||
aFTR_collision_c edge_collision[4]; /* collision for each edge */
|
||||
aFTR_collision_c edge_collision[aFTR_EDGE_COL_NUM]; /* collision for each edge */
|
||||
s16 collision_direction;
|
||||
int move_bg_idx;
|
||||
mCoBG_bg_regist_c bg_register;
|
||||
|
||||
+18
-8
@@ -12,6 +12,12 @@ extern "C" {
|
||||
|
||||
#define aMR_MAX_UNIT 8
|
||||
#define aMR_HANIWA_ON_TABLE_NUM 14
|
||||
#define aMR_GOKI_MAX 3
|
||||
#define aMR_FIT_FTR_MAX 4
|
||||
#define aMR_RSV_FTR_NUM 3
|
||||
|
||||
#define aMR_NO_FTR_ID 200
|
||||
#define aMR_NO_FTR_ID2 201
|
||||
|
||||
typedef struct my_room_actor_s MY_ROOM_ACTOR;
|
||||
|
||||
@@ -51,13 +57,13 @@ enum {
|
||||
|
||||
typedef struct my_room_contact_s {
|
||||
int contact_flag;
|
||||
int ftr_no;
|
||||
int ftrID;
|
||||
int direction;
|
||||
int contact_side;
|
||||
f32 contact_percent;
|
||||
f32* normal_p;
|
||||
f32 contact_edge0[2];
|
||||
f32 contact_edge1[2];
|
||||
f32 contact_edge_start[2];
|
||||
f32 contact_edge_end[2];
|
||||
int contact_direction;
|
||||
} aMR_contact_info_c;
|
||||
|
||||
@@ -138,11 +144,11 @@ typedef struct room_leaf_s {
|
||||
|
||||
typedef struct room_pickup_s {
|
||||
int pickup_flag;
|
||||
int ftr_no;
|
||||
int ftrID;
|
||||
xyz_t leaf_pos;
|
||||
int picking_up_flag;
|
||||
s16 layer;
|
||||
u16 dust_effect_timer;
|
||||
s16 dust_effect_timer;
|
||||
u16 icon;
|
||||
} aMR_pickup_info_c;
|
||||
|
||||
@@ -198,6 +204,12 @@ typedef struct room_fit_ftr_s {
|
||||
xyz_t ut_pos;
|
||||
} aMR_fit_ftr_c;
|
||||
|
||||
typedef struct room_parent_ftr_s {
|
||||
int ftrID;
|
||||
s16 angle_y;
|
||||
aMR_fit_ftr_c fit_ftr_table[aMR_FIT_FTR_MAX];
|
||||
} aMR_parent_ftr_c;
|
||||
|
||||
struct my_room_actor_s {
|
||||
ACTOR actor_class;
|
||||
s16 state;
|
||||
@@ -256,9 +268,7 @@ struct my_room_actor_s {
|
||||
int _4F4;
|
||||
int room_msg_flag;
|
||||
int haniwa_step_idx;
|
||||
int parent_ftrID;
|
||||
s16 parent_angleY;
|
||||
aMR_fit_ftr_c fit_ftr_table[4];
|
||||
aMR_parent_ftr_c parent_ftr;
|
||||
u32 music_box[2];
|
||||
int scene;
|
||||
int _5A4;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_shop_goods_h.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -15,4 +16,3 @@ extern ACTOR_PROFILE Shop_Goods_Profile;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef AC_SHOP_GOODS_H_H
|
||||
#define AC_SHOP_GOODS_H_H
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor_type.h"
|
||||
#include "game_h.h"
|
||||
#include "m_lib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*aSG_SINGLE_DRAW_PROC)(GAME*, mActor_name_t, xyz_t*, f32, s16, int);
|
||||
typedef int (*aSG_PLAYER_DROP_ENTRY_PROC)(GAME*, mActor_name_t, int, int, int, int);
|
||||
typedef s16 (*aSG_SINGLE_GET_ANGLE_Y_PROC)(int, int, int);
|
||||
typedef void (*aSG_SINGLE_SET_ANGLE_Y_PROC)(int, int, int, s16);
|
||||
|
||||
typedef struct shop_goods_clip_s {
|
||||
aSG_SINGLE_DRAW_PROC single_draw_proc;
|
||||
aSG_PLAYER_DROP_ENTRY_PROC player_drop_entry_proc;
|
||||
aSG_SINGLE_GET_ANGLE_Y_PROC single_get_angle_y_proc;
|
||||
aSG_SINGLE_SET_ANGLE_Y_PROC single_set_angle_y_proc;
|
||||
} aSG_Clip_c;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+17
-17
@@ -26,18 +26,18 @@ enum {
|
||||
VOICE_STATUS_NUM
|
||||
};
|
||||
|
||||
extern void sAdo_Calc_MicPosition_forTrig(f32* fcalc, u16* scalc, xyz_t* pos);
|
||||
extern void sAdo_Calc_MicPosition_forLevel(f32* fcalc, u16* scalc, xyz_t* pos);
|
||||
extern void sAdo_Calc_MicPosition_forTrig(f32* fcalc, u16* scalc, const xyz_t* pos);
|
||||
extern void sAdo_Calc_MicPosition_forLevel(f32* fcalc, u16* scalc, const xyz_t* pos);
|
||||
|
||||
extern void sAdo_GameFrame();
|
||||
extern void sAdo_BgmStart(u8 id);
|
||||
extern void sAdo_BgmStop(u16 id);
|
||||
extern void sAdo_SysTrgStart(u16 id);
|
||||
|
||||
extern void sAdo_PlyWalkSe(int walk, xyz_t* pos);
|
||||
extern void sAdo_PlyWalkSeRoom(int walk, xyz_t* pos);
|
||||
extern void sAdo_NpcWalkSe(int walk, xyz_t* pos);
|
||||
extern void sAdo_NpcWalkSeRoom(int walk, xyz_t* pos);
|
||||
extern void sAdo_PlyWalkSe(int walk, const xyz_t* pos);
|
||||
extern void sAdo_PlyWalkSeRoom(int walk, const xyz_t* pos);
|
||||
extern void sAdo_NpcWalkSe(int walk, const xyz_t* pos);
|
||||
extern void sAdo_NpcWalkSeRoom(int walk, const xyz_t* pos);
|
||||
|
||||
extern void sAdo_PlayerStatusLevel(f32 speed, int p);
|
||||
|
||||
@@ -52,19 +52,19 @@ extern u8 sAdo_MessageSpeedGet();
|
||||
extern void sAdo_SysLevStop(u8 id);
|
||||
extern void sAdo_SysLevStart(u8 id);
|
||||
|
||||
extern void sAdo_OngenPos(u32 p1, u8 p2, xyz_t* pos);
|
||||
extern void sAdo_OngenTrgStart(u16 id, xyz_t* pos);
|
||||
extern void sAdo_OngenPos(u32 p1, u8 p2, const xyz_t* pos);
|
||||
extern void sAdo_OngenTrgStart(u16 id, const xyz_t* pos);
|
||||
|
||||
extern void sAdo_SetOutMode(u8 mode);
|
||||
extern void sAdo_SetVoiceMode(u8 mode);
|
||||
|
||||
extern void sAdo_FloorTrgStart(u16 id, xyz_t* pos);
|
||||
extern void sAdo_FloorTrgStart(u16 id, const xyz_t* pos);
|
||||
|
||||
extern void sAdo_RhythmStart(u32 id, s8 type, s8 wait);
|
||||
extern void sAdo_RhythmStop(u32 id);
|
||||
extern void sAdo_RhythmAllStop();
|
||||
|
||||
extern void sAdo_FurnitureInst(int track_id, s8 cb, s32 cl, xyz_t* pos);
|
||||
extern void sAdo_FurnitureInst(u32 id, u8 inst, u8* melody, const xyz_t* pos);
|
||||
extern void sAdo_Pause(u8 mode);
|
||||
|
||||
extern f32 sAdo_GetRhythmAnimCounter(u32 id);
|
||||
@@ -74,10 +74,10 @@ extern void sAdo_SetRhythmInfo(TempoBeat_c* rhythm);
|
||||
|
||||
extern int sAdo_InstCountGet();
|
||||
|
||||
extern void sAdo_RhythmPos(u32 id, u8 haniwa_id, xyz_t* pos);
|
||||
extern void sAdo_RhythmPos(u32 id, u8 haniwa_id, const xyz_t* pos);
|
||||
|
||||
extern void sAdo_SpecChange(int spec);
|
||||
extern void sAdo_MDPlayerPos(xyz_t* pos, u16 s1, u16 s2, int p);
|
||||
extern void sAdo_MDPlayerPos(const xyz_t* pos, u16 s1, u16 s2, int p);
|
||||
|
||||
extern void sAdo_BGMVolume(f32 f, u16 volume);
|
||||
extern void sAdo_BgmCrossfadeStart(u8 b);
|
||||
@@ -98,7 +98,7 @@ extern void sAdos_GetStaffRollInfo(void* p);
|
||||
|
||||
extern void sAdos_TTKK_ARM(u8 mode);
|
||||
|
||||
extern void sAdo_OngenTrgStartSpeed(f32 speed, u16 s1, xyz_t* pos);
|
||||
extern void sAdo_OngenTrgStartSpeed(f32 speed, u16 s1, const xyz_t* pos);
|
||||
|
||||
extern void sAdo_TrgSeEcho(u8 b);
|
||||
extern void sAdo_LevSeEcho(u8 b);
|
||||
@@ -115,16 +115,16 @@ extern u16 sAdo_Get_WalkLabel(int type);
|
||||
extern int sAdo_Get_KokeruLabel(int type);
|
||||
|
||||
extern void sAdo_SceneMode(u8 mode);
|
||||
extern u8 sAdo_RoomIncectPos(u32 f, u16 u, xyz_t* pos);
|
||||
extern u8 sAdo_RoomIncectPos(u32 f, u16 u, const xyz_t* pos);
|
||||
|
||||
extern void sAdo_FurnitureInstPos(u32 f, xyz_t* pos);
|
||||
extern void sAdo_FurnitureInstPos(u32 id, const xyz_t* pos);
|
||||
extern void sAdo_Set_ongenpos_refuse_fg(int state);
|
||||
|
||||
extern int sAdo_GameframeEnd_Check();
|
||||
extern int sAdo_GetSoundFrameCounter();
|
||||
|
||||
extern int sAdo_CheckOnPlussBridge(xyz_t* pos, u32 atr);
|
||||
extern void sAdo_RegistPlussBridge(xyz_t* pos);
|
||||
extern int sAdo_CheckOnPlussBridge(const xyz_t* pos, u32 atr);
|
||||
extern void sAdo_RegistPlussBridge(const xyz_t* pos);
|
||||
extern void sAdo_DeletePlussBridge();
|
||||
|
||||
extern void sAdo_kazagurumaLevel(f32 level);
|
||||
|
||||
+11
-1
@@ -35,6 +35,8 @@ typedef enum audio_sound_effects {
|
||||
NA_SE_LIGHT_ON,
|
||||
NA_SE_LIGHT_OFF,
|
||||
|
||||
NA_SE_DRAWER_SHUT = 0x3A,
|
||||
|
||||
NA_SE_ITEM_GET = 0x40,
|
||||
NA_SE_ITEM_HORIDASHI = 0x47,
|
||||
|
||||
@@ -43,6 +45,9 @@ typedef enum audio_sound_effects {
|
||||
NA_SE_MONEY2,
|
||||
NA_SE_COIN,
|
||||
|
||||
NA_SE_BIRTH_FTR = 0x57,
|
||||
NA_SE_CLEAN_UP_FTR = 0x58,
|
||||
|
||||
NA_SE_TOOL_FURI = 0x5A, // swing?
|
||||
NA_SE_AMI_HIT = 0x5C,
|
||||
NA_SE_TOOL_GET,
|
||||
@@ -79,6 +84,7 @@ typedef enum audio_sound_effects {
|
||||
NA_SE_ZASSOU_NUKU = 0x15F,
|
||||
NA_SE_HACHI_SASARERU,
|
||||
|
||||
NA_SE_166 = 0x166,
|
||||
NA_SE_UCHIWA = 0x167,
|
||||
|
||||
NA_SE_SCOOP_SHIGEMI = 0x401,
|
||||
@@ -99,6 +105,10 @@ typedef enum audio_sound_effects {
|
||||
NA_SE_HARD_CHAIR_STANDUP,
|
||||
|
||||
NA_SE_BUBU_CHAIR_STANDUP = 0x429,
|
||||
NA_SE_FTR_DOOR_OPEN = 0x42C,
|
||||
NA_SE_FTR_DOOR_CLOSE = 0x42D,
|
||||
NA_SE_DRAWER_OPEN = 0x42E,
|
||||
NA_SE_DRAWER_CLOSE = 0x42F,
|
||||
NA_SE_DAI_UE_KAKUNOU = 0x430,
|
||||
|
||||
NA_SE_UMBRELLA_ROTATE = 0x432,
|
||||
@@ -119,8 +129,8 @@ typedef enum audio_sound_effects {
|
||||
} AudioSE;
|
||||
|
||||
typedef enum bgm_e {
|
||||
BGM_AEROBICS = 27,
|
||||
BGM_MD0 = 128,
|
||||
|
||||
} BGM_e;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -424,9 +424,8 @@ extern void cKF_SkeletonInfo_R_T_combine_play(int* arg1, int* arg2, int* arg3, c
|
||||
* @param angley Y angle for base model rotation.
|
||||
* @param anglez Z angle for base model rotation.
|
||||
*/
|
||||
extern void cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(f32 transx, f32 transy, f32 transz,
|
||||
cKF_SkeletonInfo_R_c* keyframe, s16 anglex, s16 angley,
|
||||
s16 anglez);
|
||||
extern void cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(cKF_SkeletonInfo_R_c* keyframe, f32 transx, f32 transy,
|
||||
f32 transz, s16 anglex, s16 angley, s16 anglez);
|
||||
|
||||
/**
|
||||
* Adjusts the base position and correction for a skeleton info structure based on animation flags.
|
||||
@@ -482,4 +481,4 @@ extern void cKF_SkeletonInfo_R_AnimationMove_CulcTransToWorld(f32 calcx, f32 cal
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -8,13 +8,11 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern void Na_Inst(u16, u8*);
|
||||
extern void Na_FurnitureInst(int,s8,s32,u16,f32);
|
||||
extern void Na_FurnitureInst(u32, u8, u8*, u16, f32);
|
||||
extern int Na_InstCountGet();
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@
|
||||
#include "ac_shop_umbrella.h"
|
||||
#include "ac_handOverItem.h"
|
||||
#include "ac_quest_manager_clip.h"
|
||||
#include "ac_shop_goods_h.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -63,7 +64,7 @@ typedef struct clip_s {
|
||||
/* 0x0A4 */ mDemo_Clip_c* demo_clip2; /* can be multiple clip classes */
|
||||
/* 0x0A8 */ void* _0A8;
|
||||
/* 0x0AC */ aGYO_Clip_c* gyo_clip;
|
||||
/* 0x0B0 */ void* _0B0;
|
||||
/* 0x0B0 */ aSG_Clip_c* shop_goods_clip;
|
||||
/* 0x0B4 */ void* _0B4;
|
||||
/* 0x0B8 */ aShopUmbrella_Clip_c* shop_umbrella_clip;
|
||||
/* 0x0BC */ aAR_Clip_c* arrange_room_clip;
|
||||
|
||||
@@ -277,6 +277,15 @@ extern int mCoBG_GetHoleNumber_ClData(mCoBG_Collision_u* col);
|
||||
extern void mCoBG_GetBgNorm_FromWpos(xyz_t* norm, xyz_t wpos);
|
||||
extern int mCoBG_GetWaterFlow(xyz_t* water_flow, u32 attr);
|
||||
extern void mCoBG_SetAttribute(xyz_t pos, u32 attr);
|
||||
extern int mCoBG_GetPointInfoFrontLine(f32* line, f32* check_pos, f32* norm);
|
||||
extern int mCoBG_GetCrossCircleAndLine2Dvector(f32* cross0_xz, f32* cross1_xz, f32* point_xz, f32* vec_xz,
|
||||
f32* center_xz, f32 radius);
|
||||
extern f32 mCoBG_GetVectorProductin2D(f32* vec0_xz, f32* vec1_xz);
|
||||
extern int mCoBG_GetCrossLineAndPerpendicular(f32* cross_xz, f32* start_xz, f32* end_xz, f32* point_xz);
|
||||
extern int mCoBG_RangeCheckLinePoint(f32* start_xz, f32* end_xz, f32* point_xz);
|
||||
extern int mCoBG_GetDistPointAndLine2D_Norm(f32* dist, f32* start_xz, f32* end_xz, f32* norm, f32* point_xz);
|
||||
extern f32 mCoBG_Get2VectorAngleF(f32* v0, f32* v1, u8 type);
|
||||
extern int mCoBG_CheckUtFlat(const xyz_t* pos);
|
||||
|
||||
extern void mCoBG_InitMoveBgData();
|
||||
extern void mCoBG_InitBlockBgCheckMode();
|
||||
|
||||
@@ -256,7 +256,7 @@ typedef struct common_data_s {
|
||||
/* 0x0287FA */ u8 _287FA[0x28838 - 0x0287FA];
|
||||
/* 0x028838 */ s8 player_bee_swell_flag;
|
||||
/* 0x028839 */ s8 player_bee_chase_flag;
|
||||
/* 0x02883A */ u8 goki_shocked_flag;
|
||||
/* 0x02883A */ s8 goki_shocked_flag;
|
||||
/* 0x02883B */ u8 time_changed_flag;
|
||||
/* 0x02883C */ u8 unable_to_wade_flag;
|
||||
/* 0x02883D */ u8 _02883D;
|
||||
@@ -314,7 +314,7 @@ typedef struct common_data_s {
|
||||
/* 0x02DBB0 */ s16 can_look_goki_count;
|
||||
/* 0x02DBB4 */ f32 rainbow_opacity; /* current opacity of rainbow (0.0f - 1.0f) */
|
||||
/* 0x02DBB8 */ u32 event_flags[mEv_EVENT_TYPE_NUM];
|
||||
/* 0x02DBD4 */ xyz_t* pluss_bridge_pos; /* position of extra bridge */
|
||||
/* 0x02DBD4 */ const xyz_t* pluss_bridge_pos; /* position of extra bridge */
|
||||
/* 0x02DBD8 */ lbRTC_time_c auto_nwrite_time; /* cached notice time used for fishing tourney results? */
|
||||
/* 0x02DBE0 */ u8 rhythym_updated;
|
||||
/* 0x02DBE1 */ u8 _2dbe1;
|
||||
|
||||
@@ -64,6 +64,9 @@ extern int mPlib_check_player_open_umbrella(GAME_PLAY* play);
|
||||
extern int mPlib_Check_UKI_COMEBACK_STATUS();
|
||||
extern int mPlib_check_player_actor_main_index_OutDoorMove(GAME_PLAY* play);
|
||||
extern int mPlib_request_main_close_furniture_type1(GAME* game);
|
||||
extern int mPlib_request_main_shock_type1(GAME* game, f32 time, s16 angle_y, int axe_swing);
|
||||
extern int mPlib_request_main_hold_type1(GAME* game, int ftr_no, int player_direct, const xyz_t* player_pos);
|
||||
extern int mPlib_check_player_warp_forEvent(void);
|
||||
|
||||
extern mPlayer_change_data_from_submenu_c* mPlib_Get_change_data_from_submenu_p();
|
||||
|
||||
|
||||
+76
-73
@@ -2,24 +2,24 @@
|
||||
#define M_SCENE_TABLE_H
|
||||
|
||||
#include "types.h"
|
||||
//#include "m_scene.h"
|
||||
// #include "m_scene.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum field_draw_type {
|
||||
FIELD_DRAW_TYPE_OUTDOORS,
|
||||
FIELD_DRAW_TYPE_INDOORS,
|
||||
FIELD_DRAW_TYPE_TRAIN,
|
||||
FIELD_DRAW_TYPE_PLAYER_SELECT,
|
||||
FIELD_DRAW_TYPE_OUTDOORS,
|
||||
FIELD_DRAW_TYPE_INDOORS,
|
||||
FIELD_DRAW_TYPE_TRAIN,
|
||||
FIELD_DRAW_TYPE_PLAYER_SELECT,
|
||||
|
||||
FIELD_DRAW_TYPE_NUM
|
||||
FIELD_DRAW_TYPE_NUM
|
||||
};
|
||||
|
||||
typedef struct scene_status_s {
|
||||
u8 unk0[0x13];
|
||||
u8 unk13;
|
||||
u8 unk0[0x13];
|
||||
u8 unk13;
|
||||
} Scene_data_status_c;
|
||||
|
||||
/*
|
||||
@@ -28,76 +28,79 @@ typedef struct scene_status_s {
|
||||
*/
|
||||
|
||||
enum scene_table {
|
||||
SCENE_TEST1,
|
||||
SCENE_TEST2,
|
||||
SCENE_TEST3,
|
||||
SCENE_WATER_TEST,
|
||||
SCENE_FOOTPRINT_TEST,
|
||||
SCENE_NPC_TEST,
|
||||
SCENE_NPC_HOUSE, /* npc house interior */
|
||||
SCENE_FG, /* outdoors/FG */
|
||||
SCENE_RANDOM_NPC_TEST,
|
||||
SCENE_SHOP0, /* nook's cranny */
|
||||
SCENE_BG_TEST_NO_RIVER,
|
||||
SCENE_BG_TEST_RIVER,
|
||||
SCENE_BROKER_SHOP, /* crazy redd's tent */
|
||||
SCENE_FIELD_TOOL_INSIDE,
|
||||
SCENE_POST_OFFICE, /* post office */
|
||||
SCENE_START_DEMO, /* after player select */
|
||||
SCENE_START_DEMO2, /* */
|
||||
SCENE_POLICE_BOX,
|
||||
SCENE_BUGGY,
|
||||
SCENE_PLAYERSELECT,
|
||||
SCENE_MY_ROOM_S,
|
||||
SCENE_MY_ROOM_M,
|
||||
SCENE_MY_ROOM_L,
|
||||
SCENE_CONVENI, /* nook 'n' go */
|
||||
SCENE_SUPER, /* nookway */
|
||||
SCENE_DEPART, /* nookington's 1st floor */
|
||||
SCENE_TEST5,
|
||||
SCENE_PLAYERSELECT_2,
|
||||
SCENE_PLAYERSELECT_3,
|
||||
SCENE_DEPART_2, /* nookington's 2nd floor */
|
||||
SCENE_EVENT_ANNOUNCEMENT,
|
||||
SCENE_KAMAKURA,
|
||||
SCENE_FIELD_TOOL,
|
||||
SCENE_TITLE_DEMO, /* title screen demo */
|
||||
SCENE_PLAYERSELECT_SAVE,
|
||||
SCENE_MUSEUM_ENTRANCE,
|
||||
SCENE_MUSEUM_ROOM_PAINTING,
|
||||
SCENE_MUSEUM_ROOM_FOSSIL,
|
||||
SCENE_MUSEUM_ROOM_INSECT,
|
||||
SCENE_MUSEUM_ROOM_FISH,
|
||||
SCENE_MY_ROOM_LL1,
|
||||
SCENE_MY_ROOM_LL2,
|
||||
SCENE_MY_ROOM_BASEMENT_S,
|
||||
SCENE_MY_ROOM_BASEMENT_M,
|
||||
SCENE_MY_ROOM_BASEMENT_L,
|
||||
SCENE_MY_ROOM_BASEMENT_LL1,
|
||||
SCENE_NEEDLEWORK, /* able sister's */
|
||||
SCENE_COTTAGE_MY,
|
||||
SCENE_COTTAGE_NPC,
|
||||
SCENE_START_DEMO3,
|
||||
SCENE_LIGHTHOUSE,
|
||||
SCENE_TENT,
|
||||
SCENE_TEST1,
|
||||
SCENE_TEST2,
|
||||
SCENE_TEST3,
|
||||
SCENE_WATER_TEST,
|
||||
SCENE_FOOTPRINT_TEST,
|
||||
SCENE_NPC_TEST,
|
||||
SCENE_NPC_HOUSE, /* npc house interior */
|
||||
SCENE_FG, /* outdoors/FG */
|
||||
SCENE_RANDOM_NPC_TEST,
|
||||
SCENE_SHOP0, /* nook's cranny */
|
||||
SCENE_BG_TEST_NO_RIVER,
|
||||
SCENE_BG_TEST_RIVER,
|
||||
SCENE_BROKER_SHOP, /* crazy redd's tent */
|
||||
SCENE_FIELD_TOOL_INSIDE,
|
||||
SCENE_POST_OFFICE, /* post office */
|
||||
SCENE_START_DEMO, /* after player select */
|
||||
SCENE_START_DEMO2, /* */
|
||||
SCENE_POLICE_BOX,
|
||||
SCENE_BUGGY,
|
||||
SCENE_PLAYERSELECT,
|
||||
SCENE_MY_ROOM_S,
|
||||
SCENE_MY_ROOM_M,
|
||||
SCENE_MY_ROOM_L,
|
||||
SCENE_CONVENI, /* nook 'n' go */
|
||||
SCENE_SUPER, /* nookway */
|
||||
SCENE_DEPART, /* nookington's 1st floor */
|
||||
SCENE_TEST5,
|
||||
SCENE_PLAYERSELECT_2,
|
||||
SCENE_PLAYERSELECT_3,
|
||||
SCENE_DEPART_2, /* nookington's 2nd floor */
|
||||
SCENE_EVENT_ANNOUNCEMENT,
|
||||
SCENE_KAMAKURA,
|
||||
SCENE_FIELD_TOOL,
|
||||
SCENE_TITLE_DEMO, /* title screen demo */
|
||||
SCENE_PLAYERSELECT_SAVE,
|
||||
SCENE_MUSEUM_ENTRANCE,
|
||||
SCENE_MUSEUM_ROOM_PAINTING,
|
||||
SCENE_MUSEUM_ROOM_FOSSIL,
|
||||
SCENE_MUSEUM_ROOM_INSECT,
|
||||
SCENE_MUSEUM_ROOM_FISH,
|
||||
SCENE_MY_ROOM_LL1,
|
||||
SCENE_MY_ROOM_LL2,
|
||||
SCENE_MY_ROOM_BASEMENT_S,
|
||||
SCENE_MY_ROOM_BASEMENT_M,
|
||||
SCENE_MY_ROOM_BASEMENT_L,
|
||||
SCENE_MY_ROOM_BASEMENT_LL1,
|
||||
SCENE_NEEDLEWORK, /* able sister's */
|
||||
SCENE_COTTAGE_MY,
|
||||
SCENE_COTTAGE_NPC,
|
||||
SCENE_START_DEMO3,
|
||||
SCENE_LIGHTHOUSE,
|
||||
SCENE_TENT,
|
||||
|
||||
SCENE_NUM
|
||||
SCENE_NUM
|
||||
};
|
||||
|
||||
#define mSc_IS_SCENE_PLAYER_ROOM(scene) \
|
||||
((scene) == SCENE_MY_ROOM_S || (scene) == SCENE_MY_ROOM_M || (scene) == SCENE_MY_ROOM_L || \
|
||||
(scene) == SCENE_MY_ROOM_LL1 || (scene) == SCENE_MY_ROOM_LL2 || (scene) == SCENE_MY_ROOM_BASEMENT_S || \
|
||||
(scene) == SCENE_MY_ROOM_BASEMENT_M || (scene) == (SCENE_MY_ROOM_BASEMENT_L) || (scene) == SCENE_MY_ROOM_BASEMENT_LL1 || \
|
||||
(scene) == SCENE_COTTAGE_MY)
|
||||
#define mSc_IS_SCENE_PLAYER_HOUSE_ROOM(scene) \
|
||||
((scene) == SCENE_MY_ROOM_S || (scene) == SCENE_MY_ROOM_M || (scene) == SCENE_MY_ROOM_L || \
|
||||
(scene) == SCENE_MY_ROOM_LL1 || (scene) == SCENE_MY_ROOM_LL2 || (scene) == SCENE_MY_ROOM_BASEMENT_S || \
|
||||
(scene) == SCENE_MY_ROOM_BASEMENT_M || (scene) == (SCENE_MY_ROOM_BASEMENT_L) || \
|
||||
(scene) == SCENE_MY_ROOM_BASEMENT_LL1)
|
||||
|
||||
#define mSc_IS_SCENE_BASEMENT(scene) \
|
||||
((scene) == SCENE_MY_ROOM_BASEMENT_S || \
|
||||
(scene) == SCENE_MY_ROOM_BASEMENT_M || \
|
||||
(scene) == SCENE_MY_ROOM_BASEMENT_L || \
|
||||
(scene) == SCENE_MY_ROOM_BASEMENT_LL1)
|
||||
#define mSc_IS_SCENE_PLAYER_ROOM(scene) \
|
||||
((scene) == SCENE_MY_ROOM_S || (scene) == SCENE_MY_ROOM_M || (scene) == SCENE_MY_ROOM_L || \
|
||||
(scene) == SCENE_MY_ROOM_LL1 || (scene) == SCENE_MY_ROOM_LL2 || (scene) == SCENE_MY_ROOM_BASEMENT_S || \
|
||||
(scene) == SCENE_MY_ROOM_BASEMENT_M || (scene) == (SCENE_MY_ROOM_BASEMENT_L) || \
|
||||
(scene) == SCENE_MY_ROOM_BASEMENT_LL1 || (scene) == SCENE_COTTAGE_MY)
|
||||
|
||||
#define mSc_IS_SCENE_MUSEUM_ROOM(scene) \
|
||||
((scene) >= SCENE_MUSEUM_ENTRANCE && (scene) <= SCENE_MUSEUM_ROOM_FISH)
|
||||
#define mSc_IS_SCENE_BASEMENT(scene) \
|
||||
((scene) == SCENE_MY_ROOM_BASEMENT_S || (scene) == SCENE_MY_ROOM_BASEMENT_M || \
|
||||
(scene) == SCENE_MY_ROOM_BASEMENT_L || (scene) == SCENE_MY_ROOM_BASEMENT_LL1)
|
||||
|
||||
#define mSc_IS_SCENE_MUSEUM_ROOM(scene) ((scene) >= SCENE_MUSEUM_ENTRANCE && (scene) <= SCENE_MUSEUM_ROOM_FISH)
|
||||
|
||||
extern Scene_data_status_c scene_data_status[SCENE_NUM];
|
||||
|
||||
|
||||
+47
-26
@@ -14,6 +14,9 @@
|
||||
#include "m_house.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "GBA2/gba2.h"
|
||||
#include "m_debug.h"
|
||||
#include "m_mark_room.h"
|
||||
#include "sys_matrix.h"
|
||||
|
||||
enum {
|
||||
aMR_ICON_LEAF,
|
||||
@@ -120,17 +123,33 @@ static aMR_work_c l_aMR_work;
|
||||
static u8 l_bank_index_table[FTR_NUM];
|
||||
static u8* l_bank_address_table[aMR_FTR_BANK_NUM];
|
||||
|
||||
// clang-format off
|
||||
const aMR_contact_info_c l_cntInf_default = {
|
||||
FALSE,
|
||||
100,
|
||||
0,
|
||||
0,
|
||||
0.0f,
|
||||
NULL,
|
||||
{ 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f },
|
||||
0
|
||||
};
|
||||
// clang-format on
|
||||
const f32 aMR_angle_table[4] = { 0.0f, 90.0f, 180.0f, 270.0f };
|
||||
const u8 l_typeB0_table[4] = { aFTR_SHAPE_TYPEB_0, aFTR_SHAPE_TYPEB_90, aFTR_SHAPE_TYPEB_180, aFTR_SHAPE_TYPEB_270 };
|
||||
|
||||
static int aMR_UnitNum2FtrItemNoFtrID(mActor_name_t* item_no, int* ftr_id, int ut_x, int ut_z, int layer);
|
||||
static void aMR_ReserveDefaultBgm(ACTOR* actorx, FTR_ACTOR* ftr_actor);
|
||||
static void aMR_ChangeMDBgm(ACTOR* actorx, FTR_ACTOR* ftr_actor);
|
||||
static void aMR_SetFurniture2FG(FTR_ACTOR* ftr_actor, xyz_t pos, int on_flag);
|
||||
static int aMR_SetFurniture2FG(FTR_ACTOR* ftr_actor, xyz_t pos, int on_flag);
|
||||
static int aMR_FtrIdx2ChangeFtrSwitch(ACTOR* actorx, int ftr_id);
|
||||
static aFTR_PROFILE* aMR_GetFurnitureProfile(u16 ftr_no);
|
||||
static mActor_name_t* aMR_GetLayerTopFg(s16 layer);
|
||||
|
||||
#include "../src/ac_my_room_msg_ctrl.c_inc"
|
||||
#include "../src/ac_my_room_goki.c_inc"
|
||||
#include "../src/ac_my_room_melody.c_inc"
|
||||
|
||||
static aFTR_PROFILE* aMR_GetFurnitureProfile(u16 ftr_no) {
|
||||
if (ftr_no < FTR_NUM) {
|
||||
@@ -244,7 +263,7 @@ static mActor_name_t* aMR_GetLayerTopFg(s16 layer) {
|
||||
return mFI_BkNum2UtFGTop_layer(0, 0, layer);
|
||||
}
|
||||
|
||||
u64* aMR_GetBitSwitchTable(int layer, MY_ROOM_ACTOR* my_room) {
|
||||
static u64* aMR_GetBitSwitchTable(int layer, MY_ROOM_ACTOR* my_room) {
|
||||
mActor_name_t field_id = mFI_GetFieldId();
|
||||
|
||||
if (my_room->scene == SCENE_COTTAGE_MY) {
|
||||
@@ -266,7 +285,7 @@ u64* aMR_GetBitSwitchTable(int layer, MY_ROOM_ACTOR* my_room) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32* aMR_GetHaniwaStepSaveData(s16 layer, MY_ROOM_ACTOR* my_room) {
|
||||
static u32* aMR_GetHaniwaStepSaveData(s16 layer, MY_ROOM_ACTOR* my_room) {
|
||||
mActor_name_t field_id = mFI_GetFieldId();
|
||||
|
||||
if (my_room->scene == SCENE_COTTAGE_MY) {
|
||||
@@ -764,7 +783,7 @@ static void aMR_SetFirstScale(FTR_ACTOR* ftr_actor) {
|
||||
ftr_actor->dust_timer = 0;
|
||||
}
|
||||
|
||||
static void aMR_DeleteFurnitreBank(u16 ftr_no) {
|
||||
static void aMR_DeleteFurnitureBank(u16 ftr_no) {
|
||||
if (aMR_CountAppointFurniture(ftr_no) == 0) {
|
||||
l_bank_index_table[ftr_no] = 255;
|
||||
}
|
||||
@@ -1022,7 +1041,7 @@ static void aMR_MiniDiskCommonDt(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
my_room->bgm_info.last_md_no = -1;
|
||||
|
||||
/* Don't delete for aerobics radio music */
|
||||
if (my_room->bgm_info.md_no != 27) {
|
||||
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
|
||||
mBGMPsComp_MDPlayerPos_delete();
|
||||
}
|
||||
}
|
||||
@@ -1055,7 +1074,7 @@ static void aMR_ChangeMDBgm(ACTOR* actorx, FTR_ACTOR* ftr_actor) {
|
||||
if (my_room->bgm_info.md_no != -1) {
|
||||
mBGMPsComp_make_ps_room(my_room->bgm_info.md_no, 0);
|
||||
|
||||
if (my_room->bgm_info.md_no != 27) {
|
||||
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
|
||||
mBGMPsComp_MDPlayerPos_make();
|
||||
}
|
||||
|
||||
@@ -1071,12 +1090,12 @@ static void aMR_ChangeMDBgm(ACTOR* actorx, FTR_ACTOR* ftr_actor) {
|
||||
my_room->bgm_info.last_md_no = my_room->bgm_info.md_no;
|
||||
} else {
|
||||
mBGMPsComp_delete_ps_room(my_room->bgm_info.last_md_no, 0);
|
||||
if (my_room->bgm_info.last_md_no != 27) {
|
||||
if (my_room->bgm_info.last_md_no != BGM_AEROBICS) {
|
||||
mBGMPsComp_MDPlayerPos_delete();
|
||||
}
|
||||
|
||||
mBGMPsComp_make_ps_room(my_room->bgm_info.md_no, 0);
|
||||
if (my_room->bgm_info.md_no != 27) {
|
||||
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
|
||||
mBGMPsComp_MDPlayerPos_make();
|
||||
}
|
||||
|
||||
@@ -1412,7 +1431,7 @@ static int aMR_ftrID2Wpos(xyz_t* wpos, int ftr_id);
|
||||
static int aMR_UnitNum2FtrItemNoFtrID(mActor_name_t* ftr_item_no, int* ftr_id, int ut_x, int ut_z, int layer);
|
||||
static void aMR_FtrID2ExtinguishFurniture(int ftr_id);
|
||||
static void aMR_RedmaFtrBank(void);
|
||||
static int aMR_ReserveFurniture(GAME* game, u16 ftr_no, int judge_res, int ut_x, int ut_z, u16 rotation,
|
||||
static int aMR_ReserveFurniture(GAME* game, u16 ftr_no, int free_idx, int ut_x, int ut_z, u16 rotation,
|
||||
int square_offset, int layer);
|
||||
static int aMR_CountFriendFurniture(FTR_ACTOR* ftr_actor, u8 switch_on);
|
||||
static int aMR_JudgePlace2ndLayer(int ut_x, int ut_z);
|
||||
@@ -1724,7 +1743,7 @@ static void My_Room_Actor_ct(ACTOR* actorx, GAME* game) {
|
||||
aMR_InitFurnitureBankTable();
|
||||
aMR_MakeFurnitureActor(actorx, play, mCoBG_LAYER0);
|
||||
aMR_MakeFurnitureActor(actorx, play, mCoBG_LAYER1);
|
||||
my_room->parent_ftrID = -1;
|
||||
my_room->parent_ftr.ftrID = -1;
|
||||
Common_Set(make_npc2_actor, TRUE);
|
||||
aMR_MakeItemDataInFurniture();
|
||||
aMR_DeleteMusicWhichMusicBoxDontHave();
|
||||
@@ -1939,6 +1958,8 @@ static void My_Room_Actor_dt(ACTOR* actorx, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
#include "../src/ac_my_room_move.c_inc"
|
||||
|
||||
static void aMR_RedmaFtrBank(void) {
|
||||
int i;
|
||||
|
||||
@@ -2124,7 +2145,7 @@ extern mActor_name_t aMR_FurnitureFg_to_FurnitureFgWithDirect(mActor_name_t item
|
||||
|
||||
extern void aMR_RadioCommonMove(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
if (ftr_actor->haniwa_state == 1) {
|
||||
aMR_ReserveBgm(actorx, 27, ftr_actor, 0);
|
||||
aMR_ReserveBgm(actorx, BGM_AEROBICS, ftr_actor, 0);
|
||||
ftr_actor->haniwa_state = 0;
|
||||
} else if (ftr_actor->switch_changed_flag) {
|
||||
if (ftr_actor->switch_bit == FALSE) {
|
||||
@@ -2134,7 +2155,7 @@ extern void aMR_RadioCommonMove(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
ftr_actor->switch_bit = FALSE;
|
||||
} else {
|
||||
aMR_OneMDSwitchOn_TheOtherSwitchOff(ftr_actor);
|
||||
aMR_ReserveBgm(actorx, 27, ftr_actor, 0);
|
||||
aMR_ReserveBgm(actorx, BGM_AEROBICS, ftr_actor, 0);
|
||||
aMR_ChangeMDBgm(actorx, ftr_actor);
|
||||
ftr_actor->switch_bit = TRUE;
|
||||
}
|
||||
@@ -2142,7 +2163,7 @@ extern void aMR_RadioCommonMove(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
}
|
||||
|
||||
extern int aMR_RadioBgmNow(void) {
|
||||
if (mBGMPsComp_execute_bgm_num_get() == 27) {
|
||||
if (mBGMPsComp_execute_bgm_num_get() == BGM_AEROBICS) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -2167,13 +2188,13 @@ extern FTR_ACTOR* aMR_GetParentFactor(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
if (actorx != NULL) {
|
||||
MY_ROOM_ACTOR* my_room = (MY_ROOM_ACTOR*)actorx;
|
||||
|
||||
if (my_room->parent_ftrID != -1) {
|
||||
FTR_ACTOR* parent_ftr_actor = l_aMR_work.ftr_actor_list + my_room->parent_ftrID;
|
||||
if (my_room->parent_ftr.ftrID != -1) {
|
||||
FTR_ACTOR* parent_ftr_actor = l_aMR_work.ftr_actor_list + my_room->parent_ftr.ftrID;
|
||||
|
||||
if (my_room->fit_ftr_table[0].ftr_ID == ftr_actor->id ||
|
||||
my_room->fit_ftr_table[1].ftr_ID == ftr_actor->id ||
|
||||
my_room->fit_ftr_table[2].ftr_ID == ftr_actor->id ||
|
||||
my_room->fit_ftr_table[3].ftr_ID == ftr_actor->id) {
|
||||
if (my_room->parent_ftr.fit_ftr_table[0].ftr_ID == ftr_actor->id ||
|
||||
my_room->parent_ftr.fit_ftr_table[1].ftr_ID == ftr_actor->id ||
|
||||
my_room->parent_ftr.fit_ftr_table[2].ftr_ID == ftr_actor->id ||
|
||||
my_room->parent_ftr.fit_ftr_table[3].ftr_ID == ftr_actor->id) {
|
||||
return parent_ftr_actor;
|
||||
}
|
||||
}
|
||||
@@ -2185,14 +2206,14 @@ extern FTR_ACTOR* aMR_GetParentFactor(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
extern s16 aMR_GetParentAngleOffset(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
if (actorx != NULL) {
|
||||
MY_ROOM_ACTOR* my_room = (MY_ROOM_ACTOR*)actorx;
|
||||
if (my_room->parent_ftrID != -1) {
|
||||
FTR_ACTOR* parent_ftr_actor = l_aMR_work.ftr_actor_list + my_room->parent_ftrID;
|
||||
if (my_room->parent_ftr.ftrID != -1) {
|
||||
FTR_ACTOR* parent_ftr_actor = l_aMR_work.ftr_actor_list + my_room->parent_ftr.ftrID;
|
||||
|
||||
if (my_room->fit_ftr_table[0].ftr_ID == ftr_actor->id ||
|
||||
my_room->fit_ftr_table[1].ftr_ID == ftr_actor->id ||
|
||||
my_room->fit_ftr_table[2].ftr_ID == ftr_actor->id ||
|
||||
my_room->fit_ftr_table[3].ftr_ID == ftr_actor->id) {
|
||||
return parent_ftr_actor->s_angle_y - my_room->parent_angleY;
|
||||
if (my_room->parent_ftr.fit_ftr_table[0].ftr_ID == ftr_actor->id ||
|
||||
my_room->parent_ftr.fit_ftr_table[1].ftr_ID == ftr_actor->id ||
|
||||
my_room->parent_ftr.fit_ftr_table[2].ftr_ID == ftr_actor->id ||
|
||||
my_room->parent_ftr.fit_ftr_table[3].ftr_ID == ftr_actor->id) {
|
||||
return parent_ftr_actor->s_angle_y - my_room->parent_ftr.angle_y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,31 +74,31 @@ static aMR_place_info_c* next_table[] = {
|
||||
NULL, NULL, NULL, NULL, &l_next_place_typeA, &l_next_place_typeC,
|
||||
};
|
||||
|
||||
static xyz_t l_typeB_90_pattern[2] = {
|
||||
static xyz_t l_typeB_90_pattarn[2] = {
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 40.0f },
|
||||
};
|
||||
|
||||
static xyz_t l_typeB_180_pattern[2] = {
|
||||
static xyz_t l_typeB_180_pattarn[2] = {
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 40.0f, 0.0f, 0.0f },
|
||||
};
|
||||
|
||||
static xyz_t l_typeB_270_pattern[2] = {
|
||||
static xyz_t l_typeB_270_pattarn[2] = {
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, -40.0f },
|
||||
};
|
||||
|
||||
static xyz_t l_typeB_0_pattern[2] = {
|
||||
static xyz_t l_typeB_0_pattarn[2] = {
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ -40.0f, 0.0f, 0.0f },
|
||||
};
|
||||
|
||||
static xyz_t* pattern_table[] = {
|
||||
l_typeB_90_pattern,
|
||||
l_typeB_180_pattern,
|
||||
l_typeB_270_pattern,
|
||||
l_typeB_0_pattern,
|
||||
static xyz_t* pattarn_table[] = {
|
||||
l_typeB_90_pattarn,
|
||||
l_typeB_180_pattarn,
|
||||
l_typeB_270_pattarn,
|
||||
l_typeB_0_pattarn,
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
extern void aMR_SetSurprise(ACTOR* actorx, s16 angle_y) {
|
||||
if (actorx != NULL) {
|
||||
MY_ROOM_ACTOR* my_room = (MY_ROOM_ACTOR*)actorx;
|
||||
|
||||
my_room->request_player_surprise = TRUE;
|
||||
my_room->player_surprise_angle_y = angle_y;
|
||||
}
|
||||
}
|
||||
|
||||
static int aMR_MakeIndoorGoki(xyz_t* pos, s16 arg, s16 angle_y, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
ACTOR* actor = Actor_info_make_actor(&play->actor_info, game, mAc_PROFILE_HOUSE_GOKI, pos->x, pos->y, pos->z, 0,
|
||||
angle_y, 0, -1, -1, -1, EMPTY_NO, arg, -1, -1);
|
||||
|
||||
if (actor) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
typedef struct goki_info_s {
|
||||
int scene;
|
||||
int size;
|
||||
} aMR_goki_info_c;
|
||||
|
||||
static int aMR_RandomMakeIndoorGoki(s16 arg, GAME* game) {
|
||||
// clang-format off
|
||||
static aMR_goki_info_c goki_random_make_data[] = {
|
||||
{ SCENE_MY_ROOM_S, 4 },
|
||||
{ SCENE_MY_ROOM_M, 6 },
|
||||
{ SCENE_MY_ROOM_LL2, 6 },
|
||||
{ SCENE_MY_ROOM_L, 8 },
|
||||
{ SCENE_MY_ROOM_LL1, 8 },
|
||||
{ SCENE_MY_ROOM_BASEMENT_S, 6 },
|
||||
{ SCENE_MY_ROOM_BASEMENT_M, 6 },
|
||||
{ SCENE_MY_ROOM_BASEMENT_L, 6 },
|
||||
{ SCENE_MY_ROOM_BASEMENT_LL1, 6 },
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
int scene = Save_Get(scene_no);
|
||||
int free_count0 = 0;
|
||||
int free_count1 = 0;
|
||||
mActor_name_t* fg_p = aMR_GetLayerTopFg(mCoBG_LAYER0);
|
||||
|
||||
int i;
|
||||
int sel_no;
|
||||
int ut_x;
|
||||
int ut_z;
|
||||
|
||||
if (fg_p != NULL) {
|
||||
for (i = 0; i < ARRAY_COUNT(goki_random_make_data); i++) {
|
||||
if (scene == goki_random_make_data[i].scene) {
|
||||
for (ut_z = 1; ut_z <= goki_random_make_data[i].size; ut_z++) {
|
||||
for (ut_x = 1; ut_x <= goki_random_make_data[i].size; ut_x++) {
|
||||
mActor_name_t item = fg_p[ut_x + ut_z * UT_X_NUM];
|
||||
|
||||
if (!ITEM_IS_FTR(item) && item != RSV_FE1F && item != RSV_NO && item != RSV_WALL_NO &&
|
||||
item != RSV_DOOR) {
|
||||
free_count0++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (free_count0 <= 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
sel_no = RANDOM(free_count0);
|
||||
for (ut_z = 1; ut_z <= goki_random_make_data[i].size; ut_z++) {
|
||||
for (ut_x = 1; ut_x <= goki_random_make_data[i].size; ut_x++) {
|
||||
mActor_name_t item = fg_p[ut_x + ut_z * UT_X_NUM];
|
||||
|
||||
if (!ITEM_IS_FTR(item) && item != RSV_FE1F && item != RSV_NO && item != RSV_WALL_NO &&
|
||||
item != RSV_DOOR) {
|
||||
if (sel_no == free_count1) {
|
||||
xyz_t pos;
|
||||
|
||||
if (mFI_UtNum2CenterWpos(&pos, ut_x, ut_z)) {
|
||||
pos.y = 0.0f;
|
||||
pos.y = mCoBG_GetBgY_OnlyCenter_FromWpos(pos, 0.0f);
|
||||
return aMR_MakeIndoorGoki(&pos, arg, 0, game);
|
||||
}
|
||||
}
|
||||
|
||||
free_count1++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void aMR_RequestPlayerBikkuri(ACTOR* actorx, GAME* game) {
|
||||
MY_ROOM_ACTOR* my_room = (MY_ROOM_ACTOR*)actorx;
|
||||
|
||||
if (my_room->request_player_surprise) {
|
||||
if (mPlib_get_player_actor_main_index(gamePT) != mPlayer_INDEX_SHOCK) {
|
||||
mPlib_request_main_shock_type1(gamePT, 20.0f, my_room->player_surprise_angle_y, FALSE);
|
||||
} else {
|
||||
my_room->request_player_surprise = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aMR_GokiInfoCt_Dummy(ACTOR* actorx, GAME* game) {
|
||||
// nothing
|
||||
}
|
||||
|
||||
static void aMR_GokiInfoCt(ACTOR* actorx, GAME* game) {
|
||||
int field_type = Common_Get(field_type);
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
|
||||
MY_ROOM_ACTOR* my_room = (MY_ROOM_ACTOR*)actorx;
|
||||
int goki_count = mCkRh_NowSceneGokiFamilyCount();
|
||||
|
||||
mCkRh_InitCanLookGokiCount();
|
||||
if (goki_count != 0) {
|
||||
int max;
|
||||
int i;
|
||||
|
||||
if (goki_count < aMR_GOKI_MAX) {
|
||||
max = goki_count;
|
||||
} else {
|
||||
max = aMR_GOKI_MAX;
|
||||
}
|
||||
|
||||
for (i = 0; i < max; i++) {
|
||||
if (i == 0) {
|
||||
if (Save_Get(scene_no) == SCENE_MY_ROOM_S || Save_Get(scene_no) == SCENE_MY_ROOM_M ||
|
||||
Save_Get(scene_no) == SCENE_MY_ROOM_L || Save_Get(scene_no) == SCENE_MY_ROOM_LL1 ||
|
||||
Save_Get(scene_no) == SCENE_MY_ROOM_BASEMENT_S || Save_Get(scene_no) == SCENE_MY_ROOM_BASEMENT_M ||
|
||||
Save_Get(scene_no) == SCENE_MY_ROOM_BASEMENT_L ||
|
||||
Save_Get(scene_no) == SCENE_MY_ROOM_BASEMENT_LL1) {
|
||||
static f32 off_x[] = { 10.0f, -10.0f, 15.0f, -15.0f };
|
||||
xyz_t pos = player->actor_class.world.position;
|
||||
mActor_name_t* fg_p;
|
||||
|
||||
pos.x += off_x[play->game_frame % ARRAY_COUNT(off_x)];
|
||||
pos.y = 0.0f;
|
||||
pos.z += -10.0f;
|
||||
pos.y = mCoBG_GetBgY_OnlyCenter_FromWpos2(pos, 0.0f);
|
||||
fg_p = mFI_GetUnitFG(pos);
|
||||
|
||||
if (fg_p != NULL && !ITEM_IS_FTR(*fg_p) && *fg_p != RSV_FE1F && *fg_p != RSV_NO &&
|
||||
*fg_p != RSV_WALL_NO && *fg_p != RSV_DOOR) {
|
||||
int spawned = aMR_MakeIndoorGoki(&pos, 0, DEG2SHORT_ANGLE(0.0f), game);
|
||||
|
||||
if (spawned) {
|
||||
mCkRh_CalcCanLookGokiCount(1);
|
||||
mCkRh_MinusGokiN_NowRoom(1, my_room->scene);
|
||||
if (Common_Get(goki_shocked_flag) == FALSE && field_type == mFI_FIELDTYPE2_PLAYER_ROOM) {
|
||||
aMR_SetSurprise(actorx, DEG2SHORT_ANGLE(-180.0f));
|
||||
Common_Set(goki_shocked_flag, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int spawned = aMR_RandomMakeIndoorGoki(0, game);
|
||||
|
||||
if (spawned) {
|
||||
mCkRh_CalcCanLookGokiCount(1);
|
||||
mCkRh_MinusGokiN_NowRoom(1, my_room->scene);
|
||||
if (Common_Get(goki_shocked_flag) == FALSE && field_type == mFI_FIELDTYPE2_PLAYER_ROOM) {
|
||||
aMR_SetSurprise(actorx, DEG2SHORT_ANGLE(-180.0f));
|
||||
Common_Set(goki_shocked_flag, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my_room->goki_ct_proc = &aMR_GokiInfoCt_Dummy;
|
||||
}
|
||||
|
||||
static void aMR_MakeGokiburi(xyz_t* pos, GAME* game, s16 arg) {
|
||||
if (mCkRh_NowSceneGokiFamilyCount() > 0 && mCkRh_GetCanLookGokiCount() < aMR_GOKI_MAX &&
|
||||
aMR_MakeIndoorGoki(pos, arg, DEG2SHORT_ANGLE(0.0f), game)) {
|
||||
mCkRh_CalcCanLookGokiCount(1);
|
||||
|
||||
if (aMR_CLIP != NULL) {
|
||||
ACTOR* actorx = aMR_CLIP->my_room_actor_p;
|
||||
|
||||
if (actorx != NULL) {
|
||||
MY_ROOM_ACTOR* my_room = (MY_ROOM_ACTOR*)actorx;
|
||||
|
||||
mCkRh_MinusGokiN_NowRoom(1, my_room->scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aMR_GokiInfoDt(void) {
|
||||
if (aMR_CLIP != NULL) {
|
||||
ACTOR* actorx = aMR_CLIP->my_room_actor_p;
|
||||
|
||||
if (actorx != NULL) {
|
||||
MY_ROOM_ACTOR* my_room = (MY_ROOM_ACTOR*)actorx;
|
||||
|
||||
mCkRh_PlussGokiN_NowRoom(mCkRh_GetCanLookGokiCount(), my_room->scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int aMR_CheckFtrAndGoki2(aFTR_collision_c* ftr_col, const xyz_t* goki_pos) {
|
||||
f32 check_pos[2];
|
||||
int i;
|
||||
|
||||
check_pos[0] = goki_pos->x;
|
||||
check_pos[1] = goki_pos->z;
|
||||
|
||||
for (i = 0; i < aFTR_EDGE_COL_NUM; i++) {
|
||||
aFTR_collision_c* col_p = &ftr_col[i];
|
||||
|
||||
if (mCoBG_GetPointInfoFrontLine(col_p->start, check_pos, col_p->normal)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void aMR_CheckFtrAndGoki(ACTOR* actorx, FTR_ACTOR* ftr_actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
ACTOR* actor_p = play->actor_info.list[ACTOR_PART_BG].actor;
|
||||
int count = 0;
|
||||
|
||||
while (actor_p != NULL) {
|
||||
if (actor_p->id == mAc_PROFILE_HOUSE_GOKI) {
|
||||
if (aMR_CheckFtrAndGoki2(ftr_actor->edge_collision, &actor_p->world.position)) {
|
||||
actor_p->actor_specific = 2;
|
||||
}
|
||||
|
||||
count++;
|
||||
if (count >= aMR_GOKI_MAX) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
actor_p = actor_p->next_actor;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
static void aMR_SetMelodyData(u8* melody_data) {
|
||||
mRmTp_MakeMelodyData();
|
||||
}
|
||||
|
||||
static u8* aMR_GetMelodyData(ACTOR* actorx) {
|
||||
return mRmTp_GetMelodyData();
|
||||
}
|
||||
|
||||
static void aMR_SoundMelody(FTR_ACTOR* ftr_actor, ACTOR* actorx, int idx) {
|
||||
if (ftr_actor->switch_changed_flag) {
|
||||
u8* melody_data = aMR_GetMelodyData(actorx);
|
||||
|
||||
sAdo_FurnitureInst((u32)ftr_actor, idx, melody_data, &ftr_actor->position);
|
||||
}
|
||||
|
||||
sAdo_FurnitureInstPos((u32)ftr_actor, &ftr_actor->position);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+20
-20
@@ -13,7 +13,7 @@
|
||||
|
||||
int S_ongenpos_refuse_fg;
|
||||
|
||||
static void sAdo_Calc_MicPosition_common(f32* fcalc, u16* scalc, xyz_t* pos) {
|
||||
static void sAdo_Calc_MicPosition_common(f32* fcalc, u16* scalc, const xyz_t* pos) {
|
||||
|
||||
f32 diff;
|
||||
xyz_t posd;
|
||||
@@ -35,12 +35,12 @@ static void sAdo_Calc_MicPosition_common(f32* fcalc, u16* scalc, xyz_t* pos) {
|
||||
}
|
||||
}
|
||||
|
||||
extern void sAdo_Calc_MicPosition_forTrig(f32* fcalc, u16* scalc, xyz_t* pos) {
|
||||
extern void sAdo_Calc_MicPosition_forTrig(f32* fcalc, u16* scalc, const xyz_t* pos) {
|
||||
|
||||
sAdo_Calc_MicPosition_common(fcalc, scalc, pos);
|
||||
}
|
||||
|
||||
extern void sAdo_Calc_MicPosition_forLevel(f32* fcalc, u16* scalc, xyz_t* pos) {
|
||||
extern void sAdo_Calc_MicPosition_forLevel(f32* fcalc, u16* scalc, const xyz_t* pos) {
|
||||
|
||||
sAdo_Calc_MicPosition_common(fcalc, scalc, pos);
|
||||
}
|
||||
@@ -60,7 +60,7 @@ extern void sAdo_SysTrgStart(u16 id) {
|
||||
Na_SysTrgStart(id);
|
||||
}
|
||||
|
||||
extern void sAdo_PlyWalkSe(int walk, xyz_t* pos) {
|
||||
extern void sAdo_PlyWalkSe(int walk, const xyz_t* pos) {
|
||||
|
||||
f32 fcalc;
|
||||
u16 scalc;
|
||||
@@ -69,7 +69,7 @@ extern void sAdo_PlyWalkSe(int walk, xyz_t* pos) {
|
||||
Na_PlyWalkSe(walk, scalc, fcalc);
|
||||
}
|
||||
|
||||
extern void sAdo_PlyWalkSeRoom(int walk, xyz_t* pos) {
|
||||
extern void sAdo_PlyWalkSeRoom(int walk, const xyz_t* pos) {
|
||||
|
||||
f32 fcalc;
|
||||
u16 scalc;
|
||||
@@ -78,7 +78,7 @@ extern void sAdo_PlyWalkSeRoom(int walk, xyz_t* pos) {
|
||||
Na_PlyWalkSeRoom(walk, scalc, fcalc);
|
||||
}
|
||||
|
||||
extern void sAdo_NpcWalkSe(int walk, xyz_t* pos) {
|
||||
extern void sAdo_NpcWalkSe(int walk, const xyz_t* pos) {
|
||||
|
||||
f32 fcalc;
|
||||
u16 scalc;
|
||||
@@ -87,7 +87,7 @@ extern void sAdo_NpcWalkSe(int walk, xyz_t* pos) {
|
||||
Na_NpcWalkSe(walk, scalc, fcalc);
|
||||
}
|
||||
|
||||
extern void sAdo_NpcWalkSeRoom(int walk, xyz_t* pos) {
|
||||
extern void sAdo_NpcWalkSeRoom(int walk, const xyz_t* pos) {
|
||||
|
||||
f32 fcalc;
|
||||
u16 scalc;
|
||||
@@ -135,7 +135,7 @@ extern void sAdo_SysLevStop(u8 id) {
|
||||
Na_SysLevStop(id);
|
||||
}
|
||||
|
||||
extern void sAdo_OngenPos(u32 p1, u8 p2, xyz_t* pos) {
|
||||
extern void sAdo_OngenPos(u32 p1, u8 p2, const xyz_t* pos) {
|
||||
|
||||
u16 scalc;
|
||||
f32 fcalc;
|
||||
@@ -146,7 +146,7 @@ extern void sAdo_OngenPos(u32 p1, u8 p2, xyz_t* pos) {
|
||||
}
|
||||
}
|
||||
|
||||
extern void sAdo_OngenTrgStart(u16 id, xyz_t* pos) {
|
||||
extern void sAdo_OngenTrgStart(u16 id, const xyz_t* pos) {
|
||||
|
||||
u16 scalc;
|
||||
f32 fcalc;
|
||||
@@ -171,7 +171,7 @@ extern void sAdo_SetVoiceMode(u8 mode) {
|
||||
Na_SetVoiceMode(mode);
|
||||
}
|
||||
|
||||
extern void sAdo_FloorTrgStart(u16 id, xyz_t* pos) {
|
||||
extern void sAdo_FloorTrgStart(u16 id, const xyz_t* pos) {
|
||||
|
||||
u16 scalc;
|
||||
f32 fcalc;
|
||||
@@ -195,13 +195,13 @@ extern void sAdo_RhythmAllStop() {
|
||||
Na_RhythmAllStop();
|
||||
}
|
||||
|
||||
extern void sAdo_FurnitureInst(int track_id, s8 cb, s32 cl, xyz_t* pos) {
|
||||
extern void sAdo_FurnitureInst(u32 id, u8 inst, u8* melody, const xyz_t* pos) {
|
||||
|
||||
u16 scalc;
|
||||
f32 fcalc;
|
||||
|
||||
sAdo_Calc_MicPosition_common(&fcalc, &scalc, pos);
|
||||
Na_FurnitureInst(track_id, cb, cl, scalc, fcalc);
|
||||
Na_FurnitureInst(id, inst, melody, scalc, fcalc);
|
||||
}
|
||||
|
||||
extern void sAdo_Pause(u8 mode) {
|
||||
@@ -233,7 +233,7 @@ extern int sAdo_InstCountGet() {
|
||||
return Na_InstCountGet();
|
||||
}
|
||||
|
||||
extern void sAdo_RhythmPos(u32 p, u8 haniwa_id, xyz_t* pos) {
|
||||
extern void sAdo_RhythmPos(u32 p, u8 haniwa_id, const xyz_t* pos) {
|
||||
|
||||
u16 scalc;
|
||||
f32 fcalc;
|
||||
@@ -247,7 +247,7 @@ extern void sAdo_SpecChange(int spec) {
|
||||
Na_SpecChange(spec);
|
||||
}
|
||||
|
||||
extern void sAdo_MDPlayerPos(xyz_t* pos, u16 s1, u16 s2, int p) {
|
||||
extern void sAdo_MDPlayerPos(const xyz_t* pos, u16 s1, u16 s2, int p) {
|
||||
|
||||
u16 scalc;
|
||||
f32 fcalc;
|
||||
@@ -316,7 +316,7 @@ extern void sAdos_TTKK_ARM(u8 mode) {
|
||||
Na_TTKK_ARM(mode);
|
||||
}
|
||||
|
||||
extern void sAdo_OngenTrgStartSpeed(f32 speed, u16 s1, xyz_t* pos) {
|
||||
extern void sAdo_OngenTrgStartSpeed(f32 speed, u16 s1, const xyz_t* pos) {
|
||||
|
||||
f32 fcalc;
|
||||
u16 scalc;
|
||||
@@ -443,7 +443,7 @@ extern void sAdo_SceneMode(u8 mode) {
|
||||
Na_SceneMode(mode);
|
||||
}
|
||||
|
||||
extern u8 sAdo_RoomIncectPos(u32 f, u16 u, xyz_t* pos) {
|
||||
extern u8 sAdo_RoomIncectPos(u32 f, u16 u, const xyz_t* pos) {
|
||||
|
||||
u16 scalc;
|
||||
f32 fcalc;
|
||||
@@ -452,13 +452,13 @@ extern u8 sAdo_RoomIncectPos(u32 f, u16 u, xyz_t* pos) {
|
||||
return Na_RoomIncectPos(f, u, scalc, fcalc);
|
||||
}
|
||||
|
||||
extern void sAdo_FurnitureInstPos(u32 f, xyz_t* pos) {
|
||||
extern void sAdo_FurnitureInstPos(u32 id, const xyz_t* pos) {
|
||||
|
||||
u16 scalc;
|
||||
f32 fcalc;
|
||||
|
||||
sAdo_Calc_MicPosition_forLevel(&fcalc, &scalc, pos);
|
||||
Na_FurnitureInstPos(f, scalc, fcalc);
|
||||
Na_FurnitureInstPos(id, scalc, fcalc);
|
||||
}
|
||||
|
||||
extern void sAdo_Set_ongenpos_refuse_fg(int state) {
|
||||
@@ -476,7 +476,7 @@ extern int sAdo_GetSoundFrameCounter() {
|
||||
return Na_GetSoundFrameCounter();
|
||||
}
|
||||
|
||||
extern int sAdo_CheckOnPlussBridge(xyz_t* pos, u32 atr) {
|
||||
extern int sAdo_CheckOnPlussBridge(const xyz_t* pos, u32 atr) {
|
||||
|
||||
f32 x;
|
||||
f32 z;
|
||||
@@ -490,7 +490,7 @@ extern int sAdo_CheckOnPlussBridge(xyz_t* pos, u32 atr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern void sAdo_RegistPlussBridge(xyz_t* pos) {
|
||||
extern void sAdo_RegistPlussBridge(const xyz_t* pos) {
|
||||
|
||||
Common_Set(pluss_bridge_pos, pos);
|
||||
}
|
||||
|
||||
+2
-3
@@ -1014,9 +1014,8 @@ extern void cKF_SkeletonInfo_R_T_combine_play(int* arg1, int* arg2, int* arg3, c
|
||||
*arg3 = cKF_FrameControl_play(&info3->frame_control);
|
||||
}
|
||||
|
||||
extern void cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(f32 transx, f32 transy, f32 transz,
|
||||
cKF_SkeletonInfo_R_c* keyframe, s16 anglex, s16 angley,
|
||||
s16 anglez) {
|
||||
extern void cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(cKF_SkeletonInfo_R_c* keyframe, f32 transx, f32 transy,
|
||||
f32 transz, s16 anglex, s16 angley, s16 anglez) {
|
||||
keyframe->base_model_translation.x = transx;
|
||||
keyframe->base_model_translation.y = transy;
|
||||
keyframe->base_model_translation.z = transz;
|
||||
|
||||
Reference in New Issue
Block a user