mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Implement & link ac_npc_curator
This commit is contained in:
@@ -555,6 +555,10 @@ ac_ev_soncho.c:
|
||||
.text: [0x8052400C, 0x8052475C]
|
||||
.rodata: [0x80649270, 0x80649278]
|
||||
.data: [0x806A0D38, 0x806A0D88]
|
||||
ac_npc_curator.c:
|
||||
.text: [0x8054B06C, 0x8054CF28]
|
||||
.rodata: [0x806495B0, 0x806495B8]
|
||||
.data: [0x806A4FB0, 0x806A5530]
|
||||
ac_douzou.c:
|
||||
.text: [0x805AD6D8, 0x805AE704]
|
||||
.rodata: [0x8064A7C0, 0x8064A7E8]
|
||||
|
||||
+55
-1
@@ -13,8 +13,13 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define aNPC_SPNPC_BIT_CURATOR 0
|
||||
#define aNPC_SPNPC_BIT_EV_SONCHO 5
|
||||
|
||||
#define aNPC_SPNPC_BIT_GET(field, bit) (((field) >> (bit)) & 1)
|
||||
#define aNPC_SPNPC_BIT_SET(field, bit) ((field) |= (1 << (bit)))
|
||||
#define aNPC_SPNPC_BIT_CLR(field, bit) ((field) &= ~(1 << (bit)))
|
||||
|
||||
typedef struct ac_npc_clip_s aNPC_Clip_c;
|
||||
|
||||
typedef struct npc_draw_data_s {
|
||||
@@ -31,6 +36,29 @@ enum {
|
||||
aNPC_ATTENTION_TYPE_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
aNPC_THINK_WAIT,
|
||||
aNPC_THINK_WANDER,
|
||||
aNPC_THINK_WANDER2,
|
||||
aNPC_THINK_GO_HOME,
|
||||
aNPC_THINK_INTO_HOUSE,
|
||||
aNPC_THINK_LEAVE_HOUSE,
|
||||
aNPC_THINK_IN_BLOCK,
|
||||
aNPC_THINK_PITFALL,
|
||||
aNPC_THINK_SLEEP,
|
||||
aNPC_THINK_SPECIAL,
|
||||
|
||||
aNPC_THINK_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
aNPC_THINK_TYPE_INIT,
|
||||
aNPC_THINK_TYPE_CHK_INTERRUPT,
|
||||
aNPC_THINK_TYPE_MAIN,
|
||||
|
||||
aNPC_THINK_TYPE_NUM
|
||||
};
|
||||
|
||||
typedef void (*aNPC_TALK_REQUEST_PROC)(ACTOR*, GAME*);
|
||||
typedef int (*aNPC_TALK_INIT_PROC)(ACTOR*, GAME*);
|
||||
typedef int (*aNPC_TALK_END_CHECK_PROC)(ACTOR*, GAME*);
|
||||
@@ -62,6 +90,8 @@ typedef void (*aNPC_MOVE_AFTER_PROC)(ACTOR*, GAME*);
|
||||
typedef void (*aNPC_DRAW_PROC)(ACTOR*, GAME*);
|
||||
|
||||
typedef void (*aNPC_REBUILD_DMA_PROC)();
|
||||
typedef void (*aNPC_ANIMATION_INIT_PROC)(ACTOR*, int, int);
|
||||
typedef int (*aNPC_CLIP_THINK_PROC)(NPC_ACTOR*, GAME_PLAY*, int, int);
|
||||
|
||||
typedef int (*aNPC_FORCE_CALL_REQ_PROC)(NPC_ACTOR*, int);
|
||||
|
||||
@@ -86,7 +116,11 @@ struct ac_npc_clip_s {
|
||||
/* 0x0F0 */ void* _0F0;
|
||||
/* 0x0F4 */ aNPC_DRAW_PROC draw_proc;
|
||||
/* 0x0F8 */ aNPC_REBUILD_DMA_PROC rebuild_dma_proc;
|
||||
/* 0x0FC */ void* _0FC[(0x124 - 0x0FC) / sizeof(void*)];
|
||||
/* 0x0FC */ void* _0FC[(0x114 - 0x0FC) / sizeof(void*)];
|
||||
/* 0x114 */ aNPC_ANIMATION_INIT_PROC animation_init_proc;
|
||||
/* 0x118 */ void* _118;
|
||||
/* 0x11C */ void* _11C;
|
||||
/* 0x120 */ aNPC_CLIP_THINK_PROC think_proc;
|
||||
/* 0x124 */ aNPC_FORCE_CALL_REQ_PROC force_call_req_proc;
|
||||
/* 0x128 */ void* _128;
|
||||
};
|
||||
@@ -151,6 +185,8 @@ enum {
|
||||
|
||||
typedef void (*aNPC_ACTION_PROC)(NPC_ACTOR*, GAME_PLAY*, int);
|
||||
|
||||
#define aNPC_ACTION_END_STEP 0xFF
|
||||
|
||||
typedef struct npc_action_s {
|
||||
u8 priority;
|
||||
u8 idx;
|
||||
@@ -180,6 +216,23 @@ typedef struct npc_request_s {
|
||||
xyz_t head_pos;
|
||||
} aNPC_request_c;
|
||||
|
||||
#define aNPC_COND_DEMO_SKIP_MOVE_RANGE_CHECK (1 << 0) /* 0x0001 */
|
||||
#define aNPC_COND_DEMO_SKIP_MOVE_CIRCLE_REV (1 << 1) /* 0x0002 */
|
||||
#define aNPC_COND_DEMO_SKIP_MOVE_Y (1 << 2) /* 0x0004 */
|
||||
#define aNPC_COND_DEMO_SKIP_OBJ_COL_CHECK (1 << 3) /* 0x0008 */
|
||||
#define aNPC_COND_DEMO_SKIP_BGCHECK (1 << 4) /* 0x0010 */
|
||||
#define aNPC_COND_DEMO_SKIP_FORWARD_CHECK (1 << 5) /* 0x0020 */
|
||||
#define aNPC_COND_DEMO_SKIP_ITEM (1 << 6) /* 0x0040 */
|
||||
#define aNPC_COND_DEMO_SKIP_TALK_CHECK (1 << 7) /* 0x0080 */
|
||||
#define aNPC_COND_DEMO_SKIP_HEAD_LOOKAT (1 << 8) /* 0x0100 */
|
||||
#define aNPC_COND_DEMO_SKIP_ENTRANCE_CHECK (1 << 9) /* 0x0200 */
|
||||
#define aNPC_COND_DEMO_SKIP_KUTIPAKU (1 << 10) /* 0x0400 */
|
||||
#define aNPC_COND_DEMO_SKIP_FOOTSTEPS (1 << 11) /* 0x0800 */
|
||||
#define aNPC_COND_DEMO_SKIP_FEEL_CHECK (1 << 12) /* 0x1000 */
|
||||
#define aNPC_COND_DEMO_SKIP_LOVE_CHECK (1 << 13) /* 0x2000 */
|
||||
#define aNPC_COND_DEMO_SKIP_FOOTSTEPS_VFX (1 << 14) /* 0x4000 */
|
||||
#define aNPC_COND_DEMO_SKIP_UZAI_CHECK (1 << 15) /* 0x8000 */
|
||||
|
||||
typedef struct npc_condition_s {
|
||||
u8 hide_flg;
|
||||
u8 hide_request;
|
||||
@@ -296,6 +349,7 @@ typedef struct npc_actor_talk_info_s {
|
||||
s16 npc_voice_id;
|
||||
u8 feel;
|
||||
u8 memory;
|
||||
u8 kutipaku_timer; // frames of mouth movement animation
|
||||
} aNPC_talk_info_c;
|
||||
|
||||
typedef struct npc_accessory_s {
|
||||
|
||||
@@ -9,16 +9,25 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define aCR_SLEEP_WAIT_TIMER (6 * 60) // 6 seconds (calculated in frames frames)
|
||||
#define aCR_SLEEP_TIME_START ( 6 * mTM_SECONDS_IN_HOUR)
|
||||
#define aCR_SLEEP_TIME_END (18 * mTM_SECONDS_IN_HOUR)
|
||||
|
||||
typedef struct npc_curator_actor_s NPC_CURATOR_ACTOR;
|
||||
|
||||
typedef void (*aCR_SETUPTALKACTION_PROC)(NPC_CURATOR_ACTOR*, GAME_PLAY*, int);
|
||||
typedef void (*aCR_ACTION_PROC)(NPC_ACTOR*, GAME_PLAY*);
|
||||
typedef void (*aCR_ACT_PROC)(NPC_CURATOR_ACTOR*, GAME_PLAY*);
|
||||
typedef void (*aCR_TALK_ACT_PROC)(NPC_CURATOR_ACTOR*, GAME_PLAY*);
|
||||
|
||||
struct npc_curator_actor_s {
|
||||
NPC_ACTOR npc_class;
|
||||
int action;
|
||||
aNPC_SUB_PROC action_proc;
|
||||
aCR_ACT_PROC action_proc;
|
||||
int sleep_wait_timer;
|
||||
int talk_act_idx;
|
||||
aNPC_SUB_PROC talk_proc;
|
||||
aNPC_PROC setupTalkAction_proc;
|
||||
aCR_TALK_ACT_PROC talk_proc;
|
||||
aCR_SETUPTALKACTION_PROC setupTalkAction_proc;
|
||||
int msg_no;
|
||||
int _9B0; // might be unused 'awake' state
|
||||
mActor_name_t donated_item;
|
||||
|
||||
+27
-2
@@ -637,9 +637,31 @@ extern int mNT_check_unknown(mActor_name_t item_no);
|
||||
|
||||
#define FTR_DINO_START 0x1EEC
|
||||
#define FTR_DINO_TRICERA_SKULL FTR_DINO_START
|
||||
|
||||
#define FTR_DINO_TRICERA_TAIL 0x1EF0
|
||||
#define FTR_DINO_TRICERA_BODY 0x1EF4
|
||||
#define FTR_DINO_TREX_SKULL 0x1EF8
|
||||
|
||||
#define FTR_DINO_TREX_TAIL 0x1EFC
|
||||
#define FTR_DINO_TREX_BODY 0x1F00
|
||||
#define FTR_DINO_APATO_SKULL 0x1F04
|
||||
#define FTR_DINO_APATO_TAIL 0x1F08
|
||||
#define FTR_DINO_APATO_BODY 0x1F0C
|
||||
#define FTR_DINO_STEGO_SKULL 0x1F10
|
||||
#define FTR_DINO_STEGO_TAIL 0x1F14
|
||||
#define FTR_DINO_STEGO_BODY 0x1F18
|
||||
#define FTR_DINO_PTERA_SKULL 0x1F1C
|
||||
#define FTR_DINO_PTERA_RIGHT_WING 0x1F20
|
||||
#define FTR_DINO_PTERA_LEFT_WING 0x1F24
|
||||
#define FTR_DINO_PLESIO_SKULL 0x1F28
|
||||
#define FTR_DINO_PLESIO_NECK 0x1F2C
|
||||
#define FTR_DINO_PLESIO_TORSO 0x1F30
|
||||
#define FTR_DINO_MAMMOTH_SKULL 0x1F34
|
||||
#define FTR_DINO_MAMMOTH_TORSO 0x1F38
|
||||
#define FTR_FOSSIL_AMBER 0x1F3C
|
||||
#define FTR_FOSSIL_TRACK 0x1F40
|
||||
#define FTR_FOSSIL_AMMONITE 0x1F44
|
||||
#define FTR_FOSSIL_EGG 0x1F48
|
||||
#define FTR_FOSSIL_TRILOBITE 0x1F4C
|
||||
//
|
||||
#define FTR_DINO_TRILOBITE_WEST 0x1F4F
|
||||
#define FTR_DINO_END FTR_DINO_TRILOBITE_WEST
|
||||
|
||||
@@ -1556,6 +1578,9 @@ extern int mNT_check_unknown(mActor_name_t item_no);
|
||||
|
||||
#define FTR_AXE 0x3190
|
||||
|
||||
#define FTR_PAINTING15_UNUSED 0x31D8
|
||||
#define FTR_PAINTING16_UNUSED 0x31DC
|
||||
|
||||
#define FTR_BOTTLE_ROCKET 0x31F0
|
||||
|
||||
#define FTR_FISHING_TROPHY 0x3210
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
#include "ac_npc_curator.h"
|
||||
|
||||
#include "m_common_data.h"
|
||||
#include "m_item_name.h"
|
||||
#include "m_msg.h"
|
||||
|
||||
enum {
|
||||
aCR_ACTION_WAIT,
|
||||
aCR_ACTION_SLEEP_WAIT,
|
||||
aCR_ACTION_SLEEP,
|
||||
|
||||
aCR_ACTION_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
aCR_TALK_END_WAIT,
|
||||
aCR_TALK_AFTER_TALK_START_WAIT,
|
||||
aCR_TALK_CHK_REQUEST,
|
||||
aCR_TALK_CHK_DECIDE_TO_DONATE,
|
||||
aCR_TALK_CHK_DECIDE_TO_DONATE2,
|
||||
aCR_TALK_MENU_OPEN_WAIT,
|
||||
aCR_TALK_MSG_WIN_CLOSE_WAIT,
|
||||
aCR_TALK_MENU_CLOSE_WAIT,
|
||||
aCR_TALK_GET_DEMO_START_WAIT,
|
||||
aCR_TALK_GET_DEMO_END_WAIT,
|
||||
aCR_TALK_MSG_WIN_OPEN_WAIT,
|
||||
aCR_TALK_RETURN_DEMO_START_WAIT,
|
||||
aCR_TALK_RETURN_DEMO_START_WAIT2,
|
||||
aCR_TALK_RETURN_DEMO_END_WAIT,
|
||||
aCR_TALK_RETURN_DEMO_END_WAIT2,
|
||||
aCR_TALK_CHK_CONTINUE_TO_DONATE,
|
||||
aCR_TALK_CHK_CONTINUE_TO_DONATE2,
|
||||
aCR_TALK_CHK_CONTINUE_TO_DONATE3,
|
||||
aCR_TALK_PUTAWAY_DEMO_START_WAIT,
|
||||
aCR_TALK_PUTAWAY_DEMO_START_WAIT2,
|
||||
aCR_TALK_PUTAWAY_DEMO_START_WAIT3,
|
||||
aCR_TALK_PUTAWAY_DEMO_START_WAIT4,
|
||||
aCR_TALK_PUTAWAY_DEMO_START_WAIT5,
|
||||
aCR_TALK_PUTAWAY_DEMO_START_WAIT6,
|
||||
aCR_TALK_PUTAWAY_DEMO_START_WAIT5_2,
|
||||
aCR_TALK_PUTAWAY_DEMO_END_WAIT,
|
||||
aCR_TALK_PUTAWAY_DEMO_END_WAIT2,
|
||||
aCR_TALK_PUTAWAY_DEMO_END_WAIT3,
|
||||
aCR_TALK_PUTAWAY_DEMO_END_WAIT4,
|
||||
aCR_TALK_PUTAWAY_DEMO_END_WAIT5,
|
||||
aCR_TALK_PUTAWAY_DEMO_END_WAIT6,
|
||||
aCR_TALK_AFTER_EXPLAIN_INSECT,
|
||||
aCR_TALK_THANKS_FOSSIL_MSG_END_WAIT,
|
||||
aCR_TALK_CHK_ALL_COMPLETE,
|
||||
|
||||
aCR_TALK_NUM
|
||||
};
|
||||
|
||||
static void aCR_actor_ct(ACTOR* actorx, GAME* game);
|
||||
static void aCR_actor_dt(ACTOR* actorx, GAME* game);
|
||||
static void aCR_actor_move(ACTOR* actorx, GAME* game);
|
||||
static void aCR_actor_draw(ACTOR* actorx, GAME* game);
|
||||
static void aCR_actor_init(ACTOR* actorx, GAME* game);
|
||||
static void aCR_actor_save(ACTOR* actorx, GAME* game);
|
||||
|
||||
ACTOR_PROFILE Npc_Curator_Profile = {
|
||||
mAc_PROFILE_NPC_CURATOR,
|
||||
ACTOR_PART_NPC,
|
||||
ACTOR_STATE_NONE,
|
||||
SP_NPC_CURATOR,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(NPC_CURATOR_ACTOR),
|
||||
&aCR_actor_ct,
|
||||
&aCR_actor_dt,
|
||||
&aCR_actor_init,
|
||||
mActor_NONE_PROC1,
|
||||
&aCR_actor_save
|
||||
};
|
||||
|
||||
static void aCR_talk_request(ACTOR* actorx, GAME* game);
|
||||
static int aCR_talk_init(ACTOR* actorx, GAME* game);
|
||||
static int aCR_talk_end_chk(ACTOR* actorx, GAME* game);
|
||||
|
||||
static void aCR_schedule_proc(NPC_ACTOR* actorx, GAME_PLAY* play, int sched_idx);
|
||||
static void aCR_setupTalkAction(NPC_CURATOR_ACTOR* curator, GAME_PLAY* play, int talk_act_idx);
|
||||
static void aCR_setupAction(NPC_CURATOR_ACTOR* curator, GAME_PLAY* play, int action);
|
||||
|
||||
static void aCR_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
static aNPC_ct_data_c ct_data = {
|
||||
&aCR_actor_move,
|
||||
&aCR_actor_draw,
|
||||
5,
|
||||
&aCR_talk_request,
|
||||
&aCR_talk_init,
|
||||
&aCR_talk_end_chk,
|
||||
0
|
||||
};
|
||||
|
||||
NPC_CURATOR_ACTOR* curator = (NPC_CURATOR_ACTOR*)actorx;
|
||||
|
||||
if ((*Common_Get(clip).npc_clip->birth_check_proc)(actorx, game) == TRUE) {
|
||||
curator->npc_class.schedule.schedule_proc = &aCR_schedule_proc;
|
||||
(*Common_Get(clip).npc_clip->ct_proc)(actorx, game, &ct_data);
|
||||
actorx->status_data.weight = 255;
|
||||
actorx->world.position.x += 20.0f;
|
||||
curator->setupTalkAction_proc = &aCR_setupTalkAction;
|
||||
|
||||
/* Clear 'first talk' flag if entering from a scene outside the museum */
|
||||
if (Common_Get(last_scene_no) >= SCENE_MY_ROOM_LL1 || Common_Get(last_scene_no) < SCENE_MUSEUM_ROOM_PAINTING) {
|
||||
aNPC_SPNPC_BIT_CLR(Common_Get(spnpc_first_talk_flags), aNPC_SPNPC_BIT_CURATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aCR_actor_save(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->save_proc)(actorx, game);
|
||||
}
|
||||
|
||||
static void aCR_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->dt_proc)(actorx, game);
|
||||
}
|
||||
|
||||
static void aCR_actor_init(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->init_proc)(actorx, game);
|
||||
}
|
||||
|
||||
static void aCR_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
(*Common_Get(clip).npc_clip->draw_proc)(actorx, game);
|
||||
}
|
||||
|
||||
#include "../src/ac_npc_curator_move.c_inc"
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user