mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-02 18:46:03 -04:00
match m_player_main_fall
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
static int Player_actor_request_main_fall_all(GAME* game, int flags, int prio, f32 speed) {
|
||||
PLAYER_ACTOR* player;
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_FALL, prio)) {
|
||||
player = GET_PLAYER_ACTOR_GAME(game);
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_FALL, prio);
|
||||
|
||||
player->requested_main_index_data.fall.morph_speed = speed;
|
||||
|
||||
player->requested_main_index_data.fall.flags = flags;
|
||||
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Fall(ACTOR* actor, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
int anim_idx;
|
||||
int part_table_idx;
|
||||
|
||||
f32 speed = player->requested_main_index_data.fall.morph_speed;
|
||||
|
||||
int flags = player->requested_main_index_data.fall.flags;
|
||||
|
||||
Player_actor_SetupItem_Base1(actor, mPlayer_ANIM_WAIT1, -5.0f, &anim_idx, &part_table_idx);
|
||||
Player_actor_InitAnimation_Base1(actor, game, mPlayer_ANIM_WAIT1, anim_idx, 1.0f, 1.0f, 0.5f, speed,
|
||||
part_table_idx);
|
||||
|
||||
if (flags & 1) {
|
||||
actor->position_speed.y = 0.0f;
|
||||
}
|
||||
|
||||
Player_actor_setup_main_Base(actor, game);
|
||||
}
|
||||
|
||||
static int Player_actor_CulcAnimation_Fall(ACTOR* actor) {
|
||||
f32 frame_calc;
|
||||
return Player_actor_CulcAnimation_Base2(actor, &frame_calc);
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Fall(ACTOR* actor) {
|
||||
Player_actor_Movement_Base_Braking(actor);
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Fall(ACTOR* actor, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actor, game);
|
||||
}
|
||||
|
||||
static void Player_actor_BGcheck_Fall(ACTOR* actor) {
|
||||
Player_actor_BGcheck_common_type1(actor);
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromFall_common(ACTOR* actor, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
s8 kind;
|
||||
s8 player_kind;
|
||||
|
||||
if (actor->bg_collision_check.result.on_ground) {
|
||||
Player_actor_request_main_walk_all(game, NULL, -5.0f, 4, mPlayer_REQUEST_PRIORITY_1);
|
||||
}
|
||||
kind = player->item_kind;
|
||||
player_kind = Player_actor_Get_ItemKind(actor, player->now_main_index);
|
||||
|
||||
if (kind != player_kind) {
|
||||
Player_actor_request_main_fall_all(game, 0.0f, 1, mPlayer_REQUEST_PRIORITY_0);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromFall(ACTOR* actor, GAME* game) {
|
||||
Player_actor_request_proc_index_fromFall_common(actor, game);
|
||||
}
|
||||
|
||||
static void Player_actor_main_Fall(ACTOR* actor, GAME* game) {
|
||||
Player_actor_Movement_Fall(actor);
|
||||
Player_actor_Reinput_force_position_angle(actor, game);
|
||||
Player_actor_CulcAnimation_Fall(actor);
|
||||
Player_actor_recover_lean_angle(actor);
|
||||
Player_actor_set_eye_pattern_normal(actor);
|
||||
Player_actor_ObjCheck_Fall(actor, game);
|
||||
Player_actor_BGcheck_Fall(actor);
|
||||
Player_actor_Item_main(actor, game);
|
||||
Player_actor_request_proc_index_fromFall(actor, game);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user