mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Merge branch 'master' of https://github.com/SamuraiOndo/ac-decomp
This commit is contained in:
@@ -187,7 +187,7 @@ extern u8 ics_bad;
|
||||
|
||||
extern FamicomCommon famicomCommon;
|
||||
|
||||
typedef s32 (*FAMICOM_GETSAVECHAN_PROC)(int* player_no, s32* slot_card_result);
|
||||
typedef int (*FAMICOM_GETSAVECHAN_PROC)(int* player_no, s32* slot_card_result);
|
||||
|
||||
extern int famicom_getErrorChan();
|
||||
extern void famicom_setCallback_getSaveChan(FAMICOM_GETSAVECHAN_PROC proc);
|
||||
|
||||
+38
-23
@@ -9,38 +9,54 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct halloween_npc_s NPC_HALLOWEEN_ACTOR;
|
||||
typedef struct halloween_npc_s HALLOWEEN_NPC_ACTOR;
|
||||
|
||||
typedef void (*aHWN_TALK_PROC)(HALLOWEEN_NPC_ACTOR*, GAME_PLAY*);
|
||||
typedef void (*aHWN_THINK_PROC)(HALLOWEEN_NPC_ACTOR*, GAME_PLAY*);
|
||||
|
||||
typedef void (*aHWN_TALK_PROC)(NPC_HALLOWEEN_ACTOR*, GAME_PLAY*);
|
||||
// has to be _P because a function is already defined as aHWN_think_proc
|
||||
typedef void (*aHWN_THINK_PROC_P)(NPC_ACTOR*, GAME_PLAY*);
|
||||
/* sizeof(halloween_npc_s) == 0x9AC*/
|
||||
struct halloween_npc_s {
|
||||
/* 0x000 */ NPC_ACTOR npc_class;
|
||||
/* 0x994 */ int dt_tbl_idx;
|
||||
/* 0x998 */ aHWN_THINK_PROC_P think_proc;
|
||||
/* 0x998 */ aHWN_THINK_PROC think_proc;
|
||||
/* 0x99C */ int _99C;
|
||||
/* 0x9A0 */ aHWN_TALK_PROC talk_proc;
|
||||
/* 0x9A4 */ mActor_name_t item;
|
||||
/* 0x9A8 */ BOOL _9A0;
|
||||
};
|
||||
enum {
|
||||
aHWN_TALK_FIRST_CALL_TALK_PROC, // 0
|
||||
aHWN_TALK_TRICK_OR_TREAT_TALK_PROC, // 1
|
||||
aHWN_TALK_MENU_OPEN_WAIT_TALK_PROC, // 2
|
||||
aHWN_TALK_MENU_CLOSE_WAIT_TALK_PROC, // 3
|
||||
aHWN_TALK_GET_OTHER_ITEM_WAIT_TALK_PROC, // 4
|
||||
aHWN_TALK_RECEIVE_TOOL_ITEM_START_WAIT_TALK_PROC, // 5
|
||||
aHWN_TALK_RECEIVE_TOOL_ITEM_END_WAIT_TALK_PROC, // 6
|
||||
aHWN_TALK_TRICK_TIMING_WAIT_TALK_PROC, // 7
|
||||
aHWN_TALK_TRICK_CHG_CLOTH_TALK_PROC, // 8
|
||||
aHWN_TALK_TRICK_CHG_CLOTH_END_WAIT_TALK_PROC, // 9
|
||||
aHWN_TALK_GET_AME_WAIT_TALK_PROC, // 10
|
||||
aHWN_TALK_GET_AME_TALK_PROC, // 11
|
||||
aHWN_TALK_PL_DEMO_CODE_END_WAIT_TALK_PROC, // 12
|
||||
aHWN_TALK_NONE_PROC1, // 13
|
||||
/* 0x9A8 */ BOOL wait_think_done;
|
||||
};
|
||||
|
||||
enum {
|
||||
aHWN_TALK_FIRST_CALL_TALK, // 0
|
||||
aHWN_TALK_TRICK_OR_TREAT_TALK, // 1
|
||||
aHWN_TALK_MENU_OPEN_WAIT_TALK, // 2
|
||||
aHWN_TALK_MENU_CLOSE_WAIT_TALK, // 3
|
||||
aHWN_TALK_GET_OTHER_ITEM_WAIT_TALK, // 4
|
||||
aHWN_TALK_RECEIVE_TOOL_ITEM_START_WAIT_TALK, // 5
|
||||
aHWN_TALK_RECEIVE_TOOL_ITEM_END_WAIT_TALK, // 6
|
||||
aHWN_TALK_TRICK_TIMING_WAIT_TALK, // 7
|
||||
aHWN_TALK_TRICK_CHG_CLOTH_TALK, // 8
|
||||
aHWN_TALK_TRICK_CHG_CLOTH_END_WAIT_TALK, // 9
|
||||
aHWN_TALK_GET_AME_WAIT_TALK, // 10
|
||||
aHWN_TALK_GET_AME_TALK, // 11
|
||||
aHWN_TALK_PL_DEMO_CODE_END_WAIT_TALK, // 12
|
||||
aHWN_TALK_END_WAIT, // 13
|
||||
|
||||
aHWN_TALK_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
aHWN_THINK_APPROACH,
|
||||
aHWN_THINK_APPROACH_WAIT,
|
||||
|
||||
aHWN_THINK_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
aHWN_TRICK_TYPE_CHG_CLOTH,
|
||||
aHWN_TRICK_TYPE_CHG_ITEM,
|
||||
|
||||
aHWN_TRICK_TYPE_NUM
|
||||
};
|
||||
|
||||
extern ACTOR_PROFILE Halloween_Npc_Profile;
|
||||
|
||||
@@ -49,4 +65,3 @@ extern ACTOR_PROFILE Halloween_Npc_Profile;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+2
-2
@@ -269,12 +269,12 @@ enum {
|
||||
|
||||
#define OTHERS_SIZE ALIGN_NEXT(sizeof(mCD_others_c), mCD_MEMCARD_SECTORSIZE)
|
||||
|
||||
extern s32 mCD_GetThisLandSlotNo_code(int* player_no, s32* slot_card_results);
|
||||
extern int mCD_GetThisLandSlotNo_code(int* player_no, s32* slot_card_results);
|
||||
extern int mCD_GetThisLandSlotNo(void);
|
||||
extern void mCD_save_data_aram_malloc(void);
|
||||
extern void mCD_set_aram_save_data();
|
||||
extern void mCD_init_card();
|
||||
extern s32 mCD_InitGameStart_bg(int player_no, int card_private_idx, int start_cond, s32* mounted_chan);
|
||||
extern int mCD_InitGameStart_bg(int player_no, int card_private_idx, int start_cond, s32* mounted_chan);
|
||||
extern int mCD_GetCardPrivateNameCopy(u8* name, int idx);
|
||||
extern int mCD_CheckCardPlayerNative(int idx);
|
||||
extern int mCD_CheckPassportFile(void);
|
||||
|
||||
@@ -30,40 +30,40 @@ static void aHWN_actor_save(ACTOR* actorx, GAME* game);
|
||||
static void aHWN_actor_init(ACTOR* actorx, GAME* game);
|
||||
static void aHWN_actor_draw(ACTOR* actorx, GAME* game);
|
||||
|
||||
static BOOL aHWN_set_request_act(NPC_HALLOWEEN_ACTOR* actorx, u8 prio, u8 idx, u8 type, u16 obj, s16 move_x,
|
||||
static BOOL aHWN_set_request_act(HALLOWEEN_NPC_ACTOR* actorx, u8 prio, u8 idx, u8 type, u16 obj, s16 move_x,
|
||||
s16 move_z);
|
||||
static void aHWN_actor_move(ACTOR* actorx, GAME* game);
|
||||
|
||||
static int aHWN_get_trick_type();
|
||||
static void aHWN_restart_msg_win(NPC_HALLOWEEN_ACTOR* actorx, int msg_idx);
|
||||
static void aHWN_first_call_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_trick_or_treat_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_menu_open_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_menu_close_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_get_other_item_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_receive_tool_item_start_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_receive_tool_item_end_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_trick_timing_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_trick_chg_cloth_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_trick_chg_cloth_end_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_get_ame_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_get_ame_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_pl_demo_code_end_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_change_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, int talk_proc_idx);
|
||||
static void aHWN_restart_msg_win(HALLOWEEN_NPC_ACTOR* actorx, int msg_idx);
|
||||
static void aHWN_first_call_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_trick_or_treat_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_menu_open_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_menu_close_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_get_other_item_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_receive_tool_item_start_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_receive_tool_item_end_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_trick_timing_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_trick_chg_cloth_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_trick_chg_cloth_end_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_get_ame_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_get_ame_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_pl_demo_code_end_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_change_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, int talk_proc_idx);
|
||||
static void aHWN_set_force_talk_info(ACTOR* actorx);
|
||||
static void aHWN_force_talk_request(ACTOR* actorx, GAME* game);
|
||||
static void aHWN_set_norm_talk_info(NPC_HALLOWEEN_ACTOR* actorx);
|
||||
static void aHWN_norm_talk_request(NPC_HALLOWEEN_ACTOR* actorx);
|
||||
static void aHWN_set_norm_talk_info(HALLOWEEN_NPC_ACTOR* actorx);
|
||||
static void aHWN_norm_talk_request(ACTOR* actorx, GAME* game);
|
||||
static int aHWN_talk_init();
|
||||
static BOOL aHWN_talk_end_chk(ACTOR* actorx, GAME* game);
|
||||
|
||||
static void aHWN_approach(NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_approach_wait(NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_think_main_proc(NPC_ACTOR* actorx, GAME_PLAY* playe);
|
||||
static void aHWN_approach(HALLOWEEN_NPC_ACTOR* hwn_actor, GAME_PLAY* play);
|
||||
static void aHWN_approach_wait(HALLOWEEN_NPC_ACTOR* hwn_actor, GAME_PLAY* play);
|
||||
static void aHWN_think_main_proc(NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_think_init_proc(NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_approach_init(NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_approach_wait_init(NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_setup_think_proc(ACTOR* actorx, GAME* game, int dt_tbl_idx);
|
||||
static void aHWN_approach_init(HALLOWEEN_NPC_ACTOR* hwn_actor, GAME_PLAY* play);
|
||||
static void aHWN_approach_wait_init(HALLOWEEN_NPC_ACTOR* hwn_actor, GAME_PLAY* play);
|
||||
static void aHWN_setup_think_proc(HALLOWEEN_NPC_ACTOR* hwn_actor, GAME_PLAY* play, int dt_tbl_idx);
|
||||
static void aHWN_think_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int think_proc_idx);
|
||||
static void aHWN_schedule_think_init(NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
static void aHWN_schedule_init_proc(NPC_ACTOR* actorx, GAME_PLAY* play);
|
||||
@@ -75,9 +75,9 @@ ACTOR_PROFILE Halloween_Npc_Profile = {
|
||||
mAc_PROFILE_HALLOWEEN_NPC,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_NONE,
|
||||
0,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(NPC_HALLOWEEN_ACTOR),
|
||||
sizeof(HALLOWEEN_NPC_ACTOR),
|
||||
aHWN_actor_ct,
|
||||
aHWN_actor_dt,
|
||||
aHWN_actor_init,
|
||||
@@ -98,7 +98,7 @@ static void aHWN_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
0,
|
||||
};
|
||||
// clang-format on
|
||||
NPC_HALLOWEEN_ACTOR* hwn_actor = (NPC_HALLOWEEN_ACTOR*)actorx;
|
||||
HALLOWEEN_NPC_ACTOR* hwn_actor = (HALLOWEEN_NPC_ACTOR*)actorx;
|
||||
if (NPC_CLIP->birth_check_proc(actorx, game) == TRUE) {
|
||||
hwn_actor->npc_class.schedule.schedule_proc = &aHWN_schedule_proc;
|
||||
NPC_CLIP->ct_proc(actorx, game, &ct_data);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
static BOOL aHWN_set_request_act(NPC_HALLOWEEN_ACTOR* actorx, u8 prio, u8 idx, u8 type, u16 obj, s16 move_x,
|
||||
static BOOL aHWN_set_request_act(HALLOWEEN_NPC_ACTOR* actorx, u8 prio, u8 idx, u8 type, u16 obj, s16 move_x,
|
||||
s16 move_z) {
|
||||
BOOL res = FALSE;
|
||||
if (prio >= actorx->npc_class.request.act_priority) {
|
||||
|
||||
@@ -1,57 +1,56 @@
|
||||
static void aHWN_approach(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
NPC_HALLOWEEN_ACTOR* hwn_actor = (NPC_HALLOWEEN_ACTOR*)actorx;
|
||||
static void aHWN_approach(HALLOWEEN_NPC_ACTOR* hwn_actor, GAME_PLAY* play) {
|
||||
ACTOR* talk_actor = mDemo_Get_talk_actor();
|
||||
if ((talk_actor != NULL && talk_actor != &actorx->actor_class) ||
|
||||
|
||||
if ((talk_actor != NULL && talk_actor != (ACTOR*)hwn_actor) ||
|
||||
(hwn_actor->npc_class.actor_class.block_x != play->block_table.block_x ||
|
||||
hwn_actor->npc_class.actor_class.block_z != play->block_table.block_z)) {
|
||||
aHWN_setup_think_proc(&actorx->actor_class, &play->game, 1);
|
||||
aHWN_setup_think_proc(hwn_actor, play, aHWN_THINK_APPROACH_WAIT);
|
||||
} else if (hwn_actor->npc_class.action.step == aNPC_ACTION_END_STEP) {
|
||||
aHWN_setup_think_proc(&actorx->actor_class, &play->game, 0);
|
||||
aHWN_setup_think_proc(hwn_actor, play, aHWN_THINK_APPROACH);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_approach_wait(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
NPC_HALLOWEEN_ACTOR* hwn_actor = (NPC_HALLOWEEN_ACTOR*)actorx;
|
||||
if (((mDemo_Get_talk_actor() == 0) && (hwn_actor->npc_class.actor_class.block_x == (play->block_table).block_x)) &&
|
||||
static void aHWN_approach_wait(HALLOWEEN_NPC_ACTOR* hwn_actor, GAME_PLAY* play) {
|
||||
if (((mDemo_Get_talk_actor() == NULL) &&
|
||||
(hwn_actor->npc_class.actor_class.block_x == (play->block_table).block_x)) &&
|
||||
(hwn_actor->npc_class.actor_class.block_z == (play->block_table).block_z)) {
|
||||
aHWN_setup_think_proc(&actorx->actor_class, &play->game, 0);
|
||||
aHWN_setup_think_proc(hwn_actor, play, aHWN_THINK_APPROACH);
|
||||
} else if (hwn_actor->npc_class.action.step == aNPC_ACTION_END_STEP) {
|
||||
aHWN_setup_think_proc(&actorx->actor_class, &play->game, 1);
|
||||
aHWN_setup_think_proc(hwn_actor, play, aHWN_THINK_APPROACH_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_think_main_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
NPC_HALLOWEEN_ACTOR* hwn_actor = (NPC_HALLOWEEN_ACTOR*)actorx;
|
||||
hwn_actor->think_proc(actorx, play);
|
||||
HALLOWEEN_NPC_ACTOR* hwn_actor = (HALLOWEEN_NPC_ACTOR*)actorx;
|
||||
|
||||
hwn_actor->think_proc(hwn_actor, play);
|
||||
}
|
||||
|
||||
static void aHWN_think_init_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
NPC_HALLOWEEN_ACTOR* hwn_actor = (NPC_HALLOWEEN_ACTOR*)actorx;
|
||||
aHWN_setup_think_proc(&actorx->actor_class, &play->game, 0);
|
||||
static void aHWN_think_init_proc(NPC_ACTOR* nactorx, GAME_PLAY* play) {
|
||||
HALLOWEEN_NPC_ACTOR* hwn_actor = (HALLOWEEN_NPC_ACTOR*)nactorx;
|
||||
|
||||
aHWN_setup_think_proc(hwn_actor, play, aHWN_THINK_APPROACH);
|
||||
hwn_actor->npc_class.condition_info.hide_request = 0;
|
||||
hwn_actor->npc_class.think.interrupt_flags = aNPC_THINK_INTERRUPT_ENTRANCE | aNPC_THINK_INTERRUPT_OBSTACLE;
|
||||
hwn_actor->npc_class.condition_info.demo_flg = aNPC_COND_DEMO_SKIP_MOVE_CIRCLE_REV;
|
||||
}
|
||||
|
||||
static void aHWN_approach_init(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
aHWN_set_request_act((NPC_HALLOWEEN_ACTOR*)actorx, 4, aNPC_ACT_RUN, aNPC_ACT_TYPE_SEARCH, aNPC_ACT_OBJ_PLAYER, 0,
|
||||
0);
|
||||
static void aHWN_approach_init(HALLOWEEN_NPC_ACTOR* hwn_actor, GAME_PLAY* play) {
|
||||
aHWN_set_request_act(hwn_actor, 4, aNPC_ACT_RUN, aNPC_ACT_TYPE_SEARCH, aNPC_ACT_OBJ_PLAYER, 0, 0);
|
||||
}
|
||||
|
||||
static void aHWN_approach_wait_init(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
aHWN_set_request_act((NPC_HALLOWEEN_ACTOR*)actorx, 4, aNPC_ACT_WAIT, aNPC_ACT_TYPE_SEARCH, aNPC_ACT_OBJ_PLAYER, 0,
|
||||
0);
|
||||
static void aHWN_approach_wait_init(HALLOWEEN_NPC_ACTOR* hwn_actor, GAME_PLAY* play) {
|
||||
aHWN_set_request_act(hwn_actor, 4, aNPC_ACT_WAIT, aNPC_ACT_TYPE_SEARCH, aNPC_ACT_OBJ_PLAYER, 0, 0);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
aHWN_THINK_PROC_P approach_proc;
|
||||
aHWN_THINK_PROC_P approach_init_proc;
|
||||
aHWN_THINK_PROC approach_proc;
|
||||
aHWN_THINK_PROC approach_init_proc;
|
||||
aNPC_TALK_REQUEST_PROC talk_request_proc;
|
||||
u8 unk;
|
||||
} aHWN_talk_data_c;
|
||||
|
||||
static void aHWN_setup_think_proc(ACTOR* actorx, GAME* game, int dt_tbl_idx) {
|
||||
NPC_HALLOWEEN_ACTOR* hwn_actor = (NPC_HALLOWEEN_ACTOR*)actorx;
|
||||
static void aHWN_setup_think_proc(HALLOWEEN_NPC_ACTOR* hwn_actor, GAME_PLAY* play, int dt_tbl_idx) {
|
||||
aHWN_talk_data_c* data;
|
||||
// clang-format off
|
||||
static aHWN_talk_data_c dt_tbl[] = {
|
||||
@@ -65,21 +64,23 @@ static void aHWN_setup_think_proc(ACTOR* actorx, GAME* game, int dt_tbl_idx) {
|
||||
hwn_actor->think_proc = data->approach_proc;
|
||||
hwn_actor->npc_class.talk_info.talk_request_proc = data->talk_request_proc;
|
||||
hwn_actor->_99C = data->unk;
|
||||
data->approach_init_proc((NPC_ACTOR*)actorx, (GAME_PLAY*)game);
|
||||
data->approach_init_proc(hwn_actor, play);
|
||||
}
|
||||
|
||||
static void aHWN_think_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int think_proc_idx) {
|
||||
static aHWN_THINK_PROC_P think_proc[] = { aHWN_think_init_proc, aHWN_think_main_proc };
|
||||
static aNPC_SUB_PROC think_proc[] = { aHWN_think_init_proc, aHWN_think_main_proc };
|
||||
think_proc[think_proc_idx](actorx, play);
|
||||
}
|
||||
|
||||
static void aHWN_schedule_think_init(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static int think_idx[] = { 5, 9, 1 };
|
||||
NPC_CLIP->think_proc(actorx, play, think_idx[actorx->schedule.step], 0);
|
||||
static int think_idx[] = { aNPC_THINK_LEAVE_HOUSE, aNPC_THINK_SPECIAL, aNPC_THINK_WANDER };
|
||||
|
||||
NPC_CLIP->think_proc(actorx, play, think_idx[actorx->schedule.step], aNPC_THINK_TYPE_INIT);
|
||||
}
|
||||
|
||||
static void aHWN_schedule_init_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
int step = 1;
|
||||
|
||||
actorx->think.think_proc = aHWN_think_proc;
|
||||
if (actorx->npc_info.animal->is_home == TRUE) {
|
||||
step = 0;
|
||||
@@ -89,32 +90,33 @@ static void aHWN_schedule_init_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
}
|
||||
|
||||
static void aHWN_schedule_main_proc(NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
NPC_HALLOWEEN_ACTOR* hwn_actor = (NPC_HALLOWEEN_ACTOR*)actorx;
|
||||
HALLOWEEN_NPC_ACTOR* hwn_actor = (HALLOWEEN_NPC_ACTOR*)actorx;
|
||||
if (actorx->think.end_flag == TRUE) {
|
||||
if (actorx->schedule.step != 2) {
|
||||
actorx->schedule.step += 1;
|
||||
}
|
||||
aHWN_schedule_think_init(actorx, play);
|
||||
} else if (hwn_actor->_9A0 == TRUE) {
|
||||
if (NPC_CLIP->think_proc(actorx, play, -1, 1) == 0) {
|
||||
} else if (hwn_actor->wait_think_done == TRUE) {
|
||||
if (NPC_CLIP->think_proc(actorx, play, -1, aNPC_THINK_TYPE_CHK_INTERRUPT) == FALSE) {
|
||||
if (actorx->action.step == aNPC_ACTION_END_STEP) {
|
||||
hwn_actor->_9A0 = FALSE;
|
||||
hwn_actor->wait_think_done = FALSE;
|
||||
aHWN_schedule_think_init(actorx, play);
|
||||
}
|
||||
} else {
|
||||
actorx->request.act_priority = 4;
|
||||
}
|
||||
} else {
|
||||
if (NPC_CLIP->think_proc(actorx, play, -1, 1) == 0) {
|
||||
NPC_CLIP->think_proc(actorx, play, -1, 2);
|
||||
if (NPC_CLIP->think_proc(actorx, play, -1, aNPC_THINK_TYPE_CHK_INTERRUPT) == FALSE) {
|
||||
NPC_CLIP->think_proc(actorx, play, -1, aNPC_THINK_TYPE_MAIN);
|
||||
} else {
|
||||
actorx->request.act_priority = 4;
|
||||
hwn_actor->_9A0 = TRUE;
|
||||
hwn_actor->wait_think_done = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_schedule_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int sche_proc_idx) {
|
||||
static aNPC_SUB_PROC sche_proc[] = { aHWN_schedule_init_proc, aHWN_schedule_main_proc };
|
||||
|
||||
sche_proc[sche_proc_idx](actorx, play);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ static int aHWN_get_trick_type(void) {
|
||||
int idx[mPr_POCKETS_SLOT_COUNT];
|
||||
mActor_name_t* pockets_p = Now_Private->inventory.pockets;
|
||||
int i;
|
||||
int ret = 0; // trick type enum/define
|
||||
int ret = aHWN_TRICK_TYPE_CHG_CLOTH;
|
||||
|
||||
for (i = 0; i < mPr_POCKETS_SLOT_COUNT; i++) {
|
||||
switch (ITEM_NAME_GET_TYPE(*pockets_p)) {
|
||||
@@ -35,55 +35,53 @@ static int aHWN_get_trick_type(void) {
|
||||
mSP_SelectRandomItem_New(NULL, &new_item, 1, NULL, 0, mSP_KIND_FURNITURE, mSP_LISTTYPE_HALLOWEEN2, FALSE);
|
||||
mPr_SetPossessionItem(Now_Private, idx[RANDOM(count)], new_item, mPr_ITEM_COND_NORMAL);
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_PLAYER, 0, 0xFD); // play trick animation
|
||||
ret = 1;
|
||||
ret = aHWN_TRICK_TYPE_CHG_ITEM;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void aHWN_restart_msg_win(NPC_HALLOWEEN_ACTOR* actorx, int msg_idx) {
|
||||
int msg_data;
|
||||
static void aHWN_restart_msg_win(HALLOWEEN_NPC_ACTOR* actorx, int msg_idx) {
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
int look = mNpc_GetLooks(actorx->npc_class.npc_info.event->npc_id);
|
||||
int looks = mNpc_GetLooks(actorx->npc_class.npc_info.event->npc_id);
|
||||
mMsg_request_main_appear_wait_type1(msg_p);
|
||||
mMsg_ChangeMsgData(msg_p, ((look & 0xFF) * 6 + msg_idx));
|
||||
mMsg_ChangeMsgData(msg_p, msg_idx + looks * 6);
|
||||
mMsg_Set_ForceNext(msg_p);
|
||||
mMsg_Unset_LockContinue(msg_p);
|
||||
}
|
||||
|
||||
static void aHWN_first_call_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
int look = mNpc_GetLooks(actorx->npc_class.npc_info.event->npc_id);
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
mMsg_Set_continue_msg_num(msg_p, ((look & 0xFF) * 6) + 0x98b);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_TRICK_OR_TREAT_TALK_PROC);
|
||||
static void aHWN_first_call_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
int looks = mNpc_GetLooks(actorx->npc_class.npc_info.event->npc_id);
|
||||
mMsg_SET_CONTINUE_MSG_NUM(0x098B + looks * 6);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_TRICK_OR_TREAT_TALK);
|
||||
}
|
||||
|
||||
static void aHWN_trick_or_treat_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_trick_or_treat_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
int talk_proc_idx;
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
int order_value = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
|
||||
if (order_value && mMsg_Check_MainNormalContinue(msg_p) == TRUE) {
|
||||
if (mChoice_GET_CHOSENUM() == 0) {
|
||||
if (mChoice_GET_CHOSENUM() == mChoice_CHOICE0) {
|
||||
mMsg_request_main_disappear_wait_type1(msg_p);
|
||||
talk_proc_idx = aHWN_TALK_MENU_OPEN_WAIT_TALK_PROC;
|
||||
talk_proc_idx = aHWN_TALK_MENU_OPEN_WAIT_TALK;
|
||||
} else {
|
||||
talk_proc_idx = aHWN_TALK_TRICK_TIMING_WAIT_TALK_PROC;
|
||||
talk_proc_idx = aHWN_TALK_TRICK_TIMING_WAIT_TALK;
|
||||
}
|
||||
aHWN_change_talk_proc(actorx, talk_proc_idx);
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_menu_open_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_menu_open_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
mMsg_Window_c* msg_p = mMsg_Get_base_window_p();
|
||||
if (mMsg_Check_main_wait(msg_p) == TRUE) {
|
||||
mSM_open_submenu(&play->submenu, mSM_OVL_INVENTORY, 6, 0);
|
||||
mMsg_Set_LockContinue(msg_p);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_MENU_CLOSE_WAIT_TALK_PROC);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_MENU_CLOSE_WAIT_TALK);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_menu_close_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actor, GAME_PLAY* play) {
|
||||
static void aHWN_menu_close_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
Submenu_Item_c* item_p;
|
||||
int talk_proc_idx;
|
||||
BOOL shouldSetPosessionItem;
|
||||
@@ -95,64 +93,62 @@ static void aHWN_menu_close_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actor, GAME_PLAY
|
||||
item = item_p->item;
|
||||
actor->item = item;
|
||||
if (item == EMPTY_NO) {
|
||||
talk_proc_idx = aHWN_TALK_TRICK_TIMING_WAIT_TALK_PROC;
|
||||
aHWN_restart_msg_win(actor, 0x98c);
|
||||
talk_proc_idx = aHWN_TALK_TRICK_TIMING_WAIT_TALK;
|
||||
aHWN_restart_msg_win(actor, 0x098C);
|
||||
shouldSetPosessionItem = FALSE;
|
||||
} else if (item != ITM_FOOD_CANDY) {
|
||||
if ((item >= ITM_NET && item <= ITM_ROD) || (item >= ITM_GOLDEN_NET && item <= ITM_GOLDEN_ROD)) {
|
||||
shouldSetPosessionItem = FALSE;
|
||||
}
|
||||
talk_proc_idx = aHWN_TALK_GET_OTHER_ITEM_WAIT_TALK_PROC;
|
||||
talk_proc_idx = aHWN_TALK_GET_OTHER_ITEM_WAIT_TALK;
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 1, 3);
|
||||
} else {
|
||||
talk_proc_idx = aHWN_TALK_GET_AME_WAIT_TALK_PROC;
|
||||
aHWN_restart_msg_win(actor, 0x98f);
|
||||
talk_proc_idx = aHWN_TALK_GET_AME_WAIT_TALK;
|
||||
aHWN_restart_msg_win(actor, 0x098F);
|
||||
}
|
||||
if (shouldSetPosessionItem == TRUE) {
|
||||
mPr_SetPossessionItem(Now_Private, item_p->slot_no, 0, 0);
|
||||
mPr_SetPossessionItem(Now_Private, item_p->slot_no, EMPTY_NO, mPr_ITEM_COND_NORMAL);
|
||||
}
|
||||
aHWN_change_talk_proc(actor, talk_proc_idx);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_get_other_item_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_get_other_item_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
mActor_name_t item;
|
||||
int talk_proc_idx;
|
||||
int msg_idx;
|
||||
if (CLIP(handOverItem_clip)->master_actor == 0) {
|
||||
if (CLIP(handOverItem_clip)->master_actor == NULL) {
|
||||
item = actorx->item;
|
||||
talk_proc_idx = aHWN_TALK_TRICK_TIMING_WAIT_TALK_PROC;
|
||||
msg_idx = 0x98e;
|
||||
talk_proc_idx = aHWN_TALK_TRICK_TIMING_WAIT_TALK;
|
||||
msg_idx = 0x098E;
|
||||
if ((item >= ITM_NET && item <= ITM_ROD) || (item >= ITM_GOLDEN_NET && item <= ITM_GOLDEN_ROD)) {
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 1, 0);
|
||||
msg_idx = 0x990;
|
||||
talk_proc_idx = aHWN_TALK_RECEIVE_TOOL_ITEM_START_WAIT_TALK_PROC;
|
||||
msg_idx = 0x0990;
|
||||
talk_proc_idx = aHWN_TALK_RECEIVE_TOOL_ITEM_START_WAIT_TALK;
|
||||
}
|
||||
aHWN_restart_msg_win(actorx, msg_idx);
|
||||
aHWN_change_talk_proc(actorx, talk_proc_idx);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_receive_tool_item_start_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_receive_tool_item_start_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
int OrderValue = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 1);
|
||||
if (OrderValue == 2) {
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 0, actorx->item);
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 1, 7);
|
||||
mDemo_Set_OrderValue(mDemo_ORDER_NPC1, 2, 0);
|
||||
aNPC_DEMO_GIVE_ITEM(actorx->item, aHOI_REQUEST_PUTAWAY, FALSE);
|
||||
mMsg_SET_LOCKCONTINUE();
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_RECEIVE_TOOL_ITEM_END_WAIT_TALK_PROC);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_RECEIVE_TOOL_ITEM_END_WAIT_TALK);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_receive_tool_item_end_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_receive_tool_item_end_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
int OrderValue = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 1);
|
||||
if ((OrderValue == 0) && (CLIP(handOverItem_clip)->master_actor == 0)) {
|
||||
if ((OrderValue == 0) && (CLIP(handOverItem_clip)->master_actor == NULL)) {
|
||||
mMsg_UNSET_LOCKCONTINUE();
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_TRICK_TIMING_WAIT_TALK_PROC);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_TRICK_TIMING_WAIT_TALK);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_trick_timing_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_trick_timing_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
int trick_type;
|
||||
int talk_proc_idx;
|
||||
int OrderValue = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9);
|
||||
@@ -160,9 +156,9 @@ static void aHWN_trick_timing_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_P
|
||||
if (OrderValue != 0) {
|
||||
msg_p = mMsg_Get_base_window_p();
|
||||
trick_type = aHWN_get_trick_type();
|
||||
talk_proc_idx = aHWN_TALK_PL_DEMO_CODE_END_WAIT_TALK_PROC;
|
||||
if (trick_type == 0) {
|
||||
talk_proc_idx = aHWN_TALK_TRICK_CHG_CLOTH_TALK_PROC;
|
||||
talk_proc_idx = aHWN_TALK_PL_DEMO_CODE_END_WAIT_TALK;
|
||||
if (trick_type == aHWN_TRICK_TYPE_CHG_CLOTH) {
|
||||
talk_proc_idx = aHWN_TALK_TRICK_CHG_CLOTH_TALK;
|
||||
}
|
||||
mMsg_Set_LockContinue(msg_p);
|
||||
aHWN_change_talk_proc(actorx, talk_proc_idx);
|
||||
@@ -170,59 +166,61 @@ static void aHWN_trick_timing_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_P
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_trick_chg_cloth_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_trick_chg_cloth_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
int player_actor_main_index = mPlib_get_player_actor_main_index(&play->game);
|
||||
if (player_actor_main_index == mPlayer_INDEX_CHANGE_CLOTH) {
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_TRICK_CHG_CLOTH_END_WAIT_TALK_PROC);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_TRICK_CHG_CLOTH_END_WAIT_TALK);
|
||||
} else {
|
||||
mPlib_request_main_change_cloth_forNPC_type1(&play->game, ITM_CLOTH017, 0x11, 0);
|
||||
mPlib_request_main_change_cloth_forNPC_type1(&play->game, ITM_CLOTH017, 17, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_trick_chg_cloth_end_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_trick_chg_cloth_end_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
mMsg_Window_c* msg_p;
|
||||
int looks;
|
||||
int player_actor_main_index = mPlib_get_player_actor_main_index(&play->game);
|
||||
|
||||
if (player_actor_main_index != mPlayer_INDEX_CHANGE_CLOTH) {
|
||||
msg_p = mMsg_Get_base_window_p();
|
||||
looks = mNpc_GetLooks(actorx->npc_class.npc_info.event->npc_id);
|
||||
mMsg_Unset_LockContinue(msg_p);
|
||||
mMsg_Set_ForceNext(msg_p);
|
||||
mMsg_ChangeMsgData(msg_p, (looks * 6 + 0x98d));
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_NONE_PROC1);
|
||||
mMsg_ChangeMsgData(msg_p, 0x098D + looks * 6);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_END_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_get_ame_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_get_ame_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
int OrderValue = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 1);
|
||||
if ((OrderValue == 3) && (CLIP(handOverItem_clip)->master_actor != 0)) {
|
||||
if ((OrderValue == 3) && (CLIP(handOverItem_clip)->master_actor != NULL)) {
|
||||
mMsg_SET_LOCKCONTINUE();
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_GET_AME_TALK_PROC);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_GET_AME_TALK);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_get_ame_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_get_ame_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
if (CLIP(handOverItem_clip)->master_actor == 0) {
|
||||
mMsg_UNSET_LOCKCONTINUE();
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_NONE_PROC1);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_END_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_pl_demo_code_end_wait_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aHWN_pl_demo_code_end_wait_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, GAME_PLAY* play) {
|
||||
mMsg_Window_c* msg_p;
|
||||
int look;
|
||||
int OrderValue = mDemo_Get_OrderValue(mDemo_ORDER_PLAYER, 0);
|
||||
if (OrderValue == 0) {
|
||||
int looks;
|
||||
int order = mDemo_Get_OrderValue(mDemo_ORDER_PLAYER, 0);
|
||||
|
||||
if (order == 0) {
|
||||
msg_p = mMsg_Get_base_window_p();
|
||||
look = mNpc_GetLooks(actorx->npc_class.npc_info.event->npc_id);
|
||||
looks = mNpc_GetLooks(actorx->npc_class.npc_info.event->npc_id);
|
||||
mMsg_Unset_LockContinue(msg_p);
|
||||
mMsg_Set_ForceNext(msg_p);
|
||||
mMsg_ChangeMsgData(msg_p, ((look & 0xFF) * 6 + 0x98d));
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_NONE_PROC1);
|
||||
mMsg_ChangeMsgData(msg_p, 0x098D + looks * 6);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_END_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_change_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, int talk_proc_idx) {
|
||||
static void aHWN_change_talk_proc(HALLOWEEN_NPC_ACTOR* actorx, int talk_proc_idx) {
|
||||
// clang-format off
|
||||
static aHWN_TALK_PROC talk_proc[] = {
|
||||
&aHWN_first_call_talk_proc,
|
||||
@@ -245,9 +243,11 @@ static void aHWN_change_talk_proc(NPC_HALLOWEEN_ACTOR* actorx, int talk_proc_idx
|
||||
}
|
||||
|
||||
static void aHWN_set_force_talk_info(ACTOR* actorx) {
|
||||
mDemo_Set_msg_num(0x98a);
|
||||
mDemo_Set_talk_turn(1);
|
||||
aHWN_change_talk_proc((NPC_HALLOWEEN_ACTOR*)actorx, aHWN_TALK_FIRST_CALL_TALK_PROC);
|
||||
HALLOWEEN_NPC_ACTOR* hwn_actor = (HALLOWEEN_NPC_ACTOR*)actorx;
|
||||
|
||||
mDemo_Set_msg_num(0x098A);
|
||||
mDemo_Set_talk_turn(TRUE);
|
||||
aHWN_change_talk_proc(hwn_actor, aHWN_TALK_FIRST_CALL_TALK);
|
||||
}
|
||||
|
||||
static void aHWN_force_talk_request(ACTOR* actorx, GAME* game) {
|
||||
@@ -270,32 +270,35 @@ static void aHWN_force_talk_request(ACTOR* actorx, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
static void aHWN_set_norm_talk_info(NPC_HALLOWEEN_ACTOR* actorx) {
|
||||
static void aHWN_set_norm_talk_info(HALLOWEEN_NPC_ACTOR* actorx) {
|
||||
int looks = mNpc_GetLooks(actorx->npc_class.npc_info.event->npc_id);
|
||||
mDemo_Set_msg_num((looks & 0xFF) + 0x9af);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_NONE_PROC1);
|
||||
|
||||
mDemo_Set_msg_num(0x09AF + looks);
|
||||
aHWN_change_talk_proc(actorx, aHWN_TALK_END_WAIT);
|
||||
}
|
||||
|
||||
static void aHWN_norm_talk_request(NPC_HALLOWEEN_ACTOR* actorx) {
|
||||
mDemo_Request(mDemo_TYPE_TALK, &actorx->npc_class.actor_class, (mDemo_REQUEST_PROC)aHWN_set_norm_talk_info);
|
||||
static void aHWN_norm_talk_request(ACTOR* actorx, GAME* game) {
|
||||
mDemo_Request(mDemo_TYPE_TALK, actorx, (mDemo_REQUEST_PROC)aHWN_set_norm_talk_info);
|
||||
}
|
||||
|
||||
static int aHWN_talk_init() {
|
||||
mDemo_Set_ListenAble();
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL aHWN_talk_end_chk(ACTOR* actorx, GAME* game) {
|
||||
HALLOWEEN_NPC_ACTOR* hwn_actor = (HALLOWEEN_NPC_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
BOOL res = FALSE;
|
||||
NPC_HALLOWEEN_ACTOR* hwn_actor = (NPC_HALLOWEEN_ACTOR*)actorx;
|
||||
hwn_actor->talk_proc((NPC_HALLOWEEN_ACTOR*)actorx, (GAME_PLAY*)game);
|
||||
if ((mDemo_Check(mDemo_TYPE_SPEAK, &hwn_actor->npc_class.actor_class) == FALSE) &&
|
||||
(mDemo_Check(mDemo_TYPE_TALK, &hwn_actor->npc_class.actor_class) == FALSE)) {
|
||||
|
||||
hwn_actor->talk_proc(hwn_actor, play);
|
||||
if ((mDemo_Check(mDemo_TYPE_SPEAK, actorx) == FALSE) &&
|
||||
(mDemo_Check(mDemo_TYPE_TALK, actorx) == FALSE)) {
|
||||
if (hwn_actor->npc_class.schedule.step == 1) {
|
||||
hwn_actor->npc_class.think.end_flag = TRUE;
|
||||
}
|
||||
res = TRUE;
|
||||
hwn_actor->npc_class.talk_info.talk_request_proc = (aNPC_TALK_REQUEST_PROC)aHWN_norm_talk_request;
|
||||
hwn_actor->npc_class.talk_info.talk_request_proc = aHWN_norm_talk_request;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -5032,3 +5032,505 @@ static int mCD_InitGameStart_write_passport(mCD_memMgr_c* mgr, mCD_memMgr_fileIn
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mCD_InitGameStart_bg_write_bk(mCD_memMgr_c* mgr, mCD_memMgr_fileInfo_c* fileInfo) {
|
||||
Private_c* priv = Now_Private;
|
||||
int ret = mCD_write_common(mgr);
|
||||
|
||||
if (mgr->loaded_file_type == mCD_FILE_SAVE_MAIN) {
|
||||
if (ret != mCD_RESULT_BUSY) {
|
||||
mCD_memMgr_card_info_c* card;
|
||||
|
||||
mgr->chan = ~mgr->chan & 1;
|
||||
card = &mgr->cards[mgr->chan];
|
||||
card->game_result = fileInfo->game_result;
|
||||
if (mgr->copy_protect != -1) {
|
||||
Common_Set(copy_protect, mgr->copy_protect);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ret == mCD_RESULT_SUCCESS) {
|
||||
fileInfo->proc++;
|
||||
if (Common_Get(player_decoy_flag) == TRUE && priv != NULL && !mPr_NullCheckPersonalID(&priv->player_ID)) {
|
||||
priv->exists = TRUE;
|
||||
priv->equipment = EMPTY_NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern int mCD_InitGameStart_bg(int player_no, int card_private_idx, int start_cond, s32* mounted_chan) {
|
||||
// clang-format off
|
||||
static mCD_SAVEHOME_PROC start_proc[] = {
|
||||
mCD_InitGameStart_bg_get_area,
|
||||
mCD_InitGameStart_bg_get_slot,
|
||||
mCD_InitGameStart_bg_check_repair_land,
|
||||
mCD_SaveHome_bg_repair_land,
|
||||
mCD_InitGameStart_bg_make_data,
|
||||
mCD_InitGameStart_bg_set_data,
|
||||
mCD_InitGameStart_bg_write_main,
|
||||
mCD_InitGameStart_erase_passport,
|
||||
mCD_InitGameStart_write_passport,
|
||||
mCD_InitGameStart_bg_write_bk,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
mCD_memMgr_c* mgr = &l_memMgr;
|
||||
mCD_memMgr_fileInfo_c* fileInfo = &l_memMgr.init_game_start_info;
|
||||
mCD_memMgr_card_info_c* card;
|
||||
u8 proc = fileInfo->proc;
|
||||
int res;
|
||||
int ret = mCD_TRANS_ERR_BUSY;
|
||||
|
||||
mgr->_0188++;
|
||||
if (mgr->_018C == 0) {
|
||||
if (proc < 10) {
|
||||
fileInfo->_04 = player_no;
|
||||
fileInfo->fileNo = card_private_idx;
|
||||
fileInfo->chan = start_cond;
|
||||
res = (*start_proc[proc])(mgr, fileInfo);
|
||||
|
||||
if (res == mCD_RESULT_SUCCESS) {
|
||||
if (fileInfo->proc == 10) {
|
||||
*mounted_chan = mgr->chan;
|
||||
ret = mCD_TRANS_ERR_NONE;
|
||||
}
|
||||
} else if (res != mCD_RESULT_BUSY) {
|
||||
if (mgr->_01A0 == 1) {
|
||||
*mounted_chan = mgr->chan;
|
||||
mgr->copy_protect = -1;
|
||||
ret = mCD_TRANS_ERR_NONE;
|
||||
} else if (mgr->chan == mCD_SLOT_A || mgr->chan == mCD_SLOT_B) {
|
||||
*mounted_chan = mgr->chan;
|
||||
card = &mgr->cards[mgr->chan];
|
||||
ret = card->game_result;
|
||||
if (ret == mCD_TRANS_ERR_NONE) {
|
||||
ret = mCD_TRANS_ERR_IOERROR;
|
||||
}
|
||||
|
||||
bzero(Common_Get(npclist), sizeof(Common_Get(npclist)));
|
||||
bzero(Common_Get(island_npclist), sizeof(Common_Get(island_npclist)));
|
||||
bzero(Common_Get(npc_schedule), sizeof(Common_Get(npc_schedule)));
|
||||
} else {
|
||||
ret = mCD_TRANS_ERR_IOERROR;
|
||||
}
|
||||
|
||||
if (mgr->copy_protect != -1 && fileInfo->proc <= 8) {
|
||||
Common_Set(copy_protect, mgr->copy_protect);
|
||||
}
|
||||
}
|
||||
|
||||
if (res == mCD_RESULT_ERROR || (res == mCD_RESULT_SUCCESS && fileInfo->proc == 10)) {
|
||||
if (fileInfo->_10 == 2) {
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
mCD_load_famicom_file();
|
||||
} else if (mgr->_0188 >= 112) {
|
||||
sAdo_SysLevStop(NA_SE_47);
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
if (res == mCD_RESULT_SUCCESS) {
|
||||
mCD_load_famicom_file();
|
||||
}
|
||||
} else {
|
||||
mgr->_0190 = ret;
|
||||
mgr->_018C = 1;
|
||||
mgr->_0194 = *mounted_chan;
|
||||
ret = mCD_TRANS_ERR_BUSY;
|
||||
if (mgr->_0190 == mCD_TRANS_ERR_BUSY) {
|
||||
mgr->_0190 = mCD_TRANS_ERR_NOCARD;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ret = mCD_TRANS_ERR_NONE;
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
}
|
||||
} else if (mgr->_0188 >= 112) {
|
||||
ret = mgr->_0190;
|
||||
*mounted_chan = mgr->_0194;
|
||||
sAdo_SysLevStop(NA_SE_47);
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
if (ret == mCD_TRANS_ERR_NONE) {
|
||||
mCD_load_famicom_file();
|
||||
}
|
||||
}
|
||||
|
||||
ret = mCD_GameStart_ChangeErrCode(ret);
|
||||
if (ret != mCD_TRANS_ERR_BUSY) {
|
||||
SoftResetEnable = TRUE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mCD_SaveHome_bg_write_main(mCD_memMgr_c* mgr, mCD_memMgr_fileInfo_c* fileInfo) {
|
||||
int ret = mCD_write_common(mgr);
|
||||
|
||||
if (ret == mCD_RESULT_SUCCESS) {
|
||||
mgr->loaded_file_type = mCD_FILE_SAVE_MAIN_BAK;
|
||||
fileInfo->proc++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mCD_SaveErasePlayer_bg_write_bk(mCD_memMgr_c* mgr, mCD_memMgr_fileInfo_c* fileInfo) {
|
||||
int ret = mCD_write_common(mgr);
|
||||
|
||||
if (ret == mCD_RESULT_SUCCESS) {
|
||||
fileInfo->proc++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern int mCD_SaveErasePlayer_bg(int* mounted_chan) {
|
||||
// clang-format off
|
||||
static mCD_SAVEHOME_PROC start_proc[] = {
|
||||
mCD_EraseLand_bg_get_area,
|
||||
mCD_EraseLand_bg_get_slot,
|
||||
mCD_InitGameStart_bg_set_data,
|
||||
mCD_SaveHome_bg_write_main,
|
||||
mCD_SaveErasePlayer_bg_write_bk,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
mCD_memMgr_c* mgr = &l_memMgr;
|
||||
mCD_memMgr_fileInfo_c* fileInfo = &l_memMgr.init_game_start_info;
|
||||
mCD_memMgr_card_info_c* card;
|
||||
u8 proc = fileInfo->proc;
|
||||
int res;
|
||||
int ret = mCD_TRANS_ERR_BUSY;
|
||||
|
||||
mgr->_0188++;
|
||||
if (mgr->_018C == 0) {
|
||||
if (proc < 5) {
|
||||
res = (*start_proc[proc])(mgr, fileInfo);
|
||||
|
||||
if (res == mCD_RESULT_SUCCESS) {
|
||||
if (fileInfo->proc == 5) {
|
||||
*mounted_chan = mgr->chan;
|
||||
ret = mCD_TRANS_ERR_NONE;
|
||||
}
|
||||
} else if (res != mCD_RESULT_BUSY) {
|
||||
if (mgr->chan == mCD_SLOT_A || mgr->chan == mCD_SLOT_B) {
|
||||
*mounted_chan = mgr->chan;
|
||||
card = &mgr->cards[mgr->chan];
|
||||
ret = card->game_result;
|
||||
} else {
|
||||
ret = mCD_TRANS_ERR_NOCARD;
|
||||
}
|
||||
}
|
||||
|
||||
if (res == mCD_RESULT_ERROR || (res == mCD_RESULT_SUCCESS && fileInfo->proc == 5)) {
|
||||
if (mgr->_0188 >= 112) {
|
||||
sAdo_SysLevStop(NA_SE_53);
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
} else {
|
||||
mgr->_0190 = ret;
|
||||
mgr->_018C = 1;
|
||||
mgr->_0194 = *mounted_chan;
|
||||
ret = mCD_TRANS_ERR_BUSY;
|
||||
if (mgr->_0190 == mCD_TRANS_ERR_BUSY) {
|
||||
mgr->_0190 = mCD_TRANS_ERR_NOCARD;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ret = mCD_TRANS_ERR_IOERROR;
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
}
|
||||
} else if (mgr->_0188 >= 112) {
|
||||
ret = mgr->_0190;
|
||||
*mounted_chan = mgr->_0194;
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
sAdo_SysLevStop(NA_SE_53);
|
||||
}
|
||||
|
||||
ret = mCD_GameStart_ChangeErrCode(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern int mCD_GetPlayerNum(void) {
|
||||
mCD_memMgr_c* mgr = &l_memMgr;
|
||||
mCD_cardPrivate_c* card_priv = l_mcd_card_private_table;
|
||||
s32 chan;
|
||||
mCD_memMgr_card_info_c* card;
|
||||
CARDStat* stat;
|
||||
ForeignerFile_c* foreigner;
|
||||
Private_c* priv;
|
||||
CARDFileInfo cFileInfo;
|
||||
int player_num = -1;
|
||||
int count = 0;
|
||||
int i;
|
||||
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
mgr->workArea = mCD_malloc_32(CARD_WORKAREA_SIZE);
|
||||
if (mgr->workArea != NULL && mCD_get_this_land_slot_no(mgr) == mCD_RESULT_SUCCESS && mgr->chan != -1) {
|
||||
mCD_ClearCardPrivateTable_com(card_priv, ARRAY_COUNT(l_mcd_card_private_table));
|
||||
|
||||
chan = ~mgr->chan & 1;
|
||||
card = &mgr->cards[chan];
|
||||
stat = &card->stat;
|
||||
card->workArea = mCD_malloc_32(CARD_WORKAREA_SIZE);
|
||||
if (card->workArea != NULL && mCD_check_card(&card->result, mCD_MEMCARD_SECTORSIZE, chan) == mCD_RESULT_SUCCESS) {
|
||||
card->result = CARDMount(chan, card->workArea, NULL);
|
||||
|
||||
if (card->result == CARD_RESULT_READY || card->result == CARD_RESULT_BROKEN) {
|
||||
card->result = CARDCheck(chan);
|
||||
|
||||
if (card->result == CARD_RESULT_READY) {
|
||||
for (i = 0; i < CARD_MAX_FILE; i++) {
|
||||
bzero(mgr->workArea, CARD_WORKAREA_SIZE);
|
||||
card->result = CARDGetStatus(chan, i, stat);
|
||||
if (card->result == CARD_RESULT_READY && mCD_CheckPassportFileStatus(stat) == TRUE) {
|
||||
card->result = CARDOpen(chan, stat->fileName, &cFileInfo);
|
||||
if (card->result == CARD_RESULT_READY) {
|
||||
card->result = CARDRead(&cFileInfo, mgr->workArea, sizeof(ForeignerFile_c), 0);
|
||||
|
||||
if (card->result == CARD_RESULT_READY) {
|
||||
u16 checksum;
|
||||
|
||||
foreigner = (ForeignerFile_c*)mgr->workArea;
|
||||
checksum = mFRm_ReturnCheckSum((u16*)&foreigner->file, sizeof(foreigner->file));
|
||||
priv = &foreigner->file.priv;
|
||||
if (checksum == 0 && !mPr_NullCheckPersonalID(&priv->player_ID)) {
|
||||
mCD_SetCardPrivateTable(card_priv, &foreigner->file.priv.player_ID, stat->fileName);
|
||||
count++;
|
||||
card_priv++;
|
||||
|
||||
if (count >= (u32)ARRAY_COUNT(l_mcd_card_private_table)) {
|
||||
CARDClose(&cFileInfo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CARDClose(&cFileInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CARDUnmount(chan);
|
||||
} else if (card->result == CARD_RESULT_ENCODING) {
|
||||
CARDUnmount(chan);
|
||||
}
|
||||
}
|
||||
|
||||
player_num = count;
|
||||
}
|
||||
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
return player_num;
|
||||
}
|
||||
|
||||
extern int mCD_GetCardPrivateNameCopy(u8* dst, int idx) {
|
||||
int ret = FALSE;
|
||||
|
||||
if (dst != NULL && idx >= 0 && idx < ARRAY_SIZE(l_mcd_card_private_table, mCD_cardPrivate_c)) {
|
||||
bcopy(l_mcd_card_private_table[idx].pid.player_name, dst, sizeof(l_mcd_card_private_table[idx].pid.player_name));
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern int mCD_CheckCardPlayerNative(int idx) {
|
||||
mCD_cardPrivate_c* card_priv;
|
||||
Private_c* priv = Save_Get(private_data);
|
||||
int ret = -1;
|
||||
int i;
|
||||
|
||||
if (idx >= 0 && idx < ARRAY_SIZE(l_mcd_card_private_table, mCD_cardPrivate_c)) {
|
||||
card_priv = &l_mcd_card_private_table[idx];
|
||||
if (!mPr_NullCheckPersonalID(&card_priv->pid)) {
|
||||
for (i = 0; i < PLAYER_NUM; i++) {
|
||||
if (mPr_CheckCmpPersonalID(&card_priv->pid, &priv->player_ID) == TRUE) {
|
||||
ret = i;
|
||||
break;
|
||||
}
|
||||
|
||||
priv++;
|
||||
}
|
||||
|
||||
if (i == PLAYER_NUM) {
|
||||
ret = mPr_FOREIGNER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern int mCD_GetThisLandSlotNo(void) {
|
||||
mCD_memMgr_c* mgr = &l_memMgr;
|
||||
mCD_memMgr_fileInfo_c* fileInfo = &mgr->save_home_info;
|
||||
int ret = -1;
|
||||
|
||||
if (mCD_bg_get_area_common(mgr, fileInfo, mCD_FILE_SAVE_MAIN, 2) == mCD_RESULT_SUCCESS) {
|
||||
if (mCD_get_this_land_slot_no(mgr) == mCD_RESULT_SUCCESS) {
|
||||
ret = mgr->chan;
|
||||
}
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern int mCD_GetSaveHomeSlotNo(void) {
|
||||
int state;
|
||||
mCD_memMgr_c* mgr = &l_memMgr;
|
||||
mCD_memMgr_fileInfo_c* fileInfo = &mgr->save_home_info;
|
||||
int ret = -1;
|
||||
|
||||
if (Save_Get(save_exist) == FALSE) {
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
|
||||
if (mCD_bg_get_area_common(mgr, fileInfo, mCD_FILE_SAVE_MAIN, 2) == mCD_RESULT_SUCCESS) {
|
||||
if (mgr->cards[mCD_SLOT_A].workArea != NULL && mgr->cards[mCD_SLOT_B].workArea != NULL && mgr->workArea != NULL) {
|
||||
state = mCD_RESULT_BUSY;
|
||||
|
||||
if (mCD_CheckInitProtectCode(&l_keep_noLandCode) == FALSE && mCD_CheckProtectCode(l_keep_noLandCode.code) == TRUE) {
|
||||
while (state == mCD_RESULT_BUSY) {
|
||||
state = mCD_GetNoLandSlot_bg(mgr);
|
||||
}
|
||||
|
||||
if (state == mCD_RESULT_SUCCESS) {
|
||||
ret = mgr->chan;
|
||||
}
|
||||
} else {
|
||||
while (state == mCD_RESULT_BUSY) {
|
||||
state = mCD_GetSpaceSlot_bg2(mgr, mCD_LAND_SAVE_SIZE);
|
||||
}
|
||||
|
||||
if (state == mCD_RESULT_SUCCESS) {
|
||||
ret = mgr->chan;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
} else {
|
||||
ret = mCD_GetThisLandSlotNo();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mCD_GetLandSlotNo_code_com(mLd_land_info_c* land_info, u16 land_id, PersonalID_c* pid, int* player_no, s32* slot_results) {
|
||||
mCD_memMgr_c* mgr = &l_memMgr;
|
||||
mCD_memMgr_fileInfo_c* fileInfo = &l_memMgr.save_home_info;
|
||||
int res;
|
||||
s32 result;
|
||||
int ret = mCD_RESULT_ERROR;
|
||||
Private_c* priv;
|
||||
mLd_land_info_c* save_land_info;
|
||||
Save_t* save;
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
|
||||
if (player_no != NULL) {
|
||||
*player_no = -1;
|
||||
}
|
||||
|
||||
if (slot_results != NULL) {
|
||||
slot_results[mCD_SLOT_A] = CARD_RESULT_NOCARD;
|
||||
slot_results[mCD_SLOT_B] = CARD_RESULT_NOCARD;
|
||||
}
|
||||
|
||||
res = mCD_bg_get_area_common(mgr, fileInfo, mCD_FILE_SAVE_MAIN, 2);
|
||||
save = (Save_t*)mgr->workArea;
|
||||
if (res == mCD_RESULT_SUCCESS) {
|
||||
for (i = 0; i < mCD_SLOT_NUM; i++) {
|
||||
result = CARD_RESULT_NOCARD;
|
||||
|
||||
if (mCD_check_sector_size(mCD_MEMCARD_SECTORSIZE, i) == FALSE) {
|
||||
if (slot_results != NULL) {
|
||||
slot_results[i] = CARD_RESULT_WRONGDEVICE;
|
||||
}
|
||||
} else {
|
||||
for (j = 0; j < 2; j++) {
|
||||
mgr->loaded_file_type = mCD_FILE_SAVE_MAIN + j;
|
||||
mgr->workArea_size = mCD_get_size(mgr->loaded_file_type);
|
||||
bzero(save, mgr->workArea_size);
|
||||
res = mCD_load_file(save, mgr->loaded_file_type, i, &result);
|
||||
|
||||
if (slot_results != NULL) {
|
||||
slot_results[i] = result;
|
||||
}
|
||||
|
||||
if (res == mCD_RESULT_SUCCESS) {
|
||||
save_land_info = &save->land_info;
|
||||
if (mFRm_CheckSaveData_common(&save->save_check, save_land_info->id) && mLd_CheckCmpLand(save_land_info->name, save_land_info->id, land_info->name, land_id) == TRUE) {
|
||||
if (player_no != NULL) {
|
||||
priv = save->private_data;
|
||||
for (k = 0; k < PLAYER_NUM; k++) {
|
||||
if (mPr_CheckCmpPersonalID(pid, &priv->player_ID) == TRUE) {
|
||||
*player_no = k;
|
||||
break;
|
||||
}
|
||||
|
||||
priv++;
|
||||
}
|
||||
}
|
||||
|
||||
ret = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ret != -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mCD_ClearMemMgr_com2(mgr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern int mCD_GetThisLandSlotNo_code(int* player_no, s32* slot_card_results) {
|
||||
mLd_land_info_c* info = Save_GetPointer(land_info);
|
||||
int ret = -1;
|
||||
|
||||
if (player_no != NULL) {
|
||||
*player_no = -1;
|
||||
}
|
||||
|
||||
if (slot_card_results != NULL) {
|
||||
slot_card_results[mCD_SLOT_A] = CARD_RESULT_NOCARD;
|
||||
slot_card_results[mCD_SLOT_B] = CARD_RESULT_NOCARD;
|
||||
}
|
||||
|
||||
if (Now_Private != NULL) {
|
||||
ret = mCD_GetLandSlotNo_code_com(info, info->id, &Now_Private->player_ID, player_no, slot_card_results);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern void mCD_toNextLand(void) {
|
||||
mCD_persistent_data_c persis;
|
||||
int scene_no = Save_Get(scene_no);
|
||||
Save_t* save = &l_keepSave.save;
|
||||
mLd_land_info_c* land_info = &save->land_info;
|
||||
mActor_name_t last_field_id;
|
||||
int last_scene_no;
|
||||
s16* demo_profiles_p;
|
||||
s16 demo_profile[2];
|
||||
Time_c time;
|
||||
Transition_c transition;
|
||||
|
||||
if (l_keepSave_set == TRUE && mLd_CheckId(land_info->id) == TRUE && mFRm_ReturnCheckSum((u16*)save, sizeof(Save)) == 0) {
|
||||
bcopy(Common_GetPointer(travel_persistent_data), &persis, sizeof(persis));
|
||||
last_field_id = Common_Get(last_field_id);
|
||||
last_scene_no = Common_Get(last_scene_no);
|
||||
demo_profiles_p = Common_Get(demo_profiles);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user