mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-06-26 08:24:34 -04:00
Implement & link m_npc_walk.c
This commit is contained in:
@@ -137,7 +137,7 @@ extern int mFI_GetBlockUtNum2FG(mActor_name_t* fg_item, int block_x, int block_z
|
||||
extern void mFI_UtNum2CenterWpos(xyz_t* wpos, int ut_x, int ut_z);
|
||||
extern u8 mFI_GetBlockXMax();
|
||||
extern u8 mFI_GetBlockZMax();
|
||||
extern u8 mFI_BkNum2BlockType();
|
||||
extern u8 mFI_BkNum2BlockType(int block_x, int block_z);
|
||||
extern mFI_sound_source_info_c* mFI_GetSoundSourcePBlockNum(int block_x,int block_z);
|
||||
extern int mFI_Wpos2UtNum(int* ut_x, int* ut_z, xyz_t wpos);
|
||||
extern void mFI_ClearFieldData();
|
||||
|
||||
@@ -18,8 +18,9 @@ extern "C" {
|
||||
#define FG_BLOCK_Z_NUM (BLOCK_Z_NUM - 4) /* 6 */
|
||||
#define FG_BLOCK_TOTAL_NUM (FG_BLOCK_X_NUM * FG_BLOCK_Z_NUM)
|
||||
|
||||
#define UT_X_NUM 16 /* Spaces per block (acre) in x direction */
|
||||
#define UT_Z_NUM 16 /* Spaces per block (acre) in z direction */
|
||||
#define UT_BASE_NUM 16
|
||||
#define UT_X_NUM UT_BASE_NUM /* Spaces per block (acre) in x direction */
|
||||
#define UT_Z_NUM UT_BASE_NUM /* Spaces per block (acre) in z direction */
|
||||
#define UT_TOTAL_NUM (UT_X_NUM * UT_Z_NUM)
|
||||
|
||||
#define IDX_2_UT_X(idx) ((idx) & (UT_X_NUM - 1))
|
||||
|
||||
@@ -210,6 +210,8 @@ extern void mNpc_SendMailtoNpc(Mail_c* mail);
|
||||
extern void mNpc_SetNpcinfo(ACTOR* actor, s8 npc_info_idx);
|
||||
extern void mNpc_InitNpcAllInfo(int malloc_flag);
|
||||
extern void mNpc_SetRemoveAnimalNo(u8* remove_animal_no, Animal_c* animals, int remove_no);
|
||||
extern void mNpc_ClearAnimalPersonalID(AnmPersonalID_c* id);
|
||||
extern int mNpc_CheckCmpAnimalPersonalID(AnmPersonalID_c* id0, AnmPersonalID_c* id1);
|
||||
|
||||
extern void mNpc_PrintRemoveInfo(gfxprint_t* gfxprint);
|
||||
extern void mNpc_PrintFriendship_fdebug(gfxprint_t* gfxprint);
|
||||
|
||||
+49
-4
@@ -21,7 +21,7 @@ typedef struct goal_data_s {
|
||||
typedef struct goal_data_table_s {
|
||||
mNpcW_GoalData_c* data_p;
|
||||
int count;
|
||||
} mNpc_GoalDataTable_c;
|
||||
} mNpcW_GoalDataTable_c;
|
||||
|
||||
enum {
|
||||
mNpcW_GOAL_SHRINE, /* Shrine/Wishing Well acre */
|
||||
@@ -32,15 +32,50 @@ enum {
|
||||
mNpcW_GOAL_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mNpcW_GOAL_BLOCK_SHRINE,
|
||||
mNpcW_GOAL_BLOCK_HOME,
|
||||
|
||||
mNpcW_GOAL_BLOCK_NUM
|
||||
};
|
||||
|
||||
/* TODO: figure out remaining enums */
|
||||
enum {
|
||||
mNpcW_APPEAR_STATUS_0,
|
||||
mNpcW_APPEAR_STATUS_1,
|
||||
|
||||
mNpcW_APPEAR_STATUS_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mNpcW_APPEAR_WAY_UP,
|
||||
mNpcW_APPEAR_WAY_DOWN,
|
||||
mNpcW_APPEAR_WAY_LEFT,
|
||||
mNpcW_APPEAR_WAY_RIGHT,
|
||||
|
||||
mNpcW_APPEAR_WAY_NUM
|
||||
};
|
||||
|
||||
/* TODO: figure out remaining enums */
|
||||
enum {
|
||||
mNpcW_INFO_STATUS_0,
|
||||
mNpcW_INFO_STATUS_WALKING,
|
||||
mNpcW_INFO_STATUS_2,
|
||||
mNpcW_INFO_STATUS_3,
|
||||
mNpcW_INFO_STATUS_4,
|
||||
|
||||
mNpcW_INFO_STATUS_NUM
|
||||
};
|
||||
|
||||
typedef struct npc_walk_appear_s {
|
||||
u8 state;
|
||||
u8 target_direction;
|
||||
u8 status;
|
||||
u8 way;
|
||||
} mNpcW_appear_c;
|
||||
|
||||
typedef struct npc_walk_information_s {
|
||||
AnmPersonalID_c id;
|
||||
int idx;
|
||||
u8 state;
|
||||
u8 status;
|
||||
u8 goal_type;
|
||||
u8 goal_block_x;
|
||||
u8 goal_block_z;
|
||||
@@ -54,6 +89,16 @@ typedef struct npc_walk_s {
|
||||
u8 info_max;
|
||||
} mNpc_walk_c;
|
||||
|
||||
extern void mNpcW_ClearNpcWalkInfo(mNpcW_info_c* info, int num);
|
||||
extern int mNpcW_GetNpcWalkInfoIdx(mNpcW_info_c* info, int num, AnmPersonalID_c* anm_id);
|
||||
extern int mNpcW_ChangeNpcWalk(mNpc_walk_c* walk, mNpcW_info_c* info);
|
||||
extern void mNpcW_SetGoalBlock(mNpcW_info_c* info);
|
||||
extern void mNpcW_InitNpcWalk(mNpc_walk_c* walk);
|
||||
extern int mNpcW_GetAppearStatusWay(u8* status, u8* way, Animal_c* animal);
|
||||
extern int* mNpcW_GetArriveStayCountP(int idx);
|
||||
extern int mNpcW_GetWalkInfoStatusGoalAnimalIdx(int* status, int* goal, int idx);
|
||||
extern int mNpcW_GetNearGate(int* target_ut_x, int* target_ut_z, int block_x, int block_z, int ut_x, int ut_z);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user