mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Implement & link ac_set_npc_manager
This commit is contained in:
+1
-1
@@ -1043,7 +1043,7 @@ config.libs = [
|
||||
Object(Matching, "actor/ac_s_car.c"),
|
||||
Object(Matching, "actor/ac_sample.c"),
|
||||
Object(Matching, "actor/ac_set_manager.c"),
|
||||
Object(NonMatching, "actor/ac_set_npc_manager.c"),
|
||||
Object(Matching, "actor/ac_set_npc_manager.c"),
|
||||
Object(Matching, "actor/ac_set_ovl_gyoei.c"),
|
||||
Object(Matching, "actor/ac_set_ovl_insect.c"),
|
||||
Object(Matching, "actor/ac_shop.c"),
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "m_field_info.h"
|
||||
#include "m_npc.h"
|
||||
#include "m_npc_schedule.h"
|
||||
#include "m_npc_walk.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -10,10 +14,77 @@ extern "C" {
|
||||
|
||||
#define aSNMgr_EVENT_NORMAL_NPC_NUM mNpc_EVENT_NPC_NUM
|
||||
|
||||
enum {
|
||||
aSNMgr_SET_MODE_NONE,
|
||||
aSNMgr_SET_MODE_REGULAR,
|
||||
aSNMgr_SET_MODE_GUEST,
|
||||
|
||||
aSNMgr_SET_MODE_NUM
|
||||
};
|
||||
|
||||
typedef struct set_npc_manager_actor_s SET_NPC_MANAGER_ACTOR;
|
||||
|
||||
typedef struct set_npc_scope_s {
|
||||
f32 edge[2][2];
|
||||
} aSNMgr_scope_c;
|
||||
|
||||
typedef struct set_npc_event_save_s {
|
||||
u8 animal_idx[aSNMgr_EVENT_NORMAL_NPC_NUM];
|
||||
} aSNMgr_event_save_c;
|
||||
|
||||
typedef struct set_npc_event_info_s {
|
||||
aSNMgr_event_save_c* save_p;
|
||||
int type;
|
||||
int event_map_idx;
|
||||
int joint_npc_max;
|
||||
xyz_t pos[mNpc_EVENT_NPC_NUM];
|
||||
} aSNMgr_event_info_c;
|
||||
|
||||
typedef struct set_npc_make_s {
|
||||
mActor_name_t name;
|
||||
mActor_name_t make_name;
|
||||
int bx;
|
||||
int bz;
|
||||
int ux;
|
||||
int uz;
|
||||
int idx;
|
||||
} aSNMgr_make_c;
|
||||
|
||||
typedef struct set_npc_npc_info_s {
|
||||
Animal_c* animal_p;
|
||||
mNpc_NpcList_c* list_p;
|
||||
mNPS_schedule_c* schedule_p;
|
||||
mNpc_walk_c* walk_p;
|
||||
mNpcW_info_c* winfo_p[ANIMAL_NUM_MAX];
|
||||
u8 in_block_num[BLOCK_Z_NUM - 2][BLOCK_X_NUM];
|
||||
u8 to_block[ANIMAL_NUM_MAX][2];
|
||||
u32* count_p[ANIMAL_NUM_MAX];
|
||||
u16 exist;
|
||||
u16 appear;
|
||||
u16 joint_event;
|
||||
aSNMgr_make_c make[mNpc_EVENT_NPC_NUM];
|
||||
aSNMgr_event_info_c event_info;
|
||||
int timer[ANIMAL_NUM_MAX];
|
||||
} aSNMgr_npc_info_c;
|
||||
|
||||
typedef struct set_npc_player_pos_s {
|
||||
xyz_t pos;
|
||||
int next_block[2];
|
||||
int now_block[2];
|
||||
} aSNMgr_player_pos_c;
|
||||
|
||||
typedef void (*aSNMgr_SET_PROC)(SET_NPC_MANAGER_ACTOR*);
|
||||
|
||||
struct set_npc_manager_actor_s {
|
||||
ACTOR actor_class;
|
||||
int set_mode;
|
||||
aSNMgr_SET_PROC set_proc;
|
||||
aSNMgr_player_pos_c player_pos;
|
||||
aSNMgr_scope_c scope;
|
||||
aSNMgr_scope_c guest_scope;
|
||||
aSNMgr_npc_info_c npc_info;
|
||||
};
|
||||
|
||||
extern ACTOR_PROFILE Set_Npc_Manager_Profile;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -34,6 +34,12 @@ extern "C" {
|
||||
#define mFI_BK_WORLDSIZE_X_F mFI_BK_WORLDSIZE_BASE_F
|
||||
#define mFI_BK_WORLDSIZE_Z_F mFI_BK_WORLDSIZE_BASE_F
|
||||
|
||||
#define mFI_BK_WORLDSIZE_HALF_X (mFI_BK_WORLDSIZE_X / 2)
|
||||
#define mFI_BK_WORLDSIZE_HALF_Z (mFI_BK_WORLDSIZE_Z / 2)
|
||||
|
||||
#define mFI_BK_WORLDSIZE_HALF_X_F (mFI_BK_WORLDSIZE_X_F / 2.0f)
|
||||
#define mFI_BK_WORLDSIZE_HALF_Z_F (mFI_BK_WORLDSIZE_Z_F / 2.0f)
|
||||
|
||||
#define mFI_POS2UT(pos) ((int)((pos) / mFI_UNIT_BASE_SIZE_F))
|
||||
|
||||
#define mFI_ROW_TO_CHARSTR(row) ((row) + 'A')
|
||||
|
||||
@@ -41,8 +41,8 @@ enum {
|
||||
|
||||
/* TODO: figure out remaining enums */
|
||||
enum {
|
||||
mNpcW_APPEAR_STATUS_0,
|
||||
mNpcW_APPEAR_STATUS_1,
|
||||
mNpcW_APPEAR_STATUS_REGULAR,
|
||||
mNpcW_APPEAR_STATUS_GUEST,
|
||||
|
||||
mNpcW_APPEAR_STATUS_NUM
|
||||
};
|
||||
@@ -58,10 +58,10 @@ enum {
|
||||
|
||||
/* TODO: figure out remaining enums */
|
||||
enum {
|
||||
mNpcW_INFO_STATUS_0,
|
||||
mNpcW_INFO_STATUS_NONE,
|
||||
mNpcW_INFO_STATUS_WALKING,
|
||||
mNpcW_INFO_STATUS_2,
|
||||
mNpcW_INFO_STATUS_3,
|
||||
mNpcW_INFO_STATUS_STAY_IN_BLOCK,
|
||||
mNpcW_INFO_STATUS_ARRIVE,
|
||||
mNpcW_INFO_STATUS_4,
|
||||
|
||||
mNpcW_INFO_STATUS_NUM
|
||||
@@ -95,7 +95,7 @@ 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 u32* 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);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
#include "m_random_field.h"
|
||||
#include "m_common_data.h"
|
||||
|
||||
static int l_arrive_stay_count[ANIMAL_NUM_MAX]; /* TODO: swap with l_goal_block when bss ordering is fixed */
|
||||
static u32 l_arrive_stay_count[ANIMAL_NUM_MAX]; /* TODO: swap with l_goal_block when bss ordering is fixed */
|
||||
static int l_goal_block[mNpcW_GOAL_BLOCK_NUM][2];
|
||||
|
||||
#define mNpcW_TIME_2_SEC(hour, min, sec) ((hour) * 3600 + (min) * 60 + (sec))
|
||||
@@ -616,14 +616,14 @@ extern int mNpcW_GetAppearStatusWay(u8* status, u8* way, Animal_c* animal) {
|
||||
res = TRUE;
|
||||
}
|
||||
else {
|
||||
*status = mNpcW_APPEAR_STATUS_0;
|
||||
*status = mNpcW_APPEAR_STATUS_REGULAR;
|
||||
*way = mNpcW_APPEAR_WAY_NUM;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
extern int* mNpcW_GetArriveStayCountP(int idx) {
|
||||
extern u32* mNpcW_GetArriveStayCountP(int idx) {
|
||||
if (idx >= 0 && idx < ANIMAL_NUM_MAX) {
|
||||
return &l_arrive_stay_count[idx];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user