mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Implement & link ac_intro_demo
This commit is contained in:
@@ -445,6 +445,11 @@ ac_haniwa.c:
|
||||
.text: [0x80427624, 0x80428F64]
|
||||
.rodata: [0x806440B8, 0x806440F8]
|
||||
.data: [0x80683D08, 0x80683E98]
|
||||
ac_intro_demo.c:
|
||||
.text: [0x8042A97C, 0x8042B65C]
|
||||
.rodata: [0x80644128, 0x80644158]
|
||||
.data: [0x80684208, 0x806842E0]
|
||||
.bss: [0x812F9C50, 0x812F9C60]
|
||||
ac_mbg.c:
|
||||
.text: [0x8042DCA0, 0x8042DEC8]
|
||||
.rodata: [0x80644218, 0x80644238]
|
||||
|
||||
+46
-47
@@ -17,65 +17,65 @@ extern "C" {
|
||||
#define aBTD_PROGRAM_SIZE 0x15244
|
||||
|
||||
enum {
|
||||
aBTD_ACTION_SENDO_BIRTH_WAIT,
|
||||
aBTD_ACTION_PL_RIDE_ON_START_WAIT,
|
||||
aBTD_ACTION_PL_RIDE_ON_END_WAIT,
|
||||
aBTD_ACTION_START_CALL_END_WAIT,
|
||||
aBTD_ACTION_SONG_BGM_START_WAIT,
|
||||
aBTD_ACTION_SING_SENDO_START_WAIT,
|
||||
aBTD_ACTION_SING_SENDO_MSG_SET_WAIT,
|
||||
aBTD_ACTION_SENDO_DIALOGUE_START_WAIT,
|
||||
aBTD_ACTION_SING_SENDO_START_WAIT2,
|
||||
aBTD_ACTION_MOVE_BOAT_END_WAIT,
|
||||
aBTD_ACTION_TOUCH_WHARF_END_WAIT,
|
||||
aBTD_ACTION_PL_RIDE_OFF_START_WAIT,
|
||||
aBTD_ACTION_PL_RIDE_OFF_END_WAIT,
|
||||
aBTD_ACTION_ANCHOR_WAIT,
|
||||
aBTD_ACTION_SENDO_BIRTH_WAIT,
|
||||
aBTD_ACTION_PL_RIDE_ON_START_WAIT,
|
||||
aBTD_ACTION_PL_RIDE_ON_END_WAIT,
|
||||
aBTD_ACTION_START_CALL_END_WAIT,
|
||||
aBTD_ACTION_SONG_BGM_START_WAIT,
|
||||
aBTD_ACTION_SING_SENDO_START_WAIT,
|
||||
aBTD_ACTION_SING_SENDO_MSG_SET_WAIT,
|
||||
aBTD_ACTION_SENDO_DIALOGUE_START_WAIT,
|
||||
aBTD_ACTION_SING_SENDO_START_WAIT2,
|
||||
aBTD_ACTION_MOVE_BOAT_END_WAIT,
|
||||
aBTD_ACTION_TOUCH_WHARF_END_WAIT,
|
||||
aBTD_ACTION_PL_RIDE_OFF_START_WAIT,
|
||||
aBTD_ACTION_PL_RIDE_OFF_END_WAIT,
|
||||
aBTD_ACTION_ANCHOR_WAIT,
|
||||
|
||||
aBTD_ACTION_NUM
|
||||
aBTD_ACTION_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
aBTD_DEMO_PL_RIDE_ON_START,
|
||||
aBTD_DEMO_PL_RIDE_ON_END,
|
||||
aBTD_DEMO_START_CALL_END,
|
||||
aBTD_DEMO_MOVE_BOAT_END,
|
||||
aBTD_DEMO_TOUCH_WHARF_END,
|
||||
aBTD_DEMO_PL_RIDE_OFF_START,
|
||||
aBTD_DEMO_PL_RIDE_OFF_END,
|
||||
aBTD_DEMO_ANCHOR,
|
||||
aBTD_DEMO_PL_RIDE_ON_START,
|
||||
aBTD_DEMO_PL_RIDE_ON_END,
|
||||
aBTD_DEMO_START_CALL_END,
|
||||
aBTD_DEMO_MOVE_BOAT_END,
|
||||
aBTD_DEMO_TOUCH_WHARF_END,
|
||||
aBTD_DEMO_PL_RIDE_OFF_START,
|
||||
aBTD_DEMO_PL_RIDE_OFF_END,
|
||||
aBTD_DEMO_ANCHOR,
|
||||
|
||||
aBTD_DEMO_NUM
|
||||
aBTD_DEMO_NUM
|
||||
};
|
||||
|
||||
typedef struct boat_demo_s BOAT_DEMO_ACTOR;
|
||||
|
||||
#define aBTD_GET_DEMO_ACTOR() (BOAT_DEMO_ACTOR*)(Common_Get(clip).demo_clip2->class)
|
||||
#define aBTD_GET_DEMO_ACTOR() (BOAT_DEMO_ACTOR*)(Common_Get(clip).demo_clip2->demo_class)
|
||||
|
||||
typedef void (*aBTD_PROC)(BOAT_DEMO_ACTOR*, GAME_PLAY*);
|
||||
|
||||
struct boat_demo_s {
|
||||
ACTOR actor_class;
|
||||
int action;
|
||||
aBTD_PROC action_proc;
|
||||
int demo_act;
|
||||
int song_bgm_timer;
|
||||
BOAT_ACTOR* boat_actor;
|
||||
NPC_SENDO_ACTOR* npc_sendo_actor;
|
||||
EV_CASTAWAY_ACTOR* castaway_actor;
|
||||
int at_island;
|
||||
xyz_t passenger_ofs;
|
||||
f32 boat_speed;
|
||||
int island_npc_info_registered;
|
||||
u8* island_gba_loader_p;
|
||||
u8* island_gba_program_p;
|
||||
u8 player_pattern;
|
||||
u8 sing_dialog_ofs;
|
||||
u8 sing_2nd_part;
|
||||
u8 sing_2nd_part_bgm_no;
|
||||
int sing_msg_no;
|
||||
u16 touch_wharf_timer;
|
||||
u8 touching_wharf;
|
||||
ACTOR actor_class;
|
||||
int action;
|
||||
aBTD_PROC action_proc;
|
||||
int demo_act;
|
||||
int song_bgm_timer;
|
||||
BOAT_ACTOR* boat_actor;
|
||||
NPC_SENDO_ACTOR* npc_sendo_actor;
|
||||
EV_CASTAWAY_ACTOR* castaway_actor;
|
||||
int at_island;
|
||||
xyz_t passenger_ofs;
|
||||
f32 boat_speed;
|
||||
int island_npc_info_registered;
|
||||
u8* island_gba_loader_p;
|
||||
u8* island_gba_program_p;
|
||||
u8 player_pattern;
|
||||
u8 sing_dialog_ofs;
|
||||
u8 sing_2nd_part;
|
||||
u8 sing_2nd_part_bgm_no;
|
||||
int sing_msg_no;
|
||||
u16 touch_wharf_timer;
|
||||
u8 touching_wharf;
|
||||
};
|
||||
|
||||
extern ACTOR_PROFILE Boat_Demo_Profile;
|
||||
@@ -85,4 +85,3 @@ extern ACTOR_PROFILE Boat_Demo_Profile;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+24
-11
@@ -3,34 +3,47 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "ac_npc_rcn_guide.h"
|
||||
#include "ac_npc_station_master.h"
|
||||
#include "ac_train1.h"
|
||||
#include "m_demo.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define aID_PLR_START_X_POS (mFI_BK_WORLDSIZE_X_F * 3 + 1.25f * mFI_UT_WORLDSIZE_X_F)
|
||||
#define aID_PLR_START_Z_POS (mFI_BK_WORLDSIZE_Z_F * 1 + 3 * mFI_UT_WORLDSIZE_Z_F)
|
||||
|
||||
#define aID_OFF_UT_X_POS (mFI_BK_WORLDSIZE_X_F * 3 + 7 * mFI_UT_WORLDSIZE_X_F + mFI_UT_WORLDSIZE_HALF_X_F)
|
||||
#define aID_OFF_UT_Z_POS (mFI_BK_WORLDSIZE_Z_F * 1 + 5 * mFI_UT_WORLDSIZE_Z_F) /* A @ 5 */
|
||||
|
||||
#define aID_OUT_OF_STATION_Z_POS (mFI_BK_WORLDSIZE_Z_F * 1 + 8.25f * mFI_UT_WORLDSIZE_Z_F)
|
||||
|
||||
enum {
|
||||
aID_STATE_0,
|
||||
aID_STATE_INITIAL,
|
||||
aID_STATE_TAKEN_HOUSE,
|
||||
aID_STATE_FREE_HOUSE,
|
||||
// more?
|
||||
|
||||
aID_STATE_NUM
|
||||
};
|
||||
|
||||
typedef struct actor_intor_demo_s INTRO_DEMO_ACTOR;
|
||||
typedef struct actor_intro_demo_s INTRO_DEMO_ACTOR;
|
||||
|
||||
struct actor_intor_demo_s {
|
||||
typedef void (*aID_ACT_PROC)(INTRO_DEMO_ACTOR*, GAME_PLAY*);
|
||||
|
||||
struct actor_intro_demo_s {
|
||||
ACTOR actor_class;
|
||||
int action;
|
||||
int rcn_action;
|
||||
void (*action_proc)(ACTOR*, GAME*);
|
||||
void* train1_actor_p; // TODO: correct type
|
||||
void* station_master_actor_p; // TODO: correct type
|
||||
void* rcn_guide_actor_p; // TODO: correct type
|
||||
int next_action;
|
||||
aID_ACT_PROC action_proc;
|
||||
TRAIN1_ACTOR* train1_actor_p;
|
||||
ACTOR* station_master_actor_p; // TODO: correct type
|
||||
ACTOR* rcn_guide_actor_p; // TODO: correct type
|
||||
int player_in_intro_demo;
|
||||
int player_intro_demo_state;
|
||||
int selected_house;
|
||||
int _198;
|
||||
int house_idx;
|
||||
int talk_flag;
|
||||
u8 first_field_bgm_state;
|
||||
int _1A0;
|
||||
int _1A4;
|
||||
|
||||
+4
-5
@@ -10,7 +10,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct train1_s{
|
||||
typedef struct train1_s {
|
||||
ACTOR actor_class;
|
||||
int anim_state;
|
||||
cKF_SkeletonInfo_R_c keyframe;
|
||||
@@ -20,13 +20,13 @@ typedef struct train1_s{
|
||||
u8 pad4[0x2b4 - 0x2A0];
|
||||
int tr_action;
|
||||
int player_pass_exists;
|
||||
int player_pass_leaving; //Not sure about this one
|
||||
int player_pass_leaving; // Not sure about this one
|
||||
int unk2c0;
|
||||
ACTOR* tr_actor_p;
|
||||
f32 tr_speed;
|
||||
f32 tr0_pos;
|
||||
u8 pad2[0x2D8-0x2CC];
|
||||
}TRAIN1_ACTOR;
|
||||
u8 pad2[0x2D8 - 0x2CC];
|
||||
} TRAIN1_ACTOR;
|
||||
|
||||
extern ACTOR_PROFILE Train1_Profile;
|
||||
|
||||
@@ -35,4 +35,3 @@ extern ACTOR_PROFILE Train1_Profile;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+109
-1
@@ -154,7 +154,115 @@ typedef enum audio_sound_effects {
|
||||
} AudioSE;
|
||||
|
||||
typedef enum bgm_e {
|
||||
BGM_AEROBICS = 27,
|
||||
BGM_SILENCE,
|
||||
BGM_FIELD_00,
|
||||
BGM_FIELD_01,
|
||||
BGM_FIELD_02,
|
||||
BGM_FIELD_03,
|
||||
BGM_FIELD_04,
|
||||
BGM_FIELD_05,
|
||||
BGM_FIELD_06,
|
||||
BGM_FIELD_07,
|
||||
BGM_FIELD_08,
|
||||
BGM_FIELD_09,
|
||||
BGM_FIELD_10,
|
||||
BGM_FIELD_11,
|
||||
BGM_FIELD_12,
|
||||
BGM_FIELD_13,
|
||||
BGM_FIELD_14,
|
||||
BGM_FIELD_15,
|
||||
BGM_FIELD_16,
|
||||
BGM_FIELD_17,
|
||||
BGM_FIELD_18,
|
||||
BGM_FIELD_19,
|
||||
BGM_FIELD_20,
|
||||
BGM_FIELD_21,
|
||||
BGM_FIELD_22,
|
||||
BGM_FIELD_23,
|
||||
BGM_BROKERS_SHOP,
|
||||
BGM_FORTUNE_TELLER,
|
||||
BGM_SPORTSFAIR_AEROBICS,
|
||||
BGM_SPORTSFAIR_FOOTRACE,
|
||||
BGM_SPORTSFAIR_BALLTOSS,
|
||||
BGM_HARVEST_MOON,
|
||||
BGM_NEW_YEARS_1HR,
|
||||
BGM_NEW_YEARS_30MIN,
|
||||
BGM_NEW_YEARS_10MIN,
|
||||
BGM_NEW_YEARS_5MIN,
|
||||
BGM_NEW_YEARS_NOW,
|
||||
BGM_NEW_YEARS_DAY,
|
||||
BGM_SHOP1,
|
||||
BGM_SHOP2,
|
||||
BGM_SHOP3,
|
||||
BGM_DIG_ITEM,
|
||||
BGM_POST_OFFICE0,
|
||||
BGM_INTRO_TRAIN,
|
||||
BGM_INTRO_KK,
|
||||
BGM_SHOP0,
|
||||
BGM_POLICE_BOX,
|
||||
BGM_SAVE,
|
||||
BGM_INTRO_ARRIVE,
|
||||
BGM_INTRO_STATION,
|
||||
BGM_INTRO_RCN_GUIDE,
|
||||
BGM_INTRO_SELECT_HOUSE,
|
||||
BGM_INTRO_SELECT_HOUSE2,
|
||||
BGM_INTRO_FIND_SHOP,
|
||||
BGM_INTRO_CHORES,
|
||||
BGM_XMAS_EVE,
|
||||
BGM_FIREWORKS_FESTIVAL,
|
||||
BGM_CHERRY_BLOSSOM_FESTIVAL,
|
||||
BGM_NEW_YEARS_PARTY,
|
||||
BGM_KK_HAZURE0,
|
||||
BGM_NEW_YEARS_WISH,
|
||||
BGM_SPORTSFAIR_TUGOFWAR,
|
||||
BGM_NEW_YEARS_MORNING,
|
||||
BGM_POST_OFFICE1,
|
||||
BGM_TRAIN_PULL_INTO_TOWN,
|
||||
BGM_TRAIN_BOARD,
|
||||
BGM_ENTER_HOUSE,
|
||||
BGM_RESET,
|
||||
BGM_BEE_CHASE,
|
||||
BGM_BEE_STUNG,
|
||||
BGM_RAIN,
|
||||
BGM_TITLE,
|
||||
BGM_TRAIN_ARRIVAL_WAIT,
|
||||
BGM_INTRO_NEW_TOWN,
|
||||
BGM_INTRO_CHORES_COMPLETE,
|
||||
BGM_DEBT_PAID,
|
||||
BGM_ALL_INSECTS,
|
||||
BGM_ALL_FISH,
|
||||
BGM_KAMAKURA,
|
||||
BGM_RESET2,
|
||||
BGM_SHOP0_LATE,
|
||||
BGM_SHOP1_LATE,
|
||||
BGM_SHOP2_LATE,
|
||||
BGM_SHOP3_LATE,
|
||||
BGM_NINTENDO0,
|
||||
BGM_NINTENDO1,
|
||||
BGM_NINTENDO2,
|
||||
BGM_NINTENDO3,
|
||||
BGM_NINTENDO4,
|
||||
BGM_MUSEUM,
|
||||
BGM_TAILORS,
|
||||
BGM_90,
|
||||
BGM_ISLAND,
|
||||
BGM_KAPPA_SONG0,
|
||||
BGM_KAPPA_SONG1,
|
||||
BGM_KAPPA_SONG2,
|
||||
BGM_KAPPA_SONG3,
|
||||
BGM_KAPPA_SONG4,
|
||||
BGM_KAPPA_SONG5,
|
||||
BGM_KAPPA_SONG6,
|
||||
BGM_KAPPA_SONG7,
|
||||
BGM_KAPPA_SONG8,
|
||||
BGM_KAPPA_SONG9,
|
||||
BGM_KAPPA_SONG10,
|
||||
BGM_KAPPA_SONG11,
|
||||
BGM_KAPPA_SONG12,
|
||||
BGM_KAPPA_SONG13,
|
||||
BGM_KAPPA_SONG14,
|
||||
BGM_KAPPA_SONG15,
|
||||
// TODO: others
|
||||
BGM_MD0 = 128,
|
||||
} BGM_e;
|
||||
|
||||
|
||||
@@ -297,6 +297,7 @@ extern void mCoBG_InitBlockBgCheckMode();
|
||||
extern void mCoBG_InitDecalCircle();
|
||||
|
||||
extern void mCoBG_CalcTimerDecalCircle();
|
||||
extern int mCoBG_ChangeBlockBgCheckMode(int mode);
|
||||
|
||||
extern f32 mCoBG_GetWaterHeight_File(xyz_t wpos, char* file, int line);
|
||||
#define mCoBG_GetWaterHeight(wpos) mCoBG_GetWaterHeight_File(wpos, __FILE__, __LINE__)
|
||||
|
||||
@@ -243,7 +243,7 @@ typedef struct common_data_s {
|
||||
/* 0x028598 */ int event_keep_flags[4];
|
||||
/* 0x0285A8 */ u8 _285A8[0x0285BE - 0x0285A8];
|
||||
/* 0x0285BE */ s8 player_actor_exists;
|
||||
/* 0x0285BF */ s8 payment_completed_type;
|
||||
/* 0x0285BF */ s8 complete_payment_type;
|
||||
/* 0x0285C0 */ s8 player_decoy_flag;
|
||||
/* 0x0285C1 */ u8 _285C1;
|
||||
/* 0x0285C2 */ u8 make_npc2_actor;
|
||||
|
||||
+96
-96
@@ -24,142 +24,142 @@ extern "C" {
|
||||
#define mDemo_WINDOW_COLOR_A 255
|
||||
|
||||
enum {
|
||||
mDemo_STATE_WAIT,
|
||||
mDemo_STATE_READY,
|
||||
mDemo_STATE_RUN,
|
||||
// ???
|
||||
mDemo_STATE_STOP = 9,
|
||||
mDemo_STATE_WAIT,
|
||||
mDemo_STATE_READY,
|
||||
mDemo_STATE_RUN,
|
||||
// ???
|
||||
mDemo_STATE_STOP = 9,
|
||||
|
||||
mDemo_STATE_NUM
|
||||
mDemo_STATE_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mDemo_DIRECT_N,
|
||||
mDemo_DIRECT_NE,
|
||||
mDemo_DIRECT_E,
|
||||
mDemo_DIRECT_SE,
|
||||
mDemo_DIRECT_S,
|
||||
mDemo_DIRECT_SW,
|
||||
mDemo_DIRECT_W,
|
||||
mDemo_DIRECT_NW,
|
||||
mDemo_DIRECT_N,
|
||||
mDemo_DIRECT_NE,
|
||||
mDemo_DIRECT_E,
|
||||
mDemo_DIRECT_SE,
|
||||
mDemo_DIRECT_S,
|
||||
mDemo_DIRECT_SW,
|
||||
mDemo_DIRECT_W,
|
||||
mDemo_DIRECT_NW,
|
||||
|
||||
mDemo_DIRECT_NUM
|
||||
mDemo_DIRECT_NUM
|
||||
};
|
||||
|
||||
enum demo_type {
|
||||
mDemo_TYPE_NONE,
|
||||
mDemo_TYPE_SCROLL,
|
||||
mDemo_TYPE_2,
|
||||
mDemo_TYPE_DOOR,
|
||||
mDemo_TYPE_4,
|
||||
mDemo_TYPE_SCROLL2,
|
||||
mDemo_TYPE_DOOR2,
|
||||
mDemo_TYPE_TALK,
|
||||
mDemo_TYPE_SPEAK,
|
||||
mDemo_TYPE_REPORT,
|
||||
mDemo_TYPE_SPEECH,
|
||||
mDemo_TYPE_OUTDOOR,
|
||||
mDemo_TYPE_12,
|
||||
mDemo_TYPE_EVENTMSG,
|
||||
mDemo_TYPE_EVENTMSG2,
|
||||
mDemo_TYPE_15,
|
||||
mDemo_TYPE_SCROLL3,
|
||||
mDemo_TYPE_NONE,
|
||||
mDemo_TYPE_SCROLL,
|
||||
mDemo_TYPE_2,
|
||||
mDemo_TYPE_DOOR,
|
||||
mDemo_TYPE_4,
|
||||
mDemo_TYPE_SCROLL2,
|
||||
mDemo_TYPE_DOOR2,
|
||||
mDemo_TYPE_TALK,
|
||||
mDemo_TYPE_SPEAK,
|
||||
mDemo_TYPE_REPORT,
|
||||
mDemo_TYPE_SPEECH,
|
||||
mDemo_TYPE_OUTDOOR,
|
||||
mDemo_TYPE_12,
|
||||
mDemo_TYPE_EVENTMSG,
|
||||
mDemo_TYPE_EVENTMSG2,
|
||||
mDemo_TYPE_15,
|
||||
mDemo_TYPE_SCROLL3,
|
||||
|
||||
mDemo_TYPE_NUM
|
||||
mDemo_TYPE_NUM
|
||||
};
|
||||
|
||||
enum demo_order_type {
|
||||
mDemo_ORDER_PLAYER,
|
||||
mDemo_ORDER_1,
|
||||
mDemo_ORDER_2,
|
||||
mDemo_ORDER_3,
|
||||
mDemo_ORDER_NPC0,
|
||||
mDemo_ORDER_NPC1,
|
||||
mDemo_ORDER_NPC2,
|
||||
mDemo_ORDER_7,
|
||||
mDemo_ORDER_8,
|
||||
mDemo_ORDER_QUEST,
|
||||
mDemo_ORDER_PLAYER,
|
||||
mDemo_ORDER_1,
|
||||
mDemo_ORDER_2,
|
||||
mDemo_ORDER_3,
|
||||
mDemo_ORDER_NPC0,
|
||||
mDemo_ORDER_NPC1,
|
||||
mDemo_ORDER_NPC2,
|
||||
mDemo_ORDER_7,
|
||||
mDemo_ORDER_8,
|
||||
mDemo_ORDER_QUEST,
|
||||
|
||||
mDemo_ORDER_NUM
|
||||
mDemo_ORDER_NUM
|
||||
};
|
||||
|
||||
typedef void (*mDemo_REQUEST_PROC)(ACTOR*);
|
||||
|
||||
typedef struct demo_clip_s {
|
||||
void* class;
|
||||
int type; /* 0 = none?, 1 = intro_demo, 2 = ride_off_demo */
|
||||
void* demo_class;
|
||||
int type; /* 0 = none?, 1 = intro_demo, 2 = ride_off_demo */
|
||||
} mDemo_Clip_c;
|
||||
|
||||
enum demo_clip_type {
|
||||
mDemo_CLIP_TYPE_NONE,
|
||||
mDemo_CLIP_TYPE_INTRO_DEMO,
|
||||
mDemo_CLIP_TYPE_RIDE_OFF_DEMO,
|
||||
mDemo_CLIP_TYPE_PRESENT_DEMO,
|
||||
mDemo_CLIP_TYPE_BOAT_DEMO,
|
||||
mDemo_CLIP_TYPE_RESET_DEMO,
|
||||
mDemo_CLIP_TYPE_NONE,
|
||||
mDemo_CLIP_TYPE_INTRO_DEMO,
|
||||
mDemo_CLIP_TYPE_RIDE_OFF_DEMO,
|
||||
mDemo_CLIP_TYPE_PRESENT_DEMO,
|
||||
mDemo_CLIP_TYPE_BOAT_DEMO,
|
||||
mDemo_CLIP_TYPE_RESET_DEMO,
|
||||
|
||||
mDemo_CLIP_TYPE_NUM
|
||||
mDemo_CLIP_TYPE_NUM
|
||||
};
|
||||
|
||||
typedef struct demo_req_s {
|
||||
ACTOR* actor;
|
||||
int type;
|
||||
mDemo_REQUEST_PROC proc;
|
||||
f32 talk_weight;
|
||||
ACTOR* actor;
|
||||
int type;
|
||||
mDemo_REQUEST_PROC proc;
|
||||
f32 talk_weight;
|
||||
} mDemo_Request_c;
|
||||
|
||||
typedef struct demo_door_data_s {
|
||||
int type;
|
||||
int type;
|
||||
|
||||
struct {
|
||||
f32 size;
|
||||
int direct;
|
||||
} house_info;
|
||||
struct {
|
||||
f32 size;
|
||||
int direct;
|
||||
} house_info;
|
||||
} mDemo_door_data_c;
|
||||
|
||||
typedef struct demo_emsg_data_s {
|
||||
int msg_no;
|
||||
rgba_t window_color;
|
||||
int msg_delay_timer;
|
||||
int scene_delay_timer;
|
||||
Door_data_c door_data;
|
||||
u8 _24[4]; // unused?
|
||||
int msg_no;
|
||||
rgba_t window_color;
|
||||
int msg_delay_timer;
|
||||
int scene_delay_timer;
|
||||
Door_data_c door_data;
|
||||
u8 _24[4]; // unused?
|
||||
} mDemo_emsg_data_c;
|
||||
|
||||
typedef struct demo_talk_data_s {
|
||||
int msg_no;
|
||||
int turn;
|
||||
int use_zoom_sound;
|
||||
int display_name;
|
||||
int change_player;
|
||||
int return_get_golden_axe_demo;
|
||||
int return_demo_wait;
|
||||
rgba_t window_color;
|
||||
u8 actor_saved_weight;
|
||||
int msg_no;
|
||||
int turn;
|
||||
int use_zoom_sound;
|
||||
int display_name;
|
||||
int change_player;
|
||||
int return_get_golden_axe_demo;
|
||||
int return_demo_wait;
|
||||
rgba_t window_color;
|
||||
u8 actor_saved_weight;
|
||||
} mDemo_talk_data_c;
|
||||
|
||||
typedef struct demo_data_s {
|
||||
ACTOR* speaker_actor;
|
||||
ACTOR* listen_actor;
|
||||
int speaker_able;
|
||||
int listen_able;
|
||||
u16 order_data[mDemo_ORDER_NUM][mDemo_ORDER_VALUE_MAX];
|
||||
s8 change_player_destiny;
|
||||
int state;
|
||||
mDemo_Request_c current;
|
||||
mDemo_Request_c request[mDemo_REQUEST_NUM];
|
||||
int request_num;
|
||||
int priority_type;
|
||||
int camera_type;
|
||||
int keep_camera_type;
|
||||
ACTOR* speaker_actor;
|
||||
ACTOR* listen_actor;
|
||||
int speaker_able;
|
||||
int listen_able;
|
||||
u16 order_data[mDemo_ORDER_NUM][mDemo_ORDER_VALUE_MAX];
|
||||
s8 change_player_destiny;
|
||||
int state;
|
||||
mDemo_Request_c current;
|
||||
mDemo_Request_c request[mDemo_REQUEST_NUM];
|
||||
int request_num;
|
||||
int priority_type;
|
||||
int camera_type;
|
||||
int keep_camera_type;
|
||||
|
||||
union {
|
||||
mDemo_door_data_c door;
|
||||
mDemo_emsg_data_c emsg;
|
||||
mDemo_talk_data_c talk;
|
||||
} data;
|
||||
union {
|
||||
mDemo_door_data_c door;
|
||||
mDemo_emsg_data_c emsg;
|
||||
mDemo_talk_data_c talk;
|
||||
} data;
|
||||
|
||||
mDemo_Request_c request_save;
|
||||
mDemo_Request_c request_save;
|
||||
} mDemo_Data_c;
|
||||
|
||||
extern ACTOR* mDemo_Get_talk_actor();
|
||||
|
||||
@@ -571,7 +571,9 @@ typedef struct event_common_save_data {
|
||||
|
||||
extern void mEv_clear_status(int event, s16 status);
|
||||
extern int mEv_CheckFirstJob();
|
||||
extern void mEv_UnSetFirstJob();
|
||||
extern int mEv_CheckFirstIntro();
|
||||
extern void mEv_UnSetFirstIntro();
|
||||
extern int mEv_CheckArbeit();
|
||||
extern int mEv_CheckTitleDemo();
|
||||
extern int mEv_check_status(int event, s16 status);
|
||||
|
||||
+49
-5
@@ -11,6 +11,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define mPlayer_DEBT0 17400 /* Buy house */
|
||||
#define mPlayer_DEBT1 148000 /* 1st upgrade main floor */
|
||||
#define mPlayer_DEBT2 398000 /* 2nd upgrade main floor */
|
||||
#define mPlayer_DEBT3 49800 /* Basement */
|
||||
#define mPlayer_DEBT4 798000 /* Upper floor */
|
||||
|
||||
typedef struct player_actor_s PLAYER_ACTOR;
|
||||
|
||||
#define mPlayer_FORCE_POSITION_ANGLE_NONE 0
|
||||
@@ -33,6 +39,14 @@ enum {
|
||||
mPlayer_ADDRESSABLE_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mPlayer_COMPLETE_PAYMENT_TYPE_NONE,
|
||||
mPlayer_COMPLETE_PAYMENT_TYPE_ARBEIT,
|
||||
mPlayer_COMPLETE_PAYMENT_TYPE_HOUSE,
|
||||
|
||||
mPlayer_COMPLETE_PAYMENT_TYPE_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mPlayer_INDEX_DMA,
|
||||
mPlayer_INDEX_INTRO,
|
||||
@@ -668,8 +682,6 @@ typedef struct player_request_demo_get_golden_item_s {
|
||||
u32 label;
|
||||
} mPlayer_request_demo_get_golden_item_c;
|
||||
|
||||
//
|
||||
|
||||
typedef struct player_request_walk_s {
|
||||
xyz_t pos;
|
||||
f32 morph_speed;
|
||||
@@ -1181,6 +1193,38 @@ typedef union {
|
||||
// u8 force_size[72]; // TEMP
|
||||
} mPlayer_request_main_data;
|
||||
|
||||
/* Current main state data structs */
|
||||
|
||||
typedef struct player_main_intro_s {
|
||||
f32 timer;
|
||||
} mPlayer_main_intro_c;
|
||||
|
||||
typedef struct player_main_return_demo_s {
|
||||
f32 timer;
|
||||
f32 max_timer;
|
||||
int prev_main_index;
|
||||
} mPlayer_main_return_demo_c;
|
||||
|
||||
typedef struct player_main_return_outdoor_s {
|
||||
f32 timer;
|
||||
f32 max_timer;
|
||||
int prev_main_index;
|
||||
} mPlayer_main_return_outdoor_c;
|
||||
|
||||
typedef struct player_main_return_outdoor2_s {
|
||||
f32 timer;
|
||||
f32 max_timer;
|
||||
int prev_main_index;
|
||||
} mPlayer_main_return_outdoor2_c;
|
||||
|
||||
typedef union {
|
||||
mPlayer_main_intro_c intro;
|
||||
mPlayer_main_return_demo_c return_demo;
|
||||
mPlayer_main_return_outdoor_c return_outdoor;
|
||||
mPlayer_main_return_outdoor2_c return_outdoor2;
|
||||
u8 force_size[72]; // TEMP
|
||||
} mPlayer_main_data;
|
||||
|
||||
typedef struct {
|
||||
int requested_main_index;
|
||||
int requested_index_pending;
|
||||
@@ -1212,9 +1256,9 @@ struct player_actor_s {
|
||||
/* 0x0D0C */ int requested_main_index_priority;
|
||||
/* 0x0D10 */ int requested_main_index_changed;
|
||||
/* 0x0D14 */ int settled_requested_main_index_priority;
|
||||
/* 0x0D18 */ u8 main_index_data[72]; // TODO: Union of many types...
|
||||
/* 0x0D60 */ u8 requested_main_index_data[72]; // TODO: Union of many types...
|
||||
/* 0x0DA8 */ u8 _0DA8[0x1010 - 0x0DA8]; /* TODO: finish */
|
||||
/* 0x0D18 */ mPlayer_main_data main_data; // TODO: Union of many types...
|
||||
/* 0x0D60 */ mPlayer_request_main_data requested_main_index_data; // Union of many types...
|
||||
/* 0x0DA8 */ u8 _0DA8[0x1010 - 0x0DA8]; /* TODO: finish */
|
||||
/* 0x1010 */ ClObjPipe_c col_pipe;
|
||||
/* 0x102C */ xyz_t head_pos;
|
||||
/* 0x1038 */ xyz_t feel_pos;
|
||||
|
||||
@@ -97,6 +97,9 @@ extern u8* mPlib_get_player_tex_p(GAME* game);
|
||||
extern u16* mPlib_get_player_pallet_p(GAME* game);
|
||||
extern u16* mPlib_get_player_face_pallet_p(GAME* game);
|
||||
extern int mPlib_Check_scoop_after(GAME* game, xyz_t* pos, mActor_name_t* item, ACTOR** hit_actor, int gold_shovel);
|
||||
extern int mPlib_request_main_demo_standing_train_type1(GAME* game);
|
||||
extern void mPlib_Set_unable_wade(int unable);
|
||||
extern int mPlib_request_main_demo_getoff_train_type1(GAME* game);
|
||||
|
||||
extern mPlayer_change_data_from_submenu_c* mPlib_Get_change_data_from_submenu_p();
|
||||
|
||||
|
||||
+27
-27
@@ -15,17 +15,17 @@ static void aBTD_actor_dt(ACTOR* actorx, GAME* game);
|
||||
static void aBTD_actor_move(ACTOR* actorx, GAME* game);
|
||||
|
||||
ACTOR_PROFILE Boat_Demo_Profile = {
|
||||
mAc_PROFILE_BOAT_DEMO,
|
||||
ACTOR_PART_CONTROL,
|
||||
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(BOAT_DEMO_ACTOR),
|
||||
&aBTD_actor_ct,
|
||||
&aBTD_actor_dt,
|
||||
&aBTD_actor_move,
|
||||
mActor_NONE_PROC1,
|
||||
NULL
|
||||
mAc_PROFILE_BOAT_DEMO,
|
||||
ACTOR_PART_CONTROL,
|
||||
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(BOAT_DEMO_ACTOR),
|
||||
&aBTD_actor_ct,
|
||||
&aBTD_actor_dt,
|
||||
&aBTD_actor_move,
|
||||
mActor_NONE_PROC1,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static mDemo_Clip_c aBTD_clip;
|
||||
@@ -46,28 +46,28 @@ extern u8 aBTD_island_ldr[];
|
||||
static void aBTD_setupAction(BOAT_DEMO_ACTOR* boat_demo, GAME_PLAY* play, int action);
|
||||
|
||||
static void aBTD_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
BOAT_DEMO_ACTOR* boat_demo = (BOAT_DEMO_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
BOAT_DEMO_ACTOR* boat_demo = (BOAT_DEMO_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
Common_Get(clip).demo_clip2 = &aBTD_clip;
|
||||
bzero(&aBTD_clip, sizeof(aBTD_clip));
|
||||
Common_Get(clip).demo_clip2->class = boat_demo;
|
||||
Common_Get(clip).demo_clip2->type = mDemo_CLIP_TYPE_BOAT_DEMO;
|
||||
boat_demo->island_gba_loader_p = aBTD_island_ldr;
|
||||
boat_demo->island_gba_program_p = aBTD_island_prg;
|
||||
Common_Get(clip).demo_clip2 = &aBTD_clip;
|
||||
bzero(&aBTD_clip, sizeof(aBTD_clip));
|
||||
Common_Get(clip).demo_clip2->demo_class = boat_demo;
|
||||
Common_Get(clip).demo_clip2->type = mDemo_CLIP_TYPE_BOAT_DEMO;
|
||||
boat_demo->island_gba_loader_p = aBTD_island_ldr;
|
||||
boat_demo->island_gba_program_p = aBTD_island_prg;
|
||||
|
||||
if (mFI_CheckBlockKind(play->block_table.block_x, play->block_table.block_z, mRF_BLOCKKIND_ISLAND) == TRUE) {
|
||||
boat_demo->at_island = TRUE;
|
||||
boat_demo->island_npc_info_registered = TRUE;
|
||||
}
|
||||
if (mFI_CheckBlockKind(play->block_table.block_x, play->block_table.block_z, mRF_BLOCKKIND_ISLAND) == TRUE) {
|
||||
boat_demo->at_island = TRUE;
|
||||
boat_demo->island_npc_info_registered = TRUE;
|
||||
}
|
||||
|
||||
aBTD_setupAction(boat_demo, play, aBTD_ACTION_SENDO_BIRTH_WAIT);
|
||||
aBTD_setupAction(boat_demo, play, aBTD_ACTION_SENDO_BIRTH_WAIT);
|
||||
}
|
||||
|
||||
static void aBTD_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
if (Common_Get(clip).demo_clip2 != NULL) {
|
||||
Common_Get(clip).demo_clip2 = NULL;
|
||||
}
|
||||
if (Common_Get(clip).demo_clip2 != NULL) {
|
||||
Common_Get(clip).demo_clip2 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#include "../src/ac_boat_demo_move.c_inc"
|
||||
|
||||
@@ -108,7 +108,7 @@ static int aHNW_check_house_door(ACTOR* actor, GAME* game) {
|
||||
mDemo_Clip_c* demo_clip = Common_Get(clip).demo_clip;
|
||||
|
||||
if (demo_clip != NULL) {
|
||||
INTRO_DEMO_ACTOR* demo_class = (INTRO_DEMO_ACTOR*)demo_clip->class;
|
||||
INTRO_DEMO_ACTOR* demo_class = (INTRO_DEMO_ACTOR*)demo_clip->demo_class;
|
||||
if (demo_class != NULL && demo_clip->type == mDemo_CLIP_TYPE_INTRO_DEMO && mEv_CheckFirstIntro() &&
|
||||
demo_class->player_intro_demo_state != 0) {
|
||||
res = TRUE;
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
#include "ac_intro_demo.h"
|
||||
|
||||
#include "m_name_table.h"
|
||||
#include "m_common_data.h"
|
||||
#include "libultra/libultra.h"
|
||||
#include "m_event.h"
|
||||
#include "m_play.h"
|
||||
#include "m_bgm.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_house.h"
|
||||
|
||||
enum {
|
||||
aID_ACT_FIRST_SET,
|
||||
aID_ACT_TRAIN_BIRTH_WAIT,
|
||||
aID_ACT_RIDE_TRAIN,
|
||||
aID_ACT_RIDE_OFF_PLAYER,
|
||||
aID_ACT_WALK_ONE_UNIT,
|
||||
aID_ACT_GO_OUT_OF_STATION,
|
||||
aID_ACT_BIRTH_RCN_GUIDE,
|
||||
aID_ACT_FIRST_TALK_END_WAIT,
|
||||
aID_ACT_WALK_AFTER_RCN_GUIDE,
|
||||
aID_ACT_IN_HOUSE,
|
||||
aID_ACT_DECIDE_HOUSE,
|
||||
aID_ACT_RETIRE_RCN_GUIDE_WAIT,
|
||||
aID_ACT_FIRST_JOB,
|
||||
|
||||
aID_ACT_NUM
|
||||
};
|
||||
|
||||
static void aID_actor_ct(ACTOR* actorx, GAME* game);
|
||||
static void aID_actor_dt(ACTOR* actorx, GAME* game);
|
||||
static void aID_actor_move(ACTOR* actorx, GAME* game);
|
||||
|
||||
// clang-format off
|
||||
ACTOR_PROFILE Intro_Demo_Profile = {
|
||||
mAc_PROFILE_INTRO_DEMO,
|
||||
ACTOR_PART_CONTROL,
|
||||
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(INTRO_DEMO_ACTOR),
|
||||
&aID_actor_ct,
|
||||
&aID_actor_dt,
|
||||
&aID_actor_move,
|
||||
mActor_NONE_PROC1,
|
||||
NULL,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static mDemo_Clip_c aID_clip;
|
||||
|
||||
static void aID_setupAction(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play, int action);
|
||||
|
||||
static void aID_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
Common_Get(clip).demo_clip = &aID_clip;
|
||||
bzero(&aID_clip, sizeof(aID_clip));
|
||||
Common_Get(clip).demo_clip->demo_class = actorx;
|
||||
Common_Get(clip).demo_clip->type = mDemo_CLIP_TYPE_INTRO_DEMO;
|
||||
|
||||
if (mEv_CheckFirstIntro() == TRUE) {
|
||||
if (Common_Get(field_type) == mFI_FIELDTYPE_FG) {
|
||||
switch (mFI_GET_TYPE(Common_Get(last_field_id))) {
|
||||
case mFI_FIELD_PLAYER0_ROOM:
|
||||
intro_demo->_1A4 = TRUE;
|
||||
intro_demo->next_action = aID_ACT_DECIDE_HOUSE;
|
||||
aID_setupAction(intro_demo, play, aID_ACT_BIRTH_RCN_GUIDE);
|
||||
mBGMPsComp_make_ps_demo(BGM_INTRO_STATION, 0x168);
|
||||
break;
|
||||
default:
|
||||
aID_setupAction(intro_demo, play, 0);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
aID_setupAction(intro_demo, play, aID_ACT_IN_HOUSE);
|
||||
}
|
||||
} else {
|
||||
aID_setupAction(intro_demo, play, aID_ACT_FIRST_JOB);
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)actorx;
|
||||
|
||||
if (Common_Get(clip).demo_clip != NULL) {
|
||||
Common_Get(clip).demo_clip = NULL;
|
||||
}
|
||||
|
||||
if (intro_demo->first_field_bgm_state == 2) {
|
||||
mBGMPsComp_delete_ps_fieldSuddenEv(BGM_INTRO_SELECT_HOUSE2, 0x168);
|
||||
}
|
||||
}
|
||||
|
||||
#include "../src/ac_intro_demo_move.c_inc"
|
||||
@@ -0,0 +1,331 @@
|
||||
static void aID_change_player_demo_standing_train(GAME* game) {
|
||||
if (mPlib_get_player_actor_main_index(game) != mPlayer_INDEX_DEMO_STANDING_TRAIN) {
|
||||
mPlib_request_main_demo_standing_train_type1(game);
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_set_first_field_bgm(INTRO_DEMO_ACTOR* intro_demo) {
|
||||
mBGMPsComp_make_ps_fieldSuddenEv(BGM_INTRO_SELECT_HOUSE2, 0x168, 1);
|
||||
mBGMPsComp_scene_mode(1);
|
||||
intro_demo->first_field_bgm_state = 2;
|
||||
}
|
||||
|
||||
static void aID_check_set_first_field_bgm(INTRO_DEMO_ACTOR* intro_demo) {
|
||||
if (intro_demo->first_field_bgm_state == 1 && sAdo_BgmFadeoutCheck() == TRUE) {
|
||||
aID_set_first_field_bgm(intro_demo);
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_first_set(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
Common_Set(train_coming_flag, 3);
|
||||
aID_change_player_demo_standing_train(&play->game);
|
||||
aID_setupAction(intro_demo, play, aID_ACT_TRAIN_BIRTH_WAIT);
|
||||
}
|
||||
|
||||
static void aID_train_birth_wait(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
TRAIN1_ACTOR* train = (TRAIN1_ACTOR*)Actor_info_fgName_search(&play->actor_info, TRAIN1, ACTOR_PART_ITEM);
|
||||
|
||||
aID_change_player_demo_standing_train(&play->game);
|
||||
if (train != NULL) {
|
||||
intro_demo->train1_actor_p = train;
|
||||
train->player_pass_exists = TRUE;
|
||||
aID_setupAction(intro_demo, play, aID_ACT_RIDE_TRAIN);
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_ride_train(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
TRAIN1_ACTOR* train = intro_demo->train1_actor_p;
|
||||
|
||||
aID_change_player_demo_standing_train(&play->game);
|
||||
if (train->tr_action == 5) {
|
||||
aID_setupAction(intro_demo, play, aID_ACT_RIDE_OFF_PLAYER);
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_ride_off_player(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
ACTOR* station_master = intro_demo->station_master_actor_p;
|
||||
|
||||
if (intro_demo->_1A0 == 0) {
|
||||
/* Wait for the station master to speak to the player */
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, station_master) == TRUE) {
|
||||
intro_demo->_1A0 = 1;
|
||||
}
|
||||
} else {
|
||||
/* Wait for the station master to be done speaking to the player */
|
||||
if (mDemo_Check(mDemo_TYPE_SPEAK, station_master) == FALSE) {
|
||||
aID_setupAction(intro_demo, play, aID_ACT_WALK_ONE_UNIT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_walk_one_unit(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
|
||||
|
||||
if (player != NULL) {
|
||||
if (player->actor_class.world.position.z >= aID_OFF_UT_Z_POS) {
|
||||
/* Reached target position */
|
||||
aID_setupAction(intro_demo, play, aID_ACT_GO_OUT_OF_STATION);
|
||||
} else {
|
||||
/* Walk to A-3 @ 5Z, 7.5X */
|
||||
mPlib_Set_goal_player_demo_walk(aID_OFF_UT_X_POS, aID_OFF_UT_Z_POS, 2.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_go_out_of_station(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
PLAYER_ACTOR* player = GET_PLAYER_ACTOR(play);
|
||||
|
||||
if (player != NULL) {
|
||||
if (player->actor_class.world.position.z >= aID_OUT_OF_STATION_Z_POS) {
|
||||
mPlib_request_main_demo_wait_type1(&play->game, 0, NULL);
|
||||
intro_demo->next_action = aID_ACT_FIRST_TALK_END_WAIT;
|
||||
aID_setupAction(intro_demo, play, aID_ACT_BIRTH_RCN_GUIDE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_birth_rcn_guide(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
static mActor_name_t rcn_name[] = { SP_NPC_RCN_GUIDE, SP_NPC_RCN_GUIDE_1, SP_NPC_RCN_GUIDE_2, SP_NPC_RCN_GUIDE_3 };
|
||||
static int restart_ux[] = { 6, 9, 6, 9 };
|
||||
static int restart_uz[] = { 5, 5, 12, 12 };
|
||||
static f32 restartOffsetX[] = { 10.0f, -10.0f, 10.0f, -10.0f };
|
||||
mActor_name_t name = rcn_name[mSP_GetShopLevel()];
|
||||
int type;
|
||||
int data;
|
||||
int ux;
|
||||
int uz;
|
||||
f32 ofsX;
|
||||
f32 ofsZ;
|
||||
s16 param;
|
||||
int house_idx;
|
||||
ACTOR* rcn_actor;
|
||||
|
||||
if (intro_demo->_1A4 == TRUE) {
|
||||
house_idx = Common_Get(last_field_id) - mFI_FIELD_PLAYER0_ROOM;
|
||||
intro_demo->house_idx = house_idx;
|
||||
ux = restart_ux[house_idx];
|
||||
uz = restart_uz[house_idx];
|
||||
ofsX = restartOffsetX[house_idx];
|
||||
ofsZ = 8.0f;
|
||||
if (mPr_NullCheckPersonalID(&Save_Get(homes[house_idx]).ownerID) == TRUE) {
|
||||
param = aID_STATE_TAKEN_HOUSE;
|
||||
} else {
|
||||
param = aID_STATE_FREE_HOUSE;
|
||||
}
|
||||
data = 3;
|
||||
type = 2;
|
||||
} else {
|
||||
data = 3;
|
||||
type = 1;
|
||||
ux = 8;
|
||||
uz = 15;
|
||||
ofsX = 0.0f;
|
||||
ofsZ = 0.0f;
|
||||
param = aID_STATE_INITIAL;
|
||||
}
|
||||
|
||||
if (Common_Get(clip).npc_clip->setupActor_proc(play, name, -1, -1, param, data, type, ux, uz) == TRUE) {
|
||||
rcn_actor = Actor_info_fgName_search(&play->actor_info, name, ACTOR_PART_NPC);
|
||||
intro_demo->rcn_guide_actor_p = rcn_actor;
|
||||
rcn_actor->world.position.x += ofsX;
|
||||
rcn_actor->world.position.z += ofsZ;
|
||||
aID_setupAction(intro_demo, play, intro_demo->next_action);
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_first_talk_end_wait(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
if (intro_demo->talk_flag == TRUE) {
|
||||
intro_demo->talk_flag = FALSE;
|
||||
aID_setupAction(intro_demo, play, aID_ACT_WALK_AFTER_RCN_GUIDE);
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_walk_after_rcn_guide(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
static f32 rate_table[] = { 1.0f, 0.6f };
|
||||
NPC_ACTOR* rcn_guide = (NPC_ACTOR*)intro_demo->rcn_guide_actor_p;
|
||||
f32 rate = rate_table[rcn_guide->actor_class.player_distance_xz < 80.0f] * rcn_guide->actor_class.speed;
|
||||
|
||||
/* Walk the player to the raccoon guide NPC's position */
|
||||
mPlib_Set_goal_player_demo_walk(rcn_guide->actor_class.world.position.x, rcn_guide->actor_class.world.position.z,
|
||||
rate);
|
||||
|
||||
/* If we've finished our action then stop walking and move on */
|
||||
if (((NPC_ACTOR*)intro_demo->rcn_guide_actor_p)->action.idx == 0) {
|
||||
mPlib_request_main_wait_type3(&play->game);
|
||||
aID_setupAction(intro_demo, play, aID_ACT_DECIDE_HOUSE);
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_decide_house(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
if (intro_demo->talk_flag == TRUE) {
|
||||
aID_setupAction(intro_demo, play, aID_ACT_RETIRE_RCN_GUIDE_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_retire_rcn_guide_wait(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
mQst_errand_c* errand;
|
||||
|
||||
if (intro_demo->rcn_guide_actor_p == NULL) {
|
||||
mPlib_request_main_wait_type3(&play->game);
|
||||
mHS_set_use(Common_Get(player_no), intro_demo->house_idx);
|
||||
|
||||
mPr_SetItemCollectBit(Now_Private->cloth.item);
|
||||
mPr_SetItemCollectBit(FTR_TAPEDECK);
|
||||
mPr_SetItemCollectBit(ITM_CARPET_START +
|
||||
Save_Get(homes[intro_demo->house_idx]).floors[0].wall_floor.flooring_idx);
|
||||
mPr_SetItemCollectBit(ITM_WALL_START +
|
||||
Save_Get(homes[intro_demo->house_idx]).floors[0].wall_floor.wallpaper_idx);
|
||||
|
||||
mHm_SetNowHome();
|
||||
mPlib_Set_unable_wade(FALSE);
|
||||
mCoBG_ChangeBlockBgCheckMode(0);
|
||||
mEv_UnSetFirstIntro();
|
||||
Now_Private->inventory.loan = mPlayer_DEBT0;
|
||||
errand = mQst_GetFirstJobData();
|
||||
mQst_SetFirstJobStart(errand);
|
||||
aID_setupAction(intro_demo, play, aID_ACT_FIRST_JOB);
|
||||
}
|
||||
|
||||
aID_check_set_first_field_bgm(intro_demo);
|
||||
}
|
||||
|
||||
static void aID_first_job(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
if (intro_demo->_1A8 == TRUE) {
|
||||
mQst_errand_c* errand = mQst_GetFirstJobData();
|
||||
|
||||
mQst_ClearErrand(errand, 1);
|
||||
mEv_UnSetFirstJob();
|
||||
mTM_off_renew_time(1);
|
||||
Actor_delete(&intro_demo->actor_class);
|
||||
Common_Set(complete_payment_type, mPlayer_COMPLETE_PAYMENT_TYPE_ARBEIT);
|
||||
play->event.day = 0;
|
||||
} else {
|
||||
aID_check_set_first_field_bgm(intro_demo);
|
||||
}
|
||||
}
|
||||
|
||||
static void aID_first_set_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
Actor_data* player_data = play->player_data;
|
||||
|
||||
mBGMPsComp_make_ps_demo(BGM_INTRO_ARRIVE, 0x168);
|
||||
mBGMPsComp_scene_mode(9);
|
||||
player_data->position.x = aID_PLR_START_X_POS;
|
||||
player_data->position.z = aID_PLR_START_Z_POS;
|
||||
}
|
||||
|
||||
static void aID_train_birth_wait_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
xyz_t center_pos;
|
||||
|
||||
center_pos.x = 2180.0f;
|
||||
center_pos.z = 820.0f;
|
||||
center_pos.y = mCoBG_GetBgY_OnlyCenter_FromWpos2(center_pos, -35.0f);
|
||||
Camera2_request_main_demo_fromNowPos2(play, ¢er_pos, 0.0f, 0.0f, 0.0f, 9);
|
||||
}
|
||||
|
||||
static void aID_ride_off_player_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
static xyz_t enter_pos = { 2180.0f, 0.0f, 820.0f };
|
||||
TRAIN1_ACTOR* train = intro_demo->train1_actor_p;
|
||||
ACTOR* station_master = Actor_info_fgName_search(&play->actor_info, SP_NPC_STATION_MASTER, ACTOR_PART_NPC);
|
||||
|
||||
intro_demo->station_master_actor_p = station_master;
|
||||
train->player_pass_exists = FALSE;
|
||||
mPlib_request_main_demo_getoff_train_type1(&play->game);
|
||||
intro_demo->_1A0 = 0;
|
||||
mCoBG_SetAttribute(enter_pos, mCoBG_ATTRIBUTE_STONE);
|
||||
}
|
||||
|
||||
static void aID_walk_one_unit_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
mPlib_request_main_demo_walk_type1(&play->game, 2220.0f, 840.0f, 2.5f, 0);
|
||||
}
|
||||
|
||||
static void aID_go_out_of_station_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
mPlib_request_main_wait_type3(&play->game);
|
||||
Camera2_request_main_normal(play, 0, 9);
|
||||
}
|
||||
|
||||
static void aID_walk_after_rcn_guide_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
ACTOR* rcn_guide = intro_demo->rcn_guide_actor_p;
|
||||
|
||||
/* Walk the player to the raccoon guide NPC's position */
|
||||
mPlib_request_main_demo_walk_type1(&play->game, rcn_guide->world.position.x, rcn_guide->world.position.z,
|
||||
rcn_guide->speed * 0.6f, 0);
|
||||
}
|
||||
|
||||
static void aID_decide_house_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
mPlib_Set_unable_wade(TRUE); /* We can't switch acres */
|
||||
mCoBG_ChangeBlockBgCheckMode(1); /* Acre BG check mode altered */
|
||||
}
|
||||
|
||||
static void aID_retire_rcn_guide_wait_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
mPlib_request_main_demo_wait_type1(&play->game, 0, NULL);
|
||||
mBGMPsComp_delete_ps_demo(BGM_INTRO_SELECT_HOUSE, 0x168);
|
||||
mBGMPsComp_make_ps_fc_quiet(0x2D0);
|
||||
intro_demo->first_field_bgm_state = 1;
|
||||
}
|
||||
|
||||
static void aID_first_job_init(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play) {
|
||||
mQst_errand_c* errand = mQst_GetFirstJobData();
|
||||
|
||||
if (errand->base.quest_kind == mQst_ERRAND_FIRSTJOB_CHANGE_CLOTH ||
|
||||
errand->base.quest_kind == mQst_ERRAND_FIRSTJOB_START ||
|
||||
(errand->base.quest_kind == mQst_ERRAND_FIRSTJOB_PLANT_FLOWER && errand->base.progress == 1)) {
|
||||
if (Common_Get(field_type) == mFI_FIELD_FG && intro_demo->first_field_bgm_state == 0) {
|
||||
aID_set_first_field_bgm(intro_demo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef void (*aID_INIT_PROC)(INTRO_DEMO_ACTOR*, GAME_PLAY*);
|
||||
|
||||
static void aID_init_proc(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play, int act) {
|
||||
// clang-format off
|
||||
static aID_INIT_PROC init_proc[] = {
|
||||
&aID_first_set_init,
|
||||
&aID_train_birth_wait_init,
|
||||
(aID_INIT_PROC)&none_proc1,
|
||||
&aID_ride_off_player_init,
|
||||
&aID_walk_one_unit_init,
|
||||
&aID_go_out_of_station_init,
|
||||
(aID_INIT_PROC)&none_proc1,
|
||||
(aID_INIT_PROC)&none_proc1,
|
||||
&aID_walk_after_rcn_guide_init,
|
||||
(aID_INIT_PROC)&none_proc1,
|
||||
&aID_decide_house_init,
|
||||
&aID_retire_rcn_guide_wait_init,
|
||||
&aID_first_job_init,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
(*init_proc[act])(intro_demo, play);
|
||||
}
|
||||
|
||||
static void aID_setupAction(INTRO_DEMO_ACTOR* intro_demo, GAME_PLAY* play, int act) {
|
||||
// clang-format off
|
||||
static aID_ACT_PROC process[] = {
|
||||
&aID_first_set,
|
||||
&aID_train_birth_wait,
|
||||
&aID_ride_train,
|
||||
&aID_ride_off_player,
|
||||
&aID_walk_one_unit,
|
||||
&aID_go_out_of_station,
|
||||
&aID_birth_rcn_guide,
|
||||
&aID_first_talk_end_wait,
|
||||
&aID_walk_after_rcn_guide,
|
||||
(aID_ACT_PROC)&none_proc1,
|
||||
&aID_decide_house,
|
||||
&aID_retire_rcn_guide_wait,
|
||||
&aID_first_job,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
intro_demo->action_proc = process[act];
|
||||
intro_demo->action = act;
|
||||
aID_init_proc(intro_demo, play, act);
|
||||
}
|
||||
|
||||
static void aID_actor_move(ACTOR* actorx, GAME* game) {
|
||||
INTRO_DEMO_ACTOR* intro_demo = (INTRO_DEMO_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
(*intro_demo->action_proc)(intro_demo, play);
|
||||
}
|
||||
@@ -200,7 +200,7 @@ static int aMHS_check_player_in_intro_demo(STRUCTURE_ACTOR* my_house, GAME_PLAY*
|
||||
return 0;
|
||||
}
|
||||
|
||||
intro_demo = (INTRO_DEMO_ACTOR*)clip->class;
|
||||
intro_demo = (INTRO_DEMO_ACTOR*)clip->demo_class;
|
||||
if (intro_demo == NULL || clip->type != mDemo_CLIP_TYPE_INTRO_DEMO || mEv_CheckFirstIntro() == FALSE) {
|
||||
return 0;
|
||||
}
|
||||
@@ -214,7 +214,7 @@ static int aMHS_check_player_in_intro_demo(STRUCTURE_ACTOR* my_house, GAME_PLAY*
|
||||
|
||||
my_house->arg3_f = TRUE;
|
||||
action = my_house->action;
|
||||
intro_demo->selected_house = action;
|
||||
intro_demo->house_idx = action;
|
||||
intro_demo->player_intro_demo_state =
|
||||
mPr_NullCheckPersonalID(&Save_Get(homes[action]).ownerID) ? aID_STATE_TAKEN_HOUSE : aID_STATE_FREE_HOUSE;
|
||||
return 2;
|
||||
@@ -400,7 +400,7 @@ static void aMHS_open_door(STRUCTURE_ACTOR* my_house, GAME_PLAY* play) {
|
||||
aMHS_goto_next_pl_scene(play, my_house);
|
||||
|
||||
if (Common_Get(clip).demo_clip != NULL && Common_Get(clip).demo_clip->type == mDemo_CLIP_TYPE_INTRO_DEMO) {
|
||||
demo_class = Common_Get(clip).demo_clip->class;
|
||||
demo_class = Common_Get(clip).demo_clip->demo_class;
|
||||
|
||||
if (demo_class != NULL) {
|
||||
intro_demo = (INTRO_DEMO_ACTOR*)demo_class;
|
||||
|
||||
+7
-7
@@ -1101,7 +1101,7 @@ static void aMR_MiniDiskCommonDt(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
my_room->bgm_info.last_md_no = -1;
|
||||
|
||||
/* Don't delete for aerobics radio music */
|
||||
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
|
||||
if (my_room->bgm_info.md_no != BGM_SPORTSFAIR_AEROBICS) {
|
||||
mBGMPsComp_MDPlayerPos_delete();
|
||||
}
|
||||
}
|
||||
@@ -1134,7 +1134,7 @@ static void aMR_ChangeMDBgm(ACTOR* actorx, FTR_ACTOR* ftr_actor) {
|
||||
if (my_room->bgm_info.md_no != -1) {
|
||||
mBGMPsComp_make_ps_room(my_room->bgm_info.md_no, 0);
|
||||
|
||||
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
|
||||
if (my_room->bgm_info.md_no != BGM_SPORTSFAIR_AEROBICS) {
|
||||
mBGMPsComp_MDPlayerPos_make();
|
||||
}
|
||||
|
||||
@@ -1150,12 +1150,12 @@ static void aMR_ChangeMDBgm(ACTOR* actorx, FTR_ACTOR* ftr_actor) {
|
||||
my_room->bgm_info.last_md_no = my_room->bgm_info.md_no;
|
||||
} else {
|
||||
mBGMPsComp_delete_ps_room(my_room->bgm_info.last_md_no, 0);
|
||||
if (my_room->bgm_info.last_md_no != BGM_AEROBICS) {
|
||||
if (my_room->bgm_info.last_md_no != BGM_SPORTSFAIR_AEROBICS) {
|
||||
mBGMPsComp_MDPlayerPos_delete();
|
||||
}
|
||||
|
||||
mBGMPsComp_make_ps_room(my_room->bgm_info.md_no, 0);
|
||||
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
|
||||
if (my_room->bgm_info.md_no != BGM_SPORTSFAIR_AEROBICS) {
|
||||
mBGMPsComp_MDPlayerPos_make();
|
||||
}
|
||||
|
||||
@@ -2209,7 +2209,7 @@ extern mActor_name_t aMR_FurnitureFg_to_FurnitureFgWithDirect(mActor_name_t item
|
||||
|
||||
extern void aMR_RadioCommonMove(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
if (ftr_actor->haniwa_state == 1) {
|
||||
aMR_ReserveBgm(actorx, BGM_AEROBICS, ftr_actor, 0);
|
||||
aMR_ReserveBgm(actorx, BGM_SPORTSFAIR_AEROBICS, ftr_actor, 0);
|
||||
ftr_actor->haniwa_state = 0;
|
||||
} else if (ftr_actor->switch_changed_flag) {
|
||||
if (ftr_actor->switch_bit == FALSE) {
|
||||
@@ -2219,7 +2219,7 @@ extern void aMR_RadioCommonMove(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
ftr_actor->switch_bit = FALSE;
|
||||
} else {
|
||||
aMR_OneMDSwitchOn_TheOtherSwitchOff(ftr_actor);
|
||||
aMR_ReserveBgm(actorx, BGM_AEROBICS, ftr_actor, 0);
|
||||
aMR_ReserveBgm(actorx, BGM_SPORTSFAIR_AEROBICS, ftr_actor, 0);
|
||||
aMR_ChangeMDBgm(actorx, ftr_actor);
|
||||
ftr_actor->switch_bit = TRUE;
|
||||
}
|
||||
@@ -2227,7 +2227,7 @@ extern void aMR_RadioCommonMove(FTR_ACTOR* ftr_actor, ACTOR* actorx) {
|
||||
}
|
||||
|
||||
extern int aMR_RadioBgmNow(void) {
|
||||
if (mBGMPsComp_execute_bgm_num_get() == BGM_AEROBICS) {
|
||||
if (mBGMPsComp_execute_bgm_num_get() == BGM_SPORTSFAIR_AEROBICS) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2885,7 +2885,7 @@ static void My_Room_Actor_move(ACTOR* actorx, GAME* game) {
|
||||
if (md_ftr_actor != NULL) {
|
||||
u16 md_angle = md_ftr_actor->s_angle_y;
|
||||
|
||||
if (my_room->bgm_info.md_no != BGM_AEROBICS) {
|
||||
if (my_room->bgm_info.md_no != BGM_SPORTSFAIR_AEROBICS) {
|
||||
mBGMPsComp_MDPlayerPos_param_set(&md_ftr_actor->position, md_angle,
|
||||
aMR_Fname2ConpoIndex(md_ftr_actor->name), (u32)md_ftr_actor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user