mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-09-09 19:01:16 -04:00
Match ac_my_room_move.c_inc
This commit is contained in:
+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