mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-08-11 02:53:19 -04:00
Implement even more player states
This commit is contained in:
@@ -18,6 +18,11 @@
|
||||
#include "ac_ball.h"
|
||||
#include "ac_snowman.h"
|
||||
#include "ac_boat_demo.h"
|
||||
#include "ac_balloon.h"
|
||||
#include "ac_uki.h"
|
||||
#include "ac_insect.h"
|
||||
#include "ac_gyoei.h"
|
||||
#include "ac_gyo_release.h"
|
||||
|
||||
/* Static function declarations, add as needed for intellisense */
|
||||
static int Player_actor_check_request_main_able(GAME* game, int request_main_index, int priority);
|
||||
|
||||
@@ -129,7 +129,7 @@ static void Player_actor_Item_SetAnimation_Base(ACTOR* actor, f32 frame) {
|
||||
static void Player_actor_Item_DMA_Data(ACTOR* actor, int skl_idx, int anim_idx, int mode, f32 speed, f32 morph_speed,
|
||||
f32 frame) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
int change_bank = Player_actor_Change_ItemBank();
|
||||
int change_bank = Player_actor_Change_ItemBank(actor, skl_idx, anim_idx);
|
||||
|
||||
if ((skl_idx >= 0) && (mPlib_Get_Item_DataPointerType(skl_idx) != 0)) {
|
||||
cKF_Skeleton_R_c* skeleton;
|
||||
|
||||
+127
-135
@@ -8,15 +8,14 @@ static void Player_actor_Item_Set_Scale_forUki_normal(ACTOR* actor, GAME* game)
|
||||
scale *= player->item_scale;
|
||||
}
|
||||
|
||||
if(rod != NULL){
|
||||
if (rod != NULL) {
|
||||
rod->scale.x = rod->scale.y = rod->scale.z = scale;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_normal(ACTOR* actor, GAME* game){
|
||||
static void Player_actor_Item_Set_Value_forUki_normal(ACTOR* actor, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
|
||||
Player_actor_Item_Set_Command_forUki(actor, 1);
|
||||
Player_actor_Item_Set_RightHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_PosSpeed_forUki(actor);
|
||||
@@ -25,116 +24,112 @@ static void Player_actor_Item_Set_Value_forUki_normal(ACTOR* actor, GAME* game){
|
||||
Player_actor_Item_Set_Scale_forUki_normal(actor, game);
|
||||
}
|
||||
|
||||
static int Player_actor_Item_main_rod_normal(ACTOR* actor, GAME* game){
|
||||
static int Player_actor_Item_main_rod_normal(ACTOR* actor, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
|
||||
Player_actor_Item_CulcAnimation_Base(actor);
|
||||
Player_actor_Item_Set_Value_forUki_normal(actor, game);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_ready(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static void Player_actor_Item_Set_Value_forUki_ready(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_Set_Command_forUki(actor, 2);
|
||||
Player_actor_Item_Set_RightHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_PosSpeed_forUki(actor);
|
||||
Player_actor_Item_Set_AngleSpeedY_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
|
||||
}
|
||||
|
||||
static int Player_actor_Item_main_rod_ready(ACTOR* actor, GAME* game){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static int Player_actor_Item_main_rod_ready(ACTOR* actor, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_CulcAnimation_Base(actor);
|
||||
Player_actor_Item_Set_Value_forUki_ready(actor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_CastGoalPoint_forUki_cast(ACTOR* actor, int index){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static void Player_actor_Item_Set_CastGoalPoint_forUki_cast(ACTOR* actor, int index) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
if(index == mPlayer_INDEX_CAST_ROD){
|
||||
if (index == mPlayer_INDEX_CAST_ROD) {
|
||||
UKI_ACTOR* rod = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
|
||||
if(rod != NULL){
|
||||
if (rod != NULL) {
|
||||
rod->cast_goal_point = player->main_data.uki.cast_goal_point;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_cast(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static void Player_actor_Item_Set_Value_forUki_cast(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_Set_Command_forUki(actor, 3);
|
||||
Player_actor_Item_Set_RightHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_PosSpeed_forUki(actor);
|
||||
Player_actor_Item_Set_AngleSpeedY_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
|
||||
}
|
||||
|
||||
static int Player_actor_Item_Check_Status_forUki_cast(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static int Player_actor_Item_Check_Status_forUki_cast(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
UKI_ACTOR* rod = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
|
||||
if(rod != NULL){
|
||||
switch(rod->status){
|
||||
if (rod != NULL) {
|
||||
switch (rod->status) {
|
||||
case 4:
|
||||
case 5:
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Player_actor_Item_main_rod_cast(ACTOR* actor, GAME* game){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static int Player_actor_Item_main_rod_cast(ACTOR* actor, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
int status;
|
||||
|
||||
|
||||
Player_actor_Item_CulcAnimation_Base(actor);
|
||||
Player_actor_Item_Set_Value_forUki_cast(actor);
|
||||
Player_actor_Item_Set_Value_forUki_cast(actor);
|
||||
status = Player_actor_Item_Check_Status_forUki_cast(actor);
|
||||
Player_actor_Item_Set_CastGoalPoint_forUki_cast(actor, player->now_main_index);
|
||||
return status;
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_air(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static void Player_actor_Item_Set_Value_forUki_air(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_Set_Command_forUki(actor, 4);
|
||||
Player_actor_Item_Set_RightHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_PosSpeed_forUki(actor);
|
||||
Player_actor_Item_Set_AngleSpeedY_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
}
|
||||
|
||||
static int Player_actor_Item_main_rod_air(ACTOR* actor, GAME* game){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static int Player_actor_Item_main_rod_air(ACTOR* actor, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_CulcAnimation_Base(actor);
|
||||
Player_actor_Item_Set_Value_forUki_air(actor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void Player_actor_Item_SetFrame_forUki_relax(ACTOR* actor, GAME* game){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static void Player_actor_Item_SetFrame_forUki_relax(ACTOR* actor, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
UKI_ACTOR* rod = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
|
||||
if(rod != NULL){
|
||||
if (rod != NULL) {
|
||||
f32 frame = player->item_keyframe.frame_control.current_frame;
|
||||
f32 target;
|
||||
xyz_t pos;
|
||||
if(rod->status != 3){
|
||||
f32 end_pos = 2.0f + ( 61.5f + actor->world.position.y);
|
||||
|
||||
if (rod->status != 3) {
|
||||
f32 end_pos = 2.0f + (61.5f + actor->world.position.y);
|
||||
|
||||
Player_actor_Get_ItemRodVirtualTopPos(actor, &pos);
|
||||
target = 200.0f + (9.1f * (pos.y - end_pos));
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
target = 180.0f;
|
||||
}
|
||||
|
||||
@@ -143,77 +138,76 @@ static void Player_actor_Item_SetFrame_forUki_relax(ACTOR* actor, GAME* game){
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_relax(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_relax(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_Set_RightHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_PosSpeed_forUki(actor);
|
||||
Player_actor_Item_Set_AngleSpeedY_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
}
|
||||
|
||||
static int Player_actor_Item_Check_Status_forUki_relax(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
UKI_ACTOR* rod = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
static int Player_actor_Item_Check_Status_forUki_relax(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
UKI_ACTOR* rod = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
|
||||
if(rod != NULL) {
|
||||
if (rod != NULL) {
|
||||
return rod->status;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
|
||||
static int Player_actor_Item_main_rod_relax(ACTOR* actor, GAME* game){
|
||||
Player_actor_Item_SetFrame_forUki_relax(actor,game);
|
||||
static int Player_actor_Item_main_rod_relax(ACTOR* actor, GAME* game) {
|
||||
Player_actor_Item_SetFrame_forUki_relax(actor, game);
|
||||
Player_actor_Item_Set_Value_forUki_relax(actor);
|
||||
return Player_actor_Item_Check_Status_forUki_relax(actor);
|
||||
return Player_actor_Item_Check_Status_forUki_relax(actor);
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_collect(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_collect(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_Set_Command_forUki(actor, 6);
|
||||
Player_actor_Item_Set_RightHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_PosSpeed_forUki(actor);
|
||||
Player_actor_Item_Set_AngleSpeedY_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
}
|
||||
|
||||
static int Player_actor_Item_Check_Status_forUki_collect(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static int Player_actor_Item_Check_Status_forUki_collect(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
UKI_ACTOR* rod = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
|
||||
if(rod != NULL){
|
||||
switch(rod->status){
|
||||
if (rod != NULL) {
|
||||
switch (rod->status) {
|
||||
case 7:
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int Player_actor_Item_main_rod_collect(ACTOR* actor, GAME* game){
|
||||
static int Player_actor_Item_main_rod_collect(ACTOR* actor, GAME* game) {
|
||||
Player_actor_Item_CulcAnimation_Base(actor);
|
||||
Player_actor_Item_Set_Value_forUki_collect(actor);
|
||||
return Player_actor_Item_Check_Status_forUki_collect(actor);
|
||||
return Player_actor_Item_Check_Status_forUki_collect(actor);
|
||||
}
|
||||
|
||||
static void Player_actor_Item_SetFrame_forUki_vib(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static void Player_actor_Item_SetFrame_forUki_vib(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
UKI_ACTOR* rod = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
|
||||
if(rod != NULL){
|
||||
if (rod != NULL) {
|
||||
f32 frame = player->item_keyframe.frame_control.current_frame;
|
||||
f32 target;
|
||||
xyz_t* left_hand ;
|
||||
xyz_t* left_hand;
|
||||
xyz_t* wpos;
|
||||
xyz_t pos;
|
||||
f32 left_hand_len;
|
||||
f32 wpos_len;
|
||||
f32 diff;
|
||||
|
||||
|
||||
left_hand = &player->left_hand_pos;
|
||||
wpos = &rod->actor_class.world.position;
|
||||
Player_actor_Get_ItemRodVirtualTopPos(actor, &pos);
|
||||
@@ -221,173 +215,171 @@ static void Player_actor_Item_SetFrame_forUki_vib(ACTOR* actor){
|
||||
wpos_len = Math3DLengthSquare(wpos, &pos);
|
||||
|
||||
diff = (left_hand_len + wpos_len) - Math3DLengthSquare(wpos, left_hand);
|
||||
if(diff <= 0.0f){
|
||||
if (diff <= 0.0f) {
|
||||
target = 180.0f;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
target = 180.0f + (0.01f * diff);
|
||||
}
|
||||
|
||||
add_calc2(&frame, target, 1.0f - sqrtf(0.25f), 360.0f);
|
||||
Player_actor_Item_SetAnimation_Base(actor, frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_vib(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_vib(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_Set_Command_forUki(actor, 6);
|
||||
Player_actor_Item_Set_RightHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_LeftHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_PosSpeed_forUki(actor);
|
||||
Player_actor_Item_Set_AngleSpeedY_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
}
|
||||
|
||||
static int Player_actor_Item_Check_Status_forUki_vib(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static int Player_actor_Item_Check_Status_forUki_vib(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
UKI_ACTOR* rod = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
|
||||
if(rod != NULL){
|
||||
switch(rod->status){
|
||||
if (rod != NULL) {
|
||||
switch (rod->status) {
|
||||
case 6:
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Player_actor_Item_main_rod_vib(ACTOR* actor, GAME* game){
|
||||
static int Player_actor_Item_main_rod_vib(ACTOR* actor, GAME* game) {
|
||||
Player_actor_Item_SetFrame_forUki_vib(actor);
|
||||
Player_actor_Item_Set_Value_forUki_vib(actor);
|
||||
return Player_actor_Item_Check_Status_forUki_vib(actor);
|
||||
return Player_actor_Item_Check_Status_forUki_vib(actor);
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_fly(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_fly(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_Set_Command_forUki(actor, 6);
|
||||
Player_actor_Item_Set_RightHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_LeftHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_PosSpeed_forUki(actor);
|
||||
Player_actor_Item_Set_AngleSpeedY_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
}
|
||||
|
||||
static int Player_actor_Item_Check_Status_forUki_fly(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
static int Player_actor_Item_Check_Status_forUki_fly(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
UKI_ACTOR* rod = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
|
||||
if(rod != NULL){
|
||||
switch(rod->status){
|
||||
if (rod != NULL) {
|
||||
switch (rod->status) {
|
||||
case 7:
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Player_actor_Item_main_rod_fly(ACTOR* actor, GAME* game){
|
||||
static int Player_actor_Item_main_rod_fly(ACTOR* actor, GAME* game) {
|
||||
Player_actor_Item_CulcAnimation_Base(actor);
|
||||
Player_actor_Item_Set_Value_forUki_fly(actor);
|
||||
return Player_actor_Item_Check_Status_forUki_fly(actor);
|
||||
return Player_actor_Item_Check_Status_forUki_fly(actor);
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_GyoeiScale_forUki_putaway(ACTOR* actor, int index){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
if(index == mPlayer_INDEX_PUTAWAY_ROD){
|
||||
static void Player_actor_Item_Set_GyoeiScale_forUki_putaway(ACTOR* actor, int index) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
if (index == mPlayer_INDEX_PUTAWAY_ROD) {
|
||||
UKI_ACTOR* rod = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
|
||||
if(rod != NULL){
|
||||
f32 f1 = (30.0f - player->main_data.putaway_uki.unk0) / 30.0f;
|
||||
if (rod != NULL) {
|
||||
f32 scale = (30.0f - player->main_data.putaway_uki.unk0) / 30.0f;
|
||||
|
||||
if(f1 > 1.0f){
|
||||
f1 = 1.0f;
|
||||
if (scale > 1.0f) {
|
||||
scale = 1.0f;
|
||||
} else if (scale < 0.0f) {
|
||||
scale = 0.0f;
|
||||
}
|
||||
else if(f1 < 0.0f){
|
||||
f1 = 0.0f;
|
||||
}
|
||||
|
||||
rod->unk294 = f1;
|
||||
|
||||
rod->gyo_scale = scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_putaway(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
static void Player_actor_Item_Set_Value_forUki_putaway(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_Set_Command_forUki(actor, 5);
|
||||
Player_actor_Item_Set_RightHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_LeftHandPos_forUki(actor, player->now_main_index);
|
||||
Player_actor_Item_Set_PosSpeed_forUki(actor);
|
||||
Player_actor_Item_Set_AngleSpeedY_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
Player_actor_Item_Set_RodTopPos_forUki(actor);
|
||||
}
|
||||
|
||||
static int Player_actor_Item_main_rod_putaway(ACTOR* actor, GAME* game){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
static int Player_actor_Item_main_rod_putaway(ACTOR* actor, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Player_actor_Item_CulcAnimation_Base(actor);
|
||||
Player_actor_Item_Set_Value_forUki_putaway(actor);
|
||||
Player_actor_Item_Set_GyoeiScale_forUki_putaway(actor, player->now_main_index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void Player_actor_Item_draw_net_After_main4_sao(ACTOR* actor){
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
static void Player_actor_Item_draw_net_After_main4_sao(ACTOR* actor) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
|
||||
Matrix_Position_VecX(&player->item_rod_top_pos, 1050.0f);
|
||||
}
|
||||
|
||||
typedef void (*mPlayer_item_rod_draw_proc)(void* arg, GAME* game, cKF_SkeletonInfo_R_c* keyframe, Gfx** joint_shape,
|
||||
u8* joint_flags, s_xyz* joint_rot, xyz_t* joint_pos);
|
||||
|
||||
static int Player_actor_Item_draw_rod_After(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_idx, Gfx** joint_shape,
|
||||
u8* joint_flags, void* arg, s_xyz* joint_rot, xyz_t* joint_pos) {
|
||||
static int Player_actor_Item_draw_rod_After(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_idx,
|
||||
Gfx** joint_shape, u8* joint_flags, void* arg, s_xyz* joint_rot,
|
||||
xyz_t* joint_pos) {
|
||||
static const mPlayer_item_net_draw_proc proc[] = {
|
||||
NULL,NULL,NULL,NULL, (mPlayer_item_rod_draw_proc)Player_actor_Item_draw_net_After_main4_sao,
|
||||
NULL, NULL, NULL, NULL, (mPlayer_item_rod_draw_proc)Player_actor_Item_draw_net_After_main4_sao,
|
||||
};
|
||||
|
||||
if(joint_idx >= 0 && joint_idx < 5){
|
||||
if(proc[joint_idx] != NULL){
|
||||
proc[joint_idx](arg,game,keyframe,joint_shape,joint_flags,joint_rot,joint_pos);
|
||||
if (joint_idx >= 0 && joint_idx < 5) {
|
||||
if (proc[joint_idx] != NULL) {
|
||||
proc[joint_idx](arg, game, keyframe, joint_shape, joint_flags, joint_rot, joint_pos);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void Player_actor_Item_draw_rod(ACTOR* actor, GAME* game){
|
||||
static void Player_actor_Item_draw_rod(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
Mtx* mtx;
|
||||
cKF_SkeletonInfo_R_c* keyf;
|
||||
Mtx* item_mtx;
|
||||
GRAPH* graph;
|
||||
|
||||
|
||||
item_mtx = player->item_work_mtx[play->game.frame_counter % 2];
|
||||
graph = play->game.graph;
|
||||
keyf = &player->item_keyframe;
|
||||
|
||||
|
||||
Matrix_Position_VecZ(&player->item_rod_virtual_top_pos, 6000.0f);
|
||||
Matrix_push();
|
||||
Matrix_RotateZ(player->item_rod_angle_z, 1);
|
||||
|
||||
mtx = _Matrix_to_Mtx_new(play->game.graph);
|
||||
|
||||
if(mtx != NULL){
|
||||
if (mtx != NULL) {
|
||||
OPEN_POLY_OPA_DISP(graph);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
CLOSE_POLY_OPA_DISP(graph);
|
||||
CLOSE_POLY_OPA_DISP(graph);
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyf, item_mtx , NULL, Player_actor_Item_draw_rod_After, &player->actor_class);
|
||||
player->update_item_rod_top_pos = TRUE;
|
||||
|
||||
cKF_Si3_draw_R_SV(game, keyf, item_mtx, NULL, Player_actor_Item_draw_rod_After, &player->actor_class);
|
||||
player->item_rod_top_pos_set = TRUE;
|
||||
}
|
||||
|
||||
player->balloon_start_pos_set_flag = FALSE;
|
||||
|
||||
@@ -16,9 +16,9 @@ static int Player_actor_request_main_demo_get_golden_item_all(GAME* game, int ty
|
||||
return Player_actor_request_main_demo_get_golden_item_common(game, mPlayer_INDEX_DEMO_GET_GOLDEN_ITEM, type, prio);
|
||||
}
|
||||
|
||||
static int Player_actor_request_main_demo_get_golden_item_from_submenu(ACTOR* actorx, GAME* game) {
|
||||
return Player_actor_request_main_demo_get_golden_item_all(game, mPlayer_GOLDEN_ITEM_TYPE_SHOVEL,
|
||||
mPlayer_REQUEST_PRIORITY_31);
|
||||
static void Player_actor_request_main_demo_get_golden_item_from_submenu(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_request_main_demo_get_golden_item_all(game, mPlayer_GOLDEN_ITEM_TYPE_SHOVEL,
|
||||
mPlayer_REQUEST_PRIORITY_31);
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Demo_get_golden_item(ACTOR* actorx, GAME* game) {
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
static int Player_actor_request_main_demo_getoff_train(GAME* game, const xyz_t* pos_p, s16 angle_y, int prio) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_DEMO_GETOFF_TRAIN, prio)) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
||||
mPlayer_request_demo_getoff_train_c* req_demo_getoff_train_p =
|
||||
&player->requested_main_index_data.demo_getoff_train;
|
||||
|
||||
req_demo_getoff_train_p->player_pos = *pos_p;
|
||||
req_demo_getoff_train_p->angle_y = angle_y;
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_DEMO_GETOFF_TRAIN, prio);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Demo_getoff_train(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
mPlayer_request_demo_getoff_train_c* req_demo_getoff_train_p = &player->requested_main_index_data.demo_getoff_train;
|
||||
|
||||
actorx->world.angle.y = req_demo_getoff_train_p->angle_y;
|
||||
cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(kf0_p, 0.0f, 1000.0f, 0.0f, 0, 0, DEG2SHORT_ANGLE2(90.0f));
|
||||
cKF_SkeletonInfo_R_AnimationMove_ct_base(&actorx->world.position, &req_demo_getoff_train_p->player_pos,
|
||||
actorx->shape_info.rotation.y, req_demo_getoff_train_p->angle_y, 5.0f,
|
||||
kf0_p,
|
||||
cKF_ANIMATION_TRANS_XZ | cKF_ANIMATION_TRANS_Y | cKF_ANIMATION_ROT_Y);
|
||||
|
||||
Player_actor_InitAnimation_Base2(actorx, game, mPlayer_ANIM_OUTTRAIN1, mPlayer_ANIM_OUTTRAIN1, 1.0f, 1.0f, 0.5f,
|
||||
-5.0f, cKF_FRAMECONTROL_STOP, mPlayer_PART_TABLE_NORMAL);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_settle_main_Demo_getoff_train(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
|
||||
cKF_SkeletonInfo_R_AnimationMove_dt(kf0_p);
|
||||
actorx->world.angle.y = actorx->shape_info.rotation.y;
|
||||
}
|
||||
|
||||
static int Player_actor_CulcAnimation_Demo_getoff_train(ACTOR* actorx, f32* last_anim0_cur_frame_p) {
|
||||
return Player_actor_CulcAnimation_Base2(actorx, last_anim0_cur_frame_p);
|
||||
}
|
||||
|
||||
static void Player_actor_SearchAnimation_Demo_getoff_train(ACTOR* actorx, GAME* game, f32 frame) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
|
||||
if (Player_actor_Check_AnimationFrame_PerfectEquel(actorx, frame) == FALSE) {
|
||||
Player_actor_Set_FootMark_Base1(actorx, game, TRUE, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Demo_getoff_train(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
|
||||
cKF_SkeletonInfo_R_AnimationMove_base(&actorx->world.position, &actorx->shape_info.rotation.y, &actorx->scale,
|
||||
actorx->world.angle.y, kf0_p);
|
||||
Player_actor_Movement_Base_Stop(actorx, FALSE);
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromDemo_getoff_train(ACTOR* actorx, GAME* game, int end_flag) {
|
||||
if (end_flag) {
|
||||
Player_actor_SettleRequestMainIndexPriority(actorx);
|
||||
|
||||
if (Player_actor_request_main_demo_wait_all(game, FALSE, 0, mPlayer_REQUEST_PRIORITY_19)) {
|
||||
if (Player_actor_Get_DemoOrder() == 3) {
|
||||
Player_actor_Set_DemoOrder(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_main_Demo_getoff_train(ACTOR* actorx, GAME* game) {
|
||||
f32 last_anim0_cur_frame;
|
||||
int end_flag;
|
||||
|
||||
end_flag = Player_actor_CulcAnimation_Demo_getoff_train(actorx, &last_anim0_cur_frame);
|
||||
Player_actor_Movement_Demo_getoff_train(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_SearchAnimation_Demo_getoff_train(actorx, game, last_anim0_cur_frame);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
Player_actor_request_proc_index_fromDemo_getoff_train(actorx, game, end_flag);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
static int Player_actor_request_main_demo_geton_train(GAME* game, const xyz_t* pos_p, s16 angle_y, int prio) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_DEMO_GETON_TRAIN, prio)) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
||||
mPlayer_request_demo_geton_train_c* req_demo_geton_train_p =
|
||||
&player->requested_main_index_data.demo_geton_train;
|
||||
|
||||
req_demo_geton_train_p->player_pos = *pos_p;
|
||||
req_demo_geton_train_p->angle_y = angle_y;
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_DEMO_GETON_TRAIN, prio);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Demo_geton_train(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
mPlayer_request_demo_geton_train_c* req_demo_geton_train_p = &player->requested_main_index_data.demo_geton_train;
|
||||
|
||||
actorx->world.angle.y = req_demo_geton_train_p->angle_y;
|
||||
cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(kf0_p, 0.0f, 1000.0f, 0.0f, 0, 0, DEG2SHORT_ANGLE2(90.0f));
|
||||
cKF_SkeletonInfo_R_AnimationMove_ct_base(&actorx->world.position, &req_demo_geton_train_p->player_pos,
|
||||
actorx->shape_info.rotation.y, req_demo_geton_train_p->angle_y, 5.0f,
|
||||
kf0_p,
|
||||
cKF_ANIMATION_TRANS_XZ | cKF_ANIMATION_TRANS_Y | cKF_ANIMATION_ROT_Y);
|
||||
|
||||
Player_actor_InitAnimation_Base2(actorx, game, mPlayer_ANIM_INTRAIN1, mPlayer_ANIM_INTRAIN1, 1.0f, 1.0f, 0.5f,
|
||||
-5.0f, cKF_FRAMECONTROL_STOP, mPlayer_PART_TABLE_NORMAL);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_settle_main_Demo_geton_train(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
|
||||
cKF_SkeletonInfo_R_AnimationMove_dt(kf0_p);
|
||||
actorx->world.angle.y = actorx->shape_info.rotation.y;
|
||||
}
|
||||
|
||||
static int Player_actor_CulcAnimation_Demo_geton_train(ACTOR* actorx, f32* last_anim0_cur_frame_p) {
|
||||
return Player_actor_CulcAnimation_Base2(actorx, last_anim0_cur_frame_p);
|
||||
}
|
||||
|
||||
static void Player_actor_SearchAnimation_Demo_geton_train(ACTOR* actorx, GAME* game, f32 frame) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
|
||||
if (Player_actor_Check_AnimationFrame_PerfectEquel(actorx, frame) == FALSE) {
|
||||
Player_actor_Set_FootMark_Base2(actorx, game, TRUE, 0x4204);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Demo_geton_train(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
|
||||
cKF_SkeletonInfo_R_AnimationMove_base(&actorx->world.position, &actorx->shape_info.rotation.y, &actorx->scale,
|
||||
actorx->world.angle.y, kf0_p);
|
||||
Player_actor_Movement_Base_Stop(actorx, FALSE);
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromDemo_geton_train(ACTOR* actorx, GAME* game, int end_flag) {
|
||||
if (end_flag) {
|
||||
Player_actor_SettleRequestMainIndexPriority(actorx);
|
||||
Player_actor_request_main_demo_geton_train_wait_all(game, mPlayer_REQUEST_PRIORITY_19);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_main_Demo_geton_train(ACTOR* actorx, GAME* game) {
|
||||
f32 last_anim0_cur_frame;
|
||||
int end_flag;
|
||||
|
||||
end_flag = Player_actor_CulcAnimation_Demo_geton_train(actorx, &last_anim0_cur_frame);
|
||||
Player_actor_Movement_Demo_geton_train(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_SearchAnimation_Demo_geton_train(actorx, game, last_anim0_cur_frame);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
Player_actor_request_proc_index_fromDemo_geton_train(actorx, game, end_flag);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
static int Player_actor_request_main_demo_geton_train_wait_all(GAME* game, int prio) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_DEMO_GETON_TRAIN_WAIT, prio)) {
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_DEMO_GETON_TRAIN_WAIT, prio);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Demo_geton_train_wait(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_InitAnimation_Base1(actorx, game, mPlayer_ANIM_INTRAIN_WAIT1, mPlayer_ANIM_INTRAIN_WAIT1, 1.0f, 1.0f,
|
||||
0.5f, -5.0f, mPlayer_PART_TABLE_NORMAL);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Demo_geton_train_wait(ACTOR* actorx) {
|
||||
Player_actor_Movement_Base_Stop(actorx, FALSE);
|
||||
}
|
||||
|
||||
static void Player_actor_CulcAnimation_Demo_geton_train_wait(ACTOR* actorx) {
|
||||
f32 dummy;
|
||||
|
||||
Player_actor_CulcAnimation_Base2(actorx, &dummy);
|
||||
}
|
||||
|
||||
static void Player_actor_main_Demo_geton_train_wait(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Movement_Demo_geton_train_wait(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_CulcAnimation_Demo_geton_train_wait(actorx);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
static int Player_actor_request_main_demo_standing_train_all(GAME* game, int prio) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_DEMO_STANDING_TRAIN, prio)) {
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_DEMO_STANDING_TRAIN, prio);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Demo_standing_train(ACTOR* actorx, GAME* game) {
|
||||
int anim1_idx;
|
||||
int part_table_idx;
|
||||
|
||||
Player_actor_SetupItem_Base1(actorx, mPlayer_ANIM_WAIT1, -5.0f, &anim1_idx, &part_table_idx);
|
||||
Player_actor_InitAnimation_Base1(actorx, game, mPlayer_ANIM_WAIT1, anim1_idx, 1.0f, 1.0f, 0.5f, -5.0f,
|
||||
part_table_idx);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_CulcAnimation_Demo_standing_train(ACTOR* actorx) {
|
||||
f32 dummy;
|
||||
|
||||
Player_actor_CulcAnimation_Base2(actorx, &dummy);
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Demo_standing_train(ACTOR* actorx) {
|
||||
if (Player_actor_Get_DemoChangeAngleY()) {
|
||||
s16 goal_angle_y = Player_actor_Get_DemoAngleY();
|
||||
|
||||
add_calc_short_angle2(&actorx->world.angle.y, goal_angle_y, 1.0f - sqrtf(0.5f), 2500, 50);
|
||||
actorx->shape_info.rotation.y = actorx->world.angle.y;
|
||||
if (goal_angle_y == actorx->world.angle.y) {
|
||||
Player_actor_Set_DemoChangeAngleY(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
Player_actor_Movement_Base_Stop(actorx, FALSE);
|
||||
}
|
||||
|
||||
static void Player_actor_main_Demo_standing_train(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Movement_Demo_standing_train(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_CulcAnimation_Demo_standing_train(actorx);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
static int Player_actor_request_main_demo_wade_all(GAME* game, int dir, int priority) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_DEMO_WADE, priority)) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
||||
mPlayer_request_demo_wade_c* request_demo_wade_p = &player->requested_main_index_data.demo_wade;
|
||||
|
||||
request_demo_wade_p->dir = dir;
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_DEMO_WADE, priority);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Demo_wade(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_request_demo_wade_c* request_demo_wade_p = &player->requested_main_index_data.demo_wade;
|
||||
mPlayer_main_demo_wade_c* main_demo_wade_p = &player->main_data.demo_wade;
|
||||
xyz_t* pos_p;
|
||||
int anim1_idx;
|
||||
int part_table_idx;
|
||||
int dir;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
xyz_t eye_pos;
|
||||
|
||||
dir = request_demo_wade_p->dir;
|
||||
pos_p = &actorx->world.position;
|
||||
Player_actor_SetupItem_Base1(actorx, 0, -5.0f, &anim1_idx, &part_table_idx);
|
||||
Player_actor_InitAnimation_Base1(actorx, game, mPlayer_ANIM_WAIT1, anim1_idx, 1.0f, 1.0f, 0.5f, -5.0f,
|
||||
part_table_idx);
|
||||
main_demo_wade_p->dir = dir;
|
||||
main_demo_wade_p->start_pos = *pos_p;
|
||||
|
||||
Player_actor_Culc_wade_end_pos(pos_p, &main_demo_wade_p->end_pos, dir, 18.00001f);
|
||||
main_demo_wade_p->timer = 0.0f;
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
|
||||
eye_pos = main_demo_wade_p->end_pos;
|
||||
eye_pos.y += actorx->eye.position.y - pos_p->y;
|
||||
Camera2_request_main_wade(play, &eye_pos, 9, 36.0f);
|
||||
Player_actor_setup_main_Demo_wade_other_func2(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_settle_main_Demo_wade(ACTOR* actorx, GAME* game) {
|
||||
mDemo_End(actorx);
|
||||
}
|
||||
|
||||
static void Player_actor_CulcAnimation_Demo_wade(ACTOR* actorx) {
|
||||
f32 last_kf0_current_frame;
|
||||
|
||||
Player_actor_CulcAnimation_Base2(actorx, &last_kf0_current_frame);
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Demo_wade(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_demo_wade_c* main_demo_wade_p = &player->main_data.demo_wade;
|
||||
xyz_t* start_pos_p = &main_demo_wade_p->start_pos;
|
||||
xyz_t* end_pos_p = &main_demo_wade_p->end_pos;
|
||||
xyz_t* pos_p = &actorx->world.position;
|
||||
f32 timer = main_demo_wade_p->timer;
|
||||
f32 percent = get_percent_forAccelBrake(timer, 0.0f, 36.0f, 1.2f, 34.8f);
|
||||
|
||||
pos_p->x = start_pos_p->x + percent * (end_pos_p->x - start_pos_p->x);
|
||||
pos_p->y = start_pos_p->y + percent * (end_pos_p->y - start_pos_p->y);
|
||||
pos_p->z = start_pos_p->z + percent * (end_pos_p->z - start_pos_p->z);
|
||||
|
||||
Player_actor_Movement_Base_Stop(actorx, FALSE);
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Demo_wade(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_BGcheck_Demo_wade(ACTOR* actorx) {
|
||||
Player_actor_BGcheck_common_type2(actorx);
|
||||
}
|
||||
|
||||
static int Player_actor_able_request_proc_index_fromDemo_wade_common(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_demo_wade_c* main_demo_wade_p = &player->main_data.demo_wade;
|
||||
f32* timer_p = &main_demo_wade_p->timer;
|
||||
|
||||
if (*timer_p > 36.0f) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
*timer_p += 1.0f;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromDemo_wade(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_demo_wade_c* main_demo_wade_p = &player->main_data.demo_wade;
|
||||
|
||||
if (Player_actor_able_request_proc_index_fromDemo_wade_common(actorx)) {
|
||||
f32 goal_pos_x;
|
||||
f32 goal_pos_z;
|
||||
f32 speed;
|
||||
|
||||
Player_actor_SettleRequestMainIndexPriority(actorx);
|
||||
mPlib_Get_goal_player_demo_walk(&goal_pos_x, &goal_pos_z, &speed);
|
||||
Player_actor_request_main_demo_walk_all(game, goal_pos_x, goal_pos_z, speed, mPlib_Get_end_player_demo_walk(),
|
||||
mPlayer_REQUEST_PRIORITY_19);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_main_Demo_wade(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_main_Demo_wade_other_func1(actorx, game);
|
||||
Player_actor_Movement_Demo_wade(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_CulcAnimation_Demo_wade(actorx);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_ObjCheck_Demo_wade(actorx, game);
|
||||
Player_actor_BGcheck_Demo_wade(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
Player_actor_request_proc_index_fromDemo_wade(actorx, game);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
static int Player_actor_request_main_demo_wait_all(GAME* game, int umbrella_flag, u32 label, int prio) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_DEMO_WAIT, prio)) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
||||
mPlayer_request_demo_wait_c* req_demo_wait_p = &player->requested_main_index_data.demo_wait;
|
||||
|
||||
req_demo_wait_p->umbrella_flag = umbrella_flag;
|
||||
req_demo_wait_p->label = label;
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_DEMO_WAIT, prio);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_request_main_demo_wait_from_submenu(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_change_data_from_submenu_c* change_data_p = mPlib_Get_change_data_from_submenu_p();
|
||||
mPlayer_request_demo_wait_c* req_demo_wait_p = &change_data_p->request_main_data.demo_wait;
|
||||
|
||||
Player_actor_request_main_demo_wait_all(game, req_demo_wait_p->umbrella_flag, req_demo_wait_p->label,
|
||||
mPlayer_REQUEST_PRIORITY_31);
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Demo_wait(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_request_demo_wait_c* req_demo_wait_p = &player->requested_main_index_data.demo_wait;
|
||||
mPlayer_main_demo_wait_c* demo_wait_p = &player->main_data.demo_wait;
|
||||
int anim1_idx;
|
||||
int part_table_idx;
|
||||
|
||||
if (req_demo_wait_p->umbrella_flag) {
|
||||
player->unable_hand_item_in_demo = TRUE;
|
||||
}
|
||||
|
||||
demo_wait_p->effect_id = 0;
|
||||
demo_wait_p->label = req_demo_wait_p->label;
|
||||
|
||||
Player_actor_SetupItem_Base1(actorx, mPlayer_ANIM_WAIT1, -5.0f, &anim1_idx, &part_table_idx);
|
||||
Player_actor_InitAnimation_Base1(actorx, game, mPlayer_ANIM_WAIT1, anim1_idx, 1.0f, 1.0f, 0.5f, -5.0f,
|
||||
part_table_idx);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_settle_main_Demo_wait(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_demo_wait_c* demo_wait_p = &player->main_data.demo_wait;
|
||||
|
||||
if (demo_wait_p->effect_id > 0) {
|
||||
eEC_CLIP->effect_kill_proc(demo_wait_p->effect_id - 1, RSV_NO);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Demo_wait(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
|
||||
if (Player_actor_Get_DemoChangeAngleY()) {
|
||||
s16 target_angle_y = Player_actor_Get_DemoAngleY();
|
||||
|
||||
add_calc_short_angle2(&actorx->world.angle.y, target_angle_y, 1.0f - sqrtf(0.5f), 2500, 50);
|
||||
actorx->shape_info.rotation.y = actorx->world.angle.y;
|
||||
if (target_angle_y == actorx->world.angle.y) {
|
||||
Player_actor_Set_DemoChangeAngleY(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
Player_actor_Movement_Base_Stop(actorx, FALSE);
|
||||
}
|
||||
|
||||
static int Player_actor_CulcAnimation_Demo_wait(ACTOR* actorx, f32* last_anim0_cur_frame_p) {
|
||||
return Player_actor_CulcAnimation_Base2(actorx, last_anim0_cur_frame_p);
|
||||
}
|
||||
|
||||
static void Player_actor_SearchAnimation_Demo_wait(ACTOR* actorx, f32 frame) {
|
||||
if (Player_actor_Check_AnimationFrame_PerfectEquel(actorx, frame) == FALSE) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_demo_wait_c* demo_wait_p = &player->main_data.demo_wait;
|
||||
|
||||
Player_actor_Set_FeelEffect_common(actorx, &demo_wait_p->effect_id);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_ChangeAnimation_FromDemoOrder_Demo_wait(ACTOR* actorx, GAME* game, int order, int end_flag) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_demo_wait_c* demo_wait_p = &player->main_data.demo_wait;
|
||||
|
||||
Player_actor_ChangeAnimation_FromDemoOrder_common(actorx, game, order, end_flag, &demo_wait_p->effect_id);
|
||||
}
|
||||
|
||||
static void Player_actor_SetEffect_FromDemoOrder_Demo_wait(ACTOR* actorx, GAME* game, int order) {
|
||||
Player_actor_SetEffect_FromDemoOrder_common(actorx, game, order);
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Demo_wait(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Excute_Corect_forBrake(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromDemo_wait(GAME* game) {
|
||||
if (Player_actor_Get_DemoOrder() == 1) {
|
||||
f32 pos_x;
|
||||
f32 pos_z;
|
||||
f32 speed;
|
||||
|
||||
mPlib_Get_goal_player_demo_walk(&pos_x, &pos_z, &speed);
|
||||
Player_actor_request_main_demo_walk_all(game, pos_x, pos_z, speed, mPlib_Get_end_player_demo_walk(),
|
||||
mPlayer_REQUEST_PRIORITY_19);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_main_Demo_wait(ACTOR* actorx, GAME* game) {
|
||||
int effect_order;
|
||||
f32 last_anim0_cur_frame;
|
||||
int end_flag;
|
||||
|
||||
effect_order = Player_actor_RecieveDemoOrder_EffectOrder();
|
||||
Player_actor_Movement_Demo_wait(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
end_flag = Player_actor_CulcAnimation_Demo_wait(actorx, &last_anim0_cur_frame);
|
||||
Player_actor_SearchAnimation_Demo_wait(actorx, last_anim0_cur_frame);
|
||||
Player_actor_ChangeAnimation_FromDemoOrder_Demo_wait(actorx, game, effect_order, end_flag);
|
||||
Player_actor_SetEffect_FromDemoOrder_Demo_wait(actorx, game, effect_order);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_ObjCheck_Demo_wait(actorx, game);
|
||||
Player_actor_BGcheck_Wait(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
Player_actor_request_proc_index_fromDemo_wait(game);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
static int Player_actor_request_main_demo_walk_all(GAME* game, f32 goal_pos_x, f32 goal_pos_z, f32 speed, int wait_flag,
|
||||
int prio) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_DEMO_WALK, prio)) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
||||
mPlayer_request_demo_walk_c* req_demo_walk_p = &player->requested_main_index_data.demo_walk;
|
||||
|
||||
req_demo_walk_p->goal_pos_x = goal_pos_x;
|
||||
req_demo_walk_p->goal_pos_z = goal_pos_z;
|
||||
req_demo_walk_p->speed = speed;
|
||||
req_demo_walk_p->wait_flag = wait_flag;
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_DEMO_WALK, prio);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Demo_walk(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_request_demo_walk_c* req_demo_walk_p = &player->requested_main_index_data.demo_walk;
|
||||
int anim0_idx = mPlayer_ANIM_WALK1;
|
||||
int anim1_idx;
|
||||
int part_table_idx;
|
||||
|
||||
mPlib_Set_goal_player_demo_walk(req_demo_walk_p->goal_pos_x, req_demo_walk_p->goal_pos_z, req_demo_walk_p->speed);
|
||||
mPlib_Set_continue_player_after_demo_walk(req_demo_walk_p->wait_flag);
|
||||
mPlib_Set_end_player_demo_walk(FALSE);
|
||||
|
||||
if (mPlib_Get_continue_player_after_demo_walk() == FALSE) {
|
||||
xyz_t demo_pos;
|
||||
f32 dist;
|
||||
|
||||
Player_actor_Get_DemoPosition(&demo_pos);
|
||||
dist = Math3DLengthSquare2D(demo_pos.x, demo_pos.z, actorx->world.position.x, actorx->world.position.z);
|
||||
if (dist < SQ(10.0f)) {
|
||||
anim0_idx = mPlayer_ANIM_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);
|
||||
}
|
||||
|
||||
static void Player_actor_CulcAnimation_Demo_walk(ACTOR* actorx, f32 over_speed_normalize_NoneZero,
|
||||
f32* last_anim0_cur_frame_p) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
f32 dummy;
|
||||
|
||||
if (player->animation0_idx != mPlayer_ANIM_WAIT1) {
|
||||
Player_actor_CulcAnimation_Walk(actorx, over_speed_normalize_NoneZero, last_anim0_cur_frame_p);
|
||||
} else {
|
||||
Player_actor_CulcAnimation_Base2(actorx, &dummy);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_SearchAnimation_Demo_walk(ACTOR* actorx, GAME* game, f32 frame) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
|
||||
if (player->animation0_idx != mPlayer_ANIM_WAIT1) {
|
||||
Player_actor_SearchAnimation_Walk(actorx, game, frame);
|
||||
}
|
||||
}
|
||||
|
||||
static int Player_actor_Movement_Demo_walk(ACTOR* actorx, f32* over_speed_normalize_NoneZero_p) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
f32 over_speed_normalize_NoneZero =
|
||||
Player_actor_Culc_over_speed_normalize_NoneZero(actorx, &actorx->world.position);
|
||||
xyz_t demo_pos;
|
||||
f32 demo_posX;
|
||||
f32 demo_posZ;
|
||||
f32 dx;
|
||||
f32 dz;
|
||||
f32 speed;
|
||||
s16 goal_angle_y;
|
||||
|
||||
Player_actor_Get_DemoPosition(&demo_pos);
|
||||
demo_posX = demo_pos.x;
|
||||
demo_posZ = demo_pos.z;
|
||||
dx = demo_posX - actorx->world.position.x;
|
||||
dz = demo_posZ - actorx->world.position.z;
|
||||
speed = Player_actor_Get_DemoMoveSpeedF();
|
||||
goal_angle_y = actorx->world.angle.y;
|
||||
|
||||
if (dx != 0.0f || dz != 0.0f) {
|
||||
f32 speed_mod = speed / 3.525f;
|
||||
|
||||
goal_angle_y = atans_table(dz, dx);
|
||||
if (speed_mod >= 1.0f) {
|
||||
speed_mod = 0.5f;
|
||||
} else if (speed_mod <= 0.05f) {
|
||||
speed_mod = 0.01f;
|
||||
} else {
|
||||
speed_mod = 0.01f + (speed_mod - 0.05f) * 0.5157895f;
|
||||
}
|
||||
|
||||
speed_mod = sqrtf(1.0f - speed_mod);
|
||||
add_calc_short_angle2(&actorx->world.angle.y, goal_angle_y, 1.0f - speed_mod, 2500, 50);
|
||||
if (player->animation0_idx != mPlayer_ANIM_WAIT1) {
|
||||
actorx->shape_info.rotation.y = actorx->world.angle.y;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
f32 cos;
|
||||
f32 now_speed;
|
||||
|
||||
speed /= over_speed_normalize_NoneZero;
|
||||
cos = cos_s(goal_angle_y - actorx->world.angle.y);
|
||||
|
||||
if (cos <= 0.0f) {
|
||||
speed = 0.0f;
|
||||
} else {
|
||||
speed *= cos;
|
||||
}
|
||||
|
||||
now_speed = actorx->speed;
|
||||
if (now_speed != speed) {
|
||||
if (now_speed < speed) {
|
||||
now_speed += 0.609f;
|
||||
|
||||
if (now_speed > speed) {
|
||||
now_speed = speed;
|
||||
}
|
||||
} else if (now_speed > speed) {
|
||||
now_speed -= 0.32625f;
|
||||
if (now_speed < speed) {
|
||||
now_speed = speed;
|
||||
}
|
||||
}
|
||||
|
||||
actorx->speed = now_speed;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
f32 dist = sqrtf(SQ(dx) + SQ(dz));
|
||||
|
||||
if (actorx->speed < 0.5f) {
|
||||
actorx->speed = 0.5f;
|
||||
speed = 0.5f;
|
||||
}
|
||||
|
||||
if (dist >= speed * 2.0f) {
|
||||
if (over_speed_normalize_NoneZero == 1.0f) {
|
||||
xyz_t wpos = actorx->world.position;
|
||||
s16 angle_y = actorx->world.angle.y;
|
||||
f32 speed = actorx->speed;
|
||||
f32 speedX = (speed * 0.5f) * sin_s(angle_y);
|
||||
f32 speedZ = (speed * 0.5f) * cos_s(angle_y);
|
||||
f32 tmp;
|
||||
|
||||
wpos.x += speedX;
|
||||
wpos.z += speedZ;
|
||||
tmp = Player_actor_Culc_over_speed_normalize_NoneZero(actorx, &wpos);
|
||||
if (tmp != 1.0f) {
|
||||
actorx->speed /= tmp;
|
||||
over_speed_normalize_NoneZero = tmp;
|
||||
}
|
||||
}
|
||||
} else if (dist < 0.5f) {
|
||||
actorx->speed = dist;
|
||||
} else {
|
||||
actorx->speed = dist / 2.0f;
|
||||
}
|
||||
}
|
||||
|
||||
Player_actor_Movement_Base(actorx);
|
||||
{
|
||||
f32 now_dx = demo_posX - actorx->world.position.x;
|
||||
f32 now_dz = demo_posZ - actorx->world.position.z;
|
||||
|
||||
now_dx = ABS(now_dx);
|
||||
if (now_dx < 0.5f) {
|
||||
actorx->world.position.x = demo_posX;
|
||||
}
|
||||
|
||||
now_dz = ABS(now_dz);
|
||||
if (now_dz < 0.5f) {
|
||||
actorx->world.position.z = demo_posZ;
|
||||
}
|
||||
|
||||
*over_speed_normalize_NoneZero_p = over_speed_normalize_NoneZero;
|
||||
if (demo_posX == actorx->world.position.x && demo_posZ == actorx->world.position.z) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Demo_walk(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_BGcheck_Demo_walk(ACTOR* actorx) {
|
||||
Player_actor_BGcheck_common_type1(actorx);
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromDemo_walk(ACTOR* actorx, GAME* game, int end_flag) {
|
||||
if (end_flag) {
|
||||
mPlib_Set_end_player_demo_walk(TRUE);
|
||||
if (mPlib_Get_continue_player_after_demo_walk() == FALSE) {
|
||||
if (Player_actor_request_main_demo_wait_all(game, FALSE, 0, mPlayer_REQUEST_PRIORITY_19)) {
|
||||
if (Player_actor_Get_DemoOrder() == 1) {
|
||||
Player_actor_Set_DemoOrder(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Player_actor_Set_ScrollDemo_forDemo_wade(actorx);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_main_Demo_walk(ACTOR* actorx, GAME* game) {
|
||||
f32 over_speed_normalize_NoneZero;
|
||||
f32 last_anim0_cur_frame;
|
||||
int end_flag;
|
||||
|
||||
end_flag = Player_actor_Movement_Demo_walk(actorx, &over_speed_normalize_NoneZero);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_CulcAnimation_Demo_walk(actorx, over_speed_normalize_NoneZero, &last_anim0_cur_frame);
|
||||
Player_actor_SearchAnimation_Demo_walk(actorx, game, last_anim0_cur_frame);
|
||||
Player_actor_set_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_ObjCheck_Demo_walk(actorx, game);
|
||||
Player_actor_BGcheck_Demo_walk(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
Player_actor_request_proc_index_fromDemo_walk(actorx, game, end_flag);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
static int Player_actor_request_main_groundhog(GAME* game, int prio) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_GROUNDHOG, prio)) {
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_GROUNDHOG, prio);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Groundhog(ACTOR* actorx, GAME* game) {
|
||||
int anim1_idx;
|
||||
int part_table_idx;
|
||||
|
||||
Player_actor_SetupItem_Base1(actorx, mPlayer_ANIM_WAIT1, 0.0f, &anim1_idx, &part_table_idx);
|
||||
Player_actor_InitAnimation_Base1(actorx, game, mPlayer_ANIM_WAIT1, anim1_idx, 1.0f, 1.0f, 0.5f, 0.0f,
|
||||
part_table_idx);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_CulcAnimation_Groundhog(ACTOR* actorx) {
|
||||
Player_actor_CulcAnimation_Base(actorx);
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Groundhog(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_BGcheck_Groundhog(ACTOR* actorx) {
|
||||
Player_actor_BGcheck_common_type1(actorx);
|
||||
}
|
||||
|
||||
static void Player_actor_main_Groundhog(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_CulcAnimation_Groundhog(actorx);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_ObjCheck_Groundhog(actorx, game);
|
||||
Player_actor_BGcheck_Groundhog(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
static int Player_actor_request_main_hide_all(GAME* game, int prio) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_HIDE, prio)) {
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_HIDE, prio);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Hide(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_main_Hide(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
static int Player_actor_request_main_pray_all(GAME* game, const xyz_t* pos_p, s16 angle_y, int priority) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_PRAY, priority)) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
||||
mPlayer_request_pray_c* req_pray_p = &player->requested_main_index_data.pray;
|
||||
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_PRAY, priority);
|
||||
|
||||
req_pray_p->pos = *pos_p;
|
||||
req_pray_p->angle_y = angle_y;
|
||||
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Pray(ACTOR* actorx, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
mPlayer_request_pray_c* req_pray_p = &player->requested_main_index_data.pray;
|
||||
|
||||
cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(kf0_p, 0.0f, 1000.0f, 0.0f, 0, 0, DEG2SHORT_ANGLE2(90.0f));
|
||||
cKF_SkeletonInfo_R_AnimationMove_ct_base(&actorx->world.position, &req_pray_p->pos, actorx->shape_info.rotation.y,
|
||||
req_pray_p->angle_y, 5.0f, kf0_p,
|
||||
cKF_ANIMATION_TRANS_XZ | cKF_ANIMATION_ROT_Y);
|
||||
|
||||
Player_actor_InitAnimation_Base2(actorx, game, mPlayer_ANIM_OMAIRI_US1, mPlayer_ANIM_OMAIRI_US1, 1.0f, 1.0f, 0.5f,
|
||||
-5.0f, cKF_FRAMECONTROL_STOP, mPlayer_PART_TABLE_NORMAL);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
|
||||
if (Camera2_Check_main_index(play, CAMERA2_PROCESS_NORMAL)) {
|
||||
Camera2_request_main_simple(play, &play->camera.lookat.center, &play->camera.direction,
|
||||
play->camera.focus_distance, 0, 9);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_settle_main_Pray(ACTOR* actorx, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
|
||||
cKF_SkeletonInfo_R_AnimationMove_dt(kf0_p);
|
||||
actorx->world.angle.y = actorx->shape_info.rotation.y;
|
||||
|
||||
if (Camera2_Check_main_index(play, CAMERA2_PROCESS_SIMPLE)) {
|
||||
Camera2_change_priority(play, 0);
|
||||
Camera2_request_main_normal(play, 0, 9);
|
||||
}
|
||||
}
|
||||
|
||||
static int Player_actor_CulcAnimation_Pray(ACTOR* actorx, f32* last_anim0_cur_frame_p) {
|
||||
return Player_actor_CulcAnimation_Base2(actorx, last_anim0_cur_frame_p);
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Pray(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
|
||||
cKF_SkeletonInfo_R_AnimationMove_base(&actorx->world.position, &actorx->shape_info.rotation.y, &actorx->scale,
|
||||
actorx->world.angle.y, kf0_p);
|
||||
Player_actor_Movement_Base_Stop(actorx, FALSE);
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Pray(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_BGcheck_Pray(ACTOR* actorx) {
|
||||
Player_actor_BGcheck_common_type1(actorx);
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromPray(ACTOR* actorx, GAME* game, int end_flag) {
|
||||
if (end_flag) {
|
||||
Player_actor_SettleRequestMainIndexPriority(actorx);
|
||||
Player_actor_request_main_demo_wait_all(game, FALSE, 0, mPlayer_REQUEST_PRIORITY_19);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_main_Pray(ACTOR* actorx, GAME* game) {
|
||||
f32 last_anim0_cur_frame;
|
||||
int end_flag;
|
||||
|
||||
end_flag = Player_actor_CulcAnimation_Pray(actorx, &last_anim0_cur_frame);
|
||||
Player_actor_Movement_Pray(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_ObjCheck_Pray(actorx, game);
|
||||
Player_actor_BGcheck_Pray(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
Player_actor_request_proc_index_fromPray(actorx, game, end_flag);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,300 @@
|
||||
static int Player_actor_request_main_release_creature_all(GAME* game, int type, int gold_scoop_flag,
|
||||
mPlayer_request_release_creature_u* release_data,
|
||||
ACTOR* release_actor_p, int prio) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_RELEASE_CREATURE, prio)) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
||||
mPlayer_request_release_creature_c* req_release_creature_p =
|
||||
&player->requested_main_index_data.release_creature;
|
||||
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_RELEASE_CREATURE, prio);
|
||||
req_release_creature_p->type = type;
|
||||
req_release_creature_p->gold_scoop_flag = gold_scoop_flag;
|
||||
req_release_creature_p->data = *release_data;
|
||||
req_release_creature_p->actor = release_actor_p;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_request_main_release_creature_from_submenu(ACTOR* actorx, GAME* game) {
|
||||
mPlayer_change_data_from_submenu_c* data_p = mPlib_Get_change_data_from_submenu_p();
|
||||
mPlayer_request_release_creature_c* req_release_creature_p = &data_p->request_main_data.release_creature;
|
||||
|
||||
Player_actor_request_main_release_creature_all(game, req_release_creature_p->type,
|
||||
req_release_creature_p->gold_scoop_flag,
|
||||
&req_release_creature_p->data, NULL, mPlayer_REQUEST_PRIORITY_31);
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Release_creature(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_request_release_creature_c* req_release_creature_p = &player->requested_main_index_data.release_creature;
|
||||
mPlayer_main_release_creature_c* release_creature_p = &player->main_data.release_creature;
|
||||
int type = req_release_creature_p->type;
|
||||
int gold_scoop_flag = req_release_creature_p->gold_scoop_flag;
|
||||
ACTOR* release_actor_p = req_release_creature_p->actor;
|
||||
int anim1_idx;
|
||||
int part_table_idx;
|
||||
|
||||
if (release_actor_p == NULL) {
|
||||
if (type == mPlayer_CREATURE_GYOEI) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
mPlayer_request_release_creature_gyoei_c* gyoei_data_p = &req_release_creature_p->data.gyoei;
|
||||
|
||||
release_actor_p = Actor_info_make_actor(
|
||||
&play->actor_info, game, mAc_PROFILE_GYO_RELEASE, actorx->world.position.x, actorx->world.position.y,
|
||||
actorx->world.position.z, 0, gyoei_data_p->angle_y, 0, play->block_table.block_x,
|
||||
play->block_table.block_z, -1, EMPTY_NO, gyoei_data_p->_02, -1, -1);
|
||||
} else if (type == mPlayer_CREATURE_INSECT) {
|
||||
mPlayer_request_release_creature_insect_c* insect_data_p = &req_release_creature_p->data.insect;
|
||||
|
||||
release_actor_p =
|
||||
Common_Get(clip).insect_clip->make_actor_proc(game, insect_data_p->type, &insect_data_p->pos);
|
||||
} else {
|
||||
ACTOR* actor_p = player->balloon_actor;
|
||||
|
||||
release_actor_p = actor_p;
|
||||
if (actor_p != NULL) {
|
||||
s_xyz angle;
|
||||
f32 sin;
|
||||
f32 cos;
|
||||
xyz_t pos;
|
||||
|
||||
angle.x = 0;
|
||||
angle.y = actorx->shape_info.rotation.y;
|
||||
angle.z = 0;
|
||||
|
||||
sin = sin_s(angle.y);
|
||||
cos = cos_s(angle.y);
|
||||
|
||||
pos = actorx->world.position;
|
||||
pos.y += 17.5f;
|
||||
pos.x += 12.5f * sin + 10.0f * cos;
|
||||
pos.z += 10.0f * cos - 12.5f * sin;
|
||||
|
||||
Ac_Balloon_request_fly(player->balloon_actor, game, req_release_creature_p->data.balloon.balloon_type,
|
||||
&angle, 0, &pos, -1.0f, 7.0f);
|
||||
}
|
||||
}
|
||||
|
||||
release_creature_p->actor_birth_flag = TRUE;
|
||||
} else {
|
||||
release_creature_p->actor_birth_flag = FALSE;
|
||||
}
|
||||
|
||||
release_creature_p->type = type;
|
||||
release_creature_p->golden_scoop_flag = gold_scoop_flag;
|
||||
release_creature_p->release_actor_p = release_actor_p;
|
||||
release_creature_p->timer = 0.0f;
|
||||
|
||||
Player_actor_SetupItem_Base1(actorx, mPlayer_ANIM_WAIT1, -5.0f, &anim1_idx, &part_table_idx);
|
||||
Player_actor_InitAnimation_Base1(actorx, game, mPlayer_ANIM_WAIT1, anim1_idx, 1.0f, 1.0f, 0.5f, -5.0f,
|
||||
part_table_idx);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_settle_main_Release_creature(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
|
||||
player->head_angle = ZeroSVec;
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Release_creature(ACTOR* actorx) {
|
||||
Player_actor_Movement_Base_Braking_common(actorx, 0.23925f);
|
||||
}
|
||||
|
||||
static void Player_actor_CulcAnimation_Release_creature(ACTOR* actorx) {
|
||||
f32 dummy;
|
||||
|
||||
Player_actor_CulcAnimation_Base2(actorx, &dummy);
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Release_creature(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_BGcheck_Release_creature(ACTOR* actorx) {
|
||||
Player_actor_BGcheck_common_type1(actorx);
|
||||
}
|
||||
|
||||
static void Player_actor_add_calc_head_angle(ACTOR* actorx, const s_xyz* target_angle_p) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_release_creature_c* release_creature_p = &player->main_data.release_creature;
|
||||
s_xyz* head_angle_p = &player->head_angle;
|
||||
|
||||
if (release_creature_p->type == mPlayer_CREATURE_BALLOON) {
|
||||
if (target_angle_p->x != 0) {
|
||||
add_calc_short_angle2(&head_angle_p->x, target_angle_p->x, 1.0f - sqrtf(0.75f), 500, 0);
|
||||
} else {
|
||||
add_calc_short_angle2(&head_angle_p->x, target_angle_p->x, 1.0f - sqrtf(0.5f), 500, 0);
|
||||
}
|
||||
|
||||
if (target_angle_p->y != 0) {
|
||||
add_calc_short_angle2(&head_angle_p->y, target_angle_p->y, 1.0f - sqrtf(0.75f), 500, 0);
|
||||
} else {
|
||||
add_calc_short_angle2(&head_angle_p->y, target_angle_p->y, 1.0f - sqrtf(0.5f), 200, 0);
|
||||
}
|
||||
} else {
|
||||
add_calc_short_angle2(&head_angle_p->x, target_angle_p->x, 1.0f - sqrtf(0.5f), 500, 0);
|
||||
add_calc_short_angle2(&head_angle_p->y, target_angle_p->y, 1.0f - sqrtf(0.5f), 500, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static int Player_actor_Look_Release_creature(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_release_creature_c* release_creature_p = &player->main_data.release_creature;
|
||||
ACTOR* actor_p;
|
||||
int type = release_creature_p->type;
|
||||
int exist_flag;
|
||||
int ret = TRUE;
|
||||
|
||||
if (type == mPlayer_CREATURE_GYOEI) {
|
||||
if (release_creature_p->actor_birth_flag == FALSE) {
|
||||
if (player->fishing_rod_actor_p != NULL) {
|
||||
UKI_ACTOR* uki = (UKI_ACTOR*)player->fishing_rod_actor_p;
|
||||
|
||||
actor_p = uki->child_actor;
|
||||
release_creature_p->release_actor_p = actor_p;
|
||||
} else {
|
||||
actor_p = release_creature_p->release_actor_p;
|
||||
}
|
||||
} else {
|
||||
actor_p = release_creature_p->release_actor_p;
|
||||
}
|
||||
} else {
|
||||
actor_p = release_creature_p->release_actor_p;
|
||||
}
|
||||
|
||||
if (actor_p == NULL) {
|
||||
Player_actor_add_calc_head_angle(actorx, &ZeroSVec);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (type == mPlayer_CREATURE_INSECT) {
|
||||
aINS_INSECT_ACTOR* insect_actor = (aINS_INSECT_ACTOR*)actor_p;
|
||||
|
||||
exist_flag = insect_actor->insect_flags.destruct == FALSE;
|
||||
} else if (type == mPlayer_CREATURE_GYOEI) {
|
||||
GYO_RELEASE_ACTOR* gyo_release = (GYO_RELEASE_ACTOR*)actor_p;
|
||||
|
||||
exist_flag = gyo_release->exist_flag != FALSE;
|
||||
} else if (type == mPlayer_CREATURE_BALLOON) {
|
||||
BALLOON_ACTOR* balloon_actor = (BALLOON_ACTOR*)actor_p;
|
||||
int main_mode = balloon_actor->main_mode;
|
||||
int setup_mode = balloon_actor->setup_mode;
|
||||
|
||||
if (main_mode == 1 || setup_mode >= 0) {
|
||||
exist_flag = TRUE;
|
||||
ret = FALSE;
|
||||
} else {
|
||||
exist_flag = FALSE;
|
||||
}
|
||||
} else {
|
||||
Player_actor_add_calc_head_angle(actorx, &ZeroSVec);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (exist_flag == FALSE) {
|
||||
release_creature_p->release_actor_p = NULL;
|
||||
Player_actor_add_calc_head_angle(actorx, &ZeroSVec);
|
||||
return ret;
|
||||
} else {
|
||||
f32* timer_p = &release_creature_p->timer;
|
||||
s_xyz angle = ZeroSVec;
|
||||
|
||||
if (*timer_p < 60.0f) {
|
||||
xyz_t dist;
|
||||
f32 dist_xz;
|
||||
|
||||
dist.x = actor_p->world.position.x - actorx->eye.position.x;
|
||||
dist.y = actor_p->world.position.y - actorx->eye.position.y;
|
||||
dist.z = actor_p->world.position.z - actorx->eye.position.z;
|
||||
|
||||
if (type == mPlayer_CREATURE_BALLOON) {
|
||||
dist.y += 50.0f;
|
||||
}
|
||||
|
||||
dist_xz = Math3DVecLength2D(dist.x, dist.z);
|
||||
if ((dist_xz >= 18.0f && type != mPlayer_CREATURE_BALLOON) ||
|
||||
(dist_xz >= 10.0f && type == mPlayer_CREATURE_BALLOON)) {
|
||||
int dist_angle_y = atans_table(dist.z, dist.x);
|
||||
int diff_angle_y = dist_angle_y - actorx->shape_info.rotation.y;
|
||||
int abs_diff_angle_y;
|
||||
int dist_angle_x = atans_table(dist_xz, dist.y);
|
||||
int diff_angle_x = dist_angle_x - actorx->shape_info.rotation.x;
|
||||
int abs_diff_angle_x;
|
||||
|
||||
if (diff_angle_y > DEG2SHORT_ANGLE2(180.0f)) {
|
||||
diff_angle_y -= DEG2SHORT_ANGLE2(360.0f);
|
||||
} else if (diff_angle_y < DEG2SHORT_ANGLE2(-180.0f)) {
|
||||
diff_angle_y += DEG2SHORT_ANGLE2(360.0f);
|
||||
}
|
||||
|
||||
abs_diff_angle_y = ABS(diff_angle_y);
|
||||
|
||||
if (abs_diff_angle_y < DEG2SHORT_ANGLE2(60.0f)) {
|
||||
angle.x = dist_angle_y - actorx->shape_info.rotation.y;
|
||||
} else if (diff_angle_y > 0) {
|
||||
angle.x = DEG2SHORT_ANGLE2(60.0f);
|
||||
} else {
|
||||
angle.x = DEG2SHORT_ANGLE2(-60.0f);
|
||||
}
|
||||
|
||||
if (diff_angle_x > DEG2SHORT_ANGLE2(180.0f)) {
|
||||
diff_angle_x -= DEG2SHORT_ANGLE2(360.0f);
|
||||
} else if (diff_angle_x < DEG2SHORT_ANGLE2(-180.0f)) {
|
||||
diff_angle_x += DEG2SHORT_ANGLE2(360.0f);
|
||||
}
|
||||
|
||||
abs_diff_angle_x = ABS(diff_angle_x);
|
||||
|
||||
if (abs_diff_angle_x < DEG2SHORT_ANGLE2(30.0f)) {
|
||||
angle.y = dist_angle_x - actorx->shape_info.rotation.x;
|
||||
} else if (diff_angle_x > 0) {
|
||||
angle.y = DEG2SHORT_ANGLE2(30.0f);
|
||||
} else {
|
||||
angle.y = DEG2SHORT_ANGLE2(-30.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Player_actor_add_calc_head_angle(actorx, &angle);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromRelease_creature(ACTOR* actorx, GAME* game, int end_flag) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_release_creature_c* release_creature_p = &player->main_data.release_creature;
|
||||
f32* timer_p = &release_creature_p->timer;
|
||||
|
||||
(*timer_p) += 1.0f;
|
||||
if (*timer_p >= 84.0f && end_flag) {
|
||||
Player_actor_SettleRequestMainIndexPriority(actorx);
|
||||
|
||||
if (release_creature_p->golden_scoop_flag == FALSE) {
|
||||
Player_actor_request_main_wait_all(game, -5.0f, 0.0f, 0, mPlayer_REQUEST_PRIORITY_1);
|
||||
} else {
|
||||
Player_actor_request_main_demo_get_golden_item_all(game, mPlayer_GOLDEN_ITEM_TYPE_SHOVEL,
|
||||
mPlayer_REQUEST_PRIORITY_34);
|
||||
}
|
||||
|
||||
*timer_p = 84.0f;
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_main_Release_creature(ACTOR* actorx, GAME* game) {
|
||||
int end_flag;
|
||||
|
||||
Player_actor_Movement_Release_creature(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_CulcAnimation_Release_creature(actorx);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_ObjCheck_Release_creature(actorx, game);
|
||||
Player_actor_BGcheck_Release_creature(actorx);
|
||||
end_flag = Player_actor_Look_Release_creature(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
Player_actor_request_proc_index_fromRelease_creature(actorx, game, end_flag);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
static int Player_actor_request_main_rotate_octagon_all(GAME* game, ACTOR* talk_actor_p, int turn_flag,
|
||||
int ret_main_index, const xyz_t* pos_p, s16 angle_y,
|
||||
int priority) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_ROTATE_OCTAGON, priority)) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
||||
mPlayer_request_rotate_octagon_c* req_rotate_octagon_p = &player->requested_main_index_data.rotate_octagon;
|
||||
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_ROTATE_OCTAGON, priority);
|
||||
|
||||
req_rotate_octagon_p->talk_actor = talk_actor_p;
|
||||
req_rotate_octagon_p->turn_flag = turn_flag;
|
||||
req_rotate_octagon_p->prev_main_index = ret_main_index;
|
||||
req_rotate_octagon_p->pos = *pos_p;
|
||||
req_rotate_octagon_p->angle_y = angle_y;
|
||||
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Rotate_octagon(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
mPlayer_request_rotate_octagon_c* req_rotate_octagon_p = &player->requested_main_index_data.rotate_octagon;
|
||||
mPlayer_main_rotate_octagon_c* rotate_octagon_p = &player->main_data.rotate_octagon;
|
||||
|
||||
rotate_octagon_p->talk_actor_p = req_rotate_octagon_p->talk_actor;
|
||||
rotate_octagon_p->turn_flag = req_rotate_octagon_p->turn_flag;
|
||||
rotate_octagon_p->return_main_index = req_rotate_octagon_p->prev_main_index;
|
||||
|
||||
cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(kf0_p, 0.0f, 1000.0f, 0.0f, 0, 0, DEG2SHORT_ANGLE2(90.0f));
|
||||
cKF_SkeletonInfo_R_AnimationMove_ct_base(&actorx->world.position, &req_rotate_octagon_p->pos,
|
||||
actorx->shape_info.rotation.y, req_rotate_octagon_p->angle_y, 5.0f, kf0_p,
|
||||
cKF_ANIMATION_TRANS_XZ | cKF_ANIMATION_ROT_Y);
|
||||
|
||||
Player_actor_InitAnimation_Base2(actorx, game, mPlayer_ANIM_FUKUBIKI1, mPlayer_ANIM_FUKUBIKI1, 1.0f, 1.0f, 0.5f,
|
||||
-5.0f, cKF_FRAMECONTROL_STOP, mPlayer_PART_TABLE_NORMAL);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_settle_main_Rotate_octagon(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
|
||||
cKF_SkeletonInfo_R_AnimationMove_dt(kf0_p);
|
||||
actorx->world.angle.y = actorx->shape_info.rotation.y;
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Rotate_octagon(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
|
||||
cKF_SkeletonInfo_R_AnimationMove_base(&actorx->world.position, &actorx->shape_info.rotation.y, &actorx->scale,
|
||||
actorx->world.angle.y, kf0_p);
|
||||
Player_actor_Movement_Base_Stop(actorx, FALSE);
|
||||
}
|
||||
|
||||
static int Player_actor_CulcAnimation_Rotate_octagon(ACTOR* actorx, f32* last_anim0_cur_frame_p) {
|
||||
return Player_actor_CulcAnimation_Base2(actorx, last_anim0_cur_frame_p);
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Rotate_octagon(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_BGcheck_Rotate_octagon(ACTOR* actorx) {
|
||||
Player_actor_BGcheck_common_type1(actorx);
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromRotate_octagon(ACTOR* actorx, GAME* game, int end_flag) {
|
||||
if (end_flag) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_rotate_octagon_c* rotate_octagon_p = &player->main_data.rotate_octagon;
|
||||
int return_main_index = rotate_octagon_p->return_main_index;
|
||||
|
||||
Player_actor_SettleRequestMainIndexPriority(actorx);
|
||||
if (return_main_index != mPlayer_INDEX_TALK) {
|
||||
Player_actor_request_main_demo_wait_all(game, FALSE, 0, mPlayer_REQUEST_PRIORITY_19);
|
||||
} else {
|
||||
Player_actor_request_main_talk_all(game, rotate_octagon_p->talk_actor_p, rotate_octagon_p->turn_flag, -5.0f,
|
||||
FALSE, mPlayer_REQUEST_PRIORITY_19);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_main_Rotate_octagon(ACTOR* actorx, GAME* game) {
|
||||
f32 last_anim0_cur_frame;
|
||||
int end_flag;
|
||||
|
||||
end_flag = Player_actor_CulcAnimation_Rotate_octagon(actorx, &last_anim0_cur_frame);
|
||||
Player_actor_Movement_Rotate_octagon(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_ObjCheck_Rotate_octagon(actorx, game);
|
||||
Player_actor_BGcheck_Rotate_octagon(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
Player_actor_request_proc_index_fromRotate_octagon(actorx, game, end_flag);
|
||||
}
|
||||
|
||||
+15
-14
@@ -25,7 +25,8 @@ static void Player_actor_setup_main_Run_common(ACTOR* actor, GAME* game) {
|
||||
absspeed = ABS(speed);
|
||||
|
||||
Player_actor_SetupItem_Base3(actor, mPlayer_ANIM_RUN1, -absspeed, &anim_idx, &part_table_idx);
|
||||
Player_actor_InitAnimation_Base1(actor, game, mPlayer_ANIM_RUN1, anim_idx, frame, 1.0f, 0.5f, speed, part_table_idx);
|
||||
Player_actor_InitAnimation_Base1(actor, game, mPlayer_ANIM_RUN1, anim_idx, frame, 1.0f, 0.5f, speed,
|
||||
part_table_idx);
|
||||
|
||||
if (flags & 1) {
|
||||
Player_actor_SetEffect_forTakeout_item(actor, game);
|
||||
@@ -34,12 +35,12 @@ static void Player_actor_setup_main_Run_common(ACTOR* actor, GAME* game) {
|
||||
Player_actor_setup_main_Base(actor, game);
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Run(ACTOR* actor, GAME* game) {
|
||||
Player_actor_setup_main_Run_common(actor, game);
|
||||
static void Player_actor_setup_main_Run(ACTOR* actor, GAME* game) {
|
||||
Player_actor_setup_main_Run_common(actor, game);
|
||||
}
|
||||
|
||||
static void Player_actor_CulcAnimation_Run(ACTOR* actor, f32* frame_calc, f32 frame) {
|
||||
Player_actor_CulcAnimation_Walk(actor, frame_calc, frame);
|
||||
static void Player_actor_CulcAnimation_Run(ACTOR* actor, f32 over_speed_normalize_NoneZero, f32* frame_calc) {
|
||||
Player_actor_CulcAnimation_Walk(actor, over_speed_normalize_NoneZero, frame_calc);
|
||||
}
|
||||
|
||||
static void Player_actor_SetEffect_Run(ACTOR* actor, GAME* game, f32 left_target_frame, f32 right_target_frame) {
|
||||
@@ -53,16 +54,16 @@ static void Player_actor_SearchAnimation_Run(ACTOR* actor, GAME* game, f32 frame
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Run(ACTOR* actor, GAME* game, f32* frame) {
|
||||
Player_actor_Movement_Walk(actor, game, frame);
|
||||
static void Player_actor_Movement_Run(ACTOR* actor, GAME* game, f32* frame) {
|
||||
Player_actor_Movement_Walk(actor, game, frame);
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Run(ACTOR* actor, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actor, game);
|
||||
static void Player_actor_ObjCheck_Run(ACTOR* actor, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actor, game);
|
||||
}
|
||||
|
||||
static void Player_actor_BGcheck_Run(ACTOR* actor) {
|
||||
Player_actor_BGcheck_common_type1(actor);
|
||||
static void Player_actor_BGcheck_Run(ACTOR* actor) {
|
||||
Player_actor_BGcheck_common_type1(actor);
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromRun_common(ACTOR* actor, GAME* game) {
|
||||
@@ -107,12 +108,12 @@ static void Player_actor_request_proc_index_fromRun(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
|
||||
static void Player_actor_main_Run(ACTOR* actor, GAME* game) {
|
||||
f32 frame;
|
||||
f32 over_speed_normalize_NoneZero;
|
||||
f32 frame_calc;
|
||||
|
||||
Player_actor_Movement_Run(actor, game, &frame);
|
||||
Player_actor_Movement_Run(actor, game, &over_speed_normalize_NoneZero);
|
||||
Player_actor_Reinput_force_position_angle(actor, game);
|
||||
Player_actor_CulcAnimation_Run(actor, &frame_calc, frame);
|
||||
Player_actor_CulcAnimation_Run(actor, over_speed_normalize_NoneZero, &frame_calc);
|
||||
Player_actor_SearchAnimation_Run(actor, game, frame_calc);
|
||||
Player_actor_set_lean_angle(actor);
|
||||
Player_actor_set_eye_pattern_normal(actor);
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
static int Player_actor_request_main_throw_money_all(GAME* game, const xyz_t* pos_p, s16 angle_y, int priority) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_THROW_MONEY, priority)) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
||||
mPlayer_request_throw_money_c* req_throw_money_p = &player->requested_main_index_data.throw_money;
|
||||
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_THROW_MONEY, priority);
|
||||
|
||||
req_throw_money_p->pos = *pos_p;
|
||||
req_throw_money_p->angle_y = angle_y;
|
||||
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Throw_money(ACTOR* actorx, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
mPlayer_request_throw_money_c* req_throw_money_p = &player->requested_main_index_data.throw_money;
|
||||
|
||||
cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(kf0_p, 0.0f, 1000.0f, 0.0f, 0, 0, DEG2SHORT_ANGLE2(90.0f));
|
||||
cKF_SkeletonInfo_R_AnimationMove_ct_base(&actorx->world.position, &req_throw_money_p->pos,
|
||||
actorx->shape_info.rotation.y, req_throw_money_p->angle_y, 5.0f, kf0_p,
|
||||
cKF_ANIMATION_TRANS_XZ | cKF_ANIMATION_ROT_Y);
|
||||
|
||||
Player_actor_InitAnimation_Base2(actorx, game, mPlayer_ANIM_SAISEN1, mPlayer_ANIM_SAISEN1, 1.0f, 1.0f, 0.5f, -5.0f,
|
||||
cKF_FRAMECONTROL_STOP, mPlayer_PART_TABLE_NORMAL);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
|
||||
if (Camera2_Check_main_index(play, CAMERA2_PROCESS_NORMAL)) {
|
||||
Camera2_request_main_simple(play, &play->camera.lookat.center, &play->camera.direction,
|
||||
play->camera.focus_distance, 0, 9);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_settle_main_Throw_money(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
|
||||
cKF_SkeletonInfo_R_AnimationMove_dt(kf0_p);
|
||||
actorx->world.angle.y = actorx->shape_info.rotation.y;
|
||||
}
|
||||
|
||||
static int Player_actor_CulcAnimation_Throw_money(ACTOR* actorx, f32* last_anim0_cur_frame_p) {
|
||||
return Player_actor_CulcAnimation_Base2(actorx, last_anim0_cur_frame_p);
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Throw_money(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
|
||||
cKF_SkeletonInfo_R_AnimationMove_base(&actorx->world.position, &actorx->shape_info.rotation.y, &actorx->scale,
|
||||
actorx->world.angle.y, kf0_p);
|
||||
Player_actor_Movement_Base_Stop(actorx, FALSE);
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Throw_money(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_BGcheck_Throw_money(ACTOR* actorx) {
|
||||
Player_actor_BGcheck_common_type1(actorx);
|
||||
}
|
||||
|
||||
static void Player_actor_SetSound_Throw_money(ACTOR* actorx) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
cKF_FrameControl_c* fc0_p = &kf0_p->frame_control;
|
||||
|
||||
if (Player_actor_Check_AnimationFrame(fc0_p, 9.0f)) {
|
||||
Player_actor_sound_coin_gasagoso(actorx);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_SetEffect_Throw_money(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
cKF_FrameControl_c* fc0_p = &kf0_p->frame_control;
|
||||
|
||||
if (Player_actor_Check_AnimationFrame(fc0_p, 33.0f)) {
|
||||
eEC_CLIP->effect_make_proc(eEC_EFFECT_COIN, actorx->world.position, 2, 0, game, RSV_NO, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_SearchAnimation_Throw_money(ACTOR* actorx, GAME* game, f32 frame) {
|
||||
if (Player_actor_Check_AnimationFrame_PerfectEquel(actorx, frame) == FALSE) {
|
||||
Player_actor_SetSound_Throw_money(actorx);
|
||||
Player_actor_SetEffect_Throw_money(actorx, game);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromThrow_money(ACTOR* actorx, GAME* game, int end_flag) {
|
||||
if (end_flag) {
|
||||
Player_actor_SettleRequestMainIndexPriority(actorx);
|
||||
Player_actor_request_main_pray_all(game, &actorx->world.position, actorx->shape_info.rotation.y,
|
||||
mPlayer_REQUEST_PRIORITY_19);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_main_Throw_money(ACTOR* actorx, GAME* game) {
|
||||
f32 last_anim0_cur_frame;
|
||||
int end_flag;
|
||||
|
||||
end_flag = Player_actor_CulcAnimation_Throw_money(actorx, &last_anim0_cur_frame);
|
||||
Player_actor_Movement_Throw_money(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_SearchAnimation_Throw_money(actorx, game, last_anim0_cur_frame);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_set_eye_pattern_normal(actorx);
|
||||
Player_actor_ObjCheck_Throw_money(actorx, game);
|
||||
Player_actor_BGcheck_Throw_money(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
Player_actor_request_proc_index_fromThrow_money(actorx, game, end_flag);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
static int Player_actor_request_main_tired_all(GAME* game, int priority) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_TIRED, priority)) {
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_TIRED, priority);
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Tired(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_InitAnimation_Base1(actorx, game, mPlayer_ANIM_TIRED1, mPlayer_ANIM_TIRED1, 1.0f, 1.0f, 0.5f, 0.0f,
|
||||
mPlayer_PART_TABLE_NORMAL);
|
||||
Player_actor_set_eye_pattern(actorx, 4);
|
||||
Player_actor_set_mouth_pattern(actorx, 4);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_Movement_Tired(ACTOR* actorx) {
|
||||
Player_actor_Movement_Base_Braking_common(actorx, 0.23925f);
|
||||
}
|
||||
|
||||
static void Player_actor_CulcAnimation_Tired(ACTOR* actorx, f32* last_anim0_cur_frame_p) {
|
||||
Player_actor_CulcAnimation_Base2(actorx, last_anim0_cur_frame_p);
|
||||
}
|
||||
|
||||
static void Player_actor_SetEffect_Tired(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
cKF_FrameControl_c* fc0_p = &kf0_p->frame_control;
|
||||
|
||||
if (Player_actor_Check_AnimationFrame(fc0_p, 10.0f)) {
|
||||
Player_actor_sound_araiiki(actorx);
|
||||
eEC_CLIP->effect_make_proc(eEC_EFFECT_DUST, player->feel_pos, 2, actorx->shape_info.rotation.y, game, RSV_NO, 0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_SearchAnimation_Tired(ACTOR* actorx, GAME* game, f32 frame) {
|
||||
if (Player_actor_Check_AnimationFrame_PerfectEquel(actorx, frame) == FALSE) {
|
||||
Player_actor_SetEffect_Tired(actorx, game);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_ObjCheck_Tired(ACTOR* actorx, GAME* game) {
|
||||
Player_actor_Excute_Corect_forStand(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_BGcheck_Tired(ACTOR* actorx) {
|
||||
Player_actor_BGcheck_common_type1(actorx);
|
||||
}
|
||||
|
||||
static void Player_actor_main_Tired(ACTOR* actorx, GAME* game) {
|
||||
f32 last_anim0_cur_frame;
|
||||
|
||||
Player_actor_Movement_Tired(actorx);
|
||||
Player_actor_Reinput_force_position_angle(actorx, game);
|
||||
Player_actor_CulcAnimation_Tired(actorx, &last_anim0_cur_frame);
|
||||
Player_actor_SearchAnimation_Tired(actorx, game, last_anim0_cur_frame);
|
||||
Player_actor_recover_lean_angle(actorx);
|
||||
Player_actor_ObjCheck_Tired(actorx, game);
|
||||
Player_actor_BGcheck_Tired(actorx);
|
||||
Player_actor_Item_main(actorx, game);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ static void Player_actor_setup_Item_Tumble_getup(ACTOR* actor, GAME* game, int k
|
||||
|
||||
if (check && balloon) {
|
||||
s_xyz angle;
|
||||
xyz_t pos;
|
||||
f32 frame;
|
||||
|
||||
player->main_data.balloon.balloon_shape_type = mPlib_Get_ItemKindTOBalloonShapeType(kind);
|
||||
@@ -29,8 +30,9 @@ static void Player_actor_setup_Item_Tumble_getup(ACTOR* actor, GAME* game, int k
|
||||
angle.y = actor->shape_info.rotation.y;
|
||||
angle.z = 0;
|
||||
|
||||
pos = player->right_hand_pos;
|
||||
Ac_Balloon_request_fly(player->balloon_actor, game, player->main_data.balloon.balloon_shape_type, &angle,
|
||||
player->balloon_angle.z, player->right_hand_pos, frame, 7.0f);
|
||||
player->balloon_angle.z, &pos, frame, 7.0f);
|
||||
} else {
|
||||
player->main_data.balloon.balloon_shape_type = -1;
|
||||
}
|
||||
@@ -111,7 +113,8 @@ static void Player_actor_request_proc_index_fromTumble_getup(ACTOR* actor, GAME*
|
||||
Player_actor_request_main_wait_all(game, -5.0f, 0.0f, 0, mPlayer_REQUEST_PRIORITY_1);
|
||||
} else {
|
||||
type = player->main_data.balloon.balloon_shape_type;
|
||||
Player_actor_request_main_release_creature_all(game, 2, 0, &type, player->balloon_actor, mPlayer_REQUEST_PRIORITY_30);
|
||||
Player_actor_request_main_release_creature_all(game, 2, 0, &type, player->balloon_actor,
|
||||
mPlayer_REQUEST_PRIORITY_30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ static void Player_actor_settle_main_Walk(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_CulcAnimation_Walk(ACTOR* actor, f32* frame_calc, f32 frame) {
|
||||
static void Player_actor_CulcAnimation_Walk(ACTOR* actor, f32 over_speed_normalize_NoneZero, f32* frame_calc) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actor;
|
||||
f32 sp = (actor->speed * frame) / 7.5f;
|
||||
f32 sp = (actor->speed * over_speed_normalize_NoneZero) / 7.5f;
|
||||
|
||||
sp = sqrtf(sp);
|
||||
sp = 0.6f * sp;
|
||||
@@ -270,12 +270,12 @@ static void Player_actor_request_proc_index_fromWalk(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
|
||||
static void Player_actor_main_Walk(ACTOR* actor, GAME* game) {
|
||||
f32 frame;
|
||||
f32 over_speed_normalize_NoneZero;
|
||||
f32 calc_frame;
|
||||
|
||||
Player_actor_Movement_Walk(actor, game, &frame);
|
||||
Player_actor_Movement_Walk(actor, game, &over_speed_normalize_NoneZero);
|
||||
Player_actor_Reinput_force_position_angle(actor, game);
|
||||
Player_actor_CulcAnimation_Walk(actor, &calc_frame, frame);
|
||||
Player_actor_CulcAnimation_Walk(actor, over_speed_normalize_NoneZero, &calc_frame);
|
||||
Player_actor_SearchAnimation_Walk(actor, game, calc_frame);
|
||||
Player_actor_set_lean_angle(actor);
|
||||
Player_actor_set_eye_pattern_normal(actor);
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
static int Player_actor_request_main_wash_car_all(GAME* game, const xyz_t* car_pos_p, const xyz_t* orig_pos_p,
|
||||
s16 orig_angle_y, ACTOR* parent_actor, int prio) {
|
||||
if (Player_actor_check_request_main_able(game, mPlayer_INDEX_WASH_CAR, prio)) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR_GAME(game);
|
||||
mPlayer_request_wash_car_c* req_wash_car_p = &player->requested_main_index_data.wash_car;
|
||||
|
||||
Player_actor_request_main_index(game, mPlayer_INDEX_WASH_CAR, prio);
|
||||
req_wash_car_p->car_pos = *car_pos_p;
|
||||
req_wash_car_p->orig_pos = *orig_pos_p;
|
||||
req_wash_car_p->parent_actor = parent_actor;
|
||||
req_wash_car_p->orig_angle_y = orig_angle_y;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Player_actor_setup_main_Wash_car(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_request_wash_car_c* req_wash_car_p = &player->requested_main_index_data.wash_car;
|
||||
mPlayer_main_wash_car_c* wash_car_p = &player->main_data.wash_car;
|
||||
|
||||
actorx->world.position = req_wash_car_p->car_pos;
|
||||
wash_car_p->ret_pos = req_wash_car_p->orig_pos;
|
||||
wash_car_p->ret_angle_y = req_wash_car_p->orig_angle_y;
|
||||
wash_car_p->control_actor = req_wash_car_p->parent_actor;
|
||||
wash_car_p->anime_idx = 0;
|
||||
wash_car_p->change_anime_idx = 0;
|
||||
wash_car_p->counter = 0;
|
||||
wash_car_p->ret_order = FALSE;
|
||||
wash_car_p->effect_flag = FALSE;
|
||||
|
||||
actorx->shape_info.rotation.y = 0;
|
||||
actorx->world.angle.y = 0;
|
||||
|
||||
Player_actor_InitAnimation_Base2(actorx, game, mPlayer_ANIM_WASH1, mPlayer_ANIM_WASH1, 1.0f, 1.0f, 0.0f, 0.0f,
|
||||
cKF_FRAMECONTROL_STOP, mPlayer_PART_TABLE_NORMAL);
|
||||
Player_actor_setup_main_Base(actorx, game);
|
||||
}
|
||||
|
||||
static void Player_actor_settle_main_Wash_car(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_wash_car_c* wash_car_p = &player->main_data.wash_car;
|
||||
|
||||
actorx->world.position = wash_car_p->ret_pos;
|
||||
actorx->world.angle.y = actorx->shape_info.rotation.y = wash_car_p->ret_angle_y;
|
||||
eEC_CLIP->effect_kill_proc(eEC_EFFECT_ASE2, RSV_NO);
|
||||
}
|
||||
|
||||
static int Player_actor_CulcAnimation_Wash_car(ACTOR* actorx, GAME* game, f32* last_anim0_cur_frame_p) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
cKF_SkeletonInfo_R_c* kf0_p = &player->keyframe0;
|
||||
cKF_FrameControl_c* fc0_p = &kf0_p->frame_control;
|
||||
mPlayer_main_wash_car_c* wash_car_p = &player->main_data.wash_car;
|
||||
int* counter_p = &wash_car_p->counter;
|
||||
int* change_anime_idx_p = &wash_car_p->change_anime_idx;
|
||||
int end_flag;
|
||||
|
||||
if (*change_anime_idx_p) {
|
||||
int* anime_idx_p = &wash_car_p->anime_idx;
|
||||
static const u8 data[] = {
|
||||
mPlayer_ANIM_WASH1, mPlayer_ANIM_WASH2, mPlayer_ANIM_WASH3, mPlayer_ANIM_WASH4, mPlayer_ANIM_WASH5,
|
||||
};
|
||||
int anim_idx;
|
||||
f32 speed;
|
||||
|
||||
(*anime_idx_p)++;
|
||||
if (*anime_idx_p < 0 || *anime_idx_p >= 5) {
|
||||
*anime_idx_p = 0;
|
||||
}
|
||||
|
||||
anim_idx = data[*anime_idx_p];
|
||||
speed = fc0_p->speed;
|
||||
Player_actor_InitAnimation_Base2(actorx, game, anim_idx, anim_idx, 1.0f, 1.0f, speed, 0.0f,
|
||||
cKF_FRAMECONTROL_STOP, mPlayer_PART_TABLE_NORMAL);
|
||||
*counter_p = 0;
|
||||
*change_anime_idx_p = FALSE;
|
||||
wash_car_p->effect_flag = TRUE;
|
||||
}
|
||||
|
||||
end_flag = Player_actor_CulcAnimation_Base3(actorx, last_anim0_cur_frame_p);
|
||||
if (end_flag) {
|
||||
if (*counter_p >= 3) {
|
||||
eEC_CLIP->effect_kill_proc(eEC_EFFECT_ASE2, RSV_NO);
|
||||
*change_anime_idx_p = TRUE;
|
||||
} else {
|
||||
(*counter_p)++;
|
||||
fc0_p->current_frame = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
return end_flag;
|
||||
}
|
||||
|
||||
static void Player_actor_SetEffect_Wash_car(ACTOR* actorx, f32 frame) {
|
||||
if (Player_actor_Check_AnimationFrame_PerfectEquel(actorx, frame) == FALSE) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_wash_car_c* wash_car_p = &player->main_data.wash_car;
|
||||
|
||||
if (wash_car_p->change_anime_idx == FALSE) {
|
||||
wash_car_p->effect_flag = TRUE;
|
||||
}
|
||||
} else {
|
||||
eEC_CLIP->effect_kill_proc(eEC_EFFECT_ASE2, RSV_NO);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_SearchAnimation_Wash_car(ACTOR* actorx, f32 frame) {
|
||||
Player_actor_Check_AnimationFrame_PerfectEquel(actorx, frame); // Unnecessary call, a leftover or mistake
|
||||
Player_actor_SetEffect_Wash_car(actorx, frame);
|
||||
}
|
||||
|
||||
static void Player_actor_request_proc_index_fromWash_car(ACTOR* actorx, GAME* game) {
|
||||
PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx;
|
||||
mPlayer_main_wash_car_c* wash_car_p = &player->main_data.wash_car;
|
||||
|
||||
if (wash_car_p->ret_order) {
|
||||
Player_actor_SettleRequestMainIndexPriority(actorx);
|
||||
Player_actor_request_main_tired_all(game, mPlayer_REQUEST_PRIORITY_19);
|
||||
}
|
||||
}
|
||||
|
||||
static void Player_actor_main_Wash_car(ACTOR* actorx, GAME* game) {
|
||||
f32 last_anim0_cur_frame;
|
||||
|
||||
Player_actor_CulcAnimation_Wash_car(actorx, game, &last_anim0_cur_frame);
|
||||
Player_actor_SearchAnimation_Wash_car(actorx, last_anim0_cur_frame);
|
||||
Player_actor_request_proc_index_fromWash_car(actorx, game);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user