mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-08-03 16:31:58 -04:00
120 lines
5.0 KiB
Plaintext
120 lines
5.0 KiB
Plaintext
static int Player_actor_request_main_give_wait_all(GAME* game, ACTOR* talk_actor_p, int turn_flag, int ret_main_index,
|
|
mActor_name_t item, int surface_flag, int priority) {
|
|
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_GIVE_WAIT, priority)) {
|
|
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
|
mPlayer_request_give_wait_c* req_give_wait_p = &player->requested_main_index_data.give_wait;
|
|
|
|
Player_actor_request_main_index(game, mPlayer_INDEX_GIVE_WAIT, priority);
|
|
req_give_wait_p->talk_actor = talk_actor_p;
|
|
req_give_wait_p->turn_flag = turn_flag;
|
|
req_give_wait_p->prev_main_index = ret_main_index;
|
|
req_give_wait_p->item = item;
|
|
req_give_wait_p->on_surface_flag = surface_flag;
|
|
return TRUE;
|
|
}
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
static void Player_actor_setup_main_Give_wait(ACTOR* actorx, GAME* game) {
|
|
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
|
mPlayer_request_give_wait_c* req_give_wait_p = &player->requested_main_index_data.give_wait;
|
|
mPlayer_main_give_wait_c* main_give_wait_p = &player->main_data.give_wait;
|
|
mActor_name_t item;
|
|
int anim0_idx;
|
|
int anim1_idx;
|
|
int part_table_idx;
|
|
|
|
item = req_give_wait_p->item;
|
|
|
|
main_give_wait_p->talk_actor_p = req_give_wait_p->talk_actor;
|
|
main_give_wait_p->turn_flag = req_give_wait_p->turn_flag;
|
|
main_give_wait_p->ret_main_index = req_give_wait_p->prev_main_index;
|
|
main_give_wait_p->surface_flag = req_give_wait_p->on_surface_flag;
|
|
|
|
if (Player_actor_check_item_is_fish(item)) {
|
|
anim0_idx = mPlayer_ANIM_TRANS_WAIT_F1;
|
|
} else if (main_give_wait_p->surface_flag) {
|
|
anim0_idx = mPlayer_ANIM_WAIT1;
|
|
} else {
|
|
anim0_idx = mPlayer_ANIM_TRANS_WAIT1;
|
|
}
|
|
|
|
Player_actor_SetupItem_Base1(actorx, anim0_idx, -5.0f, &anim1_idx, &part_table_idx);
|
|
Player_actor_InitAnimation_Base1(actorx, game, anim0_idx, anim1_idx, 1.0f, 1.0f, 0.5f, -5.0f, part_table_idx);
|
|
Player_actor_setup_main_Base(actorx, game);
|
|
Player_actor_CHange_TradingItemMode(actorx, aHOI_REQUEST_TRANS_WAIT);
|
|
|
|
/* Handing items over a surface (like the mail counter), item does not need to be attached to player's hand */
|
|
if (main_give_wait_p->surface_flag == FALSE) {
|
|
Player_actor_Set_item_matrix_set(actorx);
|
|
}
|
|
}
|
|
|
|
static void Player_actor_settle_main_Give_wait(ACTOR* actorx, GAME* game) {
|
|
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
|
mPlayer_main_give_wait_c* main_give_wait_p = &player->main_data.give_wait;
|
|
|
|
/* Handing items over a surface (like the mail counter), item does not need to be attached to player's hand */
|
|
if (main_give_wait_p->surface_flag == FALSE) {
|
|
Player_actor_Unset_item_matrix_set(actorx);
|
|
}
|
|
}
|
|
|
|
static void Player_actor_Movement_Give_wait(ACTOR* actorx) {
|
|
Player_actor_Movement_Base_Stop(actorx, FALSE);
|
|
}
|
|
|
|
static int Player_actor_CulcAnimation_Give_wait(ACTOR* actorx) {
|
|
f32 dummy;
|
|
|
|
return Player_actor_CulcAnimation_Base2(actorx, &dummy);
|
|
}
|
|
|
|
static void Player_actor_ObjCheck_Give_wait(ACTOR* actorx, GAME* game) {
|
|
Player_actor_Excute_Corect_forStand(actorx, game);
|
|
}
|
|
|
|
static void Player_actor_Set_item_matrix_set_Give_wait(ACTOR* actorx) {
|
|
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
|
mPlayer_main_give_wait_c* main_give_wait_p = &player->main_data.give_wait;
|
|
|
|
/* Handing items over a surface (like the mail counter), item does not need to be attached to player's hand */
|
|
if (main_give_wait_p->surface_flag == FALSE) {
|
|
Player_actor_Set_item_matrix_set(actorx);
|
|
}
|
|
}
|
|
|
|
static void Player_actor_request_proc_index_fromGive_wait(ACTOR* actorx, GAME* game) {
|
|
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
|
|
|
if (Player_actor_Check_ItemParent(actorx) == FALSE) {
|
|
mPlayer_main_give_wait_c* main_give_wait_p = &player->main_data.give_wait;
|
|
int ret_main_index = main_give_wait_p->ret_main_index;
|
|
|
|
Player_actor_SettleRequestMainIndexPriority(actorx);
|
|
|
|
if (ret_main_index != mPlayer_INDEX_TALK) {
|
|
Player_actor_request_main_demo_wait_all(game, FALSE, 0, mPlayer_REQUEST_PRIORITY_19);
|
|
} else {
|
|
ACTOR* talk_actor_p = main_give_wait_p->talk_actor_p;
|
|
int turn_flag = main_give_wait_p->turn_flag;
|
|
Player_actor_request_main_talk_all(game, talk_actor_p, turn_flag, -12.0f, FALSE,
|
|
mPlayer_REQUEST_PRIORITY_19);
|
|
}
|
|
}
|
|
}
|
|
|
|
static void Player_actor_main_Give_wait(ACTOR* actorx, GAME* game) {
|
|
Player_actor_Movement_Give_wait(actorx);
|
|
Player_actor_Reinput_force_position_angle(actorx, game);
|
|
Player_actor_CulcAnimation_Give_wait(actorx);
|
|
Player_actor_recover_lean_angle(actorx);
|
|
Player_actor_set_eye_pattern_normal(actorx);
|
|
Player_actor_ObjCheck_Give_wait(actorx, game);
|
|
Player_actor_BGcheck_Wait(actorx);
|
|
Player_actor_Set_item_matrix_set_Give_wait(actorx);
|
|
Player_actor_Item_main(actorx, game);
|
|
Player_actor_request_proc_index_fromGive_wait(actorx, game);
|
|
}
|