Implement & link ac_normal_npc

This commit is contained in:
Cuyler36
2025-03-21 02:28:07 -04:00
parent eb242526ad
commit bab8f9b8aa
3 changed files with 72 additions and 2 deletions
+1 -1
View File
@@ -1106,7 +1106,7 @@ config.libs = [
Object(NonMatching, "actor/npc/ac_harvest_npc1.c"),
Object(Matching, "actor/npc/ac_hatumode_npc0.c"),
Object(NonMatching, "actor/npc/ac_kamakura_npc0.c"),
Object(NonMatching, "actor/npc/ac_normal_npc.c"),
Object(Matching, "actor/npc/ac_normal_npc.c"),
Object(Matching, "actor/npc/ac_npc.c"),
Object(Matching, "actor/npc/ac_npc2.c"),
Object(Matching, "actor/npc/ac_npc_conv_master.c"),
+7 -1
View File
@@ -3,11 +3,18 @@
#include "types.h"
#include "m_actor.h"
#include "ac_npc.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct normal_npc_actor_s NORMAL_NPC_ACTOR;
struct normal_npc_actor_s {
NPC_ACTOR npc_class;
};
extern ACTOR_PROFILE Normal_Npc_Profile;
#ifdef __cplusplus
@@ -15,4 +22,3 @@ extern ACTOR_PROFILE Normal_Npc_Profile;
#endif
#endif
+64
View File
@@ -0,0 +1,64 @@
#include "ac_normal_npc.h"
#include "m_common_data.h"
static void aNOR_actor_ct(ACTOR* actorx, GAME* game);
static void aNOR_actor_dt(ACTOR* actorx, GAME* game);
static void aNOR_actor_move(ACTOR* actorx, GAME* game);
static void aNOR_actor_draw(ACTOR* actorx, GAME* game);
static void aNOR_actor_init(ACTOR* actorx, GAME* game);
static void aNOR_actor_save(ACTOR* actorx, GAME* game);
// clang-format off
ACTOR_PROFILE Normal_Npc_Profile = {
mAc_PROFILE_NORMAL_NPC,
ACTOR_PART_NPC,
ACTOR_STATE_NONE,
EMPTY_NO,
ACTOR_OBJ_BANK_KEEP,
sizeof(NORMAL_NPC_ACTOR),
aNOR_actor_ct,
aNOR_actor_dt,
aNOR_actor_init,
mActor_NONE_PROC1,
aNOR_actor_save,
};
// clang-format on
static void aNOR_actor_ct(ACTOR* actorx, GAME* game) {
static aNPC_ct_data_c ct_data = {
// clang-format off
aNOR_actor_move,
aNOR_actor_draw,
aNPC_CT_SCHED_TYPE_NORMAL,
NULL,
NULL,
NULL,
0,
// clang-format on
};
if (CLIP(npc_clip)->birth_check_proc(actorx, game) == TRUE) {
CLIP(npc_clip)->ct_proc(actorx, game, &ct_data);
}
}
static void aNOR_actor_dt(ACTOR* actorx, GAME* game) {
CLIP(npc_clip)->dt_proc(actorx, game);
}
static void aNOR_actor_save(ACTOR* actorx, GAME* game) {
CLIP(npc_clip)->save_proc(actorx, game);
}
static void aNOR_actor_init(ACTOR* actorx, GAME* game) {
CLIP(npc_clip)->init_proc(actorx, game);
}
static void aNOR_actor_move(ACTOR* actorx, GAME* game) {
CLIP(npc_clip)->move_proc(actorx, game);
}
static void aNOR_actor_draw(ACTOR* actorx, GAME* game) {
CLIP(npc_clip)->draw_proc(actorx, game);
}